Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Kevin C. Coram | 5f24758cbd | |
Kevin C. Coram | a34db13b72 | |
Kevin C. Coram | 689e69f0cf | |
Kevin C. Coram | b0780f91e1 | |
Kevin C. Coram | c9621cb516 | |
Kevin C. Coram | fddbc125f7 | |
Kevin C. Coram | f684465d00 | |
Kevin C. Coram | 3365dc074a |
36
README.md
36
README.md
|
@ -13,7 +13,7 @@ instructions on how to install Hugo, create a site, and install a theme.
|
|||
Installing the theme as a git submodule is the preferred way.
|
||||
|
||||
```
|
||||
git add submodule https://git.thecorams.net/kevin/basic-theme.git themes/basic-theme
|
||||
git submodule add https://git.thecorams.net/kevin/basic-theme.git themes/basic-theme
|
||||
```
|
||||
|
||||
### Example Site
|
||||
|
@ -35,16 +35,34 @@ As a very basic theme, there is very little to be configured via the `config.tom
|
|||
file.
|
||||
|
||||
The footer layout file uses Hugo's `markdownify` pipe to display the `copyright`
|
||||
configuration setting, providing support both for HTML5 character escape
|
||||
configuration setting, providing support both for HTML character escape
|
||||
sequences such as `©` as well as markdwn formatting and links.
|
||||
|
||||
The only non-standard configuration setting is the `subtitle` parameter:
|
||||
Note: Hugo versions 0.60.0 and up will have restrictions on using embedded HTML,
|
||||
including escape secquences, unless the Goldmark renderer is configure with
|
||||
`unsafe = true`.
|
||||
|
||||
### `subtitle` parameter
|
||||
|
||||
Setting the `subtitle` parameter adds a secondary header underneath the `title`
|
||||
in the site header.
|
||||
|
||||
```toml
|
||||
[params]
|
||||
subtitle = "A sub-title for your site"
|
||||
```
|
||||
|
||||
### `mainSections` parameter
|
||||
|
||||
Setting the `mainSections` parameter restricts the pages that appear on the
|
||||
homepage.
|
||||
|
||||
```toml
|
||||
[params]
|
||||
mainSections = ["posts"]
|
||||
|
||||
```
|
||||
|
||||
## Theme Organization
|
||||
|
||||
### Semantic Content Organization
|
||||
|
@ -145,6 +163,12 @@ organization. The [list](layouts/_default/list.html) and
|
|||
[single](layouts/_default/single.html) templates display the page title as
|
||||
a `<h1>...</h1>` level header.
|
||||
|
||||
#### content-menu
|
||||
|
||||
This block is for providing navigation menu(s) for the main content, matching
|
||||
with the `<nav>...</nav>` block inside the main header. The block is currently
|
||||
a place holder, with no default implementation.
|
||||
|
||||
#### content
|
||||
|
||||
This block is for the content of the page.
|
||||
|
@ -161,7 +185,11 @@ rendered inside an `<article>...</article>` block element.
|
|||
This block provides a footer for the page, which renders within the
|
||||
`<footer></footer>` block at the end of the `<main></main>` section.
|
||||
|
||||
Default content-footer definitions are not yet implemented.
|
||||
The default content-footer blocks for the homepage and for list pages
|
||||
implement pagination controls to show the content summaries a page at a time.
|
||||
|
||||
The default content-footer block for single pages displays previous and/or
|
||||
next in section links.
|
||||
|
||||
#### footer
|
||||
|
||||
|
|
|
@ -3,10 +3,11 @@ languageCode = "en-us"
|
|||
title = "Basic Hugo Theme"
|
||||
copyright = "Copyright © 2019, Copyright Owner Name | Built with [Hugo](https://gohugo.io/)"
|
||||
theme = "basic-theme"
|
||||
paginate = 10
|
||||
paginate = 5
|
||||
|
||||
[permalinks]
|
||||
posts = "/:year/:month/:title/"
|
||||
|
||||
[params]
|
||||
subtitle = "A theme with no CSS and only basic layouts"
|
||||
mainSections = [ "posts" ]
|
||||
|
|
|
@ -9,7 +9,12 @@
|
|||
<header class="list-content">
|
||||
{{ .Content }}
|
||||
</header>
|
||||
{{ range .Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ range $index, $page := (.Paginate (where .Pages ".Params.hidden" "!=" "true")).Pages }}
|
||||
{{ if ne $index 0 }}
|
||||
{{ end }}
|
||||
{{ .Render "summary" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ define "content-footer" }}
|
||||
{{ partial "paginator.html" .Paginator }}
|
||||
{{ end }}
|
|
@ -9,4 +9,7 @@
|
|||
<article>
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ define "content-footer" }}
|
||||
{{ partial "prev-next-page.html" . }}
|
||||
{{ end }}
|
|
@ -4,7 +4,12 @@
|
|||
{{.Content}}
|
||||
</article>
|
||||
<!-- Note that .Pages is the same as .Site.RegularPages on the homepage template. -->
|
||||
{{ range first 10 .Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ range $index, $page := (.Paginate (where (where .Site.RegularPages "Type" "in" site.Params.mainSections) ".Params.hidden" "!=" "true" )).Pages }}
|
||||
{{ if ne $index 0 }}
|
||||
{{ end }}
|
||||
{{ .Render "summary" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ define "content-footer" }}
|
||||
{{ partial "paginator.html" .Paginator }}
|
||||
{{ end }}
|
|
@ -0,0 +1,19 @@
|
|||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
{{if .HasPrev}}
|
||||
<a alt="Newer articles" href="{{ .Prev.URL }}">← Newer</a>
|
||||
{{ else }}
|
||||
|
||||
{{end}}
|
||||
</li>
|
||||
<li>Page {{ .PageNumber }} of {{ .TotalPages }}</li>
|
||||
<li>
|
||||
{{if .HasNext}}
|
||||
<a alt="Older articles" href="{{ .Next.URL }}">Older →</a>
|
||||
{{ else }}
|
||||
|
||||
{{end}}
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
|
@ -0,0 +1,20 @@
|
|||
{{ if not .Params.Menu }}
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
{{ if .NextInSection }}
|
||||
<a alt="Newer article" href="{{ .NextInSection.Permalink }}">← Newer</a>
|
||||
{{ else }}
|
||||
|
||||
{{ end }} </li>
|
||||
<li><a alt="Top of page" href="#">Top</a></li>
|
||||
<li>
|
||||
{{ if .PrevInSection }}
|
||||
<a alt="Older article" href="{{ .PrevInSection.Permalink }}">Older →</a>
|
||||
{{ else }}
|
||||
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{ end }}
|
|
@ -1,4 +1,7 @@
|
|||
<ul>
|
||||
{{ if not .IsHome }}
|
||||
<li><a href="{{ .Site.BaseURL }}">Home</a></li>
|
||||
{{ end }}
|
||||
{{- $currentPage := . -}}
|
||||
{{- range .Site.Menus.main -}}
|
||||
{{- if .HasChildren -}}
|
||||
|
|
Loading…
Reference in New Issue