Skip to content

Add Title to hugo.yaml and modify navbar to use it #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 55 additions & 52 deletions config/_default/hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,52 +1,55 @@
# *******************************************************************
#
# Hugo parameters for Interlisp.org
#
# An overview of hugo configuration files can be found at:
# https://gohugo.io/getting-started/configuration/#configure-server
#

# relativeURLs: Enable to force all relative URLs to be relative to content root
relativeURLs: false

# canonifyURLs: Convert relative URLs to absolute URLs
canonifyURLs: false

# enableRobotsTXT: Enable generation of robots.txt file. When enabled this
# will overwrite the default robots.txt file that disallows crawling.
# Default to false and set to true for production in config/production/hugo.yaml
enableRobotsTXT: false

# assetDir: Location where Hugo looks for assets
assetDir: static

# Enable .GitInfo object for each page. This will give values to .Lastmod etc.
enableGitInfo: false

# Top Level Language defaults
# See languages.yaml for language specific values
defaultContentLanguage: "en"
defaultContentLanguageInSubdir: false

# Useful when translating.
enableMissingTranslationPlaceholders: true

# Disable rendering of the specified page kinds
disableKinds:
- taxonomy
- term
- RSS

# Code Highlighting configuration
# Not Used. Code highlighting is controlled using the highlighting
# section in `markup.yaml`
#pygmentsCodeFences: false
#pygmentsUseClasses: false
# Use the new Chroma Go highlighter in Hugo.
# pygmentsUseClassic: false
# pygmentsOptions: linenos=table
# See https://help.farbox.com/pygments.html

# Comment out if you don't want the "print entire section" link enabled.
# [outputs]
# section = ["HTML", "print"]
# *******************************************************************
#
# Hugo parameters for Interlisp.org
#
# An overview of hugo configuration files can be found at:
# https://gohugo.io/getting-started/configuration/#configure-server
#
# title: The title that appears in the navbar of every page. We have
# edited navbar.html to not show the title in the navbar of the home page.
title: "The Medley Interlisp Project"

# relativeURLs: Enable to force all relative URLs to be relative to content root
relativeURLs: false

# canonifyURLs: Convert relative URLs to absolute URLs
canonifyURLs: false

# enableRobotsTXT: Enable generation of robots.txt file. When enabled this
# will overwrite the default robots.txt file that disallows crawling.
# Default to false and set to true for production in config/production/hugo.yaml
enableRobotsTXT: false

# assetDir: Location where Hugo looks for assets
assetDir: static

# Enable .GitInfo object for each page. This will give values to .Lastmod etc.
enableGitInfo: false

# Top Level Language defaults
# See languages.yaml for language specific values
defaultContentLanguage: "en"
defaultContentLanguageInSubdir: false

# Useful when translating.
enableMissingTranslationPlaceholders: true

# Disable rendering of the specified page kinds
disableKinds:
- taxonomy
- term
- RSS

# Code Highlighting configuration
# Not Used. Code highlighting is controlled using the highlighting
# section in `markup.yaml`
#pygmentsCodeFences: false
#pygmentsUseClasses: false
# Use the new Chroma Go highlighter in Hugo.
# pygmentsUseClassic: false
# pygmentsOptions: linenos=table
# See https://help.farbox.com/pygments.html

# Comment out if you don't want the "print entire section" link enabled.
# [outputs]
# section = ["HTML", "print"]
75 changes: 75 additions & 0 deletions layouts/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{{ $cover := and
(.HasShortcode "blocks/cover")
(not .Site.Params.ui.navbar_translucent_over_cover_disable)
-}}
{{ $baseURL := urls.Parse $.Site.Params.Baseurl -}}

<nav class="td-navbar js-navbar-scroll
{{- if $cover }} td-navbar-cover {{- end }}" data-bs-theme="dark">
<div class="container-fluid flex-column flex-md-row">
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
{{- /**/ -}}
<span class="navbar-brand__logo navbar-logo">
{{- if ne .Site.Params.ui.navbar_logo false -}}
{{ with resources.Get "icons/logo.svg" -}}
{{ ( . | minify).Content | safeHTML -}}
{{ end -}}
{{ end -}}
</span>
{{- /**/ -}}
<span class="navbar-brand__name">
<!-- Place the site title on every page header, except the home page -->
{{ if not .IsHome }}
{{ .Site.Title }}
{{ end }}

</span>
{{- /**/ -}}
</a>
<div class="td-navbar-nav-scroll ms-md-auto" id="main_navbar">
<ul class="navbar-nav">
{{ $p := . -}}
{{ range .Site.Menus.main -}}
<li class="nav-item">
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}}
{{ $href := "" -}}
{{ with .Page -}}
{{ $active = or $active ( $.IsDescendant .) -}}
{{ $href = .RelPermalink -}}
{{ else -}}
{{ $href = .URL | relLangURL -}}
{{ end -}}
{{ $isExternal := ne $baseURL.Host (urls.Parse .URL).Host -}}
<a {{/**/ -}}
class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}}
href="{{ $href }}"
{{- if $isExternal }} target="_blank" rel="noopener" {{- end -}}
>
{{- .Pre -}}
<span>{{ .Name }}</span>
{{- .Post -}}
</a>
</li>
{{ end -}}
{{ if .Site.Params.versions -}}
<li class="nav-item dropdown d-none d-lg-block">
{{ partial "navbar-version-selector.html" . -}}
</li>
{{ end -}}
{{ if (gt (len .Site.Home.Translations) 0) -}}
<li class="nav-item dropdown d-none d-lg-block">
{{ partial "navbar-lang-selector.html" . -}}
</li>
{{ end -}}
{{ if .Site.Params.ui.showLightDarkModeMenu -}}
<li class="td-light-dark-menu nav-item dropdown">
{{ partial "theme-toggler" . }}
</li>
{{ end -}}
</ul>
</div>
<div class="d-none d-lg-block">
{{ partial "search-input.html" . }}
</div>
</div>
</nav>