Skip to content

Commit 6ba3906

Browse files
committed
Update name of Markdown index files for new docs
1 parent 80b21c0 commit 6ba3906

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

usage/help.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ $ step help ssh
5555
Name: "report",
5656
Usage: "Writes a JSON report to the HTML docs directory.",
5757
},
58-
cli.BoolFlag{
59-
Name: "hugo",
60-
Usage: "Writes hugo (vs jekyll) compatible markdown files",
61-
},
6258
},
6359
}
6460
}

usage/html.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ func markdownHelpAction(ctx *cli.Context) error {
3535
return errs.FileError(err, dir)
3636
}
3737

38-
isHugo := ctx.Bool("hugo")
39-
4038
// app index
41-
index := path.Join(dir, "index.md")
39+
index := path.Join(dir, "README.mdx")
4240
w, err := os.Create(index)
4341
if err != nil {
4442
return errs.FileError(err, index)
@@ -50,23 +48,19 @@ func markdownHelpAction(ctx *cli.Context) error {
5048

5149
// Subcommands
5250
for _, cmd := range ctx.App.Commands {
53-
if err := markdownHelpCommand(ctx.App, cmd, cmd, path.Join(dir, cmd.Name), isHugo); err != nil {
51+
if err := markdownHelpCommand(ctx.App, cmd, cmd, path.Join(dir, cmd.Name)); err != nil {
5452
return err
5553
}
5654
}
5755
return nil
5856
}
5957

60-
func markdownHelpCommand(app *cli.App, cmd, parent cli.Command, base string, isHugo bool) error {
58+
func markdownHelpCommand(app *cli.App, cmd, parent cli.Command, base string) error {
6159
if err := os.MkdirAll(base, 0755); err != nil {
6260
return errs.FileError(err, base)
6361
}
6462

65-
fileName := "index.md"
66-
// preserve jekyll compatibility for transition period
67-
if isHugo && len(cmd.Subcommands) > 0 {
68-
fileName = "_index.md"
69-
}
63+
fileName := "README.mdx"
7064

7165
index := path.Join(base, fileName)
7266
w, err := os.Create(index)
@@ -93,7 +87,7 @@ func markdownHelpCommand(app *cli.App, cmd, parent cli.Command, base string, isH
9387

9488
for _, sub := range cmd.Subcommands {
9589
sub.HelpName = fmt.Sprintf("%s %s", cmd.HelpName, sub.Name)
96-
if err := markdownHelpCommand(app, sub, cmd, path.Join(base, sub.Name), isHugo); err != nil {
90+
if err := markdownHelpCommand(app, sub, cmd, path.Join(base, sub.Name)); err != nil {
9791
return err
9892
}
9993
}

0 commit comments

Comments
 (0)