diff options
author | Victoria Drake <hello@victoria.dev> | 2020-07-25 16:38:23 +0300 |
---|---|---|
committer | Victoria Drake <hello@victoria.dev> | 2020-07-25 16:57:40 +0300 |
commit | e781be1620c1f5f16044f035c265b937ba4971a7 (patch) | |
tree | 7f8c5cc351cad60c1c6d8b2edc0c28753a34a87f /exampleSite/content | |
parent | 5f5084d870d3af81cf81b701bfd50913b426ba23 (diff) |
Add example site configuration post, shortcodes
- Hopefully help explain related issues #217, #194
Close #226
Diffstat (limited to 'exampleSite/content')
-rw-r--r-- | exampleSite/content/en/blog/configuration.md | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/exampleSite/content/en/blog/configuration.md b/exampleSite/content/en/blog/configuration.md new file mode 100644 index 0000000..dc76d37 --- /dev/null +++ b/exampleSite/content/en/blog/configuration.md @@ -0,0 +1,58 @@ +--- +title: "Theme Features" +date: 2020-07-25T02:04:06-05:00 +tags: ["code"] +--- + +Here are some helpful tips for setting up this theme. + +## Syntax Highlighting + +Introduction allows the use of Hugo's rich built-in syntax highlighting capabilities. See [Syntax Highlighting](https://gohugo.io/content-management/syntax-highlighting/) in the Hugo docs. + +Below is an example configuration for Highlight. See [Highlight in the Hugo docs](https://gohugo.io/getting-started/configuration-markup#highlight) for more. + +```toml +[markup] + [markup.highlight] + codeFences = true + guessSyntax = false + hl_Lines = "" + lineNoStart = 1 + lineNos = false + lineNumbersInTable = true + noClasses = true + # For styles, see https://xyproto.github.io/splash/docs/longer/all.html + style = "friendly" + tabWidth = 4 +``` + +## Shortcodes + +[Custom shortcodes](https://gohugo.io/templates/shortcode-templates/) can be added to a `layouts/shortcodes/` directory in your site root. Below, I use two custom shortcodes to display a data file: the current configuration file for this site! See the [source for this page](https://github.com/victoriadrake/hugo-theme-introduction/blob/master/exampleSite/content/en/blog/configuration.md) to understand how to use shortcodes. + +## Show HTML in Posts + +To ensure Hugo renders any HTML that your shortcode or other additions like Font Awesome uses in posts, make sure these lines for [the Goldmark renderer](https://gohugo.io/getting-started/configuration-markup) are in your `config.toml`: + +```toml +[markup] +defaultMarkdownHandler = "goldmark" + +[markup.goldmark] + +[markup.goldmark.renderer] +unsafe = true +``` + +## Configuration + +Introduction can be easily configured using [Hugo's configuration file](https://gohugo.io/getting-started/configuration/). You can copy the `config.toml` in the `exampleSite/` to your site root get started. + +Here are all the options included in the configuration file for this example site! + +```toml +{{% md %}} +{{< readfile file="config.toml" >}} +{{% /md %}} +``` |