From 3cc2397944d794ff51d763362c82d0a2814cd659 Mon Sep 17 00:00:00 2001 From: Robert Austin Date: Thu, 19 Sep 2019 23:08:54 +1000 Subject: [PATCH] Add Stackbit Integration (#208) * add stackbit.yaml * update field model for slug * add config model * update language config model * update menu model * katex should be a boolean value * add labelField to menu item model * math should be a boolean value * Add 1-click create with stackbit button --- README.md | 6 + exampleSite/config.toml | 34 +-- .../content/posts/render-latex-using-katex.md | 2 +- exampleSite/content/posts/theme-demo.md | 2 +- stackbit.yaml | 216 ++++++++++++++++++ 5 files changed, 242 insertions(+), 18 deletions(-) create mode 100644 stackbit.yaml diff --git a/README.md b/README.md index fc7dea0..a77ac4f 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,9 @@ This theme is maintained by its author [Luiz de PrĂ¡](https://github.com/luizdep - Gleen McComb, for his great [article](https://glennmccomb.com/articles/how-to-build-custom-hugo-pagination/) about custom pagination. - All contributors, for every PR and Issue reported. + +## Stackbit + +This theme is ready to import into Stackbit. This theme can be deployed to Netlify and you can connect any headless CMS including Forestry, NetlifyCMS, DatoCMS or Contentful. + +[![Create with Stackbit](https://assets.stackbit.com/badge/create-with-stackbit.svg)](https://app.stackbit.com/create?theme=https://github.com/luizdepra/hugo-coder) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index ffdd198..a5d8f52 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -81,25 +81,27 @@ disqusShortname = "yourdiscussshortname" [languages.en] languagename = "English" - [[languages.en.menu.main]] - name = "About" - weight = 1 - url = "about/" + [languages.en.menu] - [[languages.en.menu.main]] - name = "Blog" - weight = 2 - url = "posts/" + [[languages.en.menu.main]] + name = "About" + weight = 1 + url = "about/" - [[languages.en.menu.main]] - name = "Projects" - weight = 3 - url = "projects/" + [[languages.en.menu.main]] + name = "Blog" + weight = 2 + url = "posts/" - [[languages.en.menu.main]] - name = "Contact me" - weight = 5 - url = "contact/" + [[languages.en.menu.main]] + name = "Projects" + weight = 3 + url = "projects/" + + [[languages.en.menu.main]] + name = "Contact me" + weight = 5 + url = "contact/" [languages.pt-br] diff --git a/exampleSite/content/posts/render-latex-using-katex.md b/exampleSite/content/posts/render-latex-using-katex.md index 7fd69cb..2cd510b 100644 --- a/exampleSite/content/posts/render-latex-using-katex.md +++ b/exampleSite/content/posts/render-latex-using-katex.md @@ -2,7 +2,7 @@ date = "2019-03-20" title = "Render LaTeX using KaTeX" description = "Katex support demo" -katex = "true" +katex = true series = ["Theme", "Hugo"] +++ diff --git a/exampleSite/content/posts/theme-demo.md b/exampleSite/content/posts/theme-demo.md index be97705..78241b4 100644 --- a/exampleSite/content/posts/theme-demo.md +++ b/exampleSite/content/posts/theme-demo.md @@ -3,7 +3,7 @@ date = "2017-01-08" title = "Theme Demo" description = "The post demonstrates features of the coder theme." images = ["/images/N90.jpg"] -math = "true" +math = true series = ["Theme", "Hugo"] +++ diff --git a/stackbit.yaml b/stackbit.yaml new file mode 100644 index 0000000..c4c2d5d --- /dev/null +++ b/stackbit.yaml @@ -0,0 +1,216 @@ +stackbitVersion: ~0.2.0 +ssgName: custom +publishDir: demo/public +buildCommand: make prepare && hugo --source demo --baseURL "/" +uploadDir: images +staticDir: exampleSite/static +pagesDir: exampleSite/content +dataDir: exampleSite +models: + config: + type: data + label: Config + file: config.toml + fields: + - type: string + name: title + label: Title + required: true + - type: string + name: baseurl + label: Base URL + description: Hostname (and path) to the root + - type: string + name: languagecode + - type: string + name: defaultcontentlanguage + - type: string + name: themesDir + - type: string + name: theme + label: Theme Name + - type: number + name: paginate + - type: boolean + name: canonifyurls + - type: string + name: pygmentsstyle + - type: boolean + name: pygmentscodefences + - type: boolean + name: pygmentscodefencesguesssyntax + - type: string + name: disqusShortname + - type: object + name: params + label: Params + description: Site parameters + fields: + - type: string + name: author + - type: string + name: description + - type: string + name: keywords + - type: string + name: info + - type: string + name: avatarurl + - type: string + name: footercontent + - type: string + name: dateformat + - type: boolean + name: hideCredits + - type: boolean + name: hideCopyright + - type: string + name: commit + - type: boolean + name: rtl + - type: boolean + name: inverted + - type: number + name: maxSeeAlsoItems + - type: list + name: custom_css + - type: list + name: custom_js + - type: list + name: social + label: Social Media Icons + items: + type: object + fields: + - type: string + name: name + label: Name + - type: string + name: icon + label: Icon + - type: number + name: weight + label: Weight + - type: string + name: url + label: URL + - type: object + name: languages + fields: + - type: language_config + name: en + - type: language_config + name: "pt-br" + - type: object + name: taxonomies + fields: + - type: string + name: category + - type: string + name: series + - type: string + name: tag + basicpage: + type: page + label: Basic Page + match: "*.md" + exclude: + - _index.md + fields: + - type: string + name: title + label: Title + - type: string + name: slug + label: Slug + post: + type: page + label: Blog post + folder: posts + fields: + - type: string + name: title + label: Title + - type: date + name: date + label: Date + - type: string + name: slug + label: Slug + - type: list + name: tags + label: Tags + items: + type: string + - type: list + name: categories + label: Categories + items: + type: string + - type: list + name: series + label: Series + items: + type: string + - type: string + name: externalLink + - type: string + name: description + - type: boolean + name: math + - type: boolean + name: katex + - type: list + name: images + items: + type: string + language_config: + type: object + label: Language Config + fields: + - type: string + name: languagename + - type: string + name: title + - type: object + name: params + fields: + - type: string + name: author + - type: string + name: info + - type: string + name: description + - type: string + name: keywords + - type: string + name: footercontent + - type: object + label: Menu + name: menu + fields: + - type: list + name: main + items: + type: object + labelField: name + fields: + - type: string + name: identifier + label: Identifier + - type: string + name: name + label: Title + required: true + - type: string + name: url + label: URL + required: true + - type: number + name: weight + label: Weight + description: Position for sorting + - type: string + name: parent + label: Parent Menu Identifier + description: The parent of an entry should be the identifier of another entry.