diff options
author | digitalcraftsman | 2017-09-07 21:41:16 +0200 |
---|---|---|
committer | digitalcraftsman | 2017-09-07 21:41:16 +0200 |
commit | 82832c1244f2d536c754efb98fbdb02b1844f4c7 (patch) | |
tree | ddeb1e83781a1f2793eb56c68d8a20e89fe4557c | |
parent | 50fec3e32df7b3ef311377db55093fc87bccb446 (diff) | |
download | hyde-82832c1244f2d536c754efb98fbdb02b1844f4c7.tar.lz hyde-82832c1244f2d536c754efb98fbdb02b1844f4c7.tar.zst hyde-82832c1244f2d536c754efb98fbdb02b1844f4c7.zip |
Make use of the base template
-rw-r--r-- | layouts/404.html | 16 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 8 | ||||
-rw-r--r-- | layouts/_default/list.html | 25 | ||||
-rw-r--r-- | layouts/_default/single.html | 29 | ||||
-rw-r--r-- | layouts/index.html | 33 |
5 files changed, 42 insertions, 69 deletions
diff --git a/layouts/404.html b/layouts/404.html index 8fa1a59..a919514 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,12 +1,4 @@ -{{ partial "head.html" . }} -<body class="{{ .Site.Params.themeColor }}"> - -{{ partial "sidebar.html" . }} - - <div class="content container"> - <h1>404: Page not found</h1> - <p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ .Site.BaseURL }}">Head back home</a> to try finding it again.</p> - </div> - - </body> -</html> +{{ define "main" -}} +<h1>404: Page not found</h1> +<p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ .Site.BaseURL }}">Head back home</a> to try finding it again.</p> +{{- end }} \ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..a45cf37 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,8 @@ +{{ partial "head.html" . }} + <body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}"> + {{ partial "sidebar.html" . }} + <div class="content container"> + {{ block "main" . -}}{{- end }} + </div> + </body> +</html> \ No newline at end of file diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c362b25..c6d3b69 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,16 +1,9 @@ -{{ partial "head.html" . }} -<body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}"> - - {{ partial "sidebar.html" . }} - - <div class="content container"> - <ul class="posts"> - {{ range .Data.Pages }} - <li> - <span><a href="{{ .Permalink }}">{{ .Title }}</a> <time class="pull-right post-list">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></span> - </li> - {{ end }} - </ul> - </div> -</body> -</html> +{{ define "main" -}} +<ul class="posts"> +{{ range .Data.Pages -}} + <li> + <span><a href="{{ .Permalink }}">{{ .Title }}</a> <time class="pull-right post-list">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></span> + </li> +{{- end }} +</ul> +{{- end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 26149e7..2317495 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,19 +1,12 @@ -{{ partial "head.html" . }} -<body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}"> - {{ partial "sidebar.html" . }} +{{ define "main" -}} +<div class="post"> + <h1>{{ .Title }}</h1> + <span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span> + {{ .Content }} +</div> - <div class="content container"> - <div class="post"> - <h1>{{ .Title }}</h1> - <span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span> - {{ .Content }} - </div> - - {{ if .Site.Params.disqusShortname }} - <h2>Comments</h2> - {{ partial "disqus" . }} - {{ end }} - </div> - -</body> -</html> \ No newline at end of file +{{ if .Site.Params.disqusShortname -}} +<h2>Comments</h2> +{{ partial "disqus" . }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/layouts/index.html b/layouts/index.html index 36f3ac2..3fed5be 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,26 +1,13 @@ -{{ partial "head.html" . }} -<body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}"> - -{{ partial "sidebar.html" . }} - - <div class="content container"> +{{ define "main" -}} <div class="posts"> - - {{ range .Data.Pages }} - <div class="post"> - <h1 class="post-title"> - <a href="{{ .Permalink }}"> - {{ .Title }} - </a> - </h1> - - <span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span> - - {{ .Content }} - </div> - {{ end }} +{{ range .Data.Pages -}} +<div class="post"> + <h1 class="post-title"> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </h1> + <span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span> + {{ .Content }} </div> +{{- end }} </div> - - </body> -</html> +{{- end }} \ No newline at end of file |