From ffdb78849edf02d5e6378fafe5b172150654901f Mon Sep 17 00:00:00 2001 From: zwbetz-gh Date: Sun, 17 Oct 2021 21:54:41 -0500 Subject: allow nav title text --- README.md | 17 +++++++++++------ exampleSite/config.yaml | 3 ++- layouts/partials/header.html | 11 ++++++++--- static/.DS_Store | Bin 0 -> 6148 bytes task_regen_toc.sh | 3 +++ 5 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 static/.DS_Store create mode 100755 task_regen_toc.sh diff --git a/README.md b/README.md index 2db2f52..c3a73d2 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,15 @@ An accessibility-friendly Hugo theme, ported from the [original Cupper](https:// ## Table of contents + + - [Demo](#demo) - [Minimum Hugo version](#minimum-hugo-version) - [Installation](#installation) - [Updating](#updating) - [Run example site](#run-example-site) - [Configuration](#configuration) -- [Logo](#logo) +- [Nav Title or Logo](#nav-title-or-logo) - [Favicons](#favicons) - [Shortcodes](#shortcodes) - [Syntax highlighting](#syntax-highlighting) @@ -24,6 +26,8 @@ An accessibility-friendly Hugo theme, ported from the [original Cupper](https:// - [Getting help](#getting-help) - [Credits](#credits) + + ## Demo https://cupper-hugo-theme.netlify.com/ @@ -58,15 +62,16 @@ hugo server --themesDir ../.. ## Configuration -Copy `config.yaml` from the [`exampleSite`](https://github.com/zwbetz-gh/cupper-hugo-theme/tree/master/exampleSite), then edit as desired. +Copy `config.yaml` from the [`exampleSite`](https://github.com/zwbetz-gh/cupper-hugo-theme/tree/master/exampleSite), then edit as desired. -## Logo +## Nav Title or Logo -Place your SVG logo at `static/images/logo.svg`. If you don't provide a logo, then the default theme logo will be used. +- The `navTitleText` param will be checked in your config file. **If** this param exists, the text value will be used as the nav title +- **Otherwise**, a logo will be used as the nav title. Place your **SVG** logo at `static/images/logo.svg`. If you don't provide a logo, then the default theme logo will be used ## Favicons -Upload your image to [RealFaviconGenerator](https://realfavicongenerator.net/) then copy-paste the generated favicon files under `static`. +Upload your image to [RealFaviconGenerator](https://realfavicongenerator.net/) then copy-paste the generated favicon files under `static`. ## Shortcodes @@ -133,4 +138,4 @@ If you run into an issue that isn't answered by this documentation or the [`exam ## Credits -Thank you to [Heydon Pickering](http://www.heydonworks.com) and [The Paciello Group](https://www.paciellogroup.com/) for creating the original Cupper project. +Thank you to [Heydon Pickering](http://www.heydonworks.com) and [The Paciello Group](https://www.paciellogroup.com/) for creating the original Cupper project. diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 3a218e0..aee36bd 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -29,7 +29,8 @@ params: showThemeSwitcher: true defaultDarkTheme: false moveFooterToHeader: false - logoAlt: "An alternative text description of the logo" + # navTitleText: Cupper Theme + logoAlt: An alternative text description of the logo customCss: - css/custom_01.css - css/custom_02.css diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 245d510..e5d06ec 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -6,9 +6,14 @@ href="{{ .Site.BaseURL }}" aria-label="{{ .Site.Title }} home page" > - {{ .Site.Params.logoAlt | default + {{ with .Site.Params.navTitleText }} +

{{ . }}

+ {{ else }} + {{ .Site.Params.logoAlt | default + {{ end }}

{{ with .Site.Params.description }} {{ . | markdownify }} {{ end }} diff --git a/static/.DS_Store b/static/.DS_Store new file mode 100644 index 0000000..cd3a2cf Binary files /dev/null and b/static/.DS_Store differ diff --git a/task_regen_toc.sh b/task_regen_toc.sh new file mode 100755 index 0000000..3e8ddfb --- /dev/null +++ b/task_regen_toc.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +markdown-toc -i README.md -- cgit v1.2.3