Skip to content
Snippets Groups Projects
Verified Commit f673e09d authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

feat: new export

parent 682e688b
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ Furthermore, it will parse the templates for images, anchors, and text.
##### Generate
This will generate HTML files from the prepared templates.
This will generate HTML files from the prepared templates and data YAML.
```bash
bob html generate --input ./output/ --output ./output/
......
......@@ -30,7 +30,12 @@ func GenerateFiles(dataPath, out string) error {
return err
}
outFile := path.Join(out, name)
outFile := path.Join(out, page.Export)
dir := path.Dir(outFile)
if err := os.MkdirAll(dir, 0755); err != nil {
return err
}
err = os.WriteFile(outFile, []byte(html), 0644)
if err != nil {
......
......@@ -307,7 +307,9 @@ func PrepareHtmlFile(from, to string, storage types.PageDataStorage) error {
prepareAnchors(node, pd)
prepareTextNodes(node, pd)
pd.Export = path.Join(pd.Lang, path.Base(from))
to = path.Join(to, path.Base(from))
return util.SaveHtml(to, node)
}
......@@ -26,6 +26,7 @@ type PageData struct {
Images []Image `yaml:"images"`
Anchors []Anchor `yaml:"anchors"`
Text []Text `yaml:"text"`
Export string `yaml:"export"`
}
func NewPageData() *PageData {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment