Skip to content

Commit 4cbddd5

Browse files
authored
Merge pull request #671 from buildpacks/fix/pack-cli-alias
Dynamically generate the alias for pack CLI documentation
2 parents 67d1294 + 4209cd2 commit 4cbddd5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/get_pack_commands.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
gendocFrontmatterTemplate = `+++
2323
title="%s"
2424
no_edit="true"
25-
aliases=[ "/docs/tools/pack" ]
25+
aliases=[ "%s" ]
2626
+++
2727
<!--more-->
2828
`
@@ -32,7 +32,8 @@ var filePrepender = func(filename string) string {
3232
name := filepath.Base(filename)
3333
name = strings.Replace(name, ".md", "", -1)
3434
presentationName := strings.Replace(name, "_", " ", -1)
35-
return fmt.Sprintf(gendocFrontmatterTemplate, presentationName)
35+
alias := fmt.Sprintf("/docs/tools/pack/cli/%s", name)
36+
return fmt.Sprintf(gendocFrontmatterTemplate, presentationName, alias)
3637
}
3738

3839
var linkHandler = func(name string) string {

0 commit comments

Comments
 (0)