1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

gendocs: add autogenerated header to all docs

This commit is contained in:
Nick Craig-Wood
2020-02-10 12:31:45 +00:00
parent 25cfeb2a64
commit dfb710eab7
70 changed files with 140 additions and 69 deletions

View File

@@ -25,6 +25,7 @@ date: %s
title: "%s"
slug: %s
url: %s
# autogenerated - DO NOT EDIT, instead edit the source code in %s and as part of making a release run "make commanddocs"
---
`
@@ -67,7 +68,8 @@ rclone.org website.`,
name := filepath.Base(filename)
base := strings.TrimSuffix(name, path.Ext(name))
url := "/commands/" + strings.ToLower(base) + "/"
return fmt.Sprintf(gendocFrontmatterTemplate, now, strings.Replace(base, "_", " ", -1), base, url)
source := strings.Replace(strings.Replace(base, "rclone", "cmd", -1), "_", "/", -1) + "/"
return fmt.Sprintf(gendocFrontmatterTemplate, now, strings.Replace(base, "_", " ", -1), base, url, source)
}
linkHandler := func(name string) string {
base := strings.TrimSuffix(name, path.Ext(name))