mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-03 12:12:37 +00:00
ed8bf081fd
d9c8fc220Rebuild Chroma CSSa9168b106Adds missing wordebaa172afRemove note about enabling custom GitLab domains2ef3918b2Add code toggler41878b6caClarify the use of .GetPage with page bundlesffcb26270Fix broken link for configuration.md1e72e2b3eFixed typo in heading - Hightlighter72b2db77cChange "on the form" to "of the form"e15e6966fFix example GitHub url git-subtree-dir: docs git-subtree-split:d9c8fc2207
75 lines
1.8 KiB
Markdown
75 lines
1.8 KiB
Markdown
---
|
|
title: Code Toggle
|
|
description: Code Toggle tryout and showcase.
|
|
date: 2018-03-16
|
|
categories: [getting started,fundamentals]
|
|
keywords: [configuration,toml,yaml,json]
|
|
weight: 60
|
|
sections_weight: 60
|
|
draft: false
|
|
toc: true
|
|
---
|
|
|
|
## The Config Toggler!
|
|
|
|
This is an exemple for the Config Toggle shortcode.
|
|
Its purpose is to let users choose a Config language by clicking on its corresponding tab. Upon doing so, every Code toggler on the page will be switched to the target language. Also, target language will be saved in user's `localStorage` so when they go to a different pages, Code Toggler display their last "toggled" config language.
|
|
|
|
## That Congig Toggler
|
|
|
|
{{< code-toggle file="config">}}
|
|
|
|
baseURL: "https://yoursite.example.com/"
|
|
title: "My Hugo Site"
|
|
footnoteReturnLinkContents: "↩"
|
|
permalinks:
|
|
post: /:year/:month/:title/
|
|
params:
|
|
Subtitle: "Hugo is Absurdly Fast!"
|
|
AuthorName: "Jon Doe"
|
|
GitHubUser: "spf13"
|
|
ListOfFoo:
|
|
- "foo1"
|
|
- "foo2"
|
|
SidebarRecentLimit: 5
|
|
{{< /code-toggle >}}
|
|
|
|
## Another Config Toggler!
|
|
|
|
{{< code-toggle file="theme">}}
|
|
|
|
# theme.toml template for a Hugo theme
|
|
|
|
name = "Hugo Theme"
|
|
license = "MIT"
|
|
licenselink = "https://github.com/budparr/gohugo.io/blob/master/LICENSE.md"
|
|
description = ""
|
|
homepage = "https://github.com/budparr/gohugo.io"
|
|
tags = ["website"]
|
|
features = ["", ""]
|
|
min_version = 0.18
|
|
|
|
[author]
|
|
name = "Bud Parr"
|
|
homepage = "https://github.com/budparr"
|
|
|
|
{{< /code-toggle >}}
|
|
|
|
## Two regular code blocks
|
|
|
|
{{< code file="bf-config.toml" >}}
|
|
[blackfriday]
|
|
angledQuotes = true
|
|
fractions = false
|
|
plainIDAnchors = true
|
|
extensions = ["hardLineBreak"]
|
|
{{< /code >}}
|
|
|
|
{{< code file="bf-config.yml" >}}
|
|
blackfriday:
|
|
angledQuotes: true
|
|
fractions: false
|
|
plainIDAnchors: true
|
|
extensions:
|
|
- hardLineBreak
|
|
{{< /code >}} |