adapt to npf.io themes and add social stuffs

This commit is contained in:
Huy Tran 2018-01-21 18:09:55 +07:00
parent 5814b3e80c
commit 331ef48d5c
27 changed files with 1980 additions and 178 deletions

View file

@ -4,7 +4,7 @@
<div class="content container">
{{ block "main" . -}}{{- end }}
</div>
{{ template "_internal/google_analytics_async.html" . }}
</body>
</html>

View file

@ -1,8 +1,9 @@
{{ define "main" -}}
<h1 class="title">Blog Posts</h1>
<ul class="posts">
{{ range .Data.Pages -}}
<li>
<span><a href="{{ .Permalink }}">{{ .Title }}</a> <time class="pull-right post-list">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></span>
<span><a href="{{ .Permalink }}">{{ .Title }}</a> <time class="pull-right post-list">{{ .Date.Format "Jan 2, 2006" }}</time></span>
</li>
{{- end }}
</ul>

View file

@ -1,7 +1,7 @@
{{ define "main" -}}
<div class="post">
<h1>{{ .Title }}</h1>
<span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
<span class="post-date">{{ .Date.Format "Jan 2, 2006" }}</span>
{{ .Content }}
</div>

View file

@ -6,7 +6,7 @@
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h1>
<span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
{{ .Summary }}
{{ .Content }}
{{ if .Truncated }}
<div class="read-more-link">
<a href="{{ .RelPermalink }}">Read More…</a>

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}}>
<html xmlns="http://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}} class="wf-firasans-n4-active wf-active">
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
@ -19,8 +19,9 @@
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/poole.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/syntax.css">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/hyde.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abril+Fatface|PT+Sans:400,400i,700">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Fira+Sans:300,300i,400,400i,500">
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/custom.css">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="/favicon.png">

View file

@ -1,19 +1,22 @@
<div class="sidebar">
<div class="container sidebar-sticky">
<div class="sidebar-about">
<a href="{{ .Site.BaseURL }}"><h1>{{ .Site.Title }}</h1></a>
<div class="container text-center sidebar-sticky">
<div class="sidebar-about" align="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"> {{ end }}
<p class="lead">
{{ with .Site.Params.description }} {{.}} {{ else }}An elegant open source and mobile first theme for <a href="http://hugo.spf13.com">hugo</a> made by <a href="http://twitter.com/mdo">@mdo</a>. Originally made for Jekyll.{{end}}
{{ with .Site.Params.description }} {{.}} {{ else }} Your site's description {{end}}
</p>
</div>
<div>
<ul class="sidebar-nav">
<li><a href="{{ .Site.BaseURL }}">Home</a> </li>
{{ range .Site.Menus.main -}}
<li><a href="{{.URL}}"> {{ .Name }} </a></li>
<li><a href="{{.URL}}"> {{ .Name | upper }} </a></li>
{{- end }}
</ul>
<p>{{ with .Site.Params.copyright }}{{.}}{{ else }}&copy; {{ now.Format "2006"}}. All rights reserved. {{end}}</p>
</div>
{{ partial "social.html" . }}
<p>{{ with .Site.Params.copyright }}{{.}}{{ else }}&copy; {{ now.Format "2006"}} {{.Site.Params.author}}. Some rights reserved. {{end}}</p>
</div>
<div>
</div>
</div>

View file

@ -0,0 +1,38 @@
<section class="row text-center">
{{ with .Site.Params.social.twitter }}
<a href="https://twitter.com/{{.}}"><i class="fa fa-twitter" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.google }}
<a href="https://plus.google.com/{{.}}/about"><i class="fa fa-google-plus-official" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.facebook }}
<a href="https://facebook.com/{{.}}"><i class="fa fa-facebook-official" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.github }}
<a href="https://github.com/{{.}}"><i class="fa fa-github" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.instagram }}
<a href="https://instagram.com/{{.}}"><i class="fa fa-instagram" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.linkedin }}
<a href="https://linkedin.com/in/{{.}}"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.stackoverflow }}
<a href="https://stackoverflow.com/users/{{.}}"><i class="fa fa-stack-overflow" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.medium}}
<a href="https://medium.com/{{.}}"><i class="fa fa-medium" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.devto}}
<a href="https://dev.to/{{.}}"><i class="fa fa-terminal" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.angellist}}
<a href="https://angel.co/{{.}}"><i class="fa fa-angellist" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.email }}
<a href="mailto:{{.}}"><i class="fa fa-envelope-o" aria-hidden="true"></i></a>
{{ end }}
{{ with .Site.Params.social.xing }}
<a href="https://www.xing.com/profile/{{.}}"><i class="fa fa-xing" aria-hidden="true"></i></a>
{{ end }}
</section>