Skip to content

Commit 4209cd2

Browse files
author
Natalie Arellano
committed
Dynamically generate the alias for pack CLI documentation
Fixes buildpacks/docs#668 Signed-off-by: Natalie Arellano <[email protected]>
1 parent 67d1294 commit 4209cd2

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)