Skip to content

Commit

Permalink
Fix header
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreumere committed Jan 23, 2024
1 parent 22d4a3e commit cfc368d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,31 @@ plague is a [Minima](https://github.com/jekyll/minima)-inspired theme that has s

## Installation

### Git submodule

Add the theme to your Hugo site by running the following command from your site directory and adding `theme = "plague"` to `hugo.toml`:

```sh
git submodule add https://github.com/brianreumere/plague.git themes/plague
```

Alternately, import it as a module in `hugo.toml`:
### Hugo module

Alternately, initialize your repo for Hugo modules:

```sh
hugo mod init github.com/brianreumere/plague-demo-site
```

And import it as a module in `hugo.toml`:

```toml
[module]
[[module.imports]]
disable = false
ignoreConfig = false
ignoreImports = true
path = "github.com/brianreumere/plague"
path = "github.com/brianreumere/plague" # Theme
```

## Screenshots
Expand All @@ -45,13 +55,19 @@ I'm not very experienced with web accessibility, but this theme does aim to be a

## Minimum configuration

These are the minimum required settings in your site's `hugo.toml` file for this theme to function (you may also include the theme as a module instead of using the `theme` option, [as detailed in the Installation section](#installation)):
These are the minimum required settings in your site's `hugo.toml` file for this theme to function (this example assumes you used the Hugo module method from [the Installation section](#installation)):

```toml
baseURL = "https://example.net"
languageCode = "en-us"
title = "Ellingson Mineral Tech Blog"
theme = "plague"

[module]
[[module.imports]]
disable = false
ignoreConfig = false
ignoreImports = true
path = "github.com/brianreumere/plague" # Theme

[params]
siteHeaderText = "Ellingson Mineral Tech Blog"
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<nav role="navigation" aria-label="Site menu" class="site-nav">
{{- $currentPage := . -}}
{{- range $index, $element := .Site.Menus.main -}}
{{- $len_nav_items := (len .Site.Menus.main) -}}
{{- $len_nav_items := (len $.Site.Menus.main) -}}
<a class="nav-item{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{ end }}{{ if eq $index 0 }} first{{ end }}{{ if eq (add $index 1) $len_nav_items }} last{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
{{- end }}
</nav>
Expand Down

0 comments on commit cfc368d

Please sign in to comment.