Initial commit
This commit is contained in:
0
layouts/404.html
Normal file
0
layouts/404.html
Normal file
53
layouts/_default/list.html
Normal file
53
layouts/_default/list.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
<body>
|
||||
<div class="container wrapper list">
|
||||
{{ partial "head.html" . }}
|
||||
|
||||
{{ if isset .Data "Term" }}
|
||||
<h2>{{ .Data.Term }}</h2>
|
||||
{{ else }}
|
||||
<h2 class="page-title">{{ .Name }}</h2>
|
||||
{{ end }}
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
<ul class="posts flat">
|
||||
{{- range .Data.Pages -}}
|
||||
{{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}}
|
||||
{{- else -}}
|
||||
<li class="post">
|
||||
<div class="post-header">
|
||||
<div class="meta">
|
||||
<div class="date">
|
||||
<span class="day">{{ dateFormat "02" .Date }}</span>
|
||||
<span class="rest">{{ if $.Site.Data.month }}{{ index $.Site.Data.month (printf "%d" .Date.Month) }} {{ .Date.Year }}{{ else }}{{ dateFormat "Jan 2006" .Date }}{{ end }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="matter">
|
||||
<h4 class="title small">
|
||||
<a href="{{ .RelPermalink }}">{{.Title}}{{ if .Draft }}<sup class="draft-label">DRAFT</sup>{{ end }}</a>
|
||||
</h4>
|
||||
<span class="description">
|
||||
{{ if isset .Params "description" }}
|
||||
{{ .Description }}
|
||||
{{ else if gt (countrunes .RawContent) 120 }}
|
||||
{{ slicestr .RawContent 0 120 }}...
|
||||
{{ else }}
|
||||
{{ .RawContent }}
|
||||
{{ end }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
60
layouts/_default/single.html
Normal file
60
layouts/_default/single.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{ partial "header.html" . }}
|
||||
<body>
|
||||
<div class="container wrapper">
|
||||
{{ partial "head.html" . }}
|
||||
|
||||
<div class="post">
|
||||
<div class="post-header">
|
||||
{{ if ne .Date.Year 1 }}
|
||||
<div class="meta">
|
||||
<div class="date">
|
||||
<span class="day">{{ dateFormat "02" .Date }}</span>
|
||||
<span class="rest">{{ if $.Site.Data.month }}{{ index $.Site.Data.month (printf "%d" .Date.Month) }} {{ .Date.Year }}{{ else }}{{ dateFormat "Jan 2006" .Date }}{{ end }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="matter">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="markdown">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
<div class="tags">
|
||||
{{ if ne .Type "page" }}
|
||||
{{ if gt .Params.tags 0 }}
|
||||
<ul class="flat">
|
||||
{{ range .Params.tags }}
|
||||
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{- if .Site.DisqusShortname -}}
|
||||
{{- $.Scratch.Set "isDisqus" true -}}
|
||||
|
||||
{{- if and (isset .Params "type") (in .Site.Params.disableDisqusTypes .Params.type) -}}
|
||||
{{- $.Scratch.Set "isDisqus" false -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and (isset .Params "disqus") (eq .Params.disqus false) -}}
|
||||
{{- $.Scratch.Set "isDisqus" false -}}
|
||||
{{- else if and (isset .Params "disqus") (eq .Params.disqus true) -}}
|
||||
{{- $.Scratch.Set "isDisqus" true -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if eq ($.Scratch.Get "isDisqus") true -}}
|
||||
{{- partial "disqus.html" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
{{ partial "footer.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
23
layouts/_default/term.html
Normal file
23
layouts/_default/term.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
<body>
|
||||
<div class="container wrapper tags">
|
||||
{{ partial "head.html" . }}
|
||||
|
||||
<h1 class="page-title">{{ .Title }}</h1>
|
||||
|
||||
{{ with (.Site.GetPage .Title) }}
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
30
layouts/_default/terms.html
Normal file
30
layouts/_default/terms.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
<body>
|
||||
<div class="container wrapper tags">
|
||||
{{ partial "head.html" . }}
|
||||
|
||||
<h1 class="page-title">{{ .Name }}</h1>
|
||||
|
||||
{{ $biggest := 1 }}
|
||||
{{ $smallest := 1 }}
|
||||
{{ $max := 3 }}
|
||||
{{ $min := 1 }}
|
||||
{{ $size := $min }}
|
||||
|
||||
{{ $data := .Data }}
|
||||
<div class="tag-cloud">
|
||||
{{ range $key, $value := .Data.Terms.ByCount }}
|
||||
{{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
|
||||
{{ $size := (cond (eq $biggest $smallest) $min $size) }}
|
||||
<a style="font-size: {{ $size }}rem;" href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}<sup>{{ $value.Count }}</sup></a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
44
layouts/index.html
Normal file
44
layouts/index.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html {{- if (eq .Site.Params.mode "dark") -}}class="dark"{{ end }}>
|
||||
{{ partial "header.html" . }}
|
||||
<body>
|
||||
<div class="container wrapper">
|
||||
{{ partial "head.html" . }}
|
||||
|
||||
<div class="recent-posts section">
|
||||
<div class="posts">
|
||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
{{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="post">
|
||||
<div class="post-header">
|
||||
<div class="meta">
|
||||
<div class="date">
|
||||
<span class="day">{{ dateFormat "02" .Date }}</span>
|
||||
<span class="rest">{{ if $.Site.Data.month }}{{ index $.Site.Data.month (printf "%d" .Date.Month) }} {{ .Date.Year }}{{ else }}{{ dateFormat "Jan 2006" .Date }}{{ end }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="matter">
|
||||
<h4 class="title small">
|
||||
<a href="{{ .RelPermalink }}">{{.Title}}{{ if .Draft }}<sup class="draft-label">DRAFT</sup>{{ end }}</a>
|
||||
</h4>
|
||||
<span class="description">
|
||||
{{ if isset .Params "description" }}
|
||||
{{ .Description }}
|
||||
{{ else if gt (countrunes .RawContent) 120 }}
|
||||
{{ slicestr .RawContent 0 120 }}...
|
||||
{{ else }}
|
||||
{{ .RawContent }}
|
||||
{{ end }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ template "partials/paginator.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ partial "footer.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
16
layouts/partials/disqus.html
Normal file
16
layouts/partials/disqus.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
// Don't ever inject Disqus on localhost--it creates unwanted
|
||||
// discussions from 'localhost:1313' on your Disqus account...
|
||||
if (window.location.hostname == "localhost")
|
||||
return;
|
||||
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
var disqus_shortname = '{{ .Site.DisqusShortname }}';
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the </a></noscript>
|
||||
<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
10
layouts/partials/footer.html
Normal file
10
layouts/partials/footer.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="footer wrapper">
|
||||
<nav class="nav">
|
||||
<div>{{ dateFormat "2006" now }} {{ with .Site.Copyright }} {{ . | safeHTML }} | {{ end }} <a href="https://github.com/knadh/hugo-ink">Ink</a> theme on <a href="https://gohugo.io">Hugo</a></div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{- with .Site.Params.Social -}}
|
||||
<script>feather.replace()</script>
|
||||
{{- end -}}
|
||||
35
layouts/partials/head.html
Normal file
35
layouts/partials/head.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<div class="header">
|
||||
{{ if .Site.Params.Avatar }}
|
||||
<div class="avatar">
|
||||
<a href="{{ .Site.BaseURL }}">
|
||||
<img src="{{ .Site.Params.Avatar | safeURL }}" alt="{{ .Site.Title }}" />
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
<h1 class="site-title"><a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a></h1>
|
||||
<div class="site-description">
|
||||
{{- if isset .Site.Params "subtitle" -}}
|
||||
<p>{{ .Site.Params.Subtitle | markdownify }}</p>
|
||||
{{- end -}}
|
||||
<nav class="nav social">
|
||||
<ul class="flat">
|
||||
{{- range $index, $key := .Site.Params.Social -}}
|
||||
<li><a href="{{ $key.url }}" title="{{ $key.name }}"><i data-feather="{{ $key.icon }}"></i></a></li>
|
||||
{{- end -}}
|
||||
{{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") -}}
|
||||
<li><a href="#" class="scheme-toggle" id="scheme-toggle"></a></li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<nav class="nav">
|
||||
<ul class="flat">
|
||||
{{ range .Site.Menus.main }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
45
layouts/partials/header.html
Normal file
45
layouts/partials/header.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
{{- $title := ( .Title ) -}}
|
||||
{{- $siteTitle := ( .Site.Title ) -}}
|
||||
{{- if .IsHome -}}
|
||||
<title>{{ $siteTitle }} {{ if isset .Site.Params "subtitle" }}- {{ .Site.Params.Subtitle }}{{ end }} </title>
|
||||
{{- else -}}
|
||||
<title>{{ $title }} - {{ $siteTitle }}</title>
|
||||
{{- end -}}
|
||||
|
||||
{{- if isset .Site.Params "favicon" -}}
|
||||
<link rel="icon" type="image/png" href={{ .Site.Params.favicon }} />
|
||||
{{- end -}}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- template "_internal/opengraph.html" . -}}
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
||||
<link href='https://fonts.googleapis.com/css?family=Playfair+Display:700' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/normalize.css" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/main.css" />
|
||||
{{- if isset .Site.Params "customcss" }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}{{ .Site.Params.customCSS }}" />
|
||||
{{ end }}
|
||||
|
||||
<link id="dark-scheme" rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}css/dark.css" />
|
||||
{{- if isset .Site.Params "customdarkcss" }}
|
||||
<link id="dark-scheme" rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}{{ .Site.Params.customDarkCSS }}" />
|
||||
{{- end }}
|
||||
|
||||
{{ if and (isset .Site.Params "social") (isset .Site.Params "feathericonscdn") (eq .Site.Params.featherIconsCDN true) -}}
|
||||
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
||||
{{- else if or (isset .Site.Params "social") (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") -}}
|
||||
<script src="{{ .Site.BaseURL }}js/feather.min.js"></script>
|
||||
{{ end }}
|
||||
<script src="{{ .Site.BaseURL }}js/main.js"></script>
|
||||
{{- if isset .Site.Params "customjs" -}}
|
||||
{{- range .Site.Params.customJS }}<script src="{{ $.Site.BaseURL }}{{ . }}"></script>{{- end }}
|
||||
{{- end }}
|
||||
</head>
|
||||
15
layouts/partials/paginator.html
Normal file
15
layouts/partials/paginator.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{ $pag := $.Paginator }}
|
||||
{{ if gt $pag.TotalPages 1 }}
|
||||
<ul class="pagination">
|
||||
<li class="page-item page-prev">
|
||||
{{ if $pag.HasPrev }}
|
||||
<a {{ if $pag.HasPrev }}href="{{ $pag.Prev.URL }}"{{ end }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev page</span></a>
|
||||
{{ end }}
|
||||
</li>
|
||||
<li class="page-item page-next">
|
||||
{{ if $pag.HasNext }}
|
||||
<a {{ if $pag.HasNext }}href="{{ $pag.Next.URL }}"{{ end }} class="page-link" aria-label="Next"><span aria-hidden="true">Next page →</span></a>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user