Skip to content

Commit 04aff00

Browse files
committed
Update make site-docs to reflect latest setup
- Man pages are now placed under `/manual/` - Use Jekyll `permalink` to avoid the `.html` extension - Strip "SEE ALSO" and everything after it
1 parent 1c1212e commit 04aff00

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ site:
2121

2222
site-docs: site
2323
git -C site pull
24-
git -C site rm 'gh*.md' 2>/dev/null || true
25-
go run ./cmd/gen-docs site
26-
git -C site add 'gh*.md'
24+
git -C site rm 'manual/gh*.md' 2>/dev/null || true
25+
go run ./cmd/gen-docs site/manual
26+
for f in site/manual/gh*.md; do sed -i.bak -e '/^### SEE ALSO/,$$d' "$$f"; done
27+
rm -f site/manual/*.bak
28+
git -C site add 'manual/gh*.md'
2729
git -C site commit -m 'update help docs'
2830
git -C site push
2931
.PHONY: site-docs

cmd/gen-docs/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"fmt"
55
"os"
6+
"strings"
67

78
"github.com/cli/cli/command"
89
"github.com/spf13/cobra/doc"
@@ -28,13 +29,14 @@ func main() {
2829
func filePrepender(filename string) string {
2930
return `---
3031
layout: page
32+
permalink: /:path/:basename
3133
---
3234
3335
`
3436
}
3537

3638
func linkHandler(name string) string {
37-
return fmt.Sprintf("{{site.baseurl}}{%% link %s %%}", name)
39+
return fmt.Sprintf("./%s", strings.TrimSuffix(name, ".md"))
3840
}
3941

4042
func fatal(msg interface{}) {

0 commit comments

Comments
 (0)