refactors the layouts

This commit is contained in:
Huy Tran 2018-07-16 13:22:00 +10:00
parent cefd39e9a1
commit 05d11325ea
28 changed files with 394 additions and 116 deletions

View file

@ -7,9 +7,5 @@
{{ block "content" . -}}{{- end }}
</div>
{{ block "footer" . -}}{{- end }}
{{ if and (not .Site.BuildDrafts) (.Site.GoogleAnalytics) -}}
{{ "<!-- Google Analytics -->" | safeHTML }}
{{ template "_internal/google_analytics_async.html" . }}
{{- end }}
</body>
</html>

View file

@ -3,8 +3,9 @@
{{- end -}}
{{ define "content" -}}
{{ partial "content_list.html" . }}
{{ partial "page_list.html" . }}
{{- end -}}
{{ define "footer" -}}
{{ partial "footer.html" . }}
{{- end }}

View file

@ -3,12 +3,13 @@
{{- end -}}
{{ define "content" -}}
{{ partial "content_single.html" . }}
{{ partial "page_single.html" . }}
{{- end -}}
{{ define "footer" -}}
<div class="footer content">
{{- partial "highlight.html" . -}}
{{- partial "highlight-js.html" . -}}
{{- partial "commenting.html" . -}}
</div>
{{ partial "footer.html" . }}
{{- end -}}

View file

@ -7,12 +7,14 @@
{{ range (where .Data.Pages "Type" "not in" (slice "about" "portfolio")).GroupBy "Section" -}}
{{ range .Pages }}
<div class="post">
<h1 class="post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ if .Draft }}<sup> <i class="fas fa-pen-square fa-xs"></i></sup>{{ end }}</h1>
<span class="post-date">
{{- .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") -}}
<span class="list__title--big">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>{{ if .Draft }}<sup> <i class="fas fa-pen-square fa-xs"></i></sup>{{ end }}
</span>
{{ .Summary }}
{{- if .Truncated }}
<span class="title__date">
<i class="fas fa-calendar-alt"></i> {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") }}
</span>
{{ .Summary }}
{{ if .Truncated -}}
<div class="read-more-link">
<a href="{{ .RelPermalink }}">Read More…</a>
</div>

View file

@ -1,15 +0,0 @@
<h1 class="title">{{ .Title }}</h1>
<ul class="posts">
{{- range .Data.Pages -}}
<li>
<span>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ if not .Date.IsZero }}
<time class="pull-right post-list">
{{- .Date.Format ("Jan 02 '06") -}}
</time>
{{end}}
</span>
</li>
{{- end }}
</ul>

View file

@ -1,39 +0,0 @@
<div class="post">
<h1>{{ .Title }}</h1>
{{ if ne .Params.showpagemeta false }}
<div class="col-sm-12 col-md-12">
<span class="text-left post-date meta">
<!-- published date -->
{{ if not .Date.IsZero }}
<i class="fas fa-calendar-alt"></i> {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") -}}
{{ end }}
<!-- categories -->
{{ with .Params.categories }}
{{ $total := len . }}
{{ if gt $total 0 }}
in
{{ $total := sub $total 1 }}
{{ range $i, $cat := sort . }}
<a class="meta" href="{{ "/categories/" | relURL }}{{ $cat | urlize }}">{{ $cat | upper }}</a>
{{ if lt $i $total }},{{ end }}
{{ end }}
{{ end }}
{{ end }}
<!-- tags -->
{{ with .Params.tags }}
{{ $total := len . }}
{{ if gt $total 0 }}
<br/>
{{ $subtotal := sub $total 1 }} <i class="fas fa-tags"></i>
{{ range $i, $tag := sort . }}
<a class="meta" href="{{ "/tags/" | relURL }}{{ $tag | urlize }}">{{ $tag | lower }}</a>{{ if lt $i $subtotal }} {{ end }}
{{ end }}
{{ end }}
{{ end }}
<br/>
<i class="fas fa-clock"></i> {{ .ReadingTime }} min read
</span>
</div>
{{ end }}
{{ .Content }}
</div>

View file

@ -0,0 +1,4 @@
{{ if and (not .Site.BuildDrafts) (.Site.GoogleAnalytics) -}}
{{ "<!-- Google Analytics -->" | safeHTML }}
{{ template "_internal/google_analytics_async.html" . }}
{{- end }}

View file

@ -1,35 +1,14 @@
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{ "<!-- Enable responsiveness on mobile devices -->" | safeHTML }}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
{{ with .Site.Params.meta.description -}}<meta name="description" content="{{ . }}">{{- end }}
{{ with .Site.Params.meta.keywords -}}<meta name="keywords" content="{{.}}">{{- end }}
{{ .Hugo.Generator }}
{{ if .IsHome -}}
<title>{{ .Site.Title }}</title>
{{- else }}
<title>{{ .Title }} &middot; {{ .Site.Title }}</title>
{{- end }}
<meta content="{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}" property="og:title">
<meta content="{{ $isHomePage := eq .Title .Site.Title }}{{ .Site.Params.meta.description }}{{ if eq $isHomePage false }} - {{ .Description }}{{ end }}" property="og:description">
{{ "<!-- CSS -->" | safeHTML }}
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:300,300i,400,400i,700,700i|Source+Code+Pro:300,300i,400,400i" rel="stylesheet">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/print.css" media="print">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/poole.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/hyde.css">
{{ partial "header/meta.html" . }}
{{ "<!-- Web fonts -->" | safeHTML }}
{{ partial "header/fonts.html" . }}
{{ "<!-- Font-Awesome -->" | safeHTML }}
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/all.js" integrity="sha384-xymdQtn1n3lH2wcu0qhcdaOpQwyoarkgLVxC/wZ5q7h9gHtxICrpcaSUfygqZGOe" crossorigin="anonymous"></script>
{{ if .Site.Params.highlightjs -}}
{{ "<!-- highlight.js-->" | safeHTML }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/{{ .Site.Params.highlightjsstyle | default "default" }}.min.css">
{{- end }}
{{ if .Site.Params.PygmentsUseClasses -}}
{{ "<!-- Pygments Syntax -->" | safeHTML }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/syntax.css">
{{- end }}
{{- "<!-- Customised CSS -->" | safeHTML }}
{{ partial "header/font-awesome.html" . }}
{{ "<!-- highlighting -->" | safeHTML }}
{{ partial "header/highlight-css.html" . }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/poole.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/print.min.css" media="print">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/hyde-hyde.css">
{{ `<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
@ -39,9 +18,7 @@
{{ "<!-- Icons -->" | safeHTML }}
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="/favicon.png">
{{ if .RSSLink -}}
{{ "<!-- RSS -->" | safeHTML }}
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
{{- end }}
{{- if .RSSLink -}}
{{ partial "header/feeds.html" . }}
{{- end -}}
</head>

View file

@ -0,0 +1,3 @@
<!-- RSS -->
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />

View file

@ -0,0 +1,3 @@
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/solid.css" integrity="sha384-TbilV5Lbhlwdyc4RuIV/JhD8NR+BfMrvz4BL5QFa2we1hQu6wvREr3v6XSRfCTRp" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/brands.css" integrity="sha384-7xAnn7Zm3QC1jFjVc1A6v/toepoG3JXboQYzbM0jrPzou9OFXm/fY6Z/XiIebl/k" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/fontawesome.css" integrity="sha384-ozJwkrqb90Oa3ZNb+yKFW2lToAWYdTiF1vt8JiH5ptTGHTGcN7qdoR1F95e0kYyG" crossorigin="anonymous">

View file

@ -0,0 +1,2 @@
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:300,300i,400,400i,700|Source+Code+Pro:400,400i" rel="stylesheet">

View file

@ -0,0 +1,7 @@
{{- if .Site.Params.highlightjs -}}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/{{ .Site.Params.highlightjsstyle | default "default" }}.min.css">
{{- end -}}
{{ if .Site.Params.PygmentsUseClasses -}}
<!-- Pygments Syntax -->
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/syntax.min.css">
{{- end }}

View file

@ -0,0 +1,8 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="public" />
{{ "<!-- Enable responsiveness on mobile devices -->" | safeHTML }}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
{{ .Hugo.Generator }}
{{ partial "header/twitter_cards.html" . }}
{{ partial "header/opengraph.html" . }}

View file

@ -0,0 +1,32 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Cache-Control" content="public" />
<!-- Enable responsiveness on mobile devices -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
{{ .Hugo.Generator }}
{{- if .IsHome }}
{{ $.Scratch.Set "theTitle" .Site.Title -}}
{{else}}
{{ $.Scratch.Add "theTitle" .Title}}
{{ $.Scratch.Add "theTitle" "·"}}
{{ $.Scratch.Add "theTitle" .Site.Title}}
{{- end -}}
<title>{{ $.Scratch.Get "theTitle" }}</title>
{{ with .Site.Params.meta.description -}}<meta name="description" content="{{ . }}">{{- end }}
{{ with .Site.Params.meta.keywords -}}<meta name="keywords" content="{{.}}">{{- end }}
<!-- Twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="{{.Site.Params.social.twitter}}">
<meta name="twitter:title" content="{{$.Scratch.Get "theTitle"}}">
<meta name="twitter:description" content="{{.Site.Params.meta.description}}">
<meta property="twitter:image" content="{{.Site.Params.authorimage}}">
<meta name="twitter:creator" content="{{.Site.Params.author}}">
<!-- OpenGraph -->
<meta property="og:locale" content="{{.Site.LanguageCode}}">
<meta property="og:type" content="article">
<meta property="og:url" content="{{.Permalink}}">
<meta property="og:image" content="{{.Site.Params.authorimage}}">
<meta property="og:site_name" content="{{.Site.Title}}">
<meta property="og:title" content="{{$.Scratch.Get "theTitle"}}">
<meta property="og:description" content="{{.Site.Params.meta.description}}">
{{ $.Scratch.Delete "theTitle" -}}

View file

@ -0,0 +1,62 @@
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{ with .Params.images -}}
{{- range first 6 . -}}
<meta property="og:image" content="{{ . | absURL }}" />
{{- end -}}
{{- end -}}
{{- if .IsPage -}}
{{ if not .PublishDate.IsZero -}}
<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
{{- else if not .Date.IsZero -}}
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
{{- end }}
{{- if not .Lastmod.IsZero -}}
<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
{{- end }}
{{- else -}}
{{ if not .Date.IsZero -}}
<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
{{- end }}
{{- end -}}
{{ with .Params.audio -}}<meta property="og:audio" content="{{ . }}" />{{- end }}
{{ with .Params.locale -}}<meta property="og:locale" content="{{ . }}" />{{- end }}
{{ with .Site.Params.title -}}<meta property="og:site_name" content="{{ . }}" />{{- end }}
{{ with .Params.videos -}}
{{- range . -}}
<meta property="og:video" content="{{ . | absURL }}" />
{{- end -}}
{{- end }}
<!-- If it is part of a series, link to related articles -->
{{- $permalink := .Permalink -}}
{{- $siteSeries := .Site.Taxonomies.series -}}
{{- with .Params.series -}}
{{- range $name := . -}}
{{- $series := index $siteSeries $name -}}
{{- range $page := first 6 $series.Pages -}}
{{ if ne $page.Permalink $permalink -}}
<meta property="og:see_also" content="{{ $page.Permalink }}" />
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if .IsPage -}}
{{- range .Site.Authors -}}
{{ with .Social.facebook -}}
<meta property="article:author" content="https://www.facebook.com/{{ . }}" />
{{- end }}
{{ with .Site.Social.facebook -}}
<meta property="article:publisher" content="https://www.facebook.com/{{ . }}" />
{{- end }}
<meta property="article:section" content="{{ .Section }}" />
{{ with .Params.tags -}}
{{- range first 6 . -}}
<meta property="article:tag" content="{{ . }}" />
{{- end -}}
{{- end }}
{{- end -}}
{{- end -}}
<!-- Facebook Page Admin ID for Domain Insights -->
{{ with .Site.Social.facebook_admin -}}<meta property="fb:admins" content="{{ . }}" />{{- end }}

View file

@ -0,0 +1,29 @@
{{- with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}}
{{- with $featured -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ $featured.Permalink }}"/>
{{- else -}}
{{- with $.Site.Params.images -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ index . 0 | absURL }}"/>
{{ else -}}
<meta name="twitter:card" content="summary"/>
{{- end -}}
{{- end -}}
{{- end }}
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
{{ with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}"/>
{{ end -}}
{{ range .Site.Authors }}
{{ with .twitter -}}
<meta name="twitter:creator" content="@{{ . }}"/>
{{ end -}}
{{ end -}}

View file

@ -0,0 +1,6 @@
<h1 class="title">{{ .Title }}</h1>
<ul class="posts">
{{- with .Data.Pages -}}
{{ partial "posts-list.html" . }}
{{- end }}
</ul>

View file

@ -0,0 +1,16 @@
<article>
<header>
<h1>{{ .Title }}</h1>
{{ with .Params.subtitle }}
<span class="post__subtitle">
{{.}}
</span>
{{ end }}
{{ partial "post-meta-before.html" . }}
</header>
<div class="post">
{{ .Content }}
</div>
{{ partial "post-meta-after.html" . }}
{{ partial "post-related.html" . }}
</article>

View file

@ -0,0 +1,54 @@
<div class="portfolio-content portfolio-container">
<h1 class="title">{{ .Title }}</h1>
{{ range where .Data.Pages "Params.featured" "==" "true" }}
<section class="latest section">
<div class="section-inner">
<div class="portfolio_content">
<div class="item featured text-center">
<h3 class="title">
<a href="{{ .Params.Link }}" target="_blank">{{ .Title }}</a>
</h3>
<p class="summary">{{ .Params.description }}</p>
<div class="featured-image">
<img src="{{ .Params.screenshot }}" alt="{{ .Title }}">
<div class="ribbon">
<div class="text">New</div>
</div>
</div>
<div class="desc text-left">
{{ .Content }}
</div>
<!--//desc-->
</div>
</div>
</div> <!-- inner -->
</section>
{{ end }}
<section>
<div class="section-inner">
<div class="portfolio_content">
<hr class="divider">
{{ range (where .Data.Pages "Params.featured" "<>" "true").ByDate.Reverse }}
<!-- item -->
<div class="item row">
<a class="col-md-4 col-sm-4 col-xs-12" href="{{ .Params.link }}"
target="_blank">
<img class="img-responsive project-image" src="{{ .Params.screenshot }}" alt="{{ .Title }}">
</a>
<div class="desc col-md-8 col-sm-8 col-xs-12">
<h3 class="title">
<a href="{{ .Params.link }}" target="_blank">{{ .Title }}</a>
</h3>
<p class="summary">{{ .Params.description }}</p>
<p>{{ .Content }}</p>
</div>
</div>
<!--// item -->
{{ end }}
</div>
<!--//content-->
</div>
<!--//section-inner-->
</section>
</div>

View file

@ -0,0 +1,49 @@
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
{{ "<!-- Enable responsiveness on mobile devices -->" | safeHTML }}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
{{ with .Site.Params.meta.description -}}<meta name="description" content="{{ . }}">{{- end }}
{{ with .Site.Params.meta.keywords -}}<meta name="keywords" content="{{.}}">{{- end }}
{{ .Hugo.Generator }}
{{ if .IsHome -}}
<title>{{ .Site.Title }}</title>
{{- else }}
<title>{{ .Title }} &middot; {{ .Site.Title }}</title>
{{- end }}
<meta content="{{ $isHomePage := eq .Title .Site.Title }}{{ .Title }}{{ if eq $isHomePage false }} - {{ .Site.Title }}{{ end }}" property="og:title">
<meta content="{{ $isHomePage := eq .Title .Site.Title }}{{ .Site.Params.meta.description }}{{ if eq $isHomePage false }} - {{ .Description }}{{ end }}" property="og:description">
{{ "<!-- CSS -->" | safeHTML }}
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,400i,600,700|Source+Code+Pro:400,400i" rel="stylesheet">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/print.min.css" media="print">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/poole.min.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/hyde.min.css">
{{ "<!-- Font-Awesome -->" | safeHTML }}
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/all.js" integrity="sha384-xymdQtn1n3lH2wcu0qhcdaOpQwyoarkgLVxC/wZ5q7h9gHtxICrpcaSUfygqZGOe" crossorigin="anonymous"></script>
{{ if .Site.Params.highlightjs -}}
{{ "<!-- highlight.js-->" | safeHTML }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/{{ .Site.Params.highlightjsstyle | default "default" }}.min.css">
{{- end }}
{{ if .Site.Params.PygmentsUseClasses -}}
{{ "<!-- Pygments Syntax -->" | safeHTML }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/syntax.css">
{{- end }}
{{- "<!-- Customised CSS -->" | safeHTML }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/hyde-hyde.css"/>
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/portfolio.css"/>
{{ `<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->` | safeHTML }}
{{ "<!-- Icons -->" | safeHTML }}
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="/favicon.png">
{{ if .RSSLink -}}
{{ "<!-- RSS -->" | safeHTML }}
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
{{- end }}
</head>

View file

@ -0,0 +1,13 @@
<div class="page__nav">
<hr>
<span class="pull-right">
{{ with .Prev -}}
<span>Next: <a href="{{ .RelPermalink }}">{{ .Title }}</a></span>
{{- end }}
</span>
<span>
{{ with .Next -}}
<span>Previous: <a href="{{ .RelPermalink }}">{{ .Title }}</a></span>
{{- end }}
</span>
</div>

View file

@ -0,0 +1,36 @@
{{ if ne .Params.showpagemeta false }}
<div>
<span class="text-left meta">
<!-- published date -->
{{ if not .Date.IsZero }}
<i class="fas fa-calendar-alt"></i> {{ .Date.Format (.Site.Params.dateformat | default "Jan 02, 2006") -}}
{{ end }}
<!-- categories -->
{{ with .Params.categories }}
{{ $total := len . }}
{{ if gt $total 0 }}
in
{{ $total := sub $total 1 }}
{{ range $i, $cat := sort . }}
<a class="meta" href="{{ "/categories/" | relURL }}{{ $cat | urlize }}">{{ $cat | upper }}</a>
{{ if lt $i $total }},{{ end }}
{{ end }}
{{ end }}
{{ end }}
<!-- tags -->
{{ with .Params.tags }}
{{ $total := len . }}
{{ if gt $total 0 }}
<br/>
{{ $subtotal := sub $total 1 }} <i class="fas fa-tags"></i>
{{ range $i, $tag := sort . }}
<a class="tag" href="{{ "/tags/" | relURL }}{{ $tag | urlize }}">#{{ $tag | lower }}</a>
{{ if lt $i $subtotal }} {{ end }}
{{ end }}
{{ end }}
{{ end }}
<br/>
<i class="fas fa-clock"></i> {{ .ReadingTime }} min read
</span>
</div>
{{ end }}

View file

@ -0,0 +1,11 @@
<div class="post__related">
<!-- related content -->
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<hr>
<h2>Related Articles</h2>
<ul class="related-posts">
{{ partial "posts-list.html" . }}
</ul>
{{ end }}
</div>

View file

@ -0,0 +1,10 @@
{{ range . }}
<li>
<span class="list__title--small">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{if not .Date.IsZero}}
<time class="list__date pull-right hidden-tablet">{{.Date.Format ("Jan 02 '06")}}</time>
{{end}}
</span>
</li>
{{ end }}

View file

@ -1,9 +1,12 @@
{{ "<!-- Sidebar -->" | safeHTML }}
<!-- Sidebar -->
<div class="sidebar">
<div class="container text-center {{ if .Site.Params.sidebarSticky }}sidebar-sticky{{ end }}">
<div class="container text-center {{ with .Site.Params.sidebarSticky }}sidebar-sticky{{ end }}">
<div class="sidebar-about text-center">
<a href="{{ .Site.BaseURL }}"><h1 class="brand">{{ .Site.Title }}</h1></a>
{{ with .Site.Params.authorimage }} <img src="/{{.}}" alt="Author Image" class="img-circle headshot center"> {{ end }}
<a href="{{ .Site.BaseURL }}">
<h1 class="brand">{{ .Site.Title }}</h1>
</a>
{{ with .Site.Params.authorimage }}
<img src="/{{.}}" alt="Author Image" class="img-circle headshot center"> {{ end }}
<p class="lead">
{{ with .Site.Params.description }} {{.}} {{ else }} Your site's description {{end}}
</p>
@ -13,7 +16,10 @@
{{ partial "sidebar/social.html" . }}
</p>
<p class="copyright">{{ with .Site.Params.copyright }}{{.|safeHTML}}{{ else }}&copy; {{ now.Format "2006"}} {{.Site.Params.author}}.
<a href="https://creativecommons.org/licenses/by/4.0">Some Rights Reserved</a>.<br/>Built with <a href="https://gohugo.io/">Hugo</a> &amp; <a href="https://github.com/htr3n/hyde-hyde">hyde-hyde</a>.{{end}}
<a href="https://creativecommons.org/licenses/by-sa/4.0">Some Rights Reserved</a>.
<br/>Built with
<a href="https://gohugo.io">Hugo</a> ❤️
<a href="https://github.com/htr3n/hyde-hyde">hyde-hyde</a>.{{end}}
</p>
</div>
<div>

View file

@ -3,18 +3,22 @@
{{ $currentPage := . }}
{{- range .Site.Menus.main -}}
{{ if .HasChildren -}}
<li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">
<a href="#">{{ .Pre }}<span>{{ .Name }}</span></a>
<li {{ if $currentPage.HasMenuCurrent "main" . }}class="active"{{ end }}>
<a href="#">{{ .Pre }}
<span>{{ .Name }}</span>
</a>
<ul class="sidebar-nav">
{{- range .Children -}}
<li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}">
<a href="{{ .URL }}">{{ .Name | title }}</a>
</li>
<li {{ if $currentPage.IsMenuCurrent "main" . }}class="active"{{ end }}>
<a href="{{ .URL }}">{{ .Name | title }}</a>
</li>
{{- end -}}
</ul>
{{- else -}}
{{- else -}} <!-- No children -->
<li>
<a href="{{.URL}}">{{ .Pre }} <span>{{ .Name | title }}</span></a>
<a href="{{.URL}}">{{ .Pre }}
<span>{{ .Name | title }}</span>
</a>
</li>
{{- end -}}
{{- end }}

View file

@ -1,4 +1,4 @@
<section class="row text-center">
<section class="social text-center">
{{ with .Site.Params.social.twitter -}}
<a href="https://twitter.com/{{.}}"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a>
{{- end }}