This commit is contained in:
Huy Tran 2018-03-30 10:49:07 +11:00
parent a0df983ae7
commit ad5f17e77a
6 changed files with 33 additions and 8 deletions

View File

@ -15,7 +15,7 @@ theme = "hyde-hyde"
title = "Title"
# description = "..."
authorimage = "/img/hugo.png"
dateformat = "Jan 1, 2006"
dateformat = "Jan 2, 2006"
highlightjs = true
# highlightjsstyle = "github"

View File

@ -7,7 +7,13 @@
{{ range where .Data.Pages "Type" "posts" }}
<div class="post">
<h1 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
<span class="post-date">
{{- if isset .Site.Params "dateformat" -}}
{{ .Date.Format .Site.Params.dateformat }}
{{- else -}}
{{ .Date.Format "Jan 02 2006" }}
{{- end -}}
</span>
{{ .Summary }}
{{ if .Truncated }}
<div class="read-more-link">

View File

@ -19,7 +19,7 @@
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/hyde.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Fira+Sans:300,300i,400,400i,500">
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" /> -->
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js" integrity="sha384-8iPTk2s/jMVj81dnzb/iFR2sdA7u06vHJyyLlAd4snFpCl/SnyUjRrbdJsw1pGIl" 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">

View File

@ -4,7 +4,15 @@
<li>
<span>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<time class="pull-right post-list"> {{ .Date.Format "Jan 2, 2006" }}</time>
{{ if not .Date.IsZero }}
<time class="pull-right post-list">
{{- if isset .Site.Params "dateformat" -}}
{{ .Date.Format .Site.Params.dateformat }}
{{- else -}}
{{ .Date.Format "Jan 02 2006" }}
{{- end -}}
</time>
{{end}}
</span>
</li>
{{- end }}

View File

@ -4,7 +4,14 @@
<div class="col-sm-12 col-md-12">
<span class="text-left post-date meta">
<!-- published date -->
{{ if not .Date.IsZero }} <i class="fa fa-calendar" aria-hidden="true"></i> {{ .Date.Format .Site.Params.dateformat }} {{end}}
{{ if not .Date.IsZero }}
<i class="fas fa-calendar-alt"></i>
{{ if isset .Site.Params "dateformat" -}}
{{ .Date.Format .Site.Params.dateformat }}
{{- else -}}
{{ .Date.Format "Jan 02 2006" }}
{{- end -}}
{{ end }}
<!-- categories -->
{{ if isset .Params "categories" }}
{{ $total := len .Params.categories }}
@ -22,7 +29,7 @@
{{ $total := len .Params.tags }}
{{ if gt $total 0 }}
<br/>
{{ $subtotal := sub $total 1 }} <i class="fa fa-tags" aria-hidden="true"></i>
{{ $subtotal := sub $total 1 }} <i class="fas fa-tags"></i>
{{ range $i, $tag := sort $.Params.tags }}
<a class="meta" href="{{ "/tags/" | relURL }}{{ $tag | urlize }}">{{ $tag | lower }}</a>{{ if lt $i $subtotal }} {{ end }}
{{ end }}

View File

@ -56,11 +56,11 @@ code
font-family: monospace;
border-radius: 4px;
width: 100%;
font-size: .85em;
font-size: .9em;
}
code {
padding:.15em .3em;
padding:.20em .2em .10em;
background: #272932!important;
color: #ececec!important;
box-sizing: border-box;
@ -82,3 +82,7 @@ img.center
margin-right: auto;
margin-left: auto;
}
/* Changing from font-awesome 4 to 5, the class pull-right was removed */
.pull-right {
float: right;
}