summaryrefslogtreecommitdiff
path: root/crocc.go
diff options
context:
space:
mode:
authorNicolas Paul <n@nc0.fr>2023-05-02 22:30:41 +0200
committerNicolas Paul <n@nc0.fr>2023-05-02 22:30:41 +0200
commitee181818c030315a69eff69faf79a7f2ba09b59f (patch)
tree058a6616412d866868710a89c4f7dafecfb8a7fc /crocc.go
parenta97ea6a30eccbca19fe1b3d21b5830e0e01b15a4 (diff)
Make slug have the file extension
Diffstat (limited to 'crocc.go')
-rw-r--r--crocc.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/crocc.go b/crocc.go
index e88ab33..d274992 100644
--- a/crocc.go
+++ b/crocc.go
@@ -21,6 +21,7 @@ var (
url = flag.String("url", "http://localhost", "site URL")
generateHidden = flag.Bool("hidden", false, "generate hidden pages")
printVersion = flag.Bool("version", false, "print version and exit")
+ sitemap = flag.Bool("sitemap", false, "generate sitemap (will overwrite existing sitemap.xml)")
)
const usage string = `crocc is a simple Markdown-based static site generator.
@@ -136,7 +137,7 @@ func Crocc(path string, d os.DirEntry, e error) error {
// If the file is a Markdown file, transform it into HTML
o = strings.TrimSuffix(o, filepath.Ext(o)) + ".html"
- s := strings.TrimSuffix(strings.TrimPrefix(o, *out), ".html")
+ s := strings.TrimPrefix(o, *out)
if err := TransformMarkdownFile(path, o, s); err != nil {
return err
}