summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreatradish <[email protected]>2022-04-09 19:34:05 +0800
committereatradish <[email protected]>2022-04-09 19:34:05 +0800
commit4165b2c0d86d1e3f47a7caf9a086798e51315f3b (patch)
tree095511e33c1eeab5a7888f73a41e06de1155478f
downloadSeje2-4165b2c0d86d1e3f47a7caf9a086798e51315f3b.tar.gz
Seje2-4165b2c0d86d1e3f47a7caf9a086798e51315f3b.tar.bz2
Seje2-4165b2c0d86d1e3f47a7caf9a086798e51315f3b.zip
init
-rw-r--r--config.toml29
-rw-r--r--content/_index.md5
-rw-r--r--content/archives/_index.md3
-rw-r--r--content/test.md14
-rw-r--r--content/test1.md12
-rw-r--r--templates/404.html0
-rw-r--r--templates/archives.html28
-rw-r--r--templates/base.html68
-rw-r--r--templates/home.html29
-rw-r--r--templates/macros.html16
-rw-r--r--templates/navbar.html16
-rw-r--r--templates/page.html61
-rw-r--r--templates/section.html42
-rw-r--r--templates/shortcodes/shikwasa.html16
m---------themes/Seje20
15 files changed, 339 insertions, 0 deletions
diff --git a/config.toml b/config.toml
new file mode 100644
index 0000000..b9c9eb9
--- /dev/null
+++ b/config.toml
@@ -0,0 +1,29 @@
+# The URL the site will be built for
+base_url = "https://blog.utopiospgere.net"
+theme = "Seje2"
+# Whether to automatically compile all Sass files in the sass directory
+compile_sass = true
+default_language = "zh-tw"
+
+# Whether to build a search index to be used later on by a JavaScript library
+build_search_index = false
+
+[markdown]
+# Whether to do syntax highlighting
+# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
+highlight_code = false
+
+[extra]
+# Put all your custom variables here
+
+[languages.zh-tw.translations]
+title = "寫嘢"
+home = "主頁"
+archives = "歸檔"
+about = "關於"
+rss = "訂閱"
+more = "查看全文"
+olderArticle = "舊文"
+newer = "上一篇"
+older = "下一篇"
+loading = "加載中..."
diff --git a/content/_index.md b/content/_index.md
new file mode 100644
index 0000000..d542b86
--- /dev/null
+++ b/content/_index.md
@@ -0,0 +1,5 @@
++++
+template = "home.html"
+sort_by = "date"
+paginate_by = 10
++++
diff --git a/content/archives/_index.md b/content/archives/_index.md
new file mode 100644
index 0000000..7677746
--- /dev/null
+++ b/content/archives/_index.md
@@ -0,0 +1,3 @@
++++
+template = "archives.html"
++++
diff --git a/content/test.md b/content/test.md
new file mode 100644
index 0000000..baeb41d
--- /dev/null
+++ b/content/test.md
@@ -0,0 +1,14 @@
++++
+title = "夢記・二"
+date = 2002-10-02T15:00:00Z
++++
+
+又夢見了那位決定離我遠去的人,總是夢見我們重新相逢的日子⋯⋯或者是,分別前的日子。
+
+我夢見她跟我說,我也是一步步走著過來的,我發現錢省不了,省下的錢都買零食去了,我喜歡畫畫,我才有今天這個樣子⋯⋯哎呀你不要看不起自己,你現在這樣不代表以後也這樣。
+
+我如何回應她的呢?一次所謂的「藝術家協會分享」的事情,她說我做的事情不可理喻,我像她道歉,但是我如何道歉的呢?我把自己行為那自認「理性」告訴了她,她什麼都沒有說,離我而去。
+
+之前一時不明這到底為何,後來愈發覺得,當我預設了立場,把我的理性至於高地,從以貶低她人的意志,我不知道,我什麼時候變得如此高高在上之嘴臉了?
+
+於是,我也想加入到她之中去了,還在原地的人,會覺得我是「犬儒」「優於孤獨」罷了,可是,我想為他人而活,我的正義如是說。「犬儒」?不,我只是厭倦了,甚至是厭惡這些沒有「人」,高高在上姿態的敘事罷了。
diff --git a/content/test1.md b/content/test1.md
new file mode 100644
index 0000000..114b70a
--- /dev/null
+++ b/content/test1.md
@@ -0,0 +1,12 @@
++++
+title = "夢記・一"
+date = 2003-10-02T15:00:00Z
++++
+
+徹夜趕路,不知已經走了多少路,只是走著,一切都不能停歇,停歇只會讓自己進入無限孤獨中,孤獨,便開始想著找人去擺脫孤獨,但是,我的經歷,還暫時不能分享給任何人。
+
+又看見了她,「又見到你了」,我還是休息吧。我以前見過她好幾次了,她飽食卻也總是說「我還是餓」。
+
+她開始跟我說她的經歷,「好幾次,我找到路上行走的人,我想,至少能讓我飽食一頓吧,她們卻無情講我踢開,她們難道不孤獨嗎?不想找人傾訴嗎?」
+
+我不知道該怎麼回答她,我在自言自語,「你知道嗎?無論我再好,注定你身上的所有你擁有的東西,都是要離開的」無論如何,無論如何全力追隨,都沒有用⋯⋯ \ No newline at end of file
diff --git a/templates/404.html b/templates/404.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/templates/404.html
diff --git a/templates/archives.html b/templates/archives.html
new file mode 100644
index 0000000..e691c86
--- /dev/null
+++ b/templates/archives.html
@@ -0,0 +1,28 @@
+{% extends "base.html" %}
+
+{% block content %}
+<section class="archive">
+ <ul class="post-archive">
+ {# Group the posts by year #}
+ {% set map = get_section(path="_index.md") | get(key="pages") | group_by(attribute="year") %}
+ {% set_global years = [] %}
+ {# Convert the years map to an array (since maps do not have determined order) #}
+ {% for year, ignored in map %}
+ {% set_global years = years | concat(with=year) %}
+ {% endfor %}
+
+ {% for year in years | sort | reverse %}
+ <div class="years">
+ {% set posts = map[year] %}
+ <div class="year">{{ year }}</div>
+ {% for post in posts %}
+ <li class="post-item">
+ <span class="post-date">{{ post.date | date(format="%m/%d") }}</span>
+ <a href="{{ post.permalink }}" class="post-title">{{ post.title }}</a>
+ </li>
+ {% endfor %}
+ </div>
+ {% endfor %}
+ </ul>
+</section>
+{% endblock %}
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..eef6a39
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+ {% set sub_title = section.title | default(value=page.title | default(value='')) %}
+ {% if sub_title %}
+ {% set title = sub_title ~ ' - ' ~ trans(key="title") %}
+ {% else %}
+ {% set title = trans(key="title") %}
+ {% endif %}
+ {% set cn_font_family = "'Source Serif Pro', 'Source Han Serif SC', 'Noto Serif CJK SC', 'Noto Serif SC', serif" %}
+ {% set fallback_font_family = "'Source Serif Pro', 'Source Han Serif TC', 'Noto Serif CJK TC', 'Noto Serif TC', 'Noto Serif KR', 'Noto Serif SC', serif" %}
+ {% set fonts_url = "Noto+Serif+SC:wght@400;700" %}
+ {% set font_base_url = config.extra.seje_font_mirror | default(value="fonts.googleapis.com") %}
+ {% if lang == 'zh-cn' and not config.extra.seje_vertical_layout %}
+ {% set font_family = cn_font_family %}
+ {% else %}
+ {% set font_family = fallback_font_family %}
+ {% set fonts_url = "Noto+Serif+TC:wght@400;700&family=Noto+Serif+KR:wght@400;700&" ~ fonts_url %}
+ {% endif %}
+ {% if config.extra.seje_custom_fonts %}
+ {% set font_family = config.extra.seje_custom_fonts ~ ',' ~ font_family %}
+ {% endif %}
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
+ <title>{{ title }}</title>
+ <meta charset="utf-8">
+ <meta name="title" content="{{ title }}">
+ <meta name="description" content="{{ section.description | default(value=page.description | default(value=config.description)) }}">
+ <meta property="og:image:width" content="200" />
+ <meta property="og:image:height" content="200" />
+ <link rel="stylesheet" href="{{ config.base_url }}/style.css">
+ {% if config.extra.seje_darkmode == "auto" %}
+ <link rel="stylesheet" href="{{ config.base_url }}/autodarkmode.css">
+ {% elif config.extra.seje_darkmode == "always" %}
+ <link rel="stylesheet" href="{{ config.base_url }}/darkmode.css">
+ {% endif %}
+ {% if config.extra.seje_vertical_layout %}
+ <link rel="stylesheet" href="{{ config.base_url }}/vertical.css">
+ {% else %}
+ <style>
+ @media screen and (min-width: 320px) {
+ body {
+ font-size: calc(16px + 2 * ((100vw - 320px) / 960));
+ }
+ }
+ </style>
+ {% endif %}
+ <link rel="stylesheet" href="https://{{ font_base_url }}/css2?family=Source+Serif+Pro:wght@400;700&display=swap">
+ <link rel="stylesheet" href="https://{{ font_base_url }}/css2?family={{ fonts_url }}&display=swap">
+ <style>body { font-family: {{ font_family | safe }} }</style>
+ {% block metadata %}{# <meta property="og:image" content="/<%= theme.favicon %>"> #}{% endblock %}
+</head>
+<body>
+ {% block header %}
+ <header class="header">
+ <div class="blog-title"><a href="{{ config.base_url }}" class="logo">{{ trans(key="title") }}</a></div>
+ {% include "navbar.html" %}
+ </header>
+ {% endblock %}
+ <main class="main">
+ {% block content %}
+ {% endblock %}
+ </main>
+ {% block footer %}
+ <p class="license">{{ config.license | default(value='') }}</p>
+ {% endblock %}
+</body>
+</html>
diff --git a/templates/home.html b/templates/home.html
new file mode 100644
index 0000000..25c3032
--- /dev/null
+++ b/templates/home.html
@@ -0,0 +1,29 @@
+{% extends "base.html" %}
+
+{% import "macros.html" as macros %}
+
+{% block content %}
+<section class="posts">
+ {% for post in paginator.pages %}
+ <article class="post">
+ <div class="post-title"><a href="{{ post.permalink }}" class="post-title-link">{{ post.title }}</a></div>
+ <div class="post-content">
+ {% if config.extra.seje_show_summary_only %}
+ {{ post.summary }}
+ <a href="{{ post.permalink }}" class="More">More</a>
+ {% else %}
+ {{ post.content | safe }}
+ {% endif %}
+ </div>
+ <div class="post-meta">
+ {% if config.extra.seje_chinese_date %}
+ {{ macros::format_chinese_date(year=post.year, month=post.month, day=post.day) }}
+ {% else %}
+ {{ post.date|date(format="%Y/%m/%d") }}
+ {% endif %}
+ </div>
+ </article>
+ {% endfor %}
+{{ paginator.next }}
+</section>
+{% endblock %}
diff --git a/templates/macros.html b/templates/macros.html
new file mode 100644
index 0000000..7379b1b
--- /dev/null
+++ b/templates/macros.html
@@ -0,0 +1,16 @@
+{% macro format_chinese_date(year, month, day) %}
+{% set lut1 = ["〇", "一", "二", "三", "四", "五", "六", "七", "八", "九"] %}
+{% set lut2 = [
+ '一', '二', '三', '四',
+ '五', '六', '七', '八',
+ '九', '十', '十一', '十二',
+ '十三', '十四', '十五', '十六',
+ '十七', '十八', '十九', '二十',
+ '廿一', '廿二', '廿三', '廿四',
+ '廿五', '廿六', '廿七', '廿八',
+ '廿九', '三十', '三十一'] %}
+{% for c in year | as_str %}
+ {{ lut1 | nth(n=c | int) }}
+{% endfor %}
+年{{ lut2 | nth(n=month-1)}}月{{ lut2 | nth(n=day-1) }}日
+{% endmacro %}
diff --git a/templates/navbar.html b/templates/navbar.html
new file mode 100644
index 0000000..e50799d
--- /dev/null
+++ b/templates/navbar.html
@@ -0,0 +1,16 @@
+<nav class="navbar">
+ <ul class="menu">
+ {% set data = config.extra.seje_menu_links %}
+ {% for item in data %}
+ <li class="menu-item">
+ {% set url = item['url'] ~ '/'%}
+ {% set path = page.path|default(value = section.path) %}
+ {% if url == path or item['url'] == path %}
+ <a href="{{ item['url'] }}" class="current-menu-item-link">{{ trans(key=item['name']) }}</a>
+ {% else %}
+ <a href="{{ item['url'] }}" class="menu-item-link">{{ trans(key=item['name']) }}</a>
+ {% endif %}
+ </li>
+ {% endfor %}
+ </ul>
+</nav>
diff --git a/templates/page.html b/templates/page.html
new file mode 100644
index 0000000..48a1c74
--- /dev/null
+++ b/templates/page.html
@@ -0,0 +1,61 @@
+{% extends "base.html" %}
+
+{% import "macros.html" as macros %}
+
+{% block content %}
+<article class="post">
+ <div class="post-title">
+ <h1 class="title">{{ page.title }}</h1>
+ </div>
+ <div class="post-content">
+ {{ page.content | safe }}
+ </div>
+ <div class="post-meta">
+ <span class="post-time">
+ {% if config.extra.seje_chinese_date %}
+ {{ macros::format_chinese_date(year=page.year, month=page.month, day=page.day) }}
+ {% else %}
+ {{ page.date|date(format="%Y/%m/%d") }}
+ {% endif %}
+ </span>
+ </div>
+</article>
+
+<div class="prev_next">
+<nav id="prev_next">
+ <div class="prev">
+ {% if page.later %}
+ <p>Newer</p><a href="{{ page.later.permalink }}"><div class="article-nav-title">{{ page.later.title }}</div></a>
+ {% endif %}
+ </div>
+ <div class="next">
+ {% if page.earlier %}
+ <p>Older</p><a href="{{ page.earlier.permalink }}"><div class="article-nav-title">{{ page.earlier.title }}</div></a>
+ {% endif %}
+ </div>
+</nav>
+</div>
+
+<div class="post-comment">
+{# Discussion #}
+{% block comment %}
+{% if config.seje_disqus_shortname %}
+<section id="comments">
+ <div id="disqus_thread"></div>
+ <script type="text/javascript">
+ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
+ var disqus_shortname = "{{ config.seje_disqus_shortname }}"; // required: replace example with your forum shortname
+ /* * * DON'T EDIT BELOW THIS LINE * * */
+ (function () {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ 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 href="https://disqus.com/?ref_noscript">comments powered
+ by Disqus.</a></noscript>
+</section>
+{% endif %}
+{% endblock %}
+</div>
+{% endblock %}
diff --git a/templates/section.html b/templates/section.html
new file mode 100644
index 0000000..bca7f6b
--- /dev/null
+++ b/templates/section.html
@@ -0,0 +1,42 @@
+{% extends "base.html" %}
+
+{% import "macros.html" as macros %}
+
+{% block content %}
+<article class="post">
+ <div class="post-title">
+ <h1 class="title">{{ section.title }}</h1>
+ </div>
+ <div class="post-content">
+ {{ section.content | safe }}
+ </div>
+ <div class="post-meta">
+ <span class="post-time">
+ {% if config.extra.seje_chinese_date %}
+ {{ macros::format_chinese_date(year=section.extra.year, month=section.extra.month, day=section.extra.day) }}
+ {% else %}
+ {{ section.extra.date|date(format="%Y/%m/%d") }}
+ {% endif %}
+ </span>
+ </div>
+</article>
+
+<div class="prev_next">
+<nav id="prev_next">
+ <div class="prev">
+ {% if section.later %}
+ <p>Newer</p><a href="{{ section.later.permalink }}"><div class="article-nav-title">{{ section.later.title }}</div></a>
+ {% endif %}
+ </div>
+ <div class="next">
+ {% if section.earlier %}
+ <p>Older</p><a href="{{ section.earlier.permalink }}"><div class="article-nav-title">{{ section.earlier.title }}</div></a>
+ {% endif %}
+ </div>
+</nav>
+</div>
+
+<div class="post-comment">
+{# Discussion #}
+</div>
+{% endblock %}
diff --git a/templates/shortcodes/shikwasa.html b/templates/shortcodes/shikwasa.html
new file mode 100644
index 0000000..d29238d
--- /dev/null
+++ b/templates/shortcodes/shikwasa.html
@@ -0,0 +1,16 @@
+<div class="podcast">
+ <script>
+ const player = new Shikwasa({
+ container: () => document.querySelector('.podcast'),
+ audio: {
+ title: '{{subtitle}}',
+ artist: '{{author}}',
+ cover: '{{image}}',
+ src: '{{media}}',
+ },
+ fixed: {
+ type: 'static',
+ },
+ });
+ </script>
+</div>
diff --git a/themes/Seje2 b/themes/Seje2
new file mode 160000
+Subproject 3cc2d00771f6d7e5dd090d819bc41329450ce1e