Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/tastaturtier/someparts-hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Leuchter <sandro.leuchter@dama.io>2020-02-17 11:34:05 +0300
committerSandro Leuchter <sandro.leuchter@dama.io>2020-02-17 11:34:05 +0300
commit0220f7c26bdc83c270b183c99e79ce7bbf65bcd3 (patch)
treeb74167bdd371309c37ccaa32d14c324e3c843361 /layouts
parentc76523bbbffb9d5a22446d45786b039f29737358 (diff)
add: property "private" (exclude part from navbar, homepage, sitemap, and RSS)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/index.rss.xml2
-rw-r--r--layouts/partials/nav.html2
-rw-r--r--layouts/sitemap.xml12
4 files changed, 18 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 5cf7283..71f14fd 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -7,6 +7,7 @@
{{ .Content }}
</div>
{{ range .Pages.ByWeight }}
+{{ if not .Params.private }}
{{ if .Params.id}}
<a class="nav-link" href="{{ .Permalink }}">{{ with .Site.Params.Icon }}{{ . | safeHTML }} {{ end }}<b>{{ .Params.id | markdownify }}: {{ .Title | markdownify }}</b></a>
{{ with .Params.keywords }}
@@ -14,4 +15,5 @@
{{ end }}
{{ end }}
{{ end }}
+{{ end }}
{{- end -}} \ No newline at end of file
diff --git a/layouts/index.rss.xml b/layouts/index.rss.xml
index 0aa9254..2e2cefd 100644
--- a/layouts/index.rss.xml
+++ b/layouts/index.rss.xml
@@ -17,6 +17,7 @@
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range $pages }}
+ {{ if not .Params.private }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
@@ -24,5 +25,6 @@
<description>{{ .Summary | html }}</description>
</item>
{{ end }}
+ {{ end }}
</channel>
</rss> \ No newline at end of file
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index b4d99f3..377b432 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -27,10 +27,12 @@
<ul class="navbar-nav">
{{ $currentPage := . }}
{{ range (where site.Pages "Type" "in" "part").ByWeight }}
+ {{ if not .Params.private }}
<li class='nav-item{{ if eq $currentPage.RelPermalink .RelPermalink }} active {{ end }}'>
<a class="nav-link" href="{{ .Permalink }}">{{ with .Site.Params.Icon }}{{ . | safeHTML }}&nbsp;{{ end }}{{ .Params.id }}</a>
</li>
{{ end }}
+ {{ end }}
</ul>
</div>
</nav>
diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml
new file mode 100644
index 0000000..2c2f257
--- /dev/null
+++ b/layouts/sitemap.xml
@@ -0,0 +1,12 @@
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+ {{ range .Data.Pages }}
+ {{ if not .Params.private }}
+ <url>
+ <loc>{{ .Permalink }}</loc>
+ <lastmod>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</lastmod>{{ with .Sitemap.ChangeFreq }}
+ <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
+ <priority>{{ .Sitemap.Priority }}</priority>{{ end }}
+ </url>
+ {{ end }}
+ {{ end }}
+</urlset> \ No newline at end of file