### Defining Footer Sidebar Block in Hugo Template Source: https://github.com/thuliteio/doks/blob/main/layouts/index.html This snippet defines the `sidebar-footer` block, intended for content displayed in the footer area. It conditionally renders a "Start building with Doks today" message and a "Get Started" link based on the `sectionFooter` parameter, adjusting the link path for documentation versioning. ```Go HTML Template {{ define "sidebar-footer" }} {{ if site.Params.doks.sectionFooter -}} Start building with Doks today ------------------------------ [{{ i18n "get-started" }}](/docs/{{ if site.Params.doks.docsVersioning }}{{ site.Params.doks.docsVersion }}/{{ end }}prologue/introduction/) {{ end -}} {{ end }} ``` -------------------------------- ### Installing Doks Theme with npm Source: https://github.com/thuliteio/doks/blob/main/README.md This command uses `npm create` to initialize a new Thulite project, specifically applying the Doks theme. It is the recommended method for installing Doks, ensuring all necessary files and dependencies are set up correctly for a new documentation site. ```bash npm create thulite@latest -- --template doks ``` -------------------------------- ### Defining Main Content Block in Hugo Template Source: https://github.com/thuliteio/doks/blob/main/layouts/index.html This snippet defines the `main` content block, which is the primary area for page content in a Hugo site. It includes the page title, a lead paragraph, and a "Get Started" link, conditionally adjusting the link path based on documentation versioning. ```Go HTML Template {{ define "main" }} {{ .Title }} ============ {{ .Params.lead | safeHTML }} [{{ i18n "get\_started" }}](/docs/{{ if site.Params.doks.docsVersioning }}{{ site.Params.doks.docsVersion }}/{{ end }}guides/example-guide/) {{ .Content }} {{ end }} ``` -------------------------------- ### Conditionally Loading Script for Production Environment (Hugo Template) Source: https://github.com/thuliteio/doks/blob/main/layouts/partials/footer/script-footer-custom.html This snippet demonstrates how to load a JavaScript file (`instantpage.js`) only when the Hugo environment is set to 'production'. It uses the `if eq` condition to check `hugo.Environment` and the `partial` function to include the `esbuild` helper with specific parameters for the script. ```Go Template {{ if eq (hugo.Environment) "production" -}} {{ partial "footer/esbuild" (dict "src" "js/instantpage.js" "load" "async" "transpile" false) -}} {{ end -}} ``` -------------------------------- ### Defining Pre-Footer Sidebar Block in Hugo Template Source: https://github.com/thuliteio/doks/blob/main/layouts/index.html This snippet defines the `sidebar-prefooter` block, which can display content before the main footer. It includes conditional logic to show background dots and specific instructions (like updating content or configuring the site) only if the site's language is English. ```Go HTML Template {{ define "sidebar-prefooter" }} {{ if site.Params.doks.backgroundDots -}} {{ end -}} {{ if eq $.Site.Language.LanguageName "English" }} Update content -------------- Edit `content/_index.md` to see this page change. Add new content --------------- Add Markdown files to `content` to create new pages. Configure your site ------------------- Edit your config in `config/_default/params.toml`. Read the docs ------------- Learn more in the [Docs](https://getdoks.org/). {{ end }} {{ end }} ``` -------------------------------- ### Conditionally Loading Script for Specific Page Type (Hugo Template) Source: https://github.com/thuliteio/doks/blob/main/layouts/partials/footer/script-footer-custom.html This snippet illustrates how to load a JavaScript file (`gallery.js`) only for pages of a specific type, such as 'gallery'. It uses the `if eq` condition to check the page's `.Type` property and the `partial` function to include the `esbuild` helper for the script. ```Go Template {{ if eq .Type "gallery" -}} {{ partial "footer/esbuild" (dict "src" "js/gallery.js" "load" "async" "transpile" false) -}} {{ end -}} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.