diff options
Diffstat (limited to 'templates/partials')
| -rw-r--r-- | templates/partials/footer.html | 10 | ||||
| -rw-r--r-- | templates/partials/header.html | 19 | ||||
| -rw-r--r-- | templates/partials/note-list-item.html | 14 | ||||
| -rw-r--r-- | templates/partials/related-notes.html | 11 | ||||
| -rw-r--r-- | templates/partials/related-software.html | 11 | ||||
| -rw-r--r-- | templates/partials/software-list-item.html | 4 | ||||
| -rw-r--r-- | templates/partials/toc.html | 10 |
7 files changed, 79 insertions, 0 deletions
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 %} |
