config: add titleCutting param

This commit is contained in:
Marcin Mierzejewski 2020-05-11 23:44:37 +02:00
parent 8d37fa8402
commit f2ef6d4161
2 changed files with 4 additions and 1 deletions

View file

@ -4,6 +4,9 @@ theme = "hugo-theme-console"
languageCode = "en-us" languageCode = "en-us"
[params] [params]
# Cutting off the page title to two chars for mobile (console-demo -> co)
titleCutting = true
[[params.navlinks]] [[params.navlinks]]
name = "about/" name = "about/"
url = "about/" url = "about/"

View file

@ -33,7 +33,7 @@
<div class="logo terminal-prompt"> <div class="logo terminal-prompt">
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} {{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $.Scratch.Add "path" .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"> <nav class="terminal-menu">
<ul vocab="https://schema.org/" typeof="BreadcrumbList"> <ul vocab="https://schema.org/" typeof="BreadcrumbList">
{{ range .Site.Params.navlinks }} {{ range .Site.Params.navlinks }}