From 82aa4877c09b3dc6cba8f60563fd4ba9e1ae16ae Mon Sep 17 00:00:00 2001 From: Zachary Betz Date: Sun, 17 Feb 2019 20:39:39 -0600 Subject: Homepage content from file --- README.md | 24 +++++++++++++++++------- exampleSite/content/_index.md | 6 ++++++ layouts/index.html | 5 +++++ 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 exampleSite/content/_index.md diff --git a/README.md b/README.md index 7dc2d8d..f90f3cb 100644 --- a/README.md +++ b/README.md @@ -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" }}
+{{ with .Content }} +

{{ $.Page.Title }}

+ {{ . }} +{{ else }}

{{ .Site.Title }}

{{ .Site.Params.homeText | markdownify }}

+{{ end }}
{{ end }} \ No newline at end of file -- cgit v1.2.3