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

github.com/wd/hugo-fabric.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-16 14:06:43 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-04-16 14:06:43 +0300
commit6416d231bb8425a24f62d80c836a7f3bab99bb91 (patch)
treec924837bbb4eee1b5e59b960c3f467f9ad92cca6
parentc0cba50f7f23301edf38b27cedd8902392333f08 (diff)
Add some conditionals
To get a demo running on the themes site without all the params set.
-rw-r--r--layouts/partials/article.html6
-rw-r--r--layouts/partials/header.html4
-rw-r--r--layouts/partials/post/sharing.html2
3 files changed, 9 insertions, 3 deletions
diff --git a/layouts/partials/article.html b/layouts/partials/article.html
index a3d7133..5149e0a 100644
--- a/layouts/partials/article.html
+++ b/layouts/partials/article.html
@@ -18,7 +18,9 @@
<div class="entry-content">{{ .post.Content }}</div>
{{ end }}
<div class="meta">
- {{ if .theme.disqus_shortname }}
- <span class="comments"><a href="{{ .post.URL }}#disqus_thread">Comments</a></span>
+ {{ with .theme }}
+ {{ if .disqus_shortname }}
+ <span class="comments"><a href="{{ $.post.URL }}#disqus_thread">Comments</a></span>
+ {{ end }}
{{ end }}
</div>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 78bf8a4..88094db 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -8,6 +8,8 @@
<span class="subtitle">{{ if $theme.subtitle }}{{ $theme.subtitle }}{{ end }}</span>
<br>
-{{ partial "social.html" (dict "theme" $theme) }}
+{{ with $theme }}
+{{ partial "social.html" (dict "theme" .) }}
+{{ end }}
{{ partial "navigation.html" . }}
diff --git a/layouts/partials/post/sharing.html b/layouts/partials/post/sharing.html
index 34e6a60..0d59531 100644
--- a/layouts/partials/post/sharing.html
+++ b/layouts/partials/post/sharing.html
@@ -1,3 +1,4 @@
+{{ if .theme }}
<div class="share">
<div class="addthis_toolbox addthis_default_style ">
{{ if .theme.facebook_like }}
@@ -13,3 +14,4 @@
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid={{ .theme.addthis_profile_id }}"></script>
</div>
+{{ end }} \ No newline at end of file