Han-theme 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/_includes/comments.html +5 -0
  3. data/_includes/custom.html +3 -0
  4. data/_includes/datetime.html +20 -0
  5. data/_includes/favicons.html +19 -0
  6. data/_includes/footer.html +36 -0
  7. data/_includes/head.html +107 -0
  8. data/_includes/js-selector.html +106 -0
  9. data/_includes/jsdelivr-combine.html +26 -0
  10. data/_includes/lang.html +10 -0
  11. data/_includes/language-alias.html +70 -0
  12. data/_includes/media-url.html +37 -0
  13. data/_includes/mermaid.html +62 -0
  14. data/_includes/metadata-hook.html +1 -0
  15. data/_includes/mode-toggle.html +116 -0
  16. data/_includes/no-linenos.html +10 -0
  17. data/_includes/notification.html +24 -0
  18. data/_includes/origin-type.html +13 -0
  19. data/_includes/post-description.html +16 -0
  20. data/_includes/post-nav.html +34 -0
  21. data/_includes/post-paginator.html +91 -0
  22. data/_includes/post-sharing.html +52 -0
  23. data/_includes/read-time.html +37 -0
  24. data/_includes/refactor-content.html +255 -0
  25. data/_includes/related-posts.html +94 -0
  26. data/_includes/search-loader.html +47 -0
  27. data/_includes/search-results.html +10 -0
  28. data/_includes/sidebar.html +102 -0
  29. data/_includes/toc.html +13 -0
  30. data/_includes/topbar.html +77 -0
  31. data/_includes/trending-tags.html +46 -0
  32. data/_includes/update-list.html +40 -0
  33. data/_layouts/archives.html +35 -0
  34. data/_layouts/categories.html +138 -0
  35. data/_layouts/category.html +24 -0
  36. data/_layouts/compress.html +10 -0
  37. data/_layouts/default.html +76 -0
  38. data/_layouts/home.html +115 -0
  39. data/_layouts/page.html +20 -0
  40. data/_layouts/portfolio.html +82 -0
  41. data/_layouts/post.html +152 -0
  42. data/_layouts/tag.html +23 -0
  43. data/_layouts/tags.html +22 -0
  44. data/assets/404.html +14 -0
  45. data/assets/feed.xml +54 -0
  46. data/assets/robots.txt +10 -0
  47. metadata +282 -0
@@ -0,0 +1,115 @@
1
+ ---
2
+ layout: default
3
+ refactor: true
4
+ ---
5
+
6
+ {% include lang.html %}
7
+
8
+ {% assign pinned = site.posts | where: 'pin', 'true' %}
9
+ {% assign default = site.posts | where_exp: 'item', 'item.pin != true and item.hidden != true' %}
10
+
11
+ {% assign posts = '' | split: '' %}
12
+
13
+ <!-- Get pinned posts -->
14
+
15
+ {% assign offset = paginator.page | minus: 1 | times: paginator.per_page %}
16
+ {% assign pinned_num = pinned.size | minus: offset %}
17
+
18
+ {% if pinned_num > 0 %}
19
+ {% for i in (offset..pinned.size) limit: pinned_num %}
20
+ {% assign posts = posts | push: pinned[i] %}
21
+ {% endfor %}
22
+ {% else %}
23
+ {% assign pinned_num = 0 %}
24
+ {% endif %}
25
+
26
+ <!-- Get default posts -->
27
+
28
+ {% assign default_beg = offset | minus: pinned.size %}
29
+
30
+ {% if default_beg < 0 %}
31
+ {% assign default_beg = 0 %}
32
+ {% endif %}
33
+
34
+ {% assign default_num = paginator.posts | size | minus: pinned_num %}
35
+ {% assign default_end = default_beg | plus: default_num | minus: 1 %}
36
+
37
+ {% if default_num > 0 %}
38
+ {% for i in (default_beg..default_end) %}
39
+ {% assign posts = posts | push: default[i] %}
40
+ {% endfor %}
41
+ {% endif %}
42
+
43
+ <div id="post-list" class="flex-grow-1 px-xl-1">
44
+ {% for post in posts %}
45
+ <article class="card-wrapper card">
46
+ <a href="{{ post.url | relative_url }}" class="post-preview row g-0 flex-md-row-reverse">
47
+ {% assign card_body_col = '12' %}
48
+
49
+ {% if post.image %}
50
+ {% assign src = post.image.path | default: post.image %}
51
+ {% unless src contains '//' %}
52
+ {% assign src = post.media_subpath | append: '/' | append: src | replace: '//', '/' %}
53
+ {% endunless %}
54
+
55
+ {% assign alt = post.image.alt | xml_escape | default: 'Preview Image' %}
56
+
57
+ {% assign lqip = null %}
58
+
59
+ {% if post.image.lqip %}
60
+ {% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %}
61
+ {% endif %}
62
+
63
+ <div class="col-md-5">
64
+ <img src="{{ src }}" alt="{{ alt }}" {{ lqip }}>
65
+ </div>
66
+
67
+ {% assign card_body_col = '7' %}
68
+ {% endif %}
69
+
70
+ <div class="col-md-{{ card_body_col }}">
71
+ <div class="card-body d-flex flex-column">
72
+ <h1 class="card-title my-2 mt-md-0">{{ post.title }}</h1>
73
+
74
+ <div class="card-text content mt-0 mb-3">
75
+ <p>{% include post-description.html %}</p>
76
+ </div>
77
+
78
+ <div class="post-meta flex-grow-1 d-flex align-items-end">
79
+ <div class="me-auto">
80
+ <!-- posted date -->
81
+ <i class="far fa-calendar fa-fw me-1"></i>
82
+ {% include datetime.html date=post.date lang=lang %}
83
+
84
+ <!-- categories -->
85
+ {% if post.categories.size > 0 %}
86
+ <i class="far fa-folder-open fa-fw me-1"></i>
87
+ <span class="categories">
88
+ {% for category in post.categories %}
89
+ {{ category }}
90
+ {%- unless forloop.last -%},{%- endunless -%}
91
+ {% endfor %}
92
+ </span>
93
+ {% endif %}
94
+ </div>
95
+
96
+ {% if post.pin %}
97
+ <div class="pin ms-1">
98
+ <i class="fas fa-thumbtack fa-fw"></i>
99
+ <span>{{ site.data.locales[lang].post.pin_prompt }}</span>
100
+ </div>
101
+ {% endif %}
102
+ </div>
103
+ <!-- .post-meta -->
104
+ </div>
105
+ <!-- .card-body -->
106
+ </div>
107
+ </a>
108
+ </article>
109
+ {% endfor %}
110
+ </div>
111
+ <!-- #post-list -->
112
+
113
+ {% if paginator.total_pages > 1 %}
114
+ {% include post-paginator.html %}
115
+ {% endif %}
@@ -0,0 +1,20 @@
1
+ ---
2
+ layout: default
3
+ ---
4
+
5
+ {% include lang.html %}
6
+
7
+ <article class="px-1">
8
+ {% if page.layout == 'page' or page.collection == 'tabs' %}
9
+ {% assign tab_key = page.title | downcase %}
10
+ {% assign title = site.data.locales[lang].tabs[tab_key] | default: page.title %}
11
+ <h1 class="dynamic-title">
12
+ {{ title }}
13
+ </h1>
14
+ <div class="content">
15
+ {{ content }}
16
+ </div>
17
+ {% else %}
18
+ {{ content }}
19
+ {% endif %}
20
+ </article>
@@ -0,0 +1,82 @@
1
+ ---
2
+ layout: compress
3
+ ---
4
+
5
+ <!doctype html>
6
+
7
+ {% include origin-type.html %}
8
+
9
+ {% include lang.html %}
10
+
11
+ {% if site.theme_mode %}
12
+ {% capture prefer_mode %}data-mode="{{ site.theme_mode }}"{% endcapture %}
13
+ {% endif %}
14
+
15
+ <!-- `site.alt_lang` can specify a language different from the UI -->
16
+ <html lang="{{ page.lang | default: site.alt_lang | default: site.lang }}" {{ prefer_mode }}>
17
+ {% include head.html %}
18
+
19
+ <body>
20
+ {% include sidebar.html lang=lang %}
21
+
22
+ <div id="main-wrapper" class="d-flex justify-content-center">
23
+ <div class="container d-flex flex-column px-xxl-5">
24
+ {% include topbar.html lang=lang %}
25
+
26
+ <div class="row flex-grow-1">
27
+ <main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4">
28
+ {% if layout.refactor or layout.layout == 'default' %}
29
+ {% include refactor-content.html content=content lang=lang %}
30
+ {% else %}
31
+ {{ content }}
32
+ {% endif %}
33
+ </main>
34
+
35
+ <!-- panel -->
36
+ <aside aria-label="Panel" id="panel-wrapper" class="col-xl-3 ps-2 mb-5 text-muted">
37
+ <div class="access">
38
+ {% include_cached update-list.html lang=lang %}
39
+ {% include_cached trending-tags.html lang=lang %}
40
+ </div>
41
+
42
+ {% for _include in layout.panel_includes %}
43
+ {% assign _include_path = _include | append: '.html' %}
44
+ {% include {{ _include_path }} lang=lang %}
45
+ {% endfor %}
46
+ </aside>
47
+ </div>
48
+
49
+ <div class="row">
50
+ <!-- tail -->
51
+ <div id="tail-wrapper" class="col-12 col-lg-11 col-xl-9 px-md-4">
52
+ {% for _include in layout.tail_includes %}
53
+ {% assign _include_path = _include | append: '.html' %}
54
+ {% include {{ _include_path }} lang=lang %}
55
+ {% endfor %}
56
+
57
+ {% include_cached footer.html lang=lang %}
58
+ </div>
59
+ </div>
60
+
61
+ {% include_cached search-results.html lang=lang %}
62
+ </div>
63
+
64
+ <aside aria-label="Scroll to Top">
65
+ <button id="back-to-top" type="button" class="btn btn-lg btn-box-shadow">
66
+ <i class="fas fa-angle-up"></i>
67
+ </button>
68
+ </aside>
69
+ </div>
70
+
71
+ <div id="mask"></div>
72
+
73
+ {% if site.pwa.enabled %}
74
+ {% include_cached notification.html lang=lang %}
75
+ {% endif %}
76
+
77
+ <!-- JavaScripts -->
78
+ {% include js-selector.html lang=lang %}
79
+
80
+ {% include_cached search-loader.html lang=lang %}
81
+ </body>
82
+ </html>
@@ -0,0 +1,152 @@
1
+ ---
2
+ layout: default
3
+ refactor: true
4
+ panel_includes:
5
+ - toc
6
+ tail_includes:
7
+ - related-posts
8
+ - post-nav
9
+ - comments
10
+ ---
11
+
12
+ {% include lang.html %}
13
+
14
+ <article class="px-1">
15
+ <header>
16
+ <h1 data-toc-skip>{{ page.title }}</h1>
17
+ {% if page.description %}
18
+ <p class="post-desc fw-light mb-4">{{ page.description }}</p>
19
+ {% endif %}
20
+
21
+ <div class="post-meta text-muted">
22
+ <!-- published date -->
23
+ <span>
24
+ {{ site.data.locales[lang].post.posted }}
25
+ {% include datetime.html date=page.date tooltip=true lang=lang %}
26
+ </span>
27
+
28
+ <!-- lastmod date -->
29
+ {% if page.last_modified_at and page.last_modified_at != page.date %}
30
+ <span>
31
+ {{ site.data.locales[lang].post.updated }}
32
+ {% include datetime.html date=page.last_modified_at tooltip=true lang=lang %}
33
+ </span>
34
+ {% endif %}
35
+
36
+ {% if page.image %}
37
+ {% capture src %}src="{{ page.image.path | default: page.image }}"{% endcapture %}
38
+ {% capture class %}class="preview-img{% if page.image.no_bg %}{{ ' no-bg' }}{% endif %}"{% endcapture %}
39
+ {% capture alt %}alt="{{ page.image.alt | xml_escape | default: "Preview Image" }}"{% endcapture %}
40
+
41
+ {% if page.image.lqip %}
42
+ {%- capture lqip -%}lqip="{{ page.image.lqip }}"{%- endcapture -%}
43
+ {% endif %}
44
+
45
+ <div class="mt-3 mb-3">
46
+ <img {{ src }} {{ class }} {{ alt }} w="1200" h="630" {{ lqip }}>
47
+ {%- if page.image.alt -%}
48
+ <figcaption class="text-center pt-2 pb-2">{{ page.image.alt }}</figcaption>
49
+ {%- endif -%}
50
+ </div>
51
+ {% endif %}
52
+
53
+ <div class="d-flex justify-content-between">
54
+ <!-- author(s) -->
55
+ <span>
56
+ {% if page.author %}
57
+ {% assign authors = page.author %}
58
+ {% elsif page.authors %}
59
+ {% assign authors = page.authors %}
60
+ {% endif %}
61
+
62
+ {{ site.data.locales[lang].post.written_by }}
63
+
64
+ <em>
65
+ {% if authors %}
66
+ {% for author in authors %}
67
+ {% if site.data.authors[author].url -%}
68
+ <a href="{{ site.data.authors[author].url }}">{{ site.data.authors[author].name }}</a>
69
+ {%- else -%}
70
+ {{ site.data.authors[author].name }}
71
+ {%- endif %}
72
+ {% unless forloop.last %}{{ '</em>, <em>' }}{% endunless %}
73
+ {% endfor %}
74
+ {% else %}
75
+ <a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>
76
+ {% endif %}
77
+ </em>
78
+ </span>
79
+
80
+ <div>
81
+ <!-- pageviews -->
82
+ {% if site.pageviews.provider and site.analytics[site.pageviews.provider].id %}
83
+ <span>
84
+ <em id="pageviews">
85
+ <i class="fas fa-spinner fa-spin small"></i>
86
+ </em>
87
+ {{ site.data.locales[lang].post.pageview_measure }}
88
+ </span>
89
+ {% endif %}
90
+
91
+ <!-- read time -->
92
+ {% include read-time.html content=content prompt=true lang=lang %}
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </header>
97
+
98
+ <div class="content">
99
+ {{ content }}
100
+ </div>
101
+
102
+ <div class="post-tail-wrapper text-muted">
103
+ <!-- categories -->
104
+ {% if page.categories.size > 0 %}
105
+ <div class="post-meta mb-3">
106
+ <i class="far fa-folder-open fa-fw me-1"></i>
107
+ {% for category in page.categories %}
108
+ <a href="{{ site.baseurl }}/categories/{{ category | slugify | url_encode }}/">{{ category }}</a>
109
+ {%- unless forloop.last -%},{%- endunless -%}
110
+ {% endfor %}
111
+ </div>
112
+ {% endif %}
113
+
114
+ <!-- tags -->
115
+ {% if page.tags.size > 0 %}
116
+ <div class="post-tags">
117
+ <i class="fa fa-tags fa-fw me-1"></i>
118
+ {% for tag in page.tags %}
119
+ <a
120
+ href="{{ site.baseurl }}/tags/{{ tag | slugify | url_encode }}/"
121
+ class="post-tag no-text-decoration"
122
+ >
123
+ {{- tag -}}
124
+ </a>
125
+ {% endfor %}
126
+ </div>
127
+ {% endif %}
128
+
129
+ <div
130
+ class="
131
+ post-tail-bottom
132
+ d-flex justify-content-between align-items-center mt-5 pb-2
133
+ "
134
+ >
135
+ <div class="license-wrapper">
136
+ {% if site.data.locales[lang].copyright.license.template %}
137
+ {% capture _replacement %}
138
+ <a href="{{ site.data.locales[lang].copyright.license.link }}">
139
+ {{ site.data.locales[lang].copyright.license.name }}
140
+ </a>
141
+ {% endcapture %}
142
+
143
+ {{ site.data.locales[lang].copyright.license.template | replace: ':LICENSE_NAME', _replacement }}
144
+ {% endif %}
145
+ </div>
146
+
147
+ {% include post-sharing.html lang=lang %}
148
+ </div>
149
+ <!-- .post-tail-bottom -->
150
+ </div>
151
+ <!-- div.post-tail-wrapper -->
152
+ </article>
data/_layouts/tag.html ADDED
@@ -0,0 +1,23 @@
1
+ ---
2
+ layout: page
3
+ # The layout for Tag page
4
+ ---
5
+
6
+ {% include lang.html %}
7
+
8
+ <div id="page-tag">
9
+ <h1 class="ps-lg-2">
10
+ <i class="fa fa-tag fa-fw text-muted"></i>
11
+ {{ page.title }}
12
+ <span class="lead text-muted ps-2">{{ page.posts | size }}</span>
13
+ </h1>
14
+ <ul class="content ps-0">
15
+ {% for post in page.posts %}
16
+ <li class="d-flex justify-content-between px-md-3">
17
+ <a href="{{ post.url | relative_url }}">{{ post.title }}</a>
18
+ <span class="dash flex-grow-1"></span>
19
+ {% include datetime.html date=post.date class='text-muted small text-nowrap' lang=lang %}
20
+ </li>
21
+ {% endfor %}
22
+ </ul>
23
+ </div>
@@ -0,0 +1,22 @@
1
+ ---
2
+ layout: page
3
+ # All the Tags of posts.
4
+ ---
5
+
6
+ <div id="tags" class="d-flex flex-wrap mx-xl-2">
7
+ {% assign tags = '' | split: '' %}
8
+ {% for t in site.tags %}
9
+ {% assign tags = tags | push: t[0] %}
10
+ {% endfor %}
11
+
12
+ {% assign sorted_tags = tags | sort_natural %}
13
+
14
+ {% for t in sorted_tags %}
15
+ <div>
16
+ <a class="tag" href="{{ t | slugify | url_encode | prepend: '/tags/' | append: '/' | relative_url }}">
17
+ {{ t -}}
18
+ <span class="text-muted">{{ site.tags[t].size }}</span>
19
+ </a>
20
+ </div>
21
+ {% endfor %}
22
+ </div>
data/assets/404.html ADDED
@@ -0,0 +1,14 @@
1
+ ---
2
+ layout: page
3
+ title: "404: Page not found"
4
+ permalink: /404.html
5
+
6
+ redirect_from:
7
+ - /norobots/
8
+ - /assets/
9
+ - /posts/
10
+ ---
11
+
12
+ {% include lang.html %}
13
+
14
+ <p class="lead">{{ site.data.locales[lang].not_found.statment }}</p>
data/assets/feed.xml ADDED
@@ -0,0 +1,54 @@
1
+ ---
2
+ layout: compress
3
+ permalink: /feed.xml
4
+ # Atom Feed, reference: https://validator.w3.org/feed/docs/atom.html
5
+ ---
6
+
7
+ {% capture source %}
8
+ <feed xmlns="http://www.w3.org/2005/Atom">
9
+ <id>{{ "/" | absolute_url }}</id>
10
+ <title>{{ site.title }}</title>
11
+ <subtitle>{{ site.description }}</subtitle>
12
+ <updated>{{ site.time | date_to_xmlschema }}</updated>
13
+ <author>
14
+ <name>{{ site.social.name }}</name>
15
+ <uri>{{ "/" | absolute_url }}</uri>
16
+ </author>
17
+ <link rel="self" type="application/atom+xml" href="{{ page.url | absolute_url }}"/>
18
+ <link rel="alternate" type="text/html" hreflang="{{ site.alt_lang | default: site.lang }}"
19
+ href="{{ '/' | absolute_url }}"/>
20
+ <generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
21
+ <rights> © {{ 'now' | date: '%Y' }} {{ site.social.name }} </rights>
22
+ <icon>{{ site.baseurl }}/assets/img/favicons/favicon.ico</icon>
23
+ <logo>{{ site.baseurl }}/assets/img/favicons/favicon-96x96.png</logo>
24
+
25
+ {% for post in site.posts limit: 5 %}
26
+ {% assign post_absolute_url = post.url | absolute_url %}
27
+ <entry>
28
+ <title>{{ post.title }}</title>
29
+ <link href="{{ post_absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
30
+ <published>{{ post.date | date_to_xmlschema }}</published>
31
+ {% if post.last_modified_at %}
32
+ <updated>{{ post.last_modified_at | date_to_xmlschema }}</updated>
33
+ {% else %}
34
+ <updated>{{ post.date | date_to_xmlschema }}</updated>
35
+ {% endif %}
36
+ <id>{{ post_absolute_url }}</id>
37
+ <content src="{{ post_absolute_url }}" />
38
+ <author>
39
+ <name>{{ post.author | default: site.social.name }}</name>
40
+ </author>
41
+
42
+ {% if post.categories %}
43
+ {% for category in post.categories %}
44
+ <category term="{{ category }}" />
45
+ {% endfor %}
46
+ {% endif %}
47
+
48
+ <summary>{% include post-description.html max_length=400 %}</summary>
49
+
50
+ </entry>
51
+ {% endfor %}
52
+ </feed>
53
+ {% endcapture %}
54
+ {{ source | replace: '&', '&amp;' }}
data/assets/robots.txt ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ permalink: /robots.txt
3
+ # The robots rules
4
+ ---
5
+
6
+ User-agent: *
7
+
8
+ Disallow: /norobots/
9
+
10
+ Sitemap: {{ '/sitemap.xml' | absolute_url }}