Skip to content

Commit

Permalink
Update make site-docs to reflect latest setup
Browse files Browse the repository at this point in the history
- Man pages are now placed under `/manual/`
- Use Jekyll `permalink` to avoid the `.html` extension
- Strip "SEE ALSO" and everything after it
  • Loading branch information
mislav committed Jan 31, 2020
1 parent 1c1212e commit 04aff00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ site:

site-docs: site
git -C site pull
git -C site rm 'gh*.md' 2>/dev/null || true
go run ./cmd/gen-docs site
git -C site add 'gh*.md'
git -C site rm 'manual/gh*.md' 2>/dev/null || true
go run ./cmd/gen-docs site/manual
for f in site/manual/gh*.md; do sed -i.bak -e '/^### SEE ALSO/,$$d' "$$f"; done
rm -f site/manual/*.bak
git -C site add 'manual/gh*.md'
git -C site commit -m 'update help docs'
git -C site push
.PHONY: site-docs
4 changes: 3 additions & 1 deletion cmd/gen-docs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"strings"

"github.com/cli/cli/command"
"github.com/spf13/cobra/doc"
Expand All @@ -28,13 +29,14 @@ func main() {
func filePrepender(filename string) string {
return `---
layout: page
permalink: /:path/:basename
---
`
}

func linkHandler(name string) string {
return fmt.Sprintf("{{site.baseurl}}{%% link %s %%}", name)
return fmt.Sprintf("./%s", strings.TrimSuffix(name, ".md"))
}

func fatal(msg interface{}) {
Expand Down

0 comments on commit 04aff00

Please sign in to comment.