diff options
author | Zachary Betz <zwbetz@gmail.com> | 2019-02-18 05:39:39 +0300 |
---|---|---|
committer | Zachary Betz <zwbetz@gmail.com> | 2019-02-18 05:39:39 +0300 |
commit | 82aa4877c09b3dc6cba8f60563fd4ba9e1ae16ae (patch) | |
tree | 043f8d3033960be9205ae1848d4d02b9f13cd8d3 | |
parent | 16a40bc9e72c14796ddfa90eb77d5ab90a122277 (diff) |
Homepage content from file
-rw-r--r-- | README.md | 24 | ||||
-rw-r--r-- | exampleSite/content/_index.md | 6 | ||||
-rw-r--r-- | layouts/index.html | 5 |
3 files changed, 28 insertions, 7 deletions
@@ -6,12 +6,13 @@ A vanilla [Bootstrap](https://getbootstrap.com/) theme for [Hugo](https://gohugo ## Table of Contents -* [Demos](#demos) +* [Demo](#demo) * [Minimum Hugo Version](#minimum-hugo-version) * [Installation](#installation) * [Updating](#updating) * [Run Example Site](#run-example-site) * [Configuration](#configuration) +* [Homepage Content](#homepage-content) * [Shortcodes](#shortcodes) * [bootstrap-blockquote](#bootstrap-blockquote) * [bootstrap-table](#bootstrap-table) @@ -19,16 +20,13 @@ A vanilla [Bootstrap](https://getbootstrap.com/) theme for [Hugo](https://gohugo * [Getting Help](#getting-help) * [Credits](#credits) -## Demos +## Demo -| Env | URL | -| --- | --- | -| Dev demo, immediate updates | https://vanilla-bootstrap-hugo-theme.netlify.com/ | -| Hugo Themes demo, weekly-ish updates | https://themes.gohugo.io//theme/vanilla-bootstrap-hugo-theme/ | +https://vanilla-bootstrap-hugo-theme.netlify.com/ ## Minimum Hugo Version -This theme **requires** Hugo version `0.48` or higher. Take a look at the [Hugo releases](https://github.com/gohugoio/hugo/releases) and download the binary for your OS. +Hugo version `0.48` or higher is required. View the [Hugo releases](https://github.com/gohugoio/hugo/releases) and download the binary for your OS. ## Installation @@ -58,6 +56,18 @@ hugo server --themesDir ../.. Copy the `config.toml` or `config.yaml` from the [`exampleSite`](https://github.com/zwbetz-gh/vanilla-bootstrap-hugo-theme/tree/master/exampleSite), then edit as desired. +## Homepage Content + +By default the homepage uses the `homeText` param for content. If you wish to provide content from a file, then create `content/_index.md` and it will be used instead. For example: + +``` +--- +title: Home +--- + +Homepage content goes here. +``` + ## Shortcodes ### bootstrap-blockquote diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md new file mode 100644 index 0000000..9f7982d --- /dev/null +++ b/exampleSite/content/_index.md @@ -0,0 +1,6 @@ +--- +title: Home +draft: true +--- + +Homepage content goes here.
\ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 820e32e..29bcc73 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,8 +1,13 @@ {{ define "main" }} <div id="home-jumbotron" class="jumbotron text-center"> +{{ with .Content }} + <h1>{{ $.Page.Title }}</h1> + {{ . }} +{{ else }} <h1>{{ .Site.Title }}</h1> <p class="font-125">{{ .Site.Params.homeText | markdownify }}</p> +{{ end }} </div> {{ end }}
\ No newline at end of file |