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

github.com/tosi29/inkblotty.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortosi29 <tosi16@gmail.com>2022-04-30 14:14:28 +0300
committertosi29 <tosi16@gmail.com>2022-04-30 14:14:28 +0300
commitd8bbc969f4f97d40f3b03b3a29f14ce8d7aeac1c (patch)
tree611cac6cf52cab3c2d33af19291d38605b065efd
parentce33a94efaad2a9e8218df0bebfd8538fdc394e8 (diff)
Set default value for current "post"feat/configure-post-directory
-rw-r--r--layouts/_default/single.html3
-rw-r--r--layouts/index.html2
-rw-r--r--layouts/partials/relatedposts.html2
-rw-r--r--layouts/partials/sidebar.html2
4 files changed, 4 insertions, 5 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index ace940d..a2b67fa 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -51,8 +51,7 @@
{{ partial "ad_double_rectangle.html" . }}
{{ partial "relatedposts.html" . }}
</article>
-
- {{ if eq .Page.Type .Site.Params.directoryOfPostContents }}
+ {{ if eq .Page.Type (.Site.Params.directoryOfPostContents | default "post") }}
<nav class="navigation post-navigation" role="navigation">
<div class="nav-links">
<div class="nav-previous">
diff --git a/layouts/index.html b/layouts/index.html
index d72217d..e8f733b 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,6 +1,6 @@
{{ define "main" }}
-{{ $paginator := .Paginate ( where .Site.RegularPages "Type" .Site.Params.directoryOfPostContents ) 10 }}
+{{ $paginator := .Paginate ( where .Site.RegularPages "Type" (.Site.Params.directoryOfPostContents | default "post") ) 10 }}
<main aria-role="main">
<div class="homepage-content">
<!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
diff --git a/layouts/partials/relatedposts.html b/layouts/partials/relatedposts.html
index 3496b29..536c6ae 100644
--- a/layouts/partials/relatedposts.html
+++ b/layouts/partials/relatedposts.html
@@ -1,4 +1,4 @@
-{{ if eq .Page.Type .Site.Params.directoryOfPostContents }}
+{{ if eq .Page.Type (.Site.Params.directoryOfPostContents | default "post") }}
{{ $related := .Site.RegularPages.Related . | first 7 }}
{{ with $related }}
<h4>{{ T "related_posts_title" }}</h4>
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html
index b5c9cac..4cd8989 100644
--- a/layouts/partials/sidebar.html
+++ b/layouts/partials/sidebar.html
@@ -25,7 +25,7 @@
<h2>{{ T "recent_posts_title" }}</h2>
<ul>
{{- $recent_articles_num := (.Site.Params.widgets.recent_articles_num | default 10) }}
- {{- range first $recent_articles_num (where .Site.RegularPages "Section" "in" (.Site.Params.postSections | default (slice .Site.Params.directoryOfPostContents))) }}
+ {{- range first $recent_articles_num (where .Site.RegularPages "Section" "in" (.Site.Params.postSections | default (slice (.Site.Params.directoryOfPostContents | default "post")))) }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</li>