diff options
author | Marcin Mierzejewski <marcin@mierzejewski.net> | 2020-05-12 00:44:37 +0300 |
---|---|---|
committer | Marcin Mierzejewski <marcin@mierzejewski.net> | 2020-05-12 00:44:37 +0300 |
commit | f2ef6d4161516e0df86c9e470079a706de279ef0 (patch) | |
tree | d38e1e6564cc18f6559ac29bcb484e493613a7c3 | |
parent | 8d37fa84025ad08e7e3711e5a9a1c6cbd367590c (diff) |
config: add titleCutting param
-rw-r--r-- | exampleSite/config.toml | 3 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 78b24bd..3a3d1f6 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -4,6 +4,9 @@ theme = "hugo-theme-console" languageCode = "en-us" [params] + # Cutting off the page title to two chars for mobile (console-demo -> co) + titleCutting = true + [[params.navlinks]] name = "about/" url = "about/" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index db80137..381f759 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -33,7 +33,7 @@ <div class="logo terminal-prompt"> {{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} {{ $.Scratch.Add "path" .Site.BaseURL }} - <a href="{{ .Site.BaseURL }}" class="no-style site-name">{{ .Site.Title }}</a>:~# {{ range $index, $element := split $url "/" }}{{ $.Scratch.Add "path" $element }}{{ if ne $element "" }}<a href='{{ $.Scratch.Get "path" | absURL }}'>{{ . }}</a>/{{ $.Scratch.Add "path" "/" }}{{ end }}{{ end }}</div></header> + <a href="{{ .Site.BaseURL }}" class="no-style {{ with .Site.Params.TitleCutting }}site-name{{ end }}">{{ .Site.Title }}</a>:~# {{ range $index, $element := split $url "/" }}{{ $.Scratch.Add "path" $element }}{{ if ne $element "" }}<a href='{{ $.Scratch.Get "path" | absURL }}'>{{ . }}</a>/{{ $.Scratch.Add "path" "/" }}{{ end }}{{ end }}</div></header> <nav class="terminal-menu"> <ul vocab="https://schema.org/" typeof="BreadcrumbList"> {{ range .Site.Params.navlinks }} |