Skip to content

Commit 4a7fb7f

Browse files
committed
Add Title to hugo.yaml and modify navbar to use it
navbar.html by defalut puts the title on every page. This update modifies it to not put the title on the home page. The title already is a central part of the text within the page and having it on the home page is redundant. Defining the title in the config comes in useful for other Hugo templates that want to use the title of the website.
1 parent 0e207e8 commit 4a7fb7f

File tree

2 files changed

+130
-52
lines changed

2 files changed

+130
-52
lines changed

config/_default/hugo.yaml

Lines changed: 55 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,55 @@
1-
# *******************************************************************
2-
#
3-
# Hugo parameters for Interlisp.org
4-
#
5-
# An overview of hugo configuration files can be found at:
6-
# https://gohugo.io/getting-started/configuration/#configure-server
7-
#
8-
9-
# relativeURLs: Enable to force all relative URLs to be relative to content root
10-
relativeURLs: false
11-
12-
# canonifyURLs: Convert relative URLs to absolute URLs
13-
canonifyURLs: false
14-
15-
# enableRobotsTXT: Enable generation of robots.txt file. When enabled this
16-
# will overwrite the default robots.txt file that disallows crawling.
17-
# Default to false and set to true for production in config/production/hugo.yaml
18-
enableRobotsTXT: false
19-
20-
# assetDir: Location where Hugo looks for assets
21-
assetDir: static
22-
23-
# Enable .GitInfo object for each page. This will give values to .Lastmod etc.
24-
enableGitInfo: false
25-
26-
# Top Level Language defaults
27-
# See languages.yaml for language specific values
28-
defaultContentLanguage: "en"
29-
defaultContentLanguageInSubdir: false
30-
31-
# Useful when translating.
32-
enableMissingTranslationPlaceholders: true
33-
34-
# Disable rendering of the specified page kinds
35-
disableKinds:
36-
- taxonomy
37-
- term
38-
- RSS
39-
40-
# Code Highlighting configuration
41-
# Not Used. Code highlighting is controlled using the highlighting
42-
# section in `markup.yaml`
43-
#pygmentsCodeFences: false
44-
#pygmentsUseClasses: false
45-
# Use the new Chroma Go highlighter in Hugo.
46-
# pygmentsUseClassic: false
47-
# pygmentsOptions: linenos=table
48-
# See https://help.farbox.com/pygments.html
49-
50-
# Comment out if you don't want the "print entire section" link enabled.
51-
# [outputs]
52-
# section = ["HTML", "print"]
1+
# *******************************************************************
2+
#
3+
# Hugo parameters for Interlisp.org
4+
#
5+
# An overview of hugo configuration files can be found at:
6+
# https://gohugo.io/getting-started/configuration/#configure-server
7+
#
8+
# title: The title that appears in the navbar of every page. We have
9+
# edited navbar.html to not show the title in the navbar of the home page.
10+
title: "The Medley Interlisp Project"
11+
12+
# relativeURLs: Enable to force all relative URLs to be relative to content root
13+
relativeURLs: false
14+
15+
# canonifyURLs: Convert relative URLs to absolute URLs
16+
canonifyURLs: false
17+
18+
# enableRobotsTXT: Enable generation of robots.txt file. When enabled this
19+
# will overwrite the default robots.txt file that disallows crawling.
20+
# Default to false and set to true for production in config/production/hugo.yaml
21+
enableRobotsTXT: false
22+
23+
# assetDir: Location where Hugo looks for assets
24+
assetDir: static
25+
26+
# Enable .GitInfo object for each page. This will give values to .Lastmod etc.
27+
enableGitInfo: false
28+
29+
# Top Level Language defaults
30+
# See languages.yaml for language specific values
31+
defaultContentLanguage: "en"
32+
defaultContentLanguageInSubdir: false
33+
34+
# Useful when translating.
35+
enableMissingTranslationPlaceholders: true
36+
37+
# Disable rendering of the specified page kinds
38+
disableKinds:
39+
- taxonomy
40+
- term
41+
- RSS
42+
43+
# Code Highlighting configuration
44+
# Not Used. Code highlighting is controlled using the highlighting
45+
# section in `markup.yaml`
46+
#pygmentsCodeFences: false
47+
#pygmentsUseClasses: false
48+
# Use the new Chroma Go highlighter in Hugo.
49+
# pygmentsUseClassic: false
50+
# pygmentsOptions: linenos=table
51+
# See https://help.farbox.com/pygments.html
52+
53+
# Comment out if you don't want the "print entire section" link enabled.
54+
# [outputs]
55+
# section = ["HTML", "print"]

layouts/partials/navbar.html

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{{ $cover := and
2+
(.HasShortcode "blocks/cover")
3+
(not .Site.Params.ui.navbar_translucent_over_cover_disable)
4+
-}}
5+
{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}
6+
7+
<nav class="td-navbar js-navbar-scroll
8+
{{- if $cover }} td-navbar-cover {{- end }}" data-bs-theme="dark">
9+
<div class="container-fluid flex-column flex-md-row">
10+
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
11+
{{- /**/ -}}
12+
<span class="navbar-brand__logo navbar-logo">
13+
{{- if ne .Site.Params.ui.navbar_logo false -}}
14+
{{ with resources.Get "icons/logo.svg" -}}
15+
{{ ( . | minify).Content | safeHTML -}}
16+
{{ end -}}
17+
{{ end -}}
18+
</span>
19+
{{- /**/ -}}
20+
<span class="navbar-brand__name">
21+
<!-- Place the site title on every page header, except the home page -->
22+
{{ if not .IsHome }}
23+
{{ .Site.Title }}
24+
{{ end }}
25+
26+
</span>
27+
{{- /**/ -}}
28+
</a>
29+
<div class="td-navbar-nav-scroll ms-md-auto" id="main_navbar">
30+
<ul class="navbar-nav">
31+
{{ $p := . -}}
32+
{{ range .Site.Menus.main -}}
33+
<li class="nav-item">
34+
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
35+
{{ $href := "" -}}
36+
{{ with .Page -}}
37+
{{ $active = or $active ( $.IsDescendant .) -}}
38+
{{ $href = .RelPermalink -}}
39+
{{ else -}}
40+
{{ $href = .URL | relLangURL -}}
41+
{{ end -}}
42+
{{ $isExternal := ne $baseURL.Host (urls.Parse .URL).Host -}}
43+
<a {{/**/ -}}
44+
class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}}
45+
href="{{ $href }}"
46+
{{- if $isExternal }} target="_blank" rel="noopener" {{- end -}}
47+
>
48+
{{- .Pre -}}
49+
<span>{{ .Name }}</span>
50+
{{- .Post -}}
51+
</a>
52+
</li>
53+
{{ end -}}
54+
{{ if .Site.Params.versions -}}
55+
<li class="nav-item dropdown d-none d-lg-block">
56+
{{ partial "navbar-version-selector.html" . -}}
57+
</li>
58+
{{ end -}}
59+
{{ if (gt (len .Site.Home.Translations) 0) -}}
60+
<li class="nav-item dropdown d-none d-lg-block">
61+
{{ partial "navbar-lang-selector.html" . -}}
62+
</li>
63+
{{ end -}}
64+
{{ if .Site.Params.ui.showLightDarkModeMenu -}}
65+
<li class="td-light-dark-menu nav-item dropdown">
66+
{{ partial "theme-toggler" . }}
67+
</li>
68+
{{ end -}}
69+
</ul>
70+
</div>
71+
<div class="d-none d-lg-block">
72+
{{ partial "search-input.html" . }}
73+
</div>
74+
</div>
75+
</nav>

0 commit comments

Comments
 (0)