github.com/rabbouni145/gg@v0.47.1/docs/content/en/getting-started/code-toggle.md (about) 1 --- 2 title: Code Toggle 3 description: Code Toggle tryout and showcase. 4 date: 2018-03-16 5 categories: [getting started,fundamentals] 6 keywords: [configuration,toml,yaml,json] 7 weight: 60 8 sections_weight: 60 9 draft: false 10 toc: true 11 --- 12 13 ## The Config Toggler! 14 15 This is an example for the Config Toggle shortcode. 16 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. 17 18 ## That Config Toggler 19 20 {{< code-toggle file="config">}} 21 22 baseURL: "https://yoursite.example.com/" 23 title: "My Hugo Site" 24 footnoteReturnLinkContents: "↩" 25 permalinks: 26 post: /:year/:month/:title/ 27 params: 28 Subtitle: "Hugo is Absurdly Fast!" 29 AuthorName: "Jon Doe" 30 GitHubUser: "spf13" 31 ListOfFoo: 32 - "foo1" 33 - "foo2" 34 SidebarRecentLimit: 5 35 {{< /code-toggle >}} 36 37 ## Another Config Toggler! 38 39 {{< code-toggle file="theme">}} 40 41 # theme.toml template for a Hugo theme 42 43 name = "Hugo Theme" 44 license = "MIT" 45 licenselink = "https://github.com/budparr/gohugo.io/blob/master/LICENSE.md" 46 description = "" 47 homepage = "https://github.com/budparr/gohugo.io" 48 tags = ["website"] 49 features = ["", ""] 50 min_version = 0.18 51 52 [author] 53 name = "Bud Parr" 54 homepage = "https://github.com/budparr" 55 56 {{< /code-toggle >}} 57 58 ## Two regular code blocks 59 60 {{< code file="bf-config.toml" >}} 61 [blackfriday] 62 angledQuotes = true 63 fractions = false 64 plainIDAnchors = true 65 extensions = ["hardLineBreak"] 66 {{< /code >}} 67 68 {{< code file="bf-config.yml" >}} 69 blackfriday: 70 angledQuotes: true 71 fractions: false 72 plainIDAnchors: true 73 extensions: 74 - hardLineBreak 75 {{< /code >}}