Fill theme.toml, refactor injection partials
This commit is contained in:
parent
2e5e2a2f5c
commit
ca37d7488c
18 changed files with 35 additions and 42 deletions
|
@ -1,2 +0,0 @@
|
||||||
+++
|
|
||||||
+++
|
|
4
archetypes/docs.md
Normal file
4
archetypes/docs.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
title: "{{ .Name | humanize | title }}"
|
||||||
|
weight: 1
|
||||||
|
---
|
|
@ -1,25 +1,26 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
{{ partial "book/html-head" . }}
|
{{ partial "docs/html-head" . }}
|
||||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
{{ partial "docs/inject/head" . }}
|
||||||
|
<title>{{ block "title" . }} {{- .Site.Title -}} {{ end }}</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
|
|
||||||
<div class="pure-u book-nav">
|
<div class="pure-u book-nav">
|
||||||
{{ partial "book/nav" . }}
|
{{ partial "docs/nav" . }}
|
||||||
</div>
|
</div>
|
||||||
<div class="pure-u book-content">
|
<div class="pure-u book-content">
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
|
|
||||||
<div class="pure-u book-page markdown">
|
<div class="pure-u book-page markdown">
|
||||||
{{ block "main" . }}{{ end }}
|
{{ block "main" . }} {{- .Content -}} {{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ if and (default true .Site.Params.BookShowTOC) (.Page.TableOfContents) }}
|
{{ if and (default true .Site.Params.BookShowTOC) (.Page.TableOfContents) }}
|
||||||
<div class="pure-u book-toc">
|
<div class="pure-u book-toc">
|
||||||
{{ partial "book/toc" . }}
|
{{ partial "docs/toc" . }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -27,5 +28,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
{{ partial "docs/inject/body" . }}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,7 +1 @@
|
||||||
{{- define "title" -}}
|
{{ define "." }} {{ end }}
|
||||||
{{ .Site.Title }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{- define "main" -}}
|
|
||||||
<div>{{ .Content }}</div>
|
|
||||||
{{ end }}
|
|
|
@ -1,7 +1 @@
|
||||||
{{- define "title" -}}
|
{{ define "." }} {{ end }}
|
||||||
{{ .Site.Title }}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{- define "main" -}}
|
|
||||||
<div>{{ .Content }}</div>
|
|
||||||
{{ end }}
|
|
|
@ -1,5 +0,0 @@
|
||||||
<nav role="navigation">
|
|
||||||
{{ partial "book/nav-brand" . }}
|
|
||||||
{{ with .Site.GetPage .Site.Params.BookMenuBundle }}{{ .Content }}{{ end }}
|
|
||||||
{{ partial "book/nav-after" . }}
|
|
||||||
</nav>
|
|
|
@ -1,5 +0,0 @@
|
||||||
{{ if .Site.Params.BookMenuBundle }}
|
|
||||||
{{ partial "book/nav-bundle" . }}
|
|
||||||
{{ else }}
|
|
||||||
{{ partial "book/nav-tree" . }}
|
|
||||||
{{ end }}
|
|
|
@ -6,6 +6,4 @@
|
||||||
<!-- <link href="/css/grids-responsive-min.css" rel="stylesheet"> -->
|
<!-- <link href="/css/grids-responsive-min.css" rel="stylesheet"> -->
|
||||||
|
|
||||||
{{ $styles := resources.Get "styles.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
|
{{ $styles := resources.Get "styles.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
|
||||||
<link rel="stylesheet" href="{{ $styles.Permalink }}">
|
<link rel="stylesheet" href="{{ $styles.Permalink }}">
|
||||||
|
|
||||||
{{ partial "book/html-head-after" . }}
|
|
0
layouts/partials/docs/inject/nav-before.html
Normal file
0
layouts/partials/docs/inject/nav-before.html
Normal file
8
layouts/partials/docs/nav-bundle.html
Normal file
8
layouts/partials/docs/nav-bundle.html
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<nav role="navigation">
|
||||||
|
{{ partial "docs/nav-brand" . }}
|
||||||
|
{{ partial "docs/inject/nav-before" . }}
|
||||||
|
{{ with .Site.GetPage .Site.Params.BookMenuBundle }}
|
||||||
|
{{- .Content -}}
|
||||||
|
{{ end }}
|
||||||
|
{{ partial "docs/inject/nav-after" . }}
|
||||||
|
</nav>
|
|
@ -13,8 +13,8 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<nav role="navigation">
|
<nav role="navigation">
|
||||||
{{ partial "book/nav-brand" . }}
|
{{ partial "docs/nav-brand" . }}
|
||||||
{{ partial "book/nav-before" . }}
|
{{ partial "docs/inject/nav-before" . }}
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .Scratch.Get "BookSections" }}
|
{{ range .Scratch.Get "BookSections" }}
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{ partial "book/nav-after" . }}
|
{{ partial "docs/inject/nav-after" . }}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- Single section of menu (recursive) -->
|
<!-- Single section of menu (recursive) -->
|
5
layouts/partials/docs/nav.html
Normal file
5
layouts/partials/docs/nav.html
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{{ if .Site.Params.BookMenuBundle }}
|
||||||
|
{{ partial "docs/nav-bundle" . }}
|
||||||
|
{{ else }}
|
||||||
|
{{ partial "docs/nav-tree" . }}
|
||||||
|
{{ end }}
|
10
theme.toml
10
theme.toml
|
@ -3,13 +3,13 @@
|
||||||
|
|
||||||
name = "Book"
|
name = "Book"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE"
|
licenselink = "https://github.com/alex-shpak/hugo-book/blob/master/LICENSE"
|
||||||
description = ""
|
description = "Hugo documentation theme as simple as plain book"
|
||||||
homepage = "http://example.com/"
|
homepage = "https://github.com/alex-shpak/hugo-book"
|
||||||
tags = []
|
tags = ["responsive", "clean", "documentation", "docs", "flexbox"]
|
||||||
features = []
|
features = []
|
||||||
min_version = "0.41"
|
min_version = "0.41"
|
||||||
|
|
||||||
[author]
|
[author]
|
||||||
name = "Alex Shpak"
|
name = "Alex Shpak"
|
||||||
homepage = ""
|
homepage = "https://github.com/alex-shpak/"
|
||||||
|
|
Loading…
Reference in a new issue