Skip to content

Commit 89be19f

Browse files
authored
docs: migrate documentation from mkdocs to hugo (#11)
* docs: migrate documentation from mkdocs to hugo - Replace MkDocs with Hugo + Hextra theme (no Python dependency) - Move doc pages from docs/ to content/docs/ with Hugo frontmatter - Convert admonition syntax to Hextra callout shortcode - Add homepage with hero section, feature grid, and centered layout - Override hextra-home layout for centered hero alignment - Add custom CSS for feature grid and doc page spacing - Update GitHub Actions workflow for Hugo build and deploy - Fix gofmt formatting in client.go and examples/ * fix(lint): resolve all staticcheck and golangci-lint errors - Replace deprecated WithLogger/Logger with WithStructuredLogger/StructuredLogger - Update MockLogger to implement StructuredLogger interface - Replace deprecated IsCompilationError/IsShutdownError with As* variants - Fix nil pointer dereference warnings by using t.Fatal - Remove redundant nil check before len() - Fix never-true interface nil comparisons in Scorer tests - Discard unused return values in v1 workflow test * fix(test): skip branch name tests in detached HEAD - GitHub Actions checks out in detached HEAD state - GetCurrentBranch returns empty string which is valid in CI - Tests now skip instead of fail when no branch name exists
1 parent 0806c44 commit 89be19f

29 files changed

Lines changed: 326 additions & 258 deletions

.github/workflows/docs.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'docs/**'
9-
- 'mkdocs.yml'
8+
- 'content/**'
9+
- 'hugo.toml'
1010
- '.github/workflows/docs.yml'
1111
workflow_dispatch:
1212

@@ -26,23 +26,24 @@ jobs:
2626
- name: Checkout
2727
uses: actions/checkout@v4
2828

29-
- name: Setup Python
30-
uses: actions/setup-python@v5
29+
- name: Setup Hugo
30+
uses: peaceiris/actions-hugo@v3
3131
with:
32-
python-version: '3.x'
33-
cache: 'pip'
32+
hugo-version: 'latest'
33+
extended: true
3434

35-
- name: Install dependencies
36-
run: |
37-
pip install mkdocs-material
35+
- name: Setup Go
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version-file: 'go.mod'
3839

3940
- name: Build documentation
40-
run: mkdocs build --strict
41+
run: hugo --minify
4142

4243
- name: Upload artifact
4344
uses: actions/upload-pages-artifact@v3
4445
with:
45-
path: ./site
46+
path: ./public
4647

4748
deploy:
4849
environment:

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,8 @@ coverage.out
3434
.env
3535
.env.local
3636
evaluationevaluation
37-
dist/
37+
dist/
38+
39+
# Hugo build output
40+
public/
41+
resources/_gen/

.hugo_build.lock

Whitespace-only changes.

assets/css/custom.css

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/* ============================================
2+
Langfuse Go SDK - Spacing & Layout Overrides
3+
4+
Fixes spacing inconsistencies in the default
5+
Hextra theme to establish a consistent 8px
6+
grid rhythm throughout the site.
7+
============================================ */
8+
9+
/* -------------------------------------------
10+
Homepage: Feature Grid
11+
------------------------------------------- */
12+
13+
/* Increase card gap from 16px to 24px.
14+
The default gap-4 (16px) is narrower than the
15+
cards' border-radius (24px from rounded-3xl),
16+
creating a visually pinched appearance. */
17+
.hextra-feature-grid {
18+
gap: 1.5rem;
19+
}
20+
21+
/* -------------------------------------------
22+
Documentation Pages: Article Spacing
23+
------------------------------------------- */
24+
25+
/* Increase top padding on doc article main area.
26+
Default pt-4 (16px) places the breadcrumb too
27+
close to the navbar. */
28+
article > main {
29+
padding-top: 1.5rem;
30+
}
31+
32+
@media (min-width: 768px) {
33+
article > main {
34+
padding-top: 2rem;
35+
}
36+
}
37+
38+
/* Separate the breadcrumb from the page title.
39+
Without this, the h1 crowds the breadcrumb trail. */
40+
.content > h1:first-child {
41+
margin-top: 1.5rem;
42+
}
43+
44+
/* -------------------------------------------
45+
Documentation Pages: Content Block Spacing
46+
------------------------------------------- */
47+
48+
/* Code blocks need more vertical breathing room.
49+
Default prose margins create only ~16px between
50+
a paragraph and its code example. 24px is the
51+
minimum for scannable documentation. */
52+
.content pre {
53+
margin-top: 1.5rem;
54+
margin-bottom: 1.5rem;
55+
}
56+
57+
/* Callout/admonition boxes should stand out from
58+
surrounding prose with additional separation. */
59+
.hextra-callout {
60+
margin-top: 1.5rem;
61+
margin-bottom: 1.5rem;
62+
}

client.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,24 @@ func NewWithConfig(cfg *Config) (*Client, error) {
115115
// This maps all common fields and converts types where needed.
116116
func convertToPkgClientConfig(cfg *Config) *pkgclient.Config {
117117
pkgCfg := &pkgclient.Config{
118-
PublicKey: cfg.PublicKey,
119-
SecretKey: cfg.SecretKey,
120-
BaseURL: cfg.BaseURL,
121-
Region: cfg.Region,
122-
HTTPClient: cfg.HTTPClient,
123-
Timeout: cfg.Timeout,
124-
MaxRetries: cfg.MaxRetries,
125-
RetryDelay: cfg.RetryDelay,
126-
BatchSize: cfg.BatchSize,
127-
FlushInterval: cfg.FlushInterval,
128-
Debug: cfg.Debug,
129-
ErrorHandler: cfg.ErrorHandler,
130-
MaxIdleConns: cfg.MaxIdleConns,
131-
MaxIdleConnsPerHost: cfg.MaxIdleConnsPerHost,
132-
IdleConnTimeout: cfg.IdleConnTimeout,
133-
ShutdownTimeout: cfg.ShutdownTimeout,
134-
BatchQueueSize: cfg.BatchQueueSize,
135-
IdleWarningDuration: cfg.IdleWarningDuration,
118+
PublicKey: cfg.PublicKey,
119+
SecretKey: cfg.SecretKey,
120+
BaseURL: cfg.BaseURL,
121+
Region: cfg.Region,
122+
HTTPClient: cfg.HTTPClient,
123+
Timeout: cfg.Timeout,
124+
MaxRetries: cfg.MaxRetries,
125+
RetryDelay: cfg.RetryDelay,
126+
BatchSize: cfg.BatchSize,
127+
FlushInterval: cfg.FlushInterval,
128+
Debug: cfg.Debug,
129+
ErrorHandler: cfg.ErrorHandler,
130+
MaxIdleConns: cfg.MaxIdleConns,
131+
MaxIdleConnsPerHost: cfg.MaxIdleConnsPerHost,
132+
IdleConnTimeout: cfg.IdleConnTimeout,
133+
ShutdownTimeout: cfg.ShutdownTimeout,
134+
BatchQueueSize: cfg.BatchQueueSize,
135+
IdleWarningDuration: cfg.IdleWarningDuration,
136136
IDGenerationMode: pkgclient.IDGenerationMode(cfg.IDGenerationMode),
137137
BlockOnQueueFull: cfg.BlockOnQueueFull,
138138
DropOnQueueFull: cfg.DropOnQueueFull,

content/_index.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Langfuse Go SDK
3+
layout: hextra-home
4+
description: "The official Go SDK for Langfuse. Trace, evaluate, and monitor your LLM applications with a type-safe, idiomatic Go API."
5+
---
6+
7+
<div class="hx:mt-8 hx:mb-8">
8+
{{< hextra/hero-headline >}}
9+
Langfuse Go SDK
10+
{{< /hextra/hero-headline >}}
11+
</div>
12+
13+
<div class="hx:mb-10">
14+
{{< hextra/hero-subtitle >}}
15+
The official Go SDK for Langfuse, the open-source LLM engineering platform.&nbsp;<br class="hx:hidden sm:hx:block" />Trace, evaluate, and monitor your LLM applications with a type-safe, idiomatic Go API.
16+
{{< /hextra/hero-subtitle >}}
17+
</div>
18+
19+
<div class="hx:mb-16">
20+
{{< hextra/hero-button text="Get Started" link="docs/getting-started/" >}}
21+
</div>
22+
23+
{{< hextra/feature-grid >}}
24+
{{< hextra/feature-card
25+
title="Type-Safe Tracing"
26+
subtitle="Strongly-typed API for creating traces, spans, generations, and events."
27+
>}}
28+
{{< hextra/feature-card
29+
title="Automatic Batching"
30+
subtitle="Efficient background processing of telemetry data with configurable batching."
31+
>}}
32+
{{< hextra/feature-card
33+
title="LLM-as-a-Judge"
34+
subtitle="Built-in support for AI-powered evaluation workflows."
35+
>}}
36+
{{< hextra/feature-card
37+
title="Zero Dependencies"
38+
subtitle="Minimal external dependencies for easy integration into any Go project."
39+
>}}
40+
{{< hextra/feature-card
41+
title="Production Ready"
42+
subtitle="Circuit breakers, retries, backpressure handling, and graceful shutdown."
43+
>}}
44+
{{< hextra/feature-card
45+
title="Flexible Configuration"
46+
subtitle="Support for all Langfuse regions, environment variables, and custom HTTP clients."
47+
>}}
48+
{{< /hextra/feature-grid >}}

content/docs/_index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Documentation
3+
weight: 1
4+
---
5+
6+
Welcome to the Langfuse Go SDK documentation.
7+
8+
## Guides
9+
10+
- [Getting Started](getting-started/) - Install the SDK and create your first trace
11+
- [Configuration](configuration/) - API keys, regions, batching, and HTTP settings
12+
- [Tracing](tracing/) - Traces, spans, generations, events, and scores
13+
- [Evaluation](evaluation/) - LLM-as-a-Judge and scoring workflows
14+
- [API Reference](api-reference/) - Complete type and method reference
15+
- [Migration Guide](migration/) - Migrate from the previous API version
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# API Reference
1+
---
2+
title: API Reference
3+
weight: 5
4+
---
25

36
Complete reference for the Langfuse Go SDK.
47

@@ -689,7 +692,7 @@ func main() {
689692

690693
## Next Steps
691694

692-
- [Getting Started](getting-started.md) - Basic setup guide
693-
- [Tracing Guide](tracing.md) - Complete tracing documentation
694-
- [Evaluation Guide](evaluation.md) - LLM-as-a-Judge workflows
695-
- [Configuration](configuration.md) - Configuration reference
695+
- [Getting Started](../getting-started/) - Basic setup guide
696+
- [Tracing Guide](../tracing/) - Complete tracing documentation
697+
- [Evaluation Guide](../evaluation/) - LLM-as-a-Judge workflows
698+
- [Configuration](../configuration/) - Configuration reference
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Configuration
1+
---
2+
title: Configuration
3+
weight: 2
4+
---
25

36
The Langfuse Go SDK provides flexible configuration options to customize its behavior for your needs.
47

@@ -382,6 +385,6 @@ Common validation errors:
382385

383386
## Next Steps
384387

385-
- [Tracing Guide](tracing.md) - Learn about traces, spans, and generations
386-
- [API Reference](api-reference.md) - Complete type reference
387-
- [Getting Started](getting-started.md) - Basic setup guide
388+
- [Tracing Guide](../tracing/) - Learn about traces, spans, and generations
389+
- [API Reference](../api-reference/) - Complete type reference
390+
- [Getting Started](../getting-started/) - Basic setup guide
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Evaluation
1+
---
2+
title: Evaluation
3+
weight: 4
4+
---
25

36
Langfuse provides powerful evaluation capabilities, including built-in support for LLM-as-a-Judge workflows.
47

@@ -567,6 +570,6 @@ func evaluateResponse(client *langfuse.Client, generationID string, input, outpu
567570

568571
## Next Steps
569572

570-
- [API Reference](api-reference.md) - Complete type reference
571-
- [Tracing Guide](tracing.md) - Learn about traces and observations
572-
- [Configuration](configuration.md) - Customize SDK behavior
573+
- [API Reference](../api-reference/) - Complete type reference
574+
- [Tracing Guide](../tracing/) - Learn about traces and observations
575+
- [Configuration](../configuration/) - Customize SDK behavior

0 commit comments

Comments
 (0)