Skip to content

Commit

Permalink
Merge pull request #671 from buildpacks/fix/pack-cli-alias
Browse files Browse the repository at this point in the history
Dynamically generate the alias for pack CLI documentation
  • Loading branch information
AidanDelaney authored Mar 8, 2024
2 parents 67d1294 + 4209cd2 commit 4cbddd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/get_pack_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
gendocFrontmatterTemplate = `+++
title="%s"
no_edit="true"
aliases=[ "/docs/tools/pack" ]
aliases=[ "%s" ]
+++
<!--more-->
`
Expand All @@ -32,7 +32,8 @@ var filePrepender = func(filename string) string {
name := filepath.Base(filename)
name = strings.Replace(name, ".md", "", -1)
presentationName := strings.Replace(name, "_", " ", -1)
return fmt.Sprintf(gendocFrontmatterTemplate, presentationName)
alias := fmt.Sprintf("/docs/tools/pack/cli/%s", name)
return fmt.Sprintf(gendocFrontmatterTemplate, presentationName, alias)
}

var linkHandler = func(name string) string {
Expand Down

0 comments on commit 4cbddd5

Please sign in to comment.