Skip to content

Commit 054ed11

Browse files
committed
copy layouts
1 parent 2a30a5c commit 054ed11

File tree

12 files changed

+424
-0
lines changed

12 files changed

+424
-0
lines changed

layouts/404.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{ define "main"}}
2+
<main id="main">
3+
<div>
4+
<h1 id="title"><a href="{{ "/" | relURL }}">Go Home</a></h1>
5+
</div>
6+
</main>
7+
{{ end }}

layouts/_default/list.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
{{ partial "head.html" . }}
4+
5+
<body>
6+
<article class="posts">
7+
<div class="row">
8+
<div class="col-xs-12">
9+
{{ partial "header.html" . }}
10+
11+
<h1 class="taxonomy-term">{{.Data.Term}}</h1>
12+
<div id="posts-list">
13+
{{ range (where .Data.Pages "Type" "in" site.Params.mainSections).GroupByDate "2006" -}}
14+
<section>
15+
<h1 class="site-date-catalog">{{ .Key }}</h1>
16+
17+
{{ range .Pages }}
18+
<div class="row posts-line">
19+
<div class="posts-date col-xs-2">
20+
<time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "Jan 02"}}</time>
21+
</div>
22+
<div class="posts-title col-xs-10">
23+
<div class="row">
24+
<div class="col-xs-12">
25+
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
26+
</div>
27+
</div>
28+
</div>
29+
</div>
30+
{{ end }}
31+
</section>
32+
{{ end }}
33+
</div>
34+
35+
{{ partial "footer.html" . }}
36+
</div>
37+
</div>
38+
</article>
39+
40+
{{ partial "scripts.html" . }}
41+
</body>
42+
43+
</html>

layouts/_default/single.html

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
{{ partial "head.html" . }}
4+
5+
<body>
6+
<article class="post {{ .Site.Language.LanguageName }}" id="article">
7+
<div class="row">
8+
<div class="col-xs-12">
9+
<div class="site-header">
10+
{{ partial "header.html" . }}
11+
</div>
12+
<header class="post-header">
13+
<h1 class="post-title">{{ .Title }}</h1>
14+
{{ if in .Site.Params.mainSections .Type }}
15+
<div class="row post-desc">
16+
<div class="col-xs-6">
17+
{{ if .Date }}
18+
<time class="post-date" datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">
19+
{{ .Date.Format "02 Jan 2006" }}
20+
</time>
21+
{{ end }}
22+
</div>
23+
<div class="col-xs-6">
24+
{{ if .Site.Author.name }}
25+
<div class="post-author">
26+
<a target="_blank" href="{{ .Site.Author.homepage }}">@{{ .Site.Author.name }}</a>
27+
</div>
28+
{{ end }}
29+
</div>
30+
</div>
31+
{{ end }}
32+
</header>
33+
34+
<div class="post-content markdown-body">
35+
{{ .Site.Params.postHeaderContent | safeHTML }}
36+
{{ .Content }}
37+
</div>
38+
39+
<div class="row middle-xs">
40+
<div class="col-xs-12">
41+
{{ range .Params.tags }}
42+
<div class="post-tags">
43+
<a href="{{ site.LanguagePrefix }}/tags/{{ lower . | urlize }}/">
44+
{{ . }}
45+
</a>
46+
</div>
47+
{{ end }}
48+
</div>
49+
</div>
50+
{{ if in .Site.Params.mainSections .Type }}
51+
<div class="row">
52+
<div class="col-xs-12">
53+
{{ .Site.Params.postFooterContent | safeHTML }}
54+
</div>
55+
</div>
56+
57+
{{ partial "related.html" . }}
58+
59+
{{ if .Site.Params.postAds }}
60+
<div class="post-ads">{{ .Site.Params.postAds | safeHTML }}</div>
61+
{{ end }}
62+
<!-- split -->
63+
<div style="height: 50px;"></div>
64+
{{ if .Site.Params.disqus }}
65+
<div class="post-comments">
66+
{{ partial "disqus.html" . }}
67+
</div>
68+
{{ end }}
69+
{{ end }}
70+
71+
{{ partial "footer.html" . }}
72+
</div>
73+
</div>
74+
</article>
75+
76+
{{ partial "scripts.html" . }}
77+
{{ if .Site.Params.extraBody }}
78+
{{ .Site.Params.extraBody | safeHTML }}
79+
{{ end }}
80+
81+
</body>
82+
83+
</html>

layouts/gallery/single.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
{{ partial "head.html" . }}
4+
5+
<body>
6+
<article class="post {{ .Site.Language.LanguageName }}" id="article">
7+
<div class="row">
8+
<div class="col-xs-12">
9+
<div class="site-header">
10+
{{ partial "header.html" . }}
11+
</div>
12+
<header class="post-header">
13+
<h1 class="post-title">{{ .Title }}</h1>
14+
</header>
15+
16+
<div class="post-content page-content markdown-body">
17+
<div class="row gallery">
18+
{{ range .Params.gallery }}
19+
<div class="col-xs-6 gallery-img">
20+
<img src="{{ .url }}" alt="{{ .name }}">
21+
<span class="gallery-img-desc">{{ .name }}</span>
22+
</div>
23+
{{ end }}
24+
</div>
25+
</div>
26+
27+
{{ if .Site.Params.disqus }}
28+
<div class="post-comments">
29+
{{ partial "disqus.html" . }}
30+
</div>
31+
{{ end }}
32+
33+
{{ partial "footer.html" . }}
34+
</div>
35+
</div>
36+
</article>
37+
38+
{{ partial "scripts.html" . }}
39+
{{ if .Site.Params.extraBody }}
40+
{{ .Site.Params.extraBody | safeHTML }}
41+
{{ end }}
42+
43+
</body>
44+
45+
</html>

layouts/index.html

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ .Site.LanguageCode }}" prefix="og: http://ogp.me/ns#">
3+
{{ partial "head.html" . }}
4+
5+
<body>
6+
<article class="posts">
7+
<div class="row">
8+
<div class="col-xs-12">
9+
{{ partial "header.html" . }}
10+
<div id="posts-list">
11+
{{ range (where site.RegularPages "Type" "in" site.Params.mainSections).GroupByDate "2006" -}}
12+
<section>
13+
<h1 class="site-date-catalog">{{ .Key }}</h1>
14+
15+
{{ range .Pages }}
16+
<div class="row posts-line">
17+
<div class="posts-date col-xs-3 col-sm-2">
18+
<time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "Jan 02"}}</time>
19+
</div>
20+
<div class="posts-title col-xs-9 col-sm-10">
21+
<div class="row">
22+
<div class="col-xs-11 col-sm-10">
23+
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
24+
</div>
25+
<div class="col-xs-1 col-sm-2 posts-categories">
26+
{{ range .Params.categories }}
27+
<div class="posts-category">
28+
<a href="/categories/{{ lower . }}/"><strong>{{ . }}</strong></a>
29+
</div>
30+
{{ end }}
31+
</div>
32+
</div>
33+
</div>
34+
</div>
35+
{{ end }}
36+
</section>
37+
{{ end }}
38+
</div>
39+
40+
{{ partial "footer.html" . }}
41+
</div>
42+
</div>
43+
</article>
44+
45+
{{ partial "scripts.html" . }}
46+
</body>
47+
48+
</html>

layouts/partials/disqus.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<div id="disqus_thread"></div>
2+
<script>
3+
window.addEventListener("load", () => {
4+
(function() {
5+
// DON'T EDIT BELOW THIS LINE
6+
var d = document,
7+
s = d.createElement("script");
8+
s.src = "https://{{ .Site.Params.disqus }}.disqus.com/embed.js";
9+
s.setAttribute("data-timestamp", +new Date());
10+
(d.head || d.body).appendChild(s);
11+
})();
12+
});
13+
</script>
14+
<noscript
15+
>Please enable JavaScript to view the
16+
<a href="https://disqus.com/?ref_noscript"
17+
>comments powered by Disqus.</a
18+
></noscript
19+
>

layouts/partials/footer.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div class="site-footer">
2+
<!-- {{ range .Site.Params.socials }}
3+
<div class="site-footer-item">
4+
<a href="{{ .link }}" target="_blank">{{ .name }}</a>
5+
</div>
6+
{{ end }} -->
7+
<!-- <div class="site-footer-item">
8+
<a href="https://github.com/joway/hugo-theme-yinyang" target="_blank">Theme</a>
9+
</div> -->
10+
</div>

layouts/partials/head.html

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<head>
2+
<meta charset="utf-8" />
3+
{{ hugo.Generator }}
4+
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="author" content="{{ .Site.Author.name }}" />
8+
<meta property="og:url" content="{{ .Permalink }}" />
9+
<link rel="canonical" href="{{ .Permalink }}" />
10+
11+
{{- if .Site.Params.staticPrefix -}}
12+
<link rel="dns-prefetch" href="{{ .Site.Params.staticPrefix }}" />
13+
{{- end -}}
14+
15+
{{- if .Site.Params.favicon -}}
16+
<link rel="apple-touch-icon" href="{{ .Site.Params.favicon }}" />
17+
<link rel="icon" href="{{ .Site.Params.favicon }}" />
18+
<link rel="shortcut" href="{{ .Site.Params.favicon }}" />
19+
{{- end -}}
20+
<link rel="alternate" type="application/atom+xml" href="{{.Site.BaseURL}}index.xml" title="{{ .Site.Title }}">
21+
22+
{{ partial "seo" . }}
23+
24+
{{- if .IsHome -}}
25+
<title>{{ .Site.Title }}</title>
26+
<meta property="og:title" content="{{ .Site.Title }}" />
27+
<meta property="og:type" content="website" />
28+
<meta property="og:description" content="{{ .Site.Params.description }}" />
29+
<meta name="description" content="{{ .Site.Params.description }}" />
30+
{{- else -}}
31+
<title>{{ .Title }}</title>
32+
<meta property="og:title" content="{{ .Title }}" />
33+
<meta property="og:type" content="article" />
34+
<meta property="og:description" content="{{ default .Summary .Description | plainify }}" />
35+
<meta name="description" content="{{ default .Summary .Description | plainify }}" />
36+
{{- end }}
37+
<meta property="og:locale" content="{{ .Site.LanguageCode }}" />
38+
{{- if .Params.album -}}
39+
<meta property="og:image" content="{{ .Params.album }}" />
40+
{{- else -}}
41+
<meta property="og:image" content="{{ .Site.Params.favicon }}" />
42+
{{ end }}
43+
44+
{{ with resources.Get "css/index.css" | minify }}
45+
<style>{{ .Content | safeCSS }}</style>
46+
{{ end }}
47+
{{ with resources.Get "css/flexboxgrid-6.3.1.min.css" | minify }}
48+
<style>{{ .Content | safeCSS }}</style>
49+
{{ end }}
50+
51+
{{ range .Site.Params.extraCSSFiles -}}
52+
<link rel="stylesheet" href="{{ $.Site.Params.staticPrefix }}{{ . | relURL }}">
53+
{{- end }}
54+
55+
<link href="{{ .Site.Params.staticPrefix }}{{ "index.xml" | relURL }}" rel="alternate" type="application/rss+xml"
56+
title="{{ .Site.Title }}">
57+
<!-- fonts -->
58+
<link rel="preconnect" href="https://fonts.gstatic.com">
59+
<link href="https://fonts.googleapis.com/css?family=Bree+Serif|Bungee+Shade" rel="stylesheet">
60+
<!-- quicklink require -->
61+
<!-- <script>
62+
/* Disable minification (remove `.min` from URL path) for more info
63+
https://polyfill.io/v2/polyfill.min.js?features=IntersectionObserver
64+
*/
65+
(function (undefined) { }).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
66+
</script> -->
67+
68+
{{ if .Site.Params.TwitterCards }}{{ template "_internal/twitter_cards.html" . }}{{ end }}
69+
{{ .Site.Params.extraHead | safeHTML }}
70+
</head>

layouts/partials/header.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{ $curLanguageName := .Site.Language.LanguageName }}
2+
<header>
3+
<div class="header-title">
4+
<a href="{{ .Site.LanguagePrefix }}/"
5+
>{{ or .Site.Params.headTitle .Site.Author.name }}</a
6+
>
7+
</div>
8+
<div class="header-subtitle">{{ .Site.Params.Description }}</div>
9+
</header>
10+
<div class="row end-md header-items">
11+
{{ range .Site.Params.socials }}
12+
<div class="header-item">
13+
<a href="{{ .link }}" target="_blank">{{ .name }}</a>
14+
</div>
15+
{{ end }}
16+
</div>
17+
<div class="row">
18+
{{ range .Site.Languages -}} {{ if ne .LanguageName $curLanguageName }}
19+
<div class="lang-switch col-xs-3 col-xs-offset-9">
20+
<a href="/{{ .Lang }}/">{{ .LanguageName }}</a>
21+
</div>
22+
{{ end }} {{ end }}
23+
</div>
24+
<div class="header-line"></div>

layouts/partials/related.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{ $related := (where site.RegularPages "Type" "in" site.Params.mainSections).Related . | first 3 }}
2+
{{ with $related }}
3+
<div class="related-content">
4+
<h3>Related Posts</h3>
5+
<ul>
6+
{{ range . }}
7+
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
8+
{{ end }}
9+
</ul>
10+
</div>
11+
{{ end }}

0 commit comments

Comments
 (0)