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
This commit is contained in:
Robert Austin 2019-09-19 23:08:54 +10:00 committed by Luiz F. A. de Prá
parent 02630ed83c
commit 3cc2397944
5 changed files with 242 additions and 18 deletions

View File

@ -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. - 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. - 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)

View File

@ -81,6 +81,8 @@ disqusShortname = "yourdiscussshortname"
[languages.en] [languages.en]
languagename = "English" languagename = "English"
[languages.en.menu]
[[languages.en.menu.main]] [[languages.en.menu.main]]
name = "About" name = "About"
weight = 1 weight = 1

View File

@ -2,7 +2,7 @@
date = "2019-03-20" date = "2019-03-20"
title = "Render LaTeX using KaTeX" title = "Render LaTeX using KaTeX"
description = "Katex support demo" description = "Katex support demo"
katex = "true" katex = true
series = ["Theme", "Hugo"] series = ["Theme", "Hugo"]
+++ +++

View File

@ -3,7 +3,7 @@ date = "2017-01-08"
title = "Theme Demo" title = "Theme Demo"
description = "The post demonstrates features of the coder theme." description = "The post demonstrates features of the coder theme."
images = ["/images/N90.jpg"] images = ["/images/N90.jpg"]
math = "true" math = true
series = ["Theme", "Hugo"] series = ["Theme", "Hugo"]
+++ +++

216
stackbit.yaml Normal file
View File

@ -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.