first commit
This commit is contained in:
16
themes/terminimal/templates/404.html
Normal file
16
themes/terminimal/templates/404.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends "index.html" %}
|
||||
|
||||
{% block title %}
|
||||
404
|
||||
{% endblock title %}
|
||||
|
||||
{% block header_menu %}
|
||||
{{ menu_macros::menu_for(config=config, current_item="") }}
|
||||
{% endblock header_menu %}
|
||||
|
||||
{% block content %}
|
||||
<div class="post">
|
||||
<h1 class="post-title">{% block heading %}Lost?{% endblock heading %}</h1>
|
||||
<p>{% block message %}This page does not exist.{% endblock message %}</p>
|
||||
</div>
|
||||
{% endblock content %}
|
11
themes/terminimal/templates/archive.html
Normal file
11
themes/terminimal/templates/archive.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{% extends "index.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="post">
|
||||
<h1 class="post-title">{{ page.title }}</h1>
|
||||
|
||||
{% set section = get_section(path="_index.md") %}
|
||||
|
||||
{{ post_macros::list_posts(pages=section.pages) }}
|
||||
</div>
|
||||
{% endblock content %}
|
123
themes/terminimal/templates/index.html
Normal file
123
themes/terminimal/templates/index.html
Normal file
@@ -0,0 +1,123 @@
|
||||
{% import "macros/date.html" as date_macros -%}
|
||||
{% import "macros/head.html" as head_macros -%}
|
||||
{% import "macros/menu.html" as menu_macros -%}
|
||||
{% import "macros/post.html" as post_macros -%}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="{%- if config.default_language -%}{{ config.default_language }}{%- else -%}en{%- endif -%}">
|
||||
|
||||
<head>
|
||||
<title>{%- block title %}{{ config.title }}{% endblock title -%}</title>
|
||||
{{ head_macros::head(config=config) }}
|
||||
|
||||
{%- if config.generate_feed %}
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="rss.xml") | safe }}">
|
||||
{% endif -%}
|
||||
|
||||
{%- if config.extra.favicon %}
|
||||
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") | safe }}" href="{{ config.extra.favicon | safe }}">
|
||||
{% endif -%}
|
||||
|
||||
{%- block extra_head %}
|
||||
{% endblock extra_head -%}
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
{% block header %}
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
{%- if config.logo_home_link %}
|
||||
{% set logo_link = config.logo_home_link %}
|
||||
{% else %}
|
||||
{% set logo_link = config.base_url %}
|
||||
{% endif -%}
|
||||
<a href="{{ logo_link | safe }}" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
{% block logo_content %}
|
||||
{%- if config.extra.logo_text %}
|
||||
{{ config.extra.logo_text }}
|
||||
{% else %}
|
||||
Terminimal theme
|
||||
{% endif -%}
|
||||
{% endblock logo_content %}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% block header_menu %}
|
||||
{{ menu_macros::menu(config=config, current_path=current_path) }}
|
||||
{% endblock header_menu %}
|
||||
</header>
|
||||
{% endblock header %}
|
||||
|
||||
<div class="content">
|
||||
{% block content %}
|
||||
<div class="posts">
|
||||
{%- if paginator %}
|
||||
{%- set show_pages = paginator.pages -%}
|
||||
{% else %}
|
||||
{%- set show_pages = section.pages -%}
|
||||
{% endif -%}
|
||||
|
||||
{%- for page in show_pages %}
|
||||
<div class="post on-list">
|
||||
{{ post_macros::header(page=page) }}
|
||||
{{ post_macros::content(page=page, summary=true) }}
|
||||
</div>
|
||||
{% endfor -%}
|
||||
<div class="pagination">
|
||||
<div class="pagination__buttons">
|
||||
{%- if paginator.previous %}
|
||||
<span class="button previous">
|
||||
<a href="{{ paginator.previous | safe }}">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Newer posts</span>
|
||||
</a>
|
||||
</span>
|
||||
{% endif -%}
|
||||
{%- if paginator.next %}
|
||||
<span class="button next">
|
||||
<a href="{{ paginator.next | safe }}">
|
||||
<span class="button__text">Older posts</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
{% endif -%}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
</div>
|
||||
|
||||
{% block footer %}
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
{%- if config.extra.copyright_html %}
|
||||
<div class="copyright copyright--user">{{ config.extra.copyright_html | safe }}</div>
|
||||
{% else %}
|
||||
<div class="copyright">
|
||||
{%- if config.extra.author %}
|
||||
<span>© {{ date_macros::now_year() }} {{ config.extra.author }}</span>
|
||||
{% else %}
|
||||
<span>© {{ date_macros::now_year() }} Powered by <a href="https://www.getzola.org/">Zola</a></span>
|
||||
{% endif -%}
|
||||
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep">:: </span>
|
||||
Theme: <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a> by pawroman
|
||||
</span>
|
||||
</div>
|
||||
{% endif -%}
|
||||
</div>
|
||||
</footer>
|
||||
{% endblock footer %}
|
||||
|
||||
</div>
|
||||
{%- block extra_body %}
|
||||
{% endblock extra_body -%}
|
||||
</body>
|
||||
|
||||
</html>
|
3
themes/terminimal/templates/macros/date.html
Normal file
3
themes/terminimal/templates/macros/date.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{% macro now_year() %}
|
||||
{{ now() | date(format="%Y") }}
|
||||
{% endmacro %}
|
26
themes/terminimal/templates/macros/head.html
Normal file
26
themes/terminimal/templates/macros/head.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% macro head(config) %}
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="{{ get_url(path="style.css", trailing_slash=false) | safe }}">
|
||||
|
||||
{%- if config.extra.accent_color %}
|
||||
<link rel="stylesheet" href="{{ get_url(path="color/" ~ config.extra.accent_color ~ ".css", trailing_slash=false) | safe }}">
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="{{ get_url(path="color/blue.css", trailing_slash=false) | safe }}">
|
||||
{% endif -%}
|
||||
|
||||
{%- if config.extra.background_color %}
|
||||
{%- if config.extra.accent_color and config.extra.background_color != config.extra.accent_color %}
|
||||
<link rel="stylesheet" href="{{ get_url(path="color/background_" ~ config.extra.background_color ~ ".css", trailing_slash=false) | safe }}">
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
|
||||
{%- if config.extra.use_full_hack_font %}
|
||||
<link rel="stylesheet" href="{{ get_url(path="font-hack.css", trailing_slash=false) | safe }}">
|
||||
{% else %}
|
||||
<link rel="stylesheet" href="{{ get_url(path="font-hack-subset.css", trailing_slash=false) | safe }}">
|
||||
{% endif -%}
|
||||
|
||||
{% endmacro head %}
|
52
themes/terminimal/templates/macros/menu.html
Normal file
52
themes/terminimal/templates/macros/menu.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{% macro menu(config, current_path) %}
|
||||
{%- set current_item = false -%}
|
||||
{%- if config.extra.menu_items %}
|
||||
{%- set menu_items = config.extra.menu_items -%}
|
||||
|
||||
{%- for item in menu_items %}
|
||||
{%- set abs_item_url = item.url | replace(from="$BASE_URL", to=config.base_url) -%}
|
||||
{%- set is_current = current_url == abs_item_url ~ "/"
|
||||
or current_url is starting_with(abs_item_url)
|
||||
-%}
|
||||
{%- set is_base = abs_item_url == config.base_url
|
||||
or abs_item_url == config.base_url ~ "/"
|
||||
-%}
|
||||
|
||||
{%- if is_base %}
|
||||
{%- set_global base_item = item -%}
|
||||
{% endif -%}
|
||||
|
||||
{%- if is_current and not is_base %}
|
||||
{%- set_global current_item = item -%}
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
|
||||
{%- if not current_item and base_item %}
|
||||
{# Did not match any menu URLs -- assume it's a blog post #}
|
||||
{%- set current_item = base_item -%}
|
||||
{% endif -%}
|
||||
|
||||
{{ menu_macros::menu_for(config=config, current_item=current_item) }}
|
||||
{% endif -%}
|
||||
{% endmacro menu %}
|
||||
|
||||
{% macro menu_for(config, current_item) %}
|
||||
{%- if config.extra.menu_items %}
|
||||
{%- set menu_items = config.extra.menu_items -%}
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
{%- for item in menu_items %}
|
||||
<li {%- if current_item and current_item == item %} class="active" {%- endif %}>
|
||||
{%- if item.newtab -%}
|
||||
<a href="{{ item.url | replace(from="$BASE_URL", to=config.base_url) | safe }}" target="_blank" rel="noopener noreferrer">{{ item.name | safe }}</a>
|
||||
{%- else -%}
|
||||
<a href="{{ item.url | replace(from="$BASE_URL", to=config.base_url) | safe }}">{{ item.name | safe }}</a>
|
||||
{%- endif -%}
|
||||
</li>
|
||||
{% endfor -%}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif -%}
|
||||
{% endmacro menu %}
|
||||
|
103
themes/terminimal/templates/macros/post.html
Normal file
103
themes/terminimal/templates/macros/post.html
Normal file
@@ -0,0 +1,103 @@
|
||||
{% macro content(page, summary) %}
|
||||
{%- if summary and page.summary %}
|
||||
<div class="post-content">
|
||||
{{ page.summary | safe }}
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="{{ page.permalink | safe }}">
|
||||
<span class="button__text">La suite</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="post-content">
|
||||
{{ page.content | safe }}
|
||||
</div>
|
||||
{%- endif %}
|
||||
{% endmacro content %}
|
||||
|
||||
|
||||
{% macro date(page) %}
|
||||
<span class="post-date">
|
||||
{%- if page.date %}
|
||||
{{ page.date | date(format="%Y-%m-%d") }}
|
||||
{% endif -%}
|
||||
</span>
|
||||
{% endmacro post_date %}
|
||||
|
||||
|
||||
{% macro earlier_later(page) %}
|
||||
{%- if config.extra.enable_post_view_navigation and page.lower or page.higher %}
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">{{ config.extra.post_view_navigation_prompt }}</span>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
{%- if page.higher %}
|
||||
<span class="button previous">
|
||||
<a href="{{ page.higher.permalink | safe }}">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">{{ page.higher.title }}</span>
|
||||
</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if page.lower %}
|
||||
<span class="button next">
|
||||
<a href="{{ page.lower.permalink | safe }}">
|
||||
<span class="button__text">{{ page.lower.title }}</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
{% endif -%}
|
||||
</div>
|
||||
</div>
|
||||
{% endif -%}
|
||||
{% endmacro earlier_later %}
|
||||
|
||||
|
||||
{% macro header(page) %}
|
||||
<h1 class="post-title"><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
{{ post_macros::date(page=page) }}
|
||||
</div>
|
||||
|
||||
{{ post_macros::tags(page=page) }}
|
||||
{% endmacro header %}
|
||||
|
||||
|
||||
{% macro list_posts(pages) %}
|
||||
<ul>
|
||||
{%- for page in pages %}
|
||||
{%- if page.draft %}
|
||||
{% continue %}
|
||||
{% endif -%}
|
||||
<li class="post-list">
|
||||
<a href="{{ page.permalink | safe }}">
|
||||
<span class="post-date">{{ page.date }}</span>
|
||||
:: <span class="post-list-title">{{ page.title }}</span></a>
|
||||
{{ post_macros::tags(page=page, short=true) }}
|
||||
</li>
|
||||
{% endfor -%}
|
||||
</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:
|
||||
{%- set sep = " " -%}
|
||||
{% 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 %}
|
9
themes/terminimal/templates/page.html
Normal file
9
themes/terminimal/templates/page.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends "index.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="post">
|
||||
{{ post_macros::header(page=page) }}
|
||||
{{ post_macros::content(page=page, summary=false) }}
|
||||
{{ post_macros::earlier_later(page=page) }}
|
||||
</div>
|
||||
{% endblock content %}
|
8
themes/terminimal/templates/shortcodes/figure.html
Normal file
8
themes/terminimal/templates/shortcodes/figure.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% if src %}
|
||||
<figure class="{% if position %}{{ position }}{% else -%} center {%- endif %}" >
|
||||
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %}{% if style %} style="{{ style }}"{% endif %} />
|
||||
{% if caption %}
|
||||
<figcaption class="{% if caption_position %}{{ caption_position }}{% else -%} center {%- endif %}"{% if caption_style %} style="{{ caption_style | safe }}"{% endif %}>{{ caption }}</figcaption>
|
||||
{% endif %}
|
||||
</figure>
|
||||
{% endif %}
|
3
themes/terminimal/templates/shortcodes/image.html
Normal file
3
themes/terminimal/templates/shortcodes/image.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{% if src %}
|
||||
<img src="{{ src | safe }}"{% if alt %} alt="{{ alt }}"{% endif %} class="{% if position %}{{ position }}{% else -%} center {%- endif %}" {%- if style %} style="{{ style | safe }}" {%- endif %} />
|
||||
{% endif %}
|
17
themes/terminimal/templates/tags/list.html
Normal file
17
themes/terminimal/templates/tags/list.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "index.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="post">
|
||||
<h1 class="post-title">all tags</h1>
|
||||
|
||||
<ul>
|
||||
{% for term in terms %}
|
||||
<li class="tag-list">
|
||||
<a href="{{ term.permalink | safe }}">
|
||||
{{ term.name }} ({{ term.pages | length }} post{{ term.pages | length | pluralize }})
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock content %}
|
16
themes/terminimal/templates/tags/single.html
Normal file
16
themes/terminimal/templates/tags/single.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends "index.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="post">
|
||||
<h1 class="post-title">
|
||||
tag: #{{ term.name }}
|
||||
({{ term.pages | length }} post{{ term.pages | length | pluralize }})
|
||||
</h1>
|
||||
|
||||
<a href="{{ config.base_url | safe }}/tags">
|
||||
Show all tags
|
||||
</a>
|
||||
|
||||
{{ post_macros::list_posts(pages=term.pages) }}
|
||||
</div>
|
||||
{% endblock content %}
|
Reference in New Issue
Block a user