summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/404.html17
-rw-r--r--templates/base.html26
-rw-r--r--templates/index.html62
-rw-r--r--templates/notes/page.html31
-rw-r--r--templates/notes/section.html31
-rw-r--r--templates/page.html15
-rw-r--r--templates/partials/footer.html10
-rw-r--r--templates/partials/header.html19
-rw-r--r--templates/partials/note-list-item.html14
-rw-r--r--templates/partials/related-notes.html11
-rw-r--r--templates/partials/related-software.html11
-rw-r--r--templates/partials/software-list-item.html4
-rw-r--r--templates/partials/toc.html10
-rw-r--r--templates/software/page.html27
-rw-r--r--templates/software/section.html24
-rw-r--r--templates/tags/list.html18
-rw-r--r--templates/tags/single.html20
17 files changed, 350 insertions, 0 deletions
diff --git a/templates/404.html b/templates/404.html
new file mode 100644
index 0000000..408e222
--- /dev/null
+++ b/templates/404.html
@@ -0,0 +1,17 @@
+{% extends "base.html" %}
+
+{% block title %}404 | {{ config.title }}{% endblock title %}
+{% block description %}ページが見つかりませんでした。{% endblock description %}
+
+{% block content %}
+<section class="site-container error-page" aria-labelledby="error-title">
+ <p class="error-code">404</p>
+ <h1 id="error-title">ページが見つかりません。</h1>
+ <p>URLが変更されたか、ページが存在しない可能性があります。</p>
+ <nav aria-label="エラーページからの移動">
+ <a href="{{ get_url(path='@/_index.md') }}">Home</a>
+ <a href="{{ get_url(path='@/notes/_index.md') }}">Notes</a>
+ <a href="{{ get_url(path='@/software/_index.md') }}">Software</a>
+ </nav>
+</section>
+{% endblock content %}
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..543259a
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<html lang="ja">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="color-scheme" content="light dark">
+ <meta name="description" content="{% block description %}{{ config.description }}{% endblock description %}">
+ <title>{% block title %}{{ config.title }}{% endblock title %}</title>
+ <link rel="canonical" href="{{ current_url | default(value=config.base_url) }}">
+ <link rel="icon" href="{{ get_url(path='favicon.svg') }}" type="image/svg+xml">
+ <link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom" href="{{ get_url(path='atom.xml', trailing_slash=false) }}">
+ <link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS" href="{{ get_url(path='rss.xml', trailing_slash=false) }}">
+ <link id="syntax-light" rel="stylesheet" href="{{ get_url(path='giallo-light.css') }}" media="(prefers-color-scheme: light)">
+ <link id="syntax-dark" rel="stylesheet" href="{{ get_url(path='giallo-dark.css') }}" media="(prefers-color-scheme: dark)">
+ <link rel="stylesheet" href="{{ get_url(path='main.css') }}">
+ <script src="{{ get_url(path='js/theme.js') }}" defer></script>
+</head>
+<body>
+ <a class="skip-link" href="#main-content">本文へ移動</a>
+ {% include "partials/header.html" %}
+ <main id="main-content" class="site-main" tabindex="-1">
+ {% block content %}{% endblock content %}
+ </main>
+ {% include "partials/footer.html" %}
+</body>
+</html>
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..3f0c8c6
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,62 @@
+{% extends "base.html" %}
+
+{% block title %}{{ config.title }}{% endblock title %}
+{% block description %}{{ section.description }}{% endblock description %}
+
+{% block content %}
+{% set about_url = get_url(path='@/about.md') %}
+{% set notes_url = get_url(path='@/notes/_index.md') %}
+{% set software_url = get_url(path='@/software/_index.md') %}
+{% set software = get_section(path='software/_index.md') %}
+{% set notes = get_section(path='notes/_index.md') %}
+<section class="site-container home-intro" aria-labelledby="home-title">
+ <h1 id="home-title">{{ section.title }}</h1>
+ <p>{{ section.description }}</p>
+</section>
+
+<div class="site-container home-sections">
+ <section class="home-section" aria-labelledby="latest-notes">
+ <div class="section-heading">
+ <h2 id="latest-notes">最近のNotes</h2>
+ <a href="{{ notes_url }}">すべてのNotes</a>
+ </div>
+ {% if notes.pages %}
+ <div class="note-list compact-list">
+ {% for note in notes.pages %}
+ {% if loop.index <= config.extra.home_notes_limit %}
+ {% set item = note %}
+ {% include "partials/note-list-item.html" %}
+ {% endif %}
+ {% endfor %}
+ </div>
+ {% else %}
+ <p class="empty-state">ノートは準備中です。新しい記録はここに追加されます。</p>
+ {% endif %}
+ </section>
+
+ <section class="home-section" aria-labelledby="home-software">
+ <div class="section-heading">
+ <h2 id="home-software">Software</h2>
+ <a href="{{ software_url }}">すべてのSoftware</a>
+ </div>
+ {% if software.pages %}
+ <div class="software-list compact-list">
+ {% for software_item in software.pages %}
+ {% if loop.index <= config.extra.home_software_limit %}
+ {% set item = software_item %}
+ {% include "partials/software-list-item.html" %}
+ {% endif %}
+ {% endfor %}
+ </div>
+ {% else %}
+ <p class="empty-state">Softwareは準備中です。</p>
+ {% endif %}
+ </section>
+
+ <section class="home-about" aria-labelledby="home-about-title">
+ <h2 id="home-about-title">このサイトについて</h2>
+ <p>考えたこと、読んだこと、調べたことと、作成したソフトウェアを長期的に残すための個人アーカイブです。</p>
+ <a href="{{ about_url }}">Aboutを読む</a>
+ </section>
+</div>
+{% endblock content %}
diff --git a/templates/notes/page.html b/templates/notes/page.html
new file mode 100644
index 0000000..bcabff8
--- /dev/null
+++ b/templates/notes/page.html
@@ -0,0 +1,31 @@
+{% extends "base.html" %}
+
+{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
+{% block description %}{{ page.description | default(value=config.description) }}{% endblock description %}
+
+{% block content %}
+<article class="site-container article-page">
+ <header class="article-header narrow">
+ <p class="article-kind"><a href="{{ get_url(path='@/notes/_index.md') }}">Notes</a></p>
+ <h1>{{ page.title }}</h1>
+ <dl class="article-dates">
+ <div><dt>公開</dt><dd><time datetime="{{ page.date }}">{{ page.date | date(format='%Y-%m-%d') }}</time></dd></div>
+ {% if page.updated %}<div><dt>更新</dt><dd><time datetime="{{ page.updated }}">{{ page.updated | date(format='%Y-%m-%d') }}</time></dd></div>{% endif %}
+ </dl>
+ {% if page.description %}<p class="article-description">{{ page.description }}</p>{% endif %}
+ </header>
+
+ {% if page.toc %}
+ <nav class="toc narrow" aria-label="目次">
+ <h2>目次</h2>
+ {{<toc.render headers={page.toc} />}}
+ </nav>
+ {% endif %}
+
+ <div class="prose">
+ {{ page.content | safe }}
+ </div>
+
+ {% include "partials/related-software.html" %}
+</article>
+{% endblock content %}
diff --git a/templates/notes/section.html b/templates/notes/section.html
new file mode 100644
index 0000000..4fc2675
--- /dev/null
+++ b/templates/notes/section.html
@@ -0,0 +1,31 @@
+{% extends "base.html" %}
+
+{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
+{% block description %}{{ section.description }}{% endblock description %}
+
+{% block content %}
+<div class="site-container listing-page">
+ <header class="page-header">
+ <h1>{{ section.title }}</h1>
+ <p>{{ section.description }}</p>
+ </header>
+
+ {% if section.pages %}
+ <div class="archive">
+ {% for year, pages in section.pages | group_by(attribute="year") %}
+ <section class="archive-year" aria-labelledby="year-{{ year }}">
+ <h2 id="year-{{ year }}">{{ year }}</h2>
+ <div class="note-list">
+ {% for note in pages %}
+ {% set item = note %}
+ {% include "partials/note-list-item.html" %}
+ {% endfor %}
+ </div>
+ </section>
+ {% endfor %}
+ </div>
+ {% else %}
+ <p class="empty-state">Notesはまだありません。</p>
+ {% endif %}
+</div>
+{% endblock content %}
diff --git a/templates/page.html b/templates/page.html
new file mode 100644
index 0000000..cc0494e
--- /dev/null
+++ b/templates/page.html
@@ -0,0 +1,15 @@
+{% extends "base.html" %}
+
+{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
+{% block description %}{{ page.description | default(value=config.description) }}{% endblock description %}
+
+{% block content %}
+<article class="site-container editorial-page">
+ <header class="page-header narrow">
+ <h1>{{ page.title }}</h1>
+ </header>
+ <div class="prose">
+ {{ page.content | safe }}
+ </div>
+</article>
+{% endblock content %}
diff --git a/templates/partials/footer.html b/templates/partials/footer.html
new file mode 100644
index 0000000..a04136f
--- /dev/null
+++ b/templates/partials/footer.html
@@ -0,0 +1,10 @@
+<footer class="site-footer">
+ <div class="site-container footer-inner">
+ <p>© {{ config.extra.copyright_year }} Takashi</p>
+ <nav aria-label="フッターナビゲーション">
+ <a href="{{ get_url(path='atom.xml', trailing_slash=false) }}">Atom</a>
+ <a href="{{ get_url(path='rss.xml', trailing_slash=false) }}">RSS</a>
+ <a href="mailto:{{ config.extra.mail }}">Mail</a>
+ </nav>
+ </div>
+</footer>
diff --git a/templates/partials/header.html b/templates/partials/header.html
new file mode 100644
index 0000000..dcd4ea2
--- /dev/null
+++ b/templates/partials/header.html
@@ -0,0 +1,19 @@
+{% set home_url = get_url(path='@/_index.md') %}
+{% set about_url = get_url(path='@/about.md') %}
+{% set software_url = get_url(path='@/software/_index.md') %}
+{% set notes_url = get_url(path='@/notes/_index.md') %}
+{% set active_path = current_path | default(value='') %}
+<header class="site-header">
+ <div class="site-container header-inner">
+ <a class="site-title" href="{{ home_url }}">{{ config.title }}</a>
+ <nav aria-label="メインナビゲーション">
+ <ul class="nav-list">
+ <li><a href="{{ home_url }}"{% if active_path == '/' %} aria-current="page"{% endif %}>Home</a></li>
+ <li><a href="{{ notes_url }}"{% if '/notes/' in active_path %} aria-current="page"{% endif %}>Notes</a></li>
+ <li><a href="{{ software_url }}"{% if '/software/' in active_path %} aria-current="page"{% endif %}>Software</a></li>
+ <li><a href="{{ about_url }}"{% if active_path == '/about/' %} aria-current="page"{% endif %}>About</a></li>
+ </ul>
+ </nav>
+ <button class="theme-toggle" type="button" data-theme-toggle aria-pressed="false" aria-label="ダークテーマに切り替える">Dark</button>
+ </div>
+</header>
diff --git a/templates/partials/note-list-item.html b/templates/partials/note-list-item.html
new file mode 100644
index 0000000..67ca8f7
--- /dev/null
+++ b/templates/partials/note-list-item.html
@@ -0,0 +1,14 @@
+<article class="note-list-item">
+ <time datetime="{{ item.date }}">{{ item.date | date(format='%Y-%m-%d') }}</time>
+ <div class="list-item-main">
+ <h3><a href="{{ item.permalink }}">{{ item.title }}</a></h3>
+ {% if item.description %}<p>{{ item.description }}</p>{% endif %}
+ {% if item.taxonomies.tags %}
+ <ul class="tag-list" aria-label="タグ">
+ {% for tag in item.taxonomies.tags %}
+ <li><a href="{{ get_taxonomy_url(kind='tags', term=tag) }}">{{ tag }}</a></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </div>
+</article>
diff --git a/templates/partials/related-notes.html b/templates/partials/related-notes.html
new file mode 100644
index 0000000..59cca8b
--- /dev/null
+++ b/templates/partials/related-notes.html
@@ -0,0 +1,11 @@
+{% if page.extra.related_notes %}
+<aside class="related-content" aria-labelledby="related-notes-title">
+ <h2 id="related-notes-title">関連Notes</h2>
+ <ul>
+ {% for path in page.extra.related_notes %}
+ {% set related = get_page(path=path) %}
+ <li><a href="{{ related.permalink }}">{{ related.title }}</a>{% if related.description %}<span>{{ related.description }}</span>{% endif %}</li>
+ {% endfor %}
+ </ul>
+</aside>
+{% endif %}
diff --git a/templates/partials/related-software.html b/templates/partials/related-software.html
new file mode 100644
index 0000000..a29df4f
--- /dev/null
+++ b/templates/partials/related-software.html
@@ -0,0 +1,11 @@
+{% if page.extra.related_software %}
+<aside class="related-content" aria-labelledby="related-software-title">
+ <h2 id="related-software-title">関連Software</h2>
+ <ul>
+ {% for path in page.extra.related_software %}
+ {% set related = get_page(path=path) %}
+ <li><a href="{{ related.permalink }}">{{ related.title }}</a>{% if related.description %}<span>{{ related.description }}</span>{% endif %}</li>
+ {% endfor %}
+ </ul>
+</aside>
+{% endif %}
diff --git a/templates/partials/software-list-item.html b/templates/partials/software-list-item.html
new file mode 100644
index 0000000..e6c970e
--- /dev/null
+++ b/templates/partials/software-list-item.html
@@ -0,0 +1,4 @@
+<article class="software-list-item">
+ <h3><a href="{{ item.permalink }}">{{ item.title }}</a></h3>
+ {% if item.description %}<p>{{ item.description }}</p>{% endif %}
+</article>
diff --git a/templates/partials/toc.html b/templates/partials/toc.html
new file mode 100644
index 0000000..2089d15
--- /dev/null
+++ b/templates/partials/toc.html
@@ -0,0 +1,10 @@
+{% component toc.render(headers: array) %}
+<ul>
+ {% for header in headers %}
+ <li>
+ <a href="{{ header.permalink | safe }}">{{ header.title }}</a>
+ {% if header.children %}{{<toc.render headers={header.children} />}}{% endif %}
+ </li>
+ {% endfor %}
+</ul>
+{% endcomponent toc.render %}
diff --git a/templates/software/page.html b/templates/software/page.html
new file mode 100644
index 0000000..513aee9
--- /dev/null
+++ b/templates/software/page.html
@@ -0,0 +1,27 @@
+{% extends "base.html" %}
+
+{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
+{% block description %}{{ page.description | default(value=config.description) }}{% endblock description %}
+
+{% block content %}
+<article class="site-container article-page software-page">
+ <header class="article-header narrow">
+ <p class="article-kind"><a href="{{ get_url(path='@/software/_index.md') }}">Software</a></p>
+ <h1>{{ page.title }}</h1>
+ {% if page.description %}<p class="article-description">{{ page.description }}</p>{% endif %}
+ </header>
+
+ <dl class="software-meta narrow">
+ {% if page.extra.language %}<div><dt>使用言語</dt><dd>{{ page.extra.language | join(sep=", ") }}</dd></div>{% endif %}
+ {% if page.extra.license %}<div><dt>ライセンス</dt><dd>{{ page.extra.license }}</dd></div>{% endif %}
+ <div><dt>Source</dt><dd><a class="external-link" href="{{ page.extra.source }}" rel="external">cgit</a></dd></div>
+ {% if page.extra.github_mirror %}<div><dt>Mirror</dt><dd><a class="external-link" href="{{ page.extra.github_mirror }}" rel="external">GitHub</a></dd></div>{% endif %}
+ </dl>
+
+ <div class="prose">
+ {{ page.content | safe }}
+ </div>
+
+ {% include "partials/related-notes.html" %}
+</article>
+{% endblock content %}
diff --git a/templates/software/section.html b/templates/software/section.html
new file mode 100644
index 0000000..813f793
--- /dev/null
+++ b/templates/software/section.html
@@ -0,0 +1,24 @@
+{% extends "base.html" %}
+
+{% block title %}{{ section.title }} | {{ config.title }}{% endblock title %}
+{% block description %}{{ section.description }}{% endblock description %}
+
+{% block content %}
+<div class="site-container listing-page">
+ <header class="page-header">
+ <h1>{{ section.title }}</h1>
+ <p>{{ section.description }}</p>
+ </header>
+ {% if section.pages %}
+ <div class="software-list software-list-full">
+ {% for software_item in section.pages %}
+ {% set item = software_item %}
+ {% include "partials/software-list-item.html" %}
+ {% endfor %}
+ </div>
+ {% else %}
+ <p class="empty-state">Softwareはまだありません。</p>
+ {% endif %}
+ <p class="source-note">ソースコードの正本は各Softwareから自前cgitへ案内します。</p>
+</div>
+{% endblock content %}
diff --git a/templates/tags/list.html b/templates/tags/list.html
new file mode 100644
index 0000000..6567506
--- /dev/null
+++ b/templates/tags/list.html
@@ -0,0 +1,18 @@
+{% extends "base.html" %}
+
+{% block title %}タグ | {{ config.title }}{% endblock title %}
+{% block description %}Notesを分類するタグの一覧。{% endblock description %}
+
+{% block content %}
+<div class="site-container listing-page taxonomy-page">
+ <header class="page-header">
+ <h1>タグ</h1>
+ <p>主題を横断してNotesを探すための索引です。</p>
+ </header>
+ <ul class="taxonomy-list">
+ {% for term in terms %}
+ <li><a href="{{ term.permalink }}">{{ term.name }}</a><span>{{ term.page_count }}件</span></li>
+ {% endfor %}
+ </ul>
+</div>
+{% endblock content %}
diff --git a/templates/tags/single.html b/templates/tags/single.html
new file mode 100644
index 0000000..2ec6fa1
--- /dev/null
+++ b/templates/tags/single.html
@@ -0,0 +1,20 @@
+{% extends "base.html" %}
+
+{% block title %}{{ term.name }} | タグ | {{ config.title }}{% endblock title %}
+{% block description %}タグ「{{ term.name }}」の記事一覧。{% endblock description %}
+
+{% block content %}
+<div class="site-container listing-page">
+ <header class="page-header">
+ <p class="article-kind"><a href="{{ get_url(path='tags', trailing_slash=true) }}">タグ</a></p>
+ <h1>{{ term.name }}</h1>
+ <p>{{ term.page_count }}件の記録</p>
+ </header>
+ <div class="note-list">
+ {% for page in term.pages %}
+ {% set item = page %}
+ {% include "partials/note-list-item.html" %}
+ {% endfor %}
+ </div>
+</div>
+{% endblock content %}