init blog

master
JimZhang 2 years ago
commit 15e4a08675

31
.gitignore vendored

@ -0,0 +1,31 @@
target
.idea/
test_site/public
test_site_i18n/public
docs/public
docs/out
small-blog
medium-blog
big-blog
huge-blog
extra-huge-blog
small-kb
medium-kb
huge-kb
current.bench
now.bench
*.zst
# snapcraft artifacts
snap/.snapcraft
parts
prime
stage
# nixos dependencies snippet
shell.nix
# vim temporary files
**/.*.sw*
.swp

@ -0,0 +1,45 @@
# The URL the site will be built for
base_url = "https://www.loom.run"
# Whether to automatically compile all Sass files in the sass directory
compile_sass = true
# Whether to build a search index to be used later on by a JavaScript library
build_search_index = false
taxonomies = [{ name = "tags" }]
title = "Loom Blog"
[markdown]
# Whether to do syntax highlighting
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
highlight_code = true
[extra]
# Put all your custom variables here
copyright = "JimZhang"
icp= "皖ICP备20008287号-1"
mode = "toggle"
# config social icon info in the footer
[[extra.social]]
icon = "github"
name = "GitHub"
url = "https://github.com/zzl221000"
[[extra.social]]
icon = "twitter"
name = "Twitter"
url = "https://github.com/XXXMrG/"
[[extra.social]]
icon = "gitlab"
name = "GitLab"
url = "https://gitlab.com/your-name/"
[[extra.translations.en]]
show_more = "Read more ⟶"
previous_page = "← Previous"
next_page = "Next →"
posted_on = "on "
posted_by = "Published by"
read_time = "minute read"
all_tags = "All tags"

@ -0,0 +1,4 @@
+++
paginate_by = 10
sort_by = "date"
+++

@ -0,0 +1,8 @@
+++
path = "posts"
title = "Posts"
paginate_by = 10
template = "posts.html"
transparent = true
sort_by = "date"
+++

@ -0,0 +1,6 @@
+++
title = "My first post"
date = 2019-11-27
+++
This is my first blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,8 @@
+++
title = "My second post 2"
date = 2019-11-29
[taxonomies]
tags=["Demo","Test"]
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1,6 @@
+++
title = "My second post"
date = 2019-11-28
+++
This is my second blog post.

@ -0,0 +1 @@
@font-face{font-family:'MapleMono';src:url("/fonts/MapleMono-Regular.ttf");font-weight:normal;font-style:normal;font-display:block}@font-face{font-family:'MapleMono';src:url("/fonts/MapleMono-Bold.ttf");font-weight:bold;font-style:normal;font-display:block}@font-face{font-family:'MapleMono';src:url("/fonts/MapleMono-Italic.ttf");font-weight:normal;font-style:italic;font-display:block}@font-face{font-family:'MapleMono';src:url("/fonts/MapleMono-Bolditalic.ttf");font-weight:bold;font-style:italic;font-display:block}

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -0,0 +1,23 @@
function setTheme(mode) {
localStorage.setItem("theme-storage", mode);
if (mode === "dark") {
document.documentElement.setAttribute('data-theme', 'dark')
document.getElementById("dark-mode-toggle").innerHTML = "<i data-feather=\"sun\"></i>";
feather.replace()
} else if (mode === "light") {
document.documentElement.setAttribute('data-theme', 'light')
document.getElementById("dark-mode-toggle").innerHTML = "<i data-feather=\"moon\"></i>";
feather.replace()
}
}
function toggleTheme() {
if (localStorage.getItem("theme-storage") === "light") {
setTheme("dark");
} else if (localStorage.getItem("theme-storage") === "dark") {
setTheme("light");
}
}
var savedTheme = localStorage.getItem("theme-storage") || "light";
setTheme(savedTheme);

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
html[data-theme="dark"]{--page-back-color: rgb(27, 27, 27);--main-text-color: rgb(240, 240, 240);--main-back-color: rgb(17, 17, 17);--link-text-color: rgb(120, 217, 113);--target-highlight-color: rgb(255, 255, 0);--github-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/github.png);--twitter-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/twitter-squared.png);--email-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/email.png);--coffee-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/kawaii-coffee.png);--webring-icon-url: url(https://webring.xxiivv.com/icon.white.svg);--rss-icon-url: url(https://img.icons8.com/material/64/f0f0f0/rss.png);--search-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/search.png);--cc-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/creative-commons.png);--attribution-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/creative-commons-by.png);--non_com-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/creative-commons-nc.png);--share_alike-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/creative-commons-sa.png);--copyright-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/copyright.png)}

@ -0,0 +1 @@
html[data-theme="light"]{--page-back-color: rgb(240, 240, 240);--main-text-color: rgb(0, 0, 0);--main-back-color: rgb(255, 255, 255);--link-text-color: rgb(255, 76, 31);--target-highlight-color: rgb(125, 0, 255);--github-icon-url: url(https://img.icons8.com/material-sharp/64/000000/github.png);--twitter-icon-url: url(https://img.icons8.com/material-sharp/64/000000/twitter-squared.png);--email-icon-url: url(https://img.icons8.com/material-sharp/64/000000/email.png);--coffee-icon-url: url(https://img.icons8.com/material-sharp/64/000000/kawaii-coffee.png);--webring-icon-url: url(https://webring.xxiivv.com/icon.black.svg);--rss-icon-url: url(https://img.icons8.com/material/64/000000/rss.png);--search-icon-url: url(https://img.icons8.com/material-sharp/64/000000/search.png);--cc-icon-url: url(https://img.icons8.com/material-outlined/64/000000/creative-commons.png);--attribution-icon-url: url(https://img.icons8.com/material-outlined/64/000000/creative-commons-by.png);--non_com-icon-url: url(https://img.icons8.com/material-outlined/64/000000/creative-commons-nc.png);--share_alike-icon-url: url(https://img.icons8.com/material-outlined/64/000000/creative-commons-sa.png);--copyright-icon-url: url(https://img.icons8.com/material-outlined/64/000000/copyright.png)}

@ -0,0 +1,31 @@
@font-face {
font-family: 'MapleMono';
src: url("/fonts/MapleMono-Regular.ttf");
font-weight: normal;
font-style: normal;
font-display: block
}
@font-face {
font-family: 'MapleMono';
src: url("/fonts/MapleMono-Bold.ttf");
font-weight: bold;
font-style: normal;
font-display: block
}
@font-face {
font-family: 'MapleMono';
src: url("/fonts/MapleMono-Italic.ttf");
font-weight: normal;
font-style: italic;
font-display: block
}
@font-face {
font-family: 'MapleMono';
src: url("/fonts/MapleMono-Bolditalic.ttf");
font-weight: bold;
font-style: italic;
font-display: block
}

@ -0,0 +1,364 @@
@import "theme/dark";
@import "theme/light";
:root {
--text-0: rgba(0, 0, 0, 87%);
--text-1: rgba(0, 0, 0, 66%);
--bordercl: rebeccapurple;
--bg-0: #fff;
--bg-1: #f2f2f2;
--primary-color: #ef5350;
--hover-color: white;
}
// -------------- THEME SWITCHER -------------- //
@mixin dark-appearance {
filter: invert(1);
img {
filter: invert(1);
&.ioda {
filter: invert(0);
}
}
}
body[a="dark"] {
@include dark-appearance;
}
@media (prefers-color-scheme: dark) {
body[a="auto"] {
@include dark-appearance;
}
}
// -------------------------------------------- //
// bg color is also needed in html in order to
// block body's background propagation
// see: https://stackoverflow.com/a/61265706
html,
input,
select,
textarea,
label,
button {
color: var(--main-text-color);
background-color: var(--page-back-color);
font-family: 'MapleMono';
font-size: 1rem;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
.post-meta {
text-align: right;
}
h2,
h3,
h4,
h5,
h6 {
margin-top: 3rem;
}
hr {
margin: 2rem 0;
}
p {
margin: 1rem 0;
}
li {
margin: 0.4rem 0;
}
*:target {
background-color: var(--target-highlight-color);
color: var(--main-back-color);
}
.wrapper {
position: relative;
background-color: var(--main-back-color);
min-height: calc(100vh - 8rem);
max-width: 70ch;
margin: 2rem auto;
padding: 2rem 2rem;
}
hr {
margin: 2rem 0;
text-align: center;
border: 0;
color: var(--main-text-color);
&:before {
content: "| | |";
}
&:after {
content: attr(data-content) "| | |";
}
}
table {
width: 100%;
}
table,
th,
td {
border: thin solid var(--main-text-color);
border-collapse: collapse;
padding: 0.4rem;
}
code {
color: white;
background: black;
}
code {
color: var(--main-back-color);
background-color: var(--main-text-color);
padding: 0.15rem;
}
div.highlighter-rouge code {
display: block;
overflow-x: auto;
white-space: pre-wrap;
padding: 1rem;
}
blockquote {
font-style: italic;
border: thin solid black;
padding: 1rem;
p {
margin: 0;
}
}
img {
max-width: 100%;
display: block;
margin: 0 auto;
}
a {
color: var(--link-text-color);
cursor: pointer;
}
.post_date {
font-size: 1rem;
font-style: italic;
font-weight: bold;
margin-bottom: 2rem;
margin-right: 1rem;
}
.github_icon {
content: var(--github-icon-url);
}
.twitter_icon {
content: var(--twitter-icon-url);
}
.email_icon {
content: var(--email-icon-url);
}
.coffee_icon {
content: var(--coffee-icon-url);
}
.search_icon {
content: var(--search-icon-url);
}
.webring_icon {
content: var(--webring-icon-url);
}
.rss_icon {
content: var(--rss-icon-url);
}
a.cc_list {
text-decoration: none;
}
.copyright_icon {
content: var(--copyright-icon-url);
height: 16px;
margin: -3px;
}
.cc_icon {
content: var(--cc-icon-url);
height: 16px;
margin: -3px;
}
.attribution_icon {
content: var(--attribution-icon-url);
height: 16px;
margin: -3px;
}
.non_com_icon {
content: var(--non_com-icon-url);
height: 16px;
margin: -3px;
}
.share_alike_icon {
content: var(--share_alike-icon-url);
height: 16px;
margin: -3px;
}
.octicon:hover {
visibility: hidden;
}
h1 .octicon {
margin-left: -2.4em;
margin-right: calc(2.4em - 1.8em);
}
h2 .octicon {
margin-left: -2.9em;
margin-right: calc(2.9em - 1.8em);
}
h3 .octicon {
margin-left: -3.4em;
margin-right: calc(3.4em - 1.8em);
}
h4 .octicon {
margin-left: -3.9em;
margin-right: calc(3.9em - 1.8em);
}
h5 .octicon {
margin-left: -4.4em;
margin-right: calc(4.4em - 1.8em);
}
h6 .octicon {
margin-left: -4.9em;
margin-right: calc(4.9em - 1.8em);
}
.octicon {
fill: currentColor;
visibility: visible;
pointer-events: all;
vertical-align: middle;
width: 1.2em;
height: 1.2em;
}
input,
select,
textarea,
label,
button {
border-radius: 0.3em;
margin-left: 0;
}
fieldset {
border: none;
padding: 0;
}
.textfield {
max-width: 100%;
padding-bottom: 1rem;
}
.narrowfield {
width: 420px;
}
.hp {
display: none;
}
textarea {
vertical-align: top;
}
.textfield__input {
border: 1px solid rgba(0, 0, 0, 0.12);
border-radius: 0.3em;
padding: 0.4em;
width: 100%;
max-width: -webkit-fill-available;
}
.notify-me,
.g-recaptcha {
padding-bottom: 1rem;
max-width: min-content;
}
.button {
border: 1px solid rgba(0, 0, 0, 0.12);
background: var(--page-back-color);
border-radius: 0.3em;
padding: 0.4em;
overflow: hidden;
cursor: pointer;
}
button:hover {
background-color: var(--main-text-color);
color: var(--main-back-color);
}
footer {
margin-top: 2rem;
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: 0 auto;
display: flex;
align-items: center;
flex-direction: column;
padding: 0.5rem 0rem;
}
.soc {
display: flex;
align-items: center;
justify-content: center;
margin-right: 1rem;
}
.soc:hover {
color: var(--main-back-color);
background: var(--link-text-color);
}
.footer-info {
padding: var(--footer-padding);
}
.list {
margin-bottom: 2rem;
}
.horizon{
display: flex;
justify-content: end;
.start {
width: 100%;
}
}

@ -0,0 +1,19 @@
html[data-theme="dark"] {
--page-back-color: rgb(27, 27, 27);
--main-text-color: rgb(240, 240, 240);
--main-back-color: rgb(17, 17, 17);
--link-text-color: rgb(120, 217, 113);
--target-highlight-color: rgb(255, 255, 0);
--github-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/github.png);
--twitter-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/twitter-squared.png);
--email-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/email.png);
--coffee-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/kawaii-coffee.png);
--webring-icon-url: url(https://webring.xxiivv.com/icon.white.svg);
--rss-icon-url: url(https://img.icons8.com/material/64/f0f0f0/rss.png);
--search-icon-url: url(https://img.icons8.com/material-sharp/64/f0f0f0/search.png);
--cc-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/creative-commons.png);
--attribution-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/creative-commons-by.png);
--non_com-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/creative-commons-nc.png);
--share_alike-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/creative-commons-sa.png);
--copyright-icon-url: url(https://img.icons8.com/material-outlined/64/f0f0f0/copyright.png);
}

@ -0,0 +1,19 @@
html[data-theme="light"] {
--page-back-color: rgb(240, 240, 240);
--main-text-color: rgb(0, 0, 0);
--main-back-color: rgb(255, 255, 255);
--link-text-color: rgb(255, 76, 31);
--target-highlight-color: rgb(125, 0, 255);
--github-icon-url: url(https://img.icons8.com/material-sharp/64/000000/github.png);
--twitter-icon-url: url(https://img.icons8.com/material-sharp/64/000000/twitter-squared.png);
--email-icon-url: url(https://img.icons8.com/material-sharp/64/000000/email.png);
--coffee-icon-url: url(https://img.icons8.com/material-sharp/64/000000/kawaii-coffee.png);
--webring-icon-url: url(https://webring.xxiivv.com/icon.black.svg);
--rss-icon-url: url(https://img.icons8.com/material/64/000000/rss.png);
--search-icon-url: url(https://img.icons8.com/material-sharp/64/000000/search.png);
--cc-icon-url: url(https://img.icons8.com/material-outlined/64/000000/creative-commons.png);
--attribution-icon-url: url(https://img.icons8.com/material-outlined/64/000000/creative-commons-by.png);
--non_com-icon-url: url(https://img.icons8.com/material-outlined/64/000000/creative-commons-nc.png);
--share_alike-icon-url: url(https://img.icons8.com/material-outlined/64/000000/creative-commons-sa.png);
--copyright-icon-url: url(https://img.icons8.com/material-outlined/64/000000/copyright.png);
}

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -0,0 +1,23 @@
function setTheme(mode) {
localStorage.setItem("theme-storage", mode);
if (mode === "dark") {
document.documentElement.setAttribute('data-theme', 'dark')
document.getElementById("dark-mode-toggle").innerHTML = "<i data-feather=\"sun\"></i>";
feather.replace()
} else if (mode === "light") {
document.documentElement.setAttribute('data-theme', 'light')
document.getElementById("dark-mode-toggle").innerHTML = "<i data-feather=\"moon\"></i>";
feather.replace()
}
}
function toggleTheme() {
if (localStorage.getItem("theme-storage") === "light") {
setTheme("dark");
} else if (localStorage.getItem("theme-storage") === "dark") {
setTheme("light");
}
}
var savedTheme = localStorage.getItem("theme-storage") || "light";
setTheme(savedTheme);

@ -0,0 +1,21 @@
{% import "macros/macros.html" as post_macros %}
<!DOCTYPE html>
<html>
{% include "partials/header.html" %}
<body>
<div class="content">
<div class="wrapper">
{% include "partials/nav.html" %}
{# Post page is the default #}
{% block main_content %}
Nothing here?!
{% endblock main_content %}
</div>
</div>
</body>
</html>

@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block content %}
<h1 class="title">
<title>
{{ section.title }}
</title>
</h1>
<ul>
<!-- If you are using pagination, section.pages will be empty. You need to use the paginator object -->
{% for page in section.pages %}
<li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li>
{% endfor %}
</ul>
{% endblock content %}

@ -0,0 +1 @@
{% extends "posts.html" %}

@ -0,0 +1,128 @@
{% macro list_posts(pages, tag_name=false) %}
<ul>
{% if tag_name %}
<li>{{ term.name }}</li>
{% else %}
<li>blog posts</li>
{% endif -%}
<ul>
{%- for page in pages %}
{%- if page.draft %}
{% continue %}
{% endif -%}
<li >
{{ page.date | date(format="%Y-%m-%d") }} <a href={{ page.permalink }}>{{page.title}}</a>
</li>
{% endfor -%}
</ul>
</ul>
{% endmacro list_posts %}
{% macro tags(page, short=false) %}
{%- if page.taxonomies and page.taxonomies.tags %}
<span class="post-tags-inline">
{%- if short %}
::
{%- set sep = "," -%}
{% else %}
:: tags:&nbsp;
{%- set sep = "&nbsp;" -%}
{% endif -%}
{%- for tag in page.taxonomies.tags %}
<a class="post-tag" href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}">#{{ tag }}</a>
{%- if not loop.last %}{{ sep | safe }}{% endif -%}
{% endfor -%}
</span>
{% endif -%}
{% endmacro tags %}
{% macro page_header(title) %}
<h1 >
{{ title }}
</h1>
{% endmacro content %}
{% macro content(page) %}
<main>
{% set words = page.word_count %}
{% set time = page.reading_time %}
{% if time < 1 %}
{% set time = 1 %}
{% endif %}
<article>
<div class="title">
{#<h1 class="title">{{ page.title }}</h1>#}
{{ post_macros::page_header(title=page.title) }}
{% if page.date %}
<div class="meta">
<span class="post_date">{{ page.date | date(format="%Y-%m-%d") }}</span>|
{{ time }} {% if time > 1 %} mins{% else %}min{% endif %}
{% if page.draft %}
|<span class="draft-label">DRAFT</span>
{% endif %}
</div>
{% if page.taxonomies and page.taxonomies.tags %}
<br>
tags:
{% for tag in page.taxonomies.tags %}
<a href={{ get_taxonomy_url(kind='tags', name=tag) | safe }}>
{{ tag }}</a>{% if loop.index != page.taxonomies.tags | length %},{% endif %}
{% endfor %}
{% endif %}
{% endif %}
</div>
{% if page.extra.tldr %}
<div class="tldr">
<strong>tl;dr:</strong>
{{ page.extra.tldr }}
</div>
{% endif %}
{# Optional table of contents #}
{% if config.extra.toc | default(value=false) %}
{% if page.toc %}
<h1>Table of Contents</h1>
<ul>
{% for h1 in page.toc %}
<li>
<a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
{% if h1.children %}
<ul>
{% for h2 in h1.children %}
<li>
<a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
</li>
{% if h2.children %}
<ul>
{% for h3 in h2.children %}
<li>
<a href="{{ h3.permalink | safe }}">{{ h3.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
<section class="body">
{{ page.content | safe }}
</section>
</article>
</main>
{% endmacro content %}

@ -0,0 +1,4 @@
{% extends "base.html" %}
{% block main_content %}
{{ post_macros::content(page=page)}}
{% endblock main_content %}

@ -0,0 +1,20 @@
<footer>
<div style="display:flex">
{% for social in config.extra.social %}
<a class="soc" href={{ social.url }} title={{ social.name }}>
<i data-feather={{ social.icon }}></i>
</a>
{% endfor %}
</div>
<div class="footer-info">
{{ now() | date(format="%Y") }} © {{ config.extra.copyright }} | <a
href="https://beian.miit.gov.cn/" target="_blank">{{ config.extra.icp | default(value="icpcode") }}</a>
</div>
</footer>
{% if config.extra.social %}
<script>
feather.replace();
</script>
{% endif %}

@ -0,0 +1,53 @@
{% import "macros/macros.html" as post_macros %}
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{# Site title #}
{% set current_path = current_path | default(value="/") %}
{% if current_path == "/" %}
<title>
{{ config.title }}
</title>
{% else %}
<title>
{{ page.title | default(value=config.title) | default(value="Post") }}
</title>
{% endif %}
{# Favicon #}
{% if config.extra.favicon %}
<link rel="icon" type="image/png" href={{ config.extra.favicon }} />
{% endif %}
{# Font from cdn or disk #}
{% if config.extra.use_cdn | default(value=false) %}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jetbrains-mono@1.0.6/css/jetbrains-mono.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/space-grotesk@4.5.8/index.min.css">
{% else %}
<link href={{ get_url(path="fonts.css") }} rel="stylesheet" />
{% endif %}
{# if need icon, load feather.js #}
{% if config.extra.social and config.extra.useCDN | default(value=false) %}
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
{% elif config.extra.social or config.extra.mode == "toggle" %}
<script src={{ get_url(path="js/feather.min.js") }}></script>
{% endif %}
{# RSS #}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }}" href="{{ get_url(path="atom.xml", trailing_slash=false) }}">
<link rel="stylesheet" type="text/css" media="screen" href={{ get_url(path="no-style-please.css") }} />
{% if config.extra.stylesheets %}
{% for stylesheet in config.extra.stylesheets %}
<link rel="stylesheet" href="{{ get_url(path=stylesheet) }}">
{% endfor %}
{% endif %}
</head>

@ -0,0 +1,15 @@
<header>
<nav class="horizon">
{% set current_path = current_path | default(value="/") %}
{% if current_path =="/" or current_path =="/posts/" or current_path is starting_with("/page/") %}
{% else %}
<a href="/" class="start">••</a>
{% endif %}
{% if config.extra.mode == "toggle" %}
<a id="dark-mode-toggle" onclick="toggleTheme()" href=""></a>
<script src={{ get_url(path="/js/themetoggle.js") }}></script>
{% endif %}
</nav>
</header>

@ -0,0 +1,33 @@
{% extends "base.html" %}
{% block main_content %}
<h1>{{ config.title }}</h1>
<main class="list">
{%- if paginator %}
{%- set show_pages = paginator.pages -%}
{% else %}
{% set section = get_section(path="posts/_index.md") %}
{%- set show_pages = section.pages -%}
{% endif -%}
{{ post_macros::list_posts(pages=show_pages) }}
</main>
{% if paginator %}
<ul class="pagination">
{% if paginator.previous %}
<span class="page-item page-prev">
<a href={{ paginator.previous }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
</span>
{% endif %}
{% if paginator.next %}
<span class="page-item page-next">
<a href={{ paginator.next }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
</span>
{% endif %}
</ul>
{% endif %}
{% include "partials/footer.html" %}
{% endblock main_content %}

@ -0,0 +1,19 @@
{% extends "index.html" %}
{% block main_content %}
<h1 class="page-title">{{ config.extra.translations[lang][0].all_tags }}</h1>
<div class="tag-cloud">
<ul class="tags">
{% for term in terms %}
<li>
<a href="{{ term.permalink | safe }}">
{{ term.name }} ({{ term.pages | length }} post{{ term.pages | length | pluralize }})
</a>
</li>
{% endfor %}
</ul>
</div>
{% endblock main_content %}

@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block main_content %}
{{ post_macros::list_posts(pages=term.pages,tag_name=true) }}
{% endblock main_content %}
Loading…
Cancel
Save