diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/404.html | 34 | ||||
| -rw-r--r-- | templates/base.html | 107 | ||||
| -rw-r--r-- | templates/categories/list.html | 14 | ||||
| -rw-r--r-- | templates/categories/single.html | 13 | ||||
| -rw-r--r-- | templates/contact.html | 35 | ||||
| -rw-r--r-- | templates/index.html | 31 | ||||
| -rw-r--r-- | templates/macros/macros.html | 9 | ||||
| -rw-r--r-- | templates/macros/page.html | 8 | ||||
| -rw-r--r-- | templates/macros/social.html | 7 | ||||
| -rw-r--r-- | templates/page.html | 68 | ||||
| -rw-r--r-- | templates/pages.html | 6 | ||||
| -rw-r--r-- | templates/posts.html | 17 | ||||
| -rw-r--r-- | templates/shortcodes/img.html | 51 | ||||
| -rw-r--r-- | templates/tags/list.html | 19 | ||||
| -rw-r--r-- | templates/tags/single.html | 13 |
15 files changed, 251 insertions, 181 deletions
diff --git a/templates/404.html b/templates/404.html index 23c7168..3b02be6 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,21 +1,23 @@ {% extends "base.html" %} - {# Title #} -{% block title %}<title>Sorry! Page not found.</title>{% endblock title %} - -{% if config.extra.seo | default(value=true) %} - {% block current_url %} - <meta property="og:url" content="{{ get_url(path='/') }}"> - <meta name="twitter:url" content="{{ get_url(path='/') }}"> - {% endblock current_url %} -{% endif %} -{# Page heading #} +{% block title %} + <title>Sorry! Page not found.</title> +{% endblock title %} -{% block content %}<div> +{% block current_url %} + {% if config.extra.seo | default(value=true) %} + <meta property="og:url" content="{{ get_url(path='/') }}"> + <meta name="twitter:url" content="{{ get_url(path='/') }}"> + {% endif %} +{% endblock current_url %} -<h1>404 Error</h1> -<h2>Sorry</h2> -<p>The requested page does not exist or has been moved to another address.</p> -<p>Please go back to <a href="{{ get_url(path="/", trailing_slash=true) }}">home</a>.</p> +{# Page heading #} -</div>{% endblock content %} +{% block content %} + <div> + <h1>404 Error</h1> + <h2>Sorry</h2> + <p>The requested page does not exist or has been moved to another address.</p> + <p>Please go back to <a href="{{ get_url(path="/", trailing_slash=true) }}">home</a>.</p> + </div> +{% endblock content %} diff --git a/templates/base.html b/templates/base.html index 77c4742..f43dcba 100644 --- a/templates/base.html +++ b/templates/base.html @@ -11,16 +11,20 @@ {% block description %} {% if page.description %} <meta name="description" content="{{ page.description }}" /> + {% if config.extra.seo | default(value=true) %} - <meta name="twitter:description" content="{{ page.description }}"> - <meta property="og:description" content="{{ page.description }}"> + <meta name="twitter:description" content="{{ page.description }}"> + <meta property="og:description" content="{{ page.description }}"> {% endif %} + {% else %} <meta name="description" content="{{ config.description }}" /> + {% if config.extra.seo | default(value=true) %} - <meta name="twitter:description" content="{{ config.description}}"> - <meta property="og:description" content="{{ config.description }}"> + <meta name="twitter:description" content="{{ config.description}}"> + <meta property="og:description" content="{{ config.description }}"> {% endif %} + {% endif %} {% endblock description %} @@ -44,11 +48,11 @@ <meta name="apple-mobile-web-app-status-bar-style" content="default"> {% block css %}<link rel="stylesheet" href="{{ get_url(path="abridge.css", trailing_slash=false, cachebust=true) }}">{% endblock css %} + {% if config.extra.favicon %} - <link rel="shortcut icon" href="{{ get_url(path=config.extra.favicon, trailing_slash=false) }}" sizes="16x16" type="image/png"/> - {% else %} - <link rel="shortcut icon" href="{{ get_url(path="favicon.png", trailing_slash=false) }}" sizes="16x16" type="image/png"/> + <link rel="shortcut icon" href="{{ get_url(path=config.extra.favicon, trailing_slash=false) }}" sizes="16x16" type="image/png"/> {% endif %} + <link rel="canonical" href="{{ get_url(path="/") }}"> {% if config.generate_feed %}<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ get_url(path="atom.xml") }}">{% endif %} @@ -74,8 +78,8 @@ {% endblock current_url %} {% if config.extra.social.twitter %} - <meta name="twitter:site" content="@{{ config.extra.twitter }}"> - <meta name="twitter:creator" content="@{{ config.extra.twitter }}"> + <meta name="twitter:site" content="@{{ config.extra.twitter }}"> + <meta name="twitter:creator" content="@{{ config.extra.twitter }}"> {% endif %} {% if page.extra.thumbnail %} @@ -93,55 +97,64 @@ <meta property="og:image" content="{{ get_url(path=page.extra.static_thumbnail, trailing_slash=false) }}"> {% endif %} {% elif config.extra.default_og_image %} - <meta name="twitter:card" content="summary_large_image"> - <meta name="twitter:image" content="{{ get_url(path=config.extra.default_og_image, trailing_slash=false) }}"> - <meta property="og:image" content="{{ get_url(path=config.extra.default_og_image, trailing_slash=false) }}"> + <meta name="twitter:card" content="summary_large_image"> + <meta name="twitter:image" content="{{ get_url(path=config.extra.default_og_image, trailing_slash=false) }}"> + <meta property="og:image" content="{{ get_url(path=config.extra.default_og_image, trailing_slash=false) }}"> {% elif config.extra.banner %} - <meta name="twitter:card" content="summary_large_image"> - <meta name="twitter:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}"> - <meta property="og:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}"> + <meta name="twitter:card" content="summary_large_image"> + <meta name="twitter:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}"> + <meta property="og:image" content="{{ get_url(path=config.extra.banner, trailing_slash=false) }}"> {% else %} - <meta name="twitter:card" content="summary"> + <meta name="twitter:card" content="summary"> {% endif %} {% endif %} {% block extra_head %}{% endblock extra_head %} </head> <body> -{% block header %}<header> - <nav> - <header> - <h1><a href="{{ get_url(path="/", trailing_slash=true) }}">{{ config.extra.textlogo | safe }}</a></h1> - </header> - <div overflow> - <ul> - {% for i in config.extra.menu %}<li><h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}">{{ i.name }}</a></h2></li>{% endfor %} - </ul> - </div> - </nav> - {% if config.extra.sitedesc %}{% if config.description %}<div>{{ config.description }}</div>{% endif %}{% endif %} - <hr> -</header>{% endblock header %} -<main>{% block content %} +{% block header %} + <header> + <nav> + <header> + <h1><a href="{{ get_url(path="/", trailing_slash=true) }}">{{ config.extra.textlogo | safe }}</a></h1> + </header> + <div overflow> + <ul> + {% for i in config.extra.menu %}<li><h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}">{{ i.name }}</a></h2></li>{% endfor %} + </ul> + </div> + </nav> + {% if config.extra.sitedesc %} + {% if config.description %} + <div>{{ config.description }}</div> + {% endif %} + {% endif %} + <hr> + </header> +{% endblock header %} +<main> +{% block content %} {% endblock content %} </main> -{% block footer %}<footer> - <hr> - <center> - <p>{{ social_macros::social_links(social_config=config.extra.social) }}</p> +{% block footer %} + <footer> + <hr> + <center> + <p>{{ social_macros::social_links(social_config=config.extra.social) }}</p> - {# Copyright #} - {% set start_year=config.extra.start_year | default(value="") %} - {% if start_year %}{% set start_year=start_year ~ "-" %}{% endif %} - {% set end_year=config.extra.end_year | default(value=now() | date(format="%Y")) %} - <p>Copyright © {{ start_year ~ end_year}} {{ config.title }}</p> + {# Copyright #} + {% set copyright_start_year=config.extra.copyright_start_year | default(value="") %} + {% if copyright_start_year %}{% set copyright_start_year=copyright_start_year ~ "-" %}{% endif %} + {% set copyright_end_year=config.extra.copyright_end_year | default(value=now() | date(format="%Y")) %} + <p>Copyright © {{ copyright_start_year ~ copyright_end_year}} {{ config.title }}</p> - <p>{% for i in config.extra.menu_footer %}<a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}">{{ i.name }}</a> {% endfor %}</p> - {# Optional footer credit #} - {% if config.extra.footer_credit %} - <p>Powered by <a href="https://www.getzola.org/">Zola</a> and <a href="https://github.com/jieiku/abridge/">Abridge</a></p> - {% endif %} - </center> -</footer>{% endblock footer %} + <p>{% for i in config.extra.menu_footer %}<a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}">{{ i.name }}</a> {% endfor %}</p> + {# Optional footer credit #} + {% if config.extra.footer_credit | default(value=true) %} + <p>Powered by <a href="https://www.getzola.org/">Zola</a> and <a href="https://github.com/jieiku/abridge/">Abridge</a></p> + {% endif %} + </center> + </footer> +{% endblock footer %} </body> </html> diff --git a/templates/categories/list.html b/templates/categories/list.html index 89bbc23..bce31fa 100644 --- a/templates/categories/list.html +++ b/templates/categories/list.html @@ -1,12 +1,16 @@ {% extends "base.html" %} {% block content %} - <div> +<div> <center> <h1>{{ terms | length }} Categories</h1> <p>{% for term in terms -%}[<a href="#{{ term.name }}">{{ term.name }}</a>] {%- endfor %}</p> </center> - {% for term in terms -%}<h2 id="{{ term.name }}"><a href="{{ term.permalink | safe }}">{{ term.name }}</a></h2> - {% for page in term.pages -%}<p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.timeformat | default(value="%B %e, %Y")) }}</time></p> - {% endfor -%}{% endfor -%} -</div>{% endblock content %} + {% for term in terms -%} + <h2 id="{{ term.name }}"><a href="{{ term.permalink | safe }}">{{ term.name }}</a></h2> + {% for page in term.pages -%} + <p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.timeformat | default(value="%B %e, %Y")) }}</time></p> + {% endfor -%} + {% endfor -%} +</div> +{% endblock content %} diff --git a/templates/categories/single.html b/templates/categories/single.html index d5fe5b7..641add7 100644 --- a/templates/categories/single.html +++ b/templates/categories/single.html @@ -1,8 +1,13 @@ {% extends "base.html" %} {% block content %} - <div> +<div> <h2>{{ term.name }}</h2> - {% for year, posts in term.pages | group_by(attribute="year") %}<h3>{{ year }}</h3> - {% for page in posts %}<p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.timeformat | default(value="%B %e, %Y")) }}</time></p> - {% endfor %}{% endfor %}</div>{% endblock content %} + {% for year, posts in term.pages | group_by(attribute="year") %} + <h3>{{ year }}</h3> + {% for page in posts %} + <p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.timeformat | default(value="%B %e, %Y")) }}</time></p> + {% endfor %} + {% endfor %} +</div> +{% endblock content %} diff --git a/templates/contact.html b/templates/contact.html index bf37d2d..6cdbc55 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -1,16 +1,25 @@ {% extends "base.html" %} {% block content %} -<div> -<p>Want to get in touch? Fill out the form below to send me a message and I will get back to you as soon as possible!</p> -<form name="contact" method="POST"> - <p><label>Name</label> - <input type="text" placeholder="Name" id="name" required data-validation-required-message="Please enter your name."></p> - <p><label>Email Address</label> - <input type="email" placeholder="name@example.com" id="email" required data-validation-required-message="Please enter your email address."></p> - <p><label>Message</label> - <textarea rows="5" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea></p> - <div id="success"></div> - <p><button type="submit" id="sendMessageButton">Send</button></p> -</form> -</div>{% endblock content %} + <div> + <p>Want to get in touch? Fill out the form below to send me a message and I will get back to you as soon as possible!</p> + <form name="contact" method="POST"> + <p> + <label>Name</label> + <input type="text" placeholder="Name" id="name" required data-validation-required-message="Please enter your name."> + </p> + <p> + <label>Email Address</label> + <input type="email" placeholder="name@example.com" id="email" required data-validation-required-message="Please enter your email address."> + </p> + <p> + <label>Message</label> + <textarea rows="5" placeholder="Message" id="message" required data-validation-required-message="Please enter a message."></textarea> + </p> + <div id="success"></div> + <p> + <button type="submit" id="sendMessageButton">Send</button> + </p> + </form> + </div> +{% endblock content %} diff --git a/templates/index.html b/templates/index.html index 1bd4976..ad4af41 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,20 +1,27 @@ {% import "macros/page.html" as page_macros %} {% import "macros/macros.html" as macros %} -{% extends "base.html" %}{% block content %} - <div>{% for page in paginator.pages %} - <article> -{{ macros::title(page=page) }} <p>{{ page.summary | markdown(inline=true) | safe }} <a href="{{ page.permalink | safe }}">...more</a></p> - </article>{% endfor %} +{% extends "base.html" %} +{% block content %} + <div> + {% for page in paginator.pages %} + <article> + {{ macros::title(page=page) }} + <p>{{ page.summary | markdown(inline=true) | safe }} <a href="{{ page.permalink | safe }}">...more</a></p> + </article> + {% endfor %} <nav> {% if paginator.previous %}<a href="{{ paginator.previous | safe }}">< Previous</a> {% endif %}{% if paginator.next %}<a href="{{ paginator.next | safe }}">Next ></a>{% endif %} </nav> - </div>{% set section_item = get_section(path="_index.md") %} + </div> + {% set section_item = get_section(path="_index.md") %} {% if recent %} - <div class="toc"> - <div class="toc-sticky"> - <h3>Recent Posts</h3>{% for page in section_item.pages | slice(end=config.extra.recent_items) %} -{{ page_macros::page_listing(page=page) }}{% endfor %} + <div class="toc"> + <div class="toc-sticky"> + <h3>Recent Posts</h3> + {% for page in section_item.pages | slice(end=config.extra.recent_items) %} + {{ page_macros::page_listing(page=page) }} + {% endfor %} + </div> </div> - </div> {% endif %} - {% endblock content %} +{% endblock content %} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index a470bb0..c3147aa 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,6 +1,9 @@ -{% macro title(page) %} <h1><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1> - <span>{{ page.date | date(format="%B %d, %Y") }}{% if page.taxonomies.categories %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind="categories", name=cat) | safe }}">{{ cat }}</a>{% endfor %}] </span> {% endif %} - {% if page.taxonomies.tags %} <span>{% for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">{{ tag }}</a> {% endfor %}</span>{% endif %} +{% macro title(page) %} +<h1><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1> +<span>{{ page.date | date(format="%B %d, %Y") }}{% if page.taxonomies.categories %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind="categories", name=cat) | safe }}">{{ cat }}</a>{% endfor %}] </span> {% endif %} +{% if page.taxonomies.tags %} + <span>{% for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">{{ tag }}</a> {% endfor %}</span> +{% endif %} {% endmacro title %} {% macro footer(page) %} <h3><a href="#">Back to top</a></h3> diff --git a/templates/macros/page.html b/templates/macros/page.html index 69d40f7..0029e13 100644 --- a/templates/macros/page.html +++ b/templates/macros/page.html @@ -1,3 +1,5 @@ -{% macro page_listing(page) %} <div class="toc-item"> - <a href="{{ page.permalink | safe}}" title="{{ page.title }}">{{ page.title }}</a> - </div>{% endmacro page_listing %} +{% macro page_listing(page) %} + <div class="toc-item"> + <a href="{{ page.permalink | safe}}" title="{{ page.title }}">{{ page.title }}</a> + </div> +{% endmacro page_listing %} diff --git a/templates/macros/social.html b/templates/macros/social.html index 8daf7bc..6d45b9e 100644 --- a/templates/macros/social.html +++ b/templates/macros/social.html @@ -1,4 +1,6 @@ -{% macro social_links(social_config) %}<span>{% set base_url = get_url(path="", lang=lang) %} +{% macro social_links(social_config) %} +{% set base_url = get_url(path="", lang=lang) %} +<span> {% if config.generate_feed %}{% if config.extra.social.feed %} <a href="{{ get_url(path="atom.xml") }}" target="_blank"><span class="svg rss" title="Rss"></span></a>{% endif %}{% endif %} {% if social_config.mail %} <a href="mailto:{{ social_config.mail }}" target="_blank"><span class="svg mail" title="Mail"></span></a>{% endif %} @@ -20,4 +22,5 @@ {% if social_config.pinterest %} <a href="https://www.pinterest.com/{{ social_config.pinterest }}/" target="_blank"><span class="svg pinterest" title="Pinterest"></span></a>{% endif %} {% if social_config.twitch %} <a href="https://www.twitch.tv/{{ social_config.twitch }}/" target="_blank"><span class="svg twitch" title="Twitch"></span></a>{% endif %} {% if social_config.youtube %} <a href="https://www.youtube.com/channel/{{ social_config.youtube }}/" target="_blank"><span class="svg youtube" title="YouTube"></span></a>{% endif %} - </span>{% endmacro %} +</span> +{% endmacro %} diff --git a/templates/page.html b/templates/page.html index e3388c0..f92574e 100644 --- a/templates/page.html +++ b/templates/page.html @@ -2,39 +2,39 @@ {% import "macros/macros.html" as macros %} {{config.title}} - {{page.title}} {% block content %} -<article> - {{ macros::title(page=page) }} - {{ page.content | safe }} - {% block page_before_footer %} - {% endblock page_before_footer %} - {% block page_footer %} - {{ macros::footer(page=page) }} - {% endblock page_footer %} - {% block page_after_footer %} - {% endblock page_after_footer %} -</article> -{% block toc %} - {% if page.extra.toc %} - {% set toc = page.toc %} - {% endif %} - {% if toc %} - <div class="toc"> - <div class="toc-sticky"> - <h3>Index</h3> - {% for h in toc %} - <div class="toc-item"> - <a class="subtext" href="{{h.permalink | safe}}">{{ h.title }}</a> + <article> + {{ macros::title(page=page) }} + {{ page.content | safe }} + {% block page_before_footer %} + {% endblock page_before_footer %} + {% block page_footer %} + {{ macros::footer(page=page) }} + {% endblock page_footer %} + {% block page_after_footer %} + {% endblock page_after_footer %} + </article> + {% block toc %} + {% if page.extra.toc %} + {% set toc = page.toc %} + {% endif %} + {% if toc %} + <div class="toc"> + <div class="toc-sticky"> + <h3>Index</h3> + {% for h in toc %} + <div class="toc-item"> + <a class="subtext" href="{{h.permalink | safe}}">{{ h.title }}</a> + </div> + {% if h.children %} + {% for h2 in h.children %} + <div class="toc-item-child"> + <a class="subtext" href="{{h2.permalink | safe}}"><small>- {{ h2.title }}</small></a> + </div> + {% endfor %} + {% endif %} + {% endfor %} + </div> </div> - {% if h.children %} - {% for h2 in h.children %} - <div class="toc-item-child"> - <a class="subtext" href="{{h2.permalink | safe}}"><small>- {{ h2.title }}</small></a> - </div> - {% endfor %} - {% endif %} - {% endfor %} - </div> - </div> - {% endif %} -{% endblock toc %} + {% endif %} + {% endblock toc %} {% endblock content %} diff --git a/templates/pages.html b/templates/pages.html index 30c95e9..3d2ca80 100644 --- a/templates/pages.html +++ b/templates/pages.html @@ -1,2 +1,4 @@ -{% extends "base.html" %}{% block content %} -<div>{{ page.content | safe }}</div>{% endblock content %} +{% extends "base.html" %} +{% block content %} + <div>{{ page.content | safe }}</div> +{% endblock content %} diff --git a/templates/posts.html b/templates/posts.html index 7aee3a7..f093e8e 100644 --- a/templates/posts.html +++ b/templates/posts.html @@ -1,5 +1,12 @@ -{% extends "base.html" %}{% block content %}{% set section_item = get_section(path="_index.md") %} - <div>{% for year, posts in section_item.pages | group_by(attribute="year") %} - <h2>{{ year }}</h2> - {% for post in posts %}<p><a href="{{ post.permalink | safe }}" title="{{ post.title }}">{{ post.title }}</a> - {{ post.date | date(format="%F") }}</p>{% endfor %}{% endfor %} - </div>{% endblock content %} +{% extends "base.html" %} +{% block content %} + {% set section_item = get_section(path="_index.md") %} + <div> + {% for year, posts in section_item.pages | group_by(attribute="year") %} + <h2>{{ year }}</h2> + {% for post in posts %} + <p><a href="{{ post.permalink | safe }}" title="{{ post.title }}">{{ post.title }}</a> - {{ post.date | date(format="%F") }}</p> + {% endfor %} + {% endfor %} + </div> +{% endblock content %} diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html index 94cb9fa..d003eeb 100644 --- a/templates/shortcodes/img.html +++ b/templates/shortcodes/img.html @@ -7,36 +7,39 @@ {% set figure_width = container_width - (40 * 2) %} {% if path is starting_with("./") %} - {% set relative_path = page.relative_path | split(pat="/") | slice(end=-1) | join(sep="/") %} - {% set img_path = path | trim_start_matches(pat="./") %} - {% set img_path = relative_path ~ "/" ~ img_path %} + {% set relative_path = page.relative_path | split(pat="/") | slice(end=-1) | join(sep="/") %} + {% set img_path = path | trim_start_matches(pat="./") %} + {% set img_path = relative_path ~ "/" ~ img_path %} {% else %} - {% set img_path = path %} + {% set img_path = path %} {% endif %} {% if path is not ending_with(".svg") %} - {% set resize = true %} - {% set image_quality = 90 %} - {% if quality %} - {% set image_quality = quality %} - {% endif %} - {% if extended_width_pct %} - {% if extended_width_pct == -1 %} - {# adjust extended width to container width #} - {% set extended_width_pct = 0.042 %} - {% endif %} - {% set _width = config.extra.images.max_width - figure_width %} - {% set extended_width = (extended_width_pct * _width + figure_width) | round | int %} - {% if extended_width > config.extra.images.max_width %} - {% set extended_width = config.extra.images.max_width %} - {% endif %} - {% set resized_image = resize_image(path=img_path, width=extended_width, op="fit_width", quality=image_quality) %} - {% else %} - {% set resized_image = resize_image(path=img_path, width=figure_width, op="fit_width", quality=image_quality) %} + {% set resize = true %} + {% set image_quality = 90 %} + {% if quality %} + {% set image_quality = quality %} + {% endif %} + + {% if extended_width_pct %} + + {% if extended_width_pct == -1 %} + {# adjust extended width to container width #} + {% set extended_width_pct = 0.042 %} {% endif %} + {% set _width = config.extra.images.max_width - figure_width %} + {% set extended_width = (extended_width_pct * _width + figure_width) | round | int %} + {% if extended_width > config.extra.images.max_width %} + {% set extended_width = config.extra.images.max_width %} + {% endif %} + {% set resized_image = resize_image(path=img_path, width=extended_width, op="fit_width", quality=image_quality) %} + + {% else %} + {% set resized_image = resize_image(path=img_path, width=figure_width, op="fit_width", quality=image_quality) %} + {% endif %} {% endif %} <figure> - <img src="{% if resize %}{{ resized_image.url }}{% else %}{{ path }}{% endif %}" {% if alt %}alt="{{alt}}"{% endif %}/> - {% if caption %}<figcaption>{{ caption | safe }}</figcaption>{% endif %} + <img src="{% if resize %}{{ resized_image.url }}{% else %}{{ path }}{% endif %}" {% if alt %}alt="{{alt}}"{% endif %}/> + {% if caption %}<figcaption>{{ caption | safe }}</figcaption>{% endif %} </figure> diff --git a/templates/tags/list.html b/templates/tags/list.html index e7a6b7d..56575df 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -2,10 +2,15 @@ {% block content %} <div> - <center> - <h1>{{ terms | length }} Tags</h1> - <p>{% for term in terms -%}#<a href="#{{ term.name }}">{{ term.name }}</a> {%- endfor %}</p> - </center> - {% for term in terms -%}<h2 id="{{ term.name }}">#<a href="{{ term.permalink | safe }}">{{ term.name }}</a></h2> - {% for page in term.pages -%}<p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.timeformat | default(value="%B %e, %Y")) }}</time></p> - {% endfor -%}{% endfor -%}</div>{% endblock content %} + <center> + <h1>{{ terms | length }} Tags</h1> + <p>{% for term in terms -%}#<a href="#{{ term.name }}">{{ term.name }}</a> {%- endfor %}</p> + </center> + {% for term in terms -%} + <h2 id="{{ term.name }}">#<a href="{{ term.permalink | safe }}">{{ term.name }}</a></h2> + {% for page in term.pages -%} + <p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.timeformat | default(value="%B %e, %Y")) }}</time></p> + {% endfor -%} + {% endfor -%} + </div> +{% endblock content %} diff --git a/templates/tags/single.html b/templates/tags/single.html index fd1a10f..2bddb8e 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -2,7 +2,12 @@ {% block content %} <div> - <h2>{{ term.name }}</h2> - {% for year, posts in term.pages | group_by(attribute="year") %}<h3>{{ year }}</h3> - {% for page in term.pages %}<p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.timeformat | default(value="%B %e, %Y")) }}</time></p> - {% endfor %}{% endfor %}</div>{% endblock content %} + <h2>{{ term.name }}</h2> + {% for year, posts in term.pages | group_by(attribute="year") %} + <h3>{{ year }}</h3> + {% for page in term.pages %} + <p><a href="{{ page.permalink | safe }}">{{ page.title }}</a> - <time datetime="{{ page.date }}">{{ page.date | date(format=config.extra.timeformat | default(value="%B %e, %Y")) }}</time></p> + {% endfor %} + {% endfor %} + </div> +{% endblock content %} |
