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

github.com/dldx/hpstr-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDurand D'souza <durand1@gmail.com>2016-09-21 09:04:54 +0300
committerDurand D'souza <durand1@gmail.com>2016-09-21 09:04:54 +0300
commit16f06826e0fbf0b792614c2a3f4c500ca34012d5 (patch)
treeb2be355b16ef2bc285df6bd640ab32800d7d166d
parent0e756e656dcaa95bca4dea8ee65fcd2f93d5a297 (diff)
Added support for non-article pages
-rw-r--r--layouts/_default/list.html2
-rw-r--r--layouts/_default/single.html14
-rw-r--r--layouts/partials/head.html6
-rw-r--r--layouts/partials/navigation.html52
4 files changed, 41 insertions, 33 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 243154f..05a26eb 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,6 +1,6 @@
{{ partial "head.html" . }}
<body id="post-index" {{ if isset ($.Scratch.Get "Params") "image" }}class="feature"{{ end }}>
-{{ partial "navigation.html" }}
+{{ partial "navigation.html" . }}
<div class="entry-header">
{{ if isset ($.Scratch.Get "Params") "image" }}
{{ $imageparams := index ($.Scratch.Get "Params") "image" }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index d6fec54..ad93ab6 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,10 +1,10 @@
{{ partial "head.html" . }}
-<body id="post" {{ if isset ($.Scratch.Get "Params") "image" }}class="feature"{{ end }}>
-{{ partial "navigation.html" }}
+<body id="{{ if eq .Type "page" }}page{{ else }}post{{ end }}" {{ if isset ($.Scratch.Get "Params") "image" }}class="feature"{{ end }}>
+{{ partial "navigation.html" . }}
{{ if isset ($.Scratch.Get "Params") "image" }}
<div class="entry-header">
{{ $imageparams := index ($.Scratch.Get "Params") "image" }}
- {{ if $imageparams.credit }}<div class="image-credit">Image source: <a href="{{ $imageparams.creditlink }}">{{ $imageparams.credit }}</a></div><!-- /.image-credit -->{{ end }}
+ {{ if $imageparams.credit }}<div class="image-credit">Image credit: <a {{ with $imageparams.creditlink }}href="{{ . }}"{{ end }}>{{ $imageparams.credit }}</a></div><!-- /.image-credit -->{{ end }}
<div class="entry-image">
<img src="{{ .Site.BaseURL }}/images/{{ $imageparams.feature }}" alt="{{ .Title }}">
</div><!-- /.entry-image -->
@@ -20,7 +20,9 @@
{{ else }}
<h1 class="entry-title"><a href="{{ .Permalink }}" rel="bookmark" title="{{ .Title }}">{{ .Title }}</a></h1>
{{ end }}
+ {{ if ne .Type "page" }}
<h2><span class="entry-date date published"><time datetime="{{ .Date }}">{{ .Date.Format "January 2, 2006" }}</time></span></h2>
+ {{ end }}
<p class="entry-reading-time">
<i class="fa fa-clock-o"></i>
{{ partial "read-time-index.html" . }}
@@ -30,14 +32,16 @@
<div class="entry-content">
{{ .Content }}
<footer class="entry-meta">
+ {{ if ne .Type "page" }}
<span class="entry-tags">{{ range .Params.tags }}<a href="{{ $.Site.BaseURL }}/tags/{{ . | urlize }}" title="Pages tagged {{ . }}" class="tag"><span class="term">{{ . }}</span></a>{{ end }}</span>
+ {{ end }}
{{ if gt .Lastmod .Date }}<span>Updated on <span class="entry-date date updated"><time datetime="{{ .Lastmod }}">{{ .Lastmod.Format "Jan 2, 2006" }}</time></span></span>
<span class="author vcard"><span class="fn">{{ $.Site.Author }}</span></span>{{ end }}
- {{ if not (eq .Params.share false) }}{{ partial "share.html" }}{{ end }}
+ {{ if not (eq .Params.share false) }}{{ partial "share.html" . }}{{ end }}
</footer>
</div><!-- /.entry-content -->
<section id="disqus_thread">{{ template "_internal/disqus.html" . }}</section><!-- /#disqus_thread -->
- <!--{% if site.related_posts.size > 0 %}{% include read-more.html %}{% endif %} -->
+ <!--{{ if ne .Type "page" }}{% if site.related_posts.size > 0 %}{% include read-more.html %}{% endif %}{{ end }} -->
</article>
</div><!-- /#main -->
{{ partial "foot.html" . }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index ea3e1ad..f8da399 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,8 +1,8 @@
<!DOCTYPE html>
-<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
+{{ `<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if (IE 7)&!(IEMobile)]><html class="no-js lt-ie9 lt-ie8" lang="en"><![endif]-->
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en"><!--<![endif]-->` | safeHTML }}
<head>
<meta charset="utf-8">
<title>{{ if eq .IsHome false }}{{ .Title }} &#8211; {{ end }}{{ .Site.Title }}</title>
@@ -29,7 +29,7 @@
<!-- For all browsers -->
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/main.css">
<!-- Webfonts -->
-<link href="http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">
+<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">
<meta http-equiv="cleartype" content="on">
<!-- Hugo version -->
diff --git a/layouts/partials/navigation.html b/layouts/partials/navigation.html
index 8237976..30b0234 100644
--- a/layouts/partials/navigation.html
+++ b/layouts/partials/navigation.html
@@ -5,42 +5,46 @@
<li>
<a href="#">About</a>
<ul class="dl-submenu">
+ {{ with .Site.Params.author }}
<li>
- <img src="{{ .Site.BaseURL }}/images/{{ .Site.Author.avatar }}" alt="{{ .Site.Author.name }}'s photo" class="author-photo">
- <h4>{{ .Site.Author.name }}</h4>
- <p>{{ .Site.Author.bio }}</p>
+ {{ if isset . "avatar" }}
+ <img src="{{ .Site.BaseURL }}/images/{{ .avatar }}" alt="{{ .name }}'s photo" class="author-photo">
+ {{ end }}
+ <h4>{{ .name }}</h4>
+ <p>{{ .bio }}</p>
</li>
<li><a href="{{ .Site.BaseURL }}/about/"><span class="btn btn-inverse">Learn More</span></a></li>
- {{ if .Site.Owner.email }}<li>
- <a href="mailto:{{ .Site.Author.email }}"><i class="fa fa-fw fa-envelope"></i> Email</a>
+ {{ if isset . "email" }}<li>
+ <a href="mailto:{{ .email }}"><i class="fa fa-fw fa-envelope"></i> Email</a>
</li>{{ end }}
- {{ if .Site.Owner.twitter }}<li>
- <a href="https://twitter.com/{{ .Site.Owner.twitter }}"><i class="fa fa-fw fa-twitter"></i> Twitter</a>
+ {{ if isset . "twitter" }}<li>
+ <a href="https://twitter.com/{{ .twitter }}"><i class="fa fa-fw fa-twitter"></i> Twitter</a>
</li>{{ end }}
- {{ if .Site.Owner.facebook }}<li>
- <a href="https://facebook.com/{{ .Site.Owner.facebook }}"><i class="fa fa-fw fa-facebook"></i> Facebook</a>
+ {{ if isset . "facebook" }}<li>
+ <a href="https://facebook.com/{{ .facebook }}"><i class="fa fa-fw fa-facebook"></i> Facebook</a>
</li>{{ end }}
- {{ if .Site.Owner.google_plus }}<li>
- <a href="https://google.com/{{ .Site.Owner.google_plus }}"><i class="fa fa-fw fa-google-plus"></i> Google+</a>
+ {{ if isset . "google_plus" }}<li>
+ <a href="https://google.com/{{ .google_plus }}"><i class="fa fa-fw fa-google-plus"></i> Google+</a>
</li>{{ end }}
- {{ if .Site.Owner.linkedin }}<li>
- <a href="https://linkedin.com/in/{{ .Site.Owner.linkedin }}"><i class="fa fa-fw fa-linkedin"></i> LinkedIn</a>
+ {{ if isset . "linkedin" }}<li>
+ <a href="https://linkedin.com/in/{{ .linkedin }}"><i class="fa fa-fw fa-linkedin"></i> LinkedIn</a>
</li>{{ end }}
- {{ if .Site.Owner.github }}<li>
- <a href="https://github.com/{{ .Site.Owner.github }}"><i class="fa fa-fw fa-github"></i> GitHub</a>
+ {{ if isset . "github" }}<li>
+ <a href="https://github.com/{{ .github }}"><i class="fa fa-fw fa-github"></i> GitHub</a>
</li>{{ end }}
- {{ if .Site.Owner.stackexchange }}<li>
- <a href="{{ .Site.Owner.stackexchange }}"><i class="fa fa-fw fa-stack-exchange"></i> Stackexchange</a>
+ {{ if isset . "stackexchange" }}<li>
+ <a href="{{ .stackexchange }}"><i class="fa fa-fw fa-stack-exchange"></i> Stackexchange</a>
</li>{{ end }}
- {{ if .Site.Owner.instagram }}<li>
- <a href="https://instagram.com/{{ .Site.Owner.instagram }}"><i class="fa fa-fw fa-instagram"></i> Instagram</a>
+ {{ if isset . "instagram" }}<li>
+ <a href="https://instagram.com/{{ .instagram }}"><i class="fa fa-fw fa-instagram"></i> Instagram</a>
</li>{{ end }}
- {{ if .Site.Owner.flickr }}<li>
- <a href="https://www.flickr.com/photos/{{ .Site.Owner.flickr }}"><i class="fa fa-fw fa-flickr"></i> Flickr</a>
+ {{ if isset . "flickr" }}<li>
+ <a href="https://www.flickr.com/photos/{{ .flickr }}"><i class="fa fa-fw fa-flickr"></i> Flickr</a>
</li>{{ end }}
- {{ if .Site.Owner.tumblr }}<li>
- <a href="http://{{ .Site.Owner.tumblr }}.tumblr.com"><i class="fa fa-fw fa-tumblr"></i> Tumblr</a>
+ {{ if isset . "tumblr" }}<li>
+ <a href="http://{{ .tumblr }}.tumblr.com"><i class="fa fa-fw fa-tumblr"></i> Tumblr</a>
</li>{{ end }}
+ {{ end }}
</ul><!-- /.dl-submenu -->
</li>
<li>
@@ -50,7 +54,7 @@
<li><a href="{{ .Site.BaseURL }}/tags/">All Tags</a></li>
</ul>
</li>
- {{ range .Site.Data.navigation }}
+ {{ range .Site.Data.navigation.links }}
<li><a href="{{ .url }}" {{ if in .url "http" }}target="_blank"{{ end }}>{{ .title }}</a></li>
{{ end }}
</ul><!-- /.dl-menu -->