shithub: hugo

Download patch

ref: d61bee5e0916b5d2b388e66ef85c336312a21a06
parent: 21ca2e9ce4255bfad2bb0576aff087a240acf70a
author: Jonathan Ling <colonelpopcorn.jl@gmail.com>
date: Sun Jan 19 03:42:27 EST 2020

examples: Fix blog not building

The example blog had not been updated for some time and I had to restructure it a little bit.

Fixes #6752

Changed tag and category directory structure

diff: cannot open b/examples/blog/layouts/categories//null: file does not exist: 'b/examples/blog/layouts/categories//null' diff: cannot open a/examples/blog/layouts/indexes//null: file does not exist: 'a/examples/blog/layouts/indexes//null' diff: cannot open b/examples/blog/layouts/tags//null: file does not exist: 'b/examples/blog/layouts/tags//null'
--- /dev/null
+++ b/examples/blog/layouts/categories/list.html
@@ -1,0 +1,25 @@
+{{ partial "header.html" . }}
+
+<body>
+    {{ partial "navbar.html" . }}
+    <div class="container">
+        <div class="row">
+            <div class="col-md-9">
+                <div class="well well-sm">
+                    <strong>Items in category <code>{{ .Title | lower }}</code></strong>
+                    <ul class="list-unstyled">
+                        {{ range .Data.Pages }}
+                        {{ .Render "li" }}
+                        {{ end}}
+                    </ul>
+                </div>
+            </div>
+
+            <!-- Sidebar -->
+            <div class="col-md-3">
+                {{ partial "menu.html" . }}
+            </div>
+        </div>
+        {{ partial "footer.copyright.html" . }}
+    </div>
+    {{ partial "footer.html" . }}
\ No newline at end of file
--- a/examples/blog/layouts/indexes/category.html
+++ /dev/null
@@ -1,24 +1,0 @@
-{{ partial "header.html" . }}
-<body>
-{{ partial "navbar.html" . }}
-<div class="container">
-    <div class="row">
-        <div class="col-md-9">
-            <div class="well well-sm">
-                <strong>Items in category <code>{{ .Title | lower }}</code></strong>
-                <ul class="list-unstyled">
-                    {{ range .Data.Pages }}
-                        {{ .Render "li" }}
-                    {{ end}}
-                </ul>
-            </div>
-        </div>
-
-        <!-- Sidebar -->
-        <div class="col-md-3">
-        {{ partial "menu.html" . }}
-        </div>
-    </div>
-{{ partial "footer.copyright.html" . }}
-</div>
-{{ partial "footer.html" . }}
--- a/examples/blog/layouts/indexes/post.html
+++ /dev/null
@@ -1,24 +1,0 @@
-{{ partial "header.html" . }}
-<body>
-{{ partial "navbar.html" . }}
-<div class="container">
-    <div class="row">
-        <div class="col-md-9">
-            <div class="well well-sm">
-                <strong>Blog Post Archive</strong>
-                <ul class="list-unstyled">
-                    {{ range .Data.Pages }}
-                        {{ .Render "li" }}
-                    {{ end}}
-                </ul>
-            </div>
-        </div>
-
-        <!-- Sidebar -->
-        <div class="col-md-3">
-        {{ partial "menu.html" . }}
-        </div>
-    </div>
-{{ partial "footer.copyright.html" . }}
-</div>
-{{ partial "footer.html" . }}
--- a/examples/blog/layouts/indexes/tag.html
+++ /dev/null
@@ -1,24 +1,0 @@
-{{ partial "header.html" . }}
-<body>
-{{ partial "navbar.html" . }}
-<div class="container">
-    <div class="row">
-        <div class="col-md-9">
-            <div class="well well-sm">
-                <strong>Items with tag <code>{{ .Title | lower }}</code></strong>
-                <ul class="list-unstyled">
-                    {{ range .Data.Pages }}
-                        {{ .Render "li" }}
-                    {{ end}}
-                </ul>
-            </div>
-        </div>
-
-        <!-- Sidebar -->
-        <div class="col-md-3">
-        {{ partial "menu.html" . }}
-        </div>
-    </div>
-{{ partial "footer.copyright.html" . }}
-</div>
-{{ partial "footer.html" . }}
--- a/examples/blog/layouts/partials/header.html
+++ b/examples/blog/layouts/partials/header.html
@@ -1,5 +1,6 @@
 <!doctype html>
 <html lang="en">
+
 <head>
     {{ partial "meta.html" . }}
 
@@ -7,6 +8,6 @@
     <link rel="canonical" href="{{ .Permalink }}">
     {{ partial "header.includes.html" . }}
     {{ with .OutputFormats.Get "RSS" -}}
-    {{ printf "<link href=%q rel=\"alternate\" type=%q title=%q />" .Permalink .MediaType .Title | safeHTML }}
+    {{ printf "<link href=%q rel=\"alternate\" type=%q title=%q />" .Permalink .MediaType $.Site.Title | safeHTML }}
     {{- end }}
-</head>
+</head>
\ No newline at end of file
--- /dev/null
+++ b/examples/blog/layouts/post/list.html
@@ -1,0 +1,24 @@
+{{ partial "header.html" . }}
+<body>
+{{ partial "navbar.html" . }}
+<div class="container">
+    <div class="row">
+        <div class="col-md-9">
+            <div class="well well-sm">
+                <strong>Blog Post Archive</strong>
+                <ul class="list-unstyled">
+                    {{ range .Data.Pages }}
+                        {{ .Render "li" }}
+                    {{ end}}
+                </ul>
+            </div>
+        </div>
+
+        <!-- Sidebar -->
+        <div class="col-md-3">
+        {{ partial "menu.html" . }}
+        </div>
+    </div>
+{{ partial "footer.copyright.html" . }}
+</div>
+{{ partial "footer.html" . }}
--- /dev/null
+++ b/examples/blog/layouts/tags/list.html
@@ -1,0 +1,24 @@
+{{ partial "header.html" . }}
+<body>
+{{ partial "navbar.html" . }}
+<div class="container">
+    <div class="row">
+        <div class="col-md-9">
+            <div class="well well-sm">
+                <strong>Items with tag <code>{{ .Title | lower }}</code></strong>
+                <ul class="list-unstyled">
+                    {{ range .Data.Pages }}
+                        {{ .Render "li" }}
+                    {{ end}}
+                </ul>
+            </div>
+        </div>
+
+        <!-- Sidebar -->
+        <div class="col-md-3">
+        {{ partial "menu.html" . }}
+        </div>
+    </div>
+{{ partial "footer.copyright.html" . }}
+</div>
+{{ partial "footer.html" . }}