Skip to content

Commit f34ed60

Browse files
authored
Merge pull request #1752 from ramalama-labs/bug/docsite-build
Fixes docsite page linking
2 parents 5347af9 + c0f6c88 commit f34ed60

28 files changed

+47
-33
lines changed

docs/ramalama-cann.7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This guide walks through the steps required to set up RamaLama with Ascend NPU s
77
- [Hardware](#hardware)
88
- [Model](#model)
99
- [Docker](#docker)
10-
- [HISTORY](#todo)
10+
- [HISTORY](#history)
1111

1212
## Background
1313

docsite/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This Makefile provides commands for building and managing the RamaLama
44
# documentation site powered by Docusaurus.
55

6-
.PHONY: help convert dev build serve clean install
6+
.PHONY: help convert dev build serve clean install clean-generated
77

88
# Default target - show help
99
help: ## Show this help message
@@ -43,6 +43,14 @@ clean: ## Clean build artifacts and node_modules
4343
@rm -rf build .docusaurus node_modules
4444
@echo "✅ Clean complete!"
4545

46+
clean-generated: ## Clean auto-generated MDX files
47+
@echo "Cleaning auto-generated MDX files..."
48+
@find docs -name "*.mdx" -exec grep -l "# This file is auto-generated from manpages. Do not edit manually." {} \; | while read file; do \
49+
echo " Removing: $$file"; \
50+
rm "$$file"; \
51+
done
52+
@echo "✅ Auto-generated files cleaned!"
53+
4654
all: install convert build ## Install deps, convert manpages, and build site
4755

4856
# Development workflow targets

docsite/convert_manpages.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,14 @@ def extract_title_and_description(content, filename):
4343

4444
title = f"{platform} Setup"
4545
if base_name.endswith('.5.md'):
46-
# Config: ramalama.conf.5.md -> ramalama.conf
47-
title = base_name.replace('.5.md', '')
46+
# Config files with custom titles
47+
if base_name == 'ramalama.conf.5.md':
48+
title = 'Configuration File'
49+
elif base_name == 'ramalama-oci.5.md':
50+
title = 'OCI Spec'
51+
else:
52+
# Fallback for other .5.md files
53+
title = base_name.replace('.5.md', '')
4854
else:
4955
# Fallback
5056
title = base_name.replace('.md', '').replace('-', ' ')
@@ -136,6 +142,8 @@ def convert_markdown_to_mdx(content, filename):
136142
if history_match:
137143
history_text = history_match.group(1).strip()
138144
content = re.sub(history_pattern, '', content, flags=re.DOTALL)
145+
# Remove TOC links to HISTORY since it becomes a footer
146+
content = re.sub(r'\s*- \[HISTORY\]\(#history\)\n?', '', content)
139147
# Add history as footer
140148
content += f"\n\n---\n\n*{history_text}*"
141149

@@ -171,7 +179,7 @@ def convert_link(match):
171179
if filename == 'ramalama.1.md':
172180
return f'[{text}](#)' # Self-reference
173181
else:
174-
return f'[{text}]({base_path}commands/ramalama/ramalama)'
182+
return f'[{text}](/docs/commands/ramalama/)' # Link to ramalama category index
175183
return f'[{text}]({base_path}commands/ramalama/{command_name})'
176184
if link.endswith('.5.md'):
177185
# Configuration file

docsite/docs/commands/ramalama/bench.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ ramalama bench granite3-moe
156156
```
157157

158158
## See Also
159-
[ramalama(1)](../../commands/ramalama/ramalama)
159+
[ramalama(1)](/docs/commands/ramalama/)
160160

161161
---
162162

docsite/docs/commands/ramalama/chat.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $ ramalama chat --url http://localhost:1234
5959
```
6060

6161
## See Also
62-
[ramalama(1)](../../commands/ramalama/ramalama)
62+
[ramalama(1)](/docs/commands/ramalama/)
6363

6464
---
6565

docsite/docs/commands/ramalama/containers.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ granite-server
7474
```
7575

7676
## See Also
77-
[ramalama(1)](../../commands/ramalama/ramalama)
77+
[ramalama(1)](/docs/commands/ramalama/)
7878

7979
---
8080

docsite/docs/commands/ramalama/convert.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $ ramalama run oci://quay.io/kugupta/granite-3.2-q4-k-m:latest
6565
```
6666

6767
## See Also
68-
[ramalama(1)](../../commands/ramalama/ramalama), [ramalama-push(1)](../../commands/ramalama/push)
68+
[ramalama(1)](/docs/commands/ramalama/), [ramalama-push(1)](../../commands/ramalama/push)
6969

7070
---
7171

docsite/docs/commands/ramalama/info.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ $ ramalama info | jq .Shortnames.Names.mixtao
352352
```
353353

354354
## See Also
355-
[ramalama(1)](../../commands/ramalama/ramalama)
355+
[ramalama(1)](/docs/commands/ramalama/)
356356

357357
---
358358

docsite/docs/commands/ramalama/inspect.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ $ ramalama inspect smollm:135m --all --json
7575
```
7676

7777
## See Also
78-
[ramalama(1)](../../commands/ramalama/ramalama)
78+
[ramalama(1)](/docs/commands/ramalama/)
7979

8080
---
8181

docsite/docs/commands/ramalama/list.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ $ ramalama list --json
4949
```
5050

5151
## See Also
52-
[ramalama(1)](../../commands/ramalama/ramalama)
52+
[ramalama(1)](/docs/commands/ramalama/)
5353

5454
---
5555

0 commit comments

Comments
 (0)