Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[autofix] Format Jinja #293

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[autofix] Format Jinja
  • Loading branch information
kdeldycke authored and github-actions[bot] committed Aug 1, 2024
commit af67d599eb2e7e3f82ff00e118c74b7e52f391d2
24 changes: 12 additions & 12 deletions plumage/templates/archives.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %}Archives{% endblock title %}
{% block title %}
Archives
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ ARCHIVES_SAVE_AS }}"
Expand All @@ -15,21 +17,19 @@ <h1>
{% set yearly_articles = [] %}
{% for article in dates %}
{% if article.date.year == year %}
{% if yearly_articles.append(article) %}
{% endif %}
{% if yearly_articles.append(article) %}{% endif %}
{% endif %}
{% endfor %}
{# Ignore empty years #}
{% if yearly_articles|length > 0 %}
{% if year_range.append({'year': year, 'articles': yearly_articles}) %}
{% endif %}
{% if year_range.append({'year': year, 'articles': yearly_articles}) %}{% endif %}
{% endif %}
{% endfor %}
<div class="accordion"
id="accordionArchives"
role="tablist"
aria-multiselectable="true">
{% for yearly_group in year_range|sort(reverse = True, attribute = 'year') %}
{% for yearly_group in year_range|sort(reverse = True, attribute = 'year') %}
<div class="card">
<h4 class="card-header" role="tab" id="heading{{ yearly_group.year }}">
<button type="button"
Expand All @@ -54,19 +54,19 @@ <h4 class="card-header" role="tab" id="heading{{ yearly_group.year }}">
{% if article.date.month != current_month %}
{% set current_month = article.date.month %}
{% if not loop.first %}</dl>{% endif %}
<dl class="row">
<dl class="row">
{% endif %}
<dt class="col-sm-2">
<abbr class="published" title="{{ article.date.isoformat() }}">{{ article.date.strftime('%b. %d') }}</abbr>
<abbr class="published" title="{{ article.date.isoformat() }}">{{ article.date.strftime("%b. %d") }}</abbr>
</dt>
<dd class="col-sm-10">
<a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
</dd>
{% if loop.last %}</dl>{% endif %}
{% endfor %}
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
{% endblock content %}
4 changes: 3 additions & 1 deletion plumage/templates/article.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends "base.html" %}
{% set has_right = True %}
{% block title %}{{ article.title|striptags|e }}{% endblock title %}
{% block title %}
{{ article.title|striptags|e }}
{% endblock title %}
{% block head %}
{% if article.tags %}
<meta name="keywords"
Expand Down
4 changes: 3 additions & 1 deletion plumage/templates/author.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "index.html" %}
{% block title %}Articles by {{ author.name }}{% endblock title %}
{% block title %}
Articles by {{ author.name }}
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ author.url }}"
Expand Down
7 changes: 4 additions & 3 deletions plumage/templates/authors.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %}All authors{% endblock title %}
{% block title %}
All authors
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ AUTHORS_SAVE_AS }}"
Expand All @@ -10,8 +12,7 @@ <h1>
{% block content %}
{% set all_authors = [] %}
{% for author, articles in authors %}
{% if all_authors.append({'name': author.name, 'url': author.url, 'articles': articles|length()}) %}
{% endif %}
{% if all_authors.append({'name': author.name, 'url': author.url, 'articles': articles|length()}) %}{% endif %}
{% endfor %}
<dl class="row">
{# Sort by number of articles, then alphabetically #}
Expand Down
20 changes: 14 additions & 6 deletions plumage/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,17 @@ <h1>
{% if STORK_SEARCH %}
<div class="position-relative dropdown">
<div class="input-group">
<label class="input-group-text" for="sitesearch-input"><i class="fas fa-search fa-fw"></i></label>
<input data-stork="sitesearch" id="sitesearch-input" class="form-control dropdown-toggle" placeholder="Search" data-bs-toggle="dropdown" aria-expanded="false" />
<div data-stork="sitesearch-output" class="dropdown-menu dropdown-menu-end shadow"></div>
<label class="input-group-text" for="sitesearch-input">
<i class="fas fa-search fa-fw"></i>
</label>
<input data-stork="sitesearch"
id="sitesearch-input"
class="form-control dropdown-toggle"
placeholder="Search"
data-bs-toggle="dropdown"
aria-expanded="false" />
<div data-stork="sitesearch-output"
class="dropdown-menu dropdown-menu-end shadow"></div>
</div>
</div>
{% endif %}
Expand All @@ -174,8 +182,8 @@ <h1>
</div>
{% endif %}
<main id="content"
role="main"
class=" {% if LAYOUT == 'full-width' %} offset-md-1 {% elif has_left_content and has_right_content %} col-md-6 {% elif has_left_content or has_right_content %} col-md-9 {% else %} col-md-12 {% endif %}">
role="main"
class=" {% if LAYOUT == 'full-width' %} offset-md-1 {% elif has_left_content and has_right_content %} col-md-6 {% elif has_left_content or has_right_content %} col-md-9 {% else %} col-md-12 {% endif %}">
{% block content %}{% endblock %}
</main>
{% if LAYOUT != 'full-width' and has_right_content %}
Expand Down Expand Up @@ -287,7 +295,7 @@ <h6>Feeds</h6>
<div class="row mt-3">
<div class="offset-3 col-6 small text-muted text-center">
Site generated by <a class="text-dark" href="https://getpelican.com">Pelican</a>.
<br/>
<br />
<a class="text-dark" href="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/kdeldycke/plumage">Plumage</a>
theme by <a class="text-dark" href="https://kevin.deldycke.com">Kevin Deldycke</a>.
</div>
Expand Down
4 changes: 3 additions & 1 deletion plumage/templates/categories.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %}All categories{% endblock title %}
{% block title %}
All categories
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ CATEGORIES_SAVE_AS }}"
Expand Down
4 changes: 3 additions & 1 deletion plumage/templates/category.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %}{{ category }}{% endblock title %}
{% block title %}
{{ category }}
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ category.url }}"
Expand Down
6 changes: 4 additions & 2 deletions plumage/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{% extends "base.html" %}
{% block content %}
{% block content_title %}<h2>Articles</h2>{% endblock content_title %}
{% block content_title %}
<h2>Articles</h2>
{% endblock content_title %}
{% for article in articles_page.object_list %}
<article>
<header>
Expand All @@ -15,7 +17,7 @@ <h2>
<a class="btn btn-primary" href="{{ SITEURL }}/{{ article.url }}"><strong>➟ Read more</strong></a>
</div>
</article>
<hr/>
<hr />
{% endfor %}
{% include "pagination.html" %}
{% endblock content %}
4 changes: 3 additions & 1 deletion plumage/templates/page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %}{{ page.title|striptags }}{% endblock title %}
{% block title %}
{{ page.title|striptags }}
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ page.url }}"
Expand Down
8 changes: 4 additions & 4 deletions plumage/templates/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
{% endif %}
{% for num in articles_paginator.page_range %}
{% set linked_pages = [
1, 2, articles_page.number - 1, articles_page.number,
articles_page.number + 1, articles_paginator.num_pages - 1,
articles_paginator.num_pages] %}
1, 2, articles_page.number - 1, articles_page.number,
articles_page.number + 1, articles_paginator.num_pages - 1,
articles_paginator.num_pages] %}
{% if num in linked_pages %}
{% set is_current_page = (num == articles_page.number) -%}
<li class="page-item {% if is_current_page %}active{% endif %}"
{% if is_current_page %}aria-current="page"{% endif %}>
<a class="page-link"
href="{{ SITEURL }}/{{ articles_paginator.page(num).url }}"
rel=" {% if num == 1 %} first{% endif %} {% if num == articles_paginator.num_pages %} last{% endif %} {% if num == (articles_page.number - 1) %} prev {% endif %} {% if num == (articles_page.number + 1) %} next {% endif %}">
rel=" {% if num == 1 %}first{% endif %} {% if num == articles_paginator.num_pages %}last{% endif %} {% if num == (articles_page.number - 1) %}prev{% endif %} {% if num == (articles_page.number + 1) %}next{% endif %}">
{{ num }}
{% if is_current_page %}<span class="visually-hidden">(current)</span>{% endif %}
</a>
Expand Down
10 changes: 5 additions & 5 deletions plumage/templates/period_archives.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "base.html" %}
{% macro period_label() %}
{{ period|reverse|join(' ') }}
{{ period|reverse|join(" ") }}
{% endmacro %}
{% macro period_url() -%}
{# Ugly hack to get period archive URL. The {{ url }} variable doesn't return what I expected.
Expand All @@ -9,14 +9,14 @@
{% set url_parts = output_file.split('index.html', 1) %}
{{- url_parts[0] -}}
{%- endmacro %}
{% block title %}{{ period_label() }} archives{% endblock title %}
{% block title %}
{{ period_label() }} archives
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ period_url() }}"
rel="bookmark"
title="Permalink to {{ period_label()|e }} archives">
{{ period_label() }} archives
</a>
title="Permalink to {{ period_label() |e }} archives">{{ period_label() }} archives</a>
</h1>
{% endblock top_center %}
{% block content %}
Expand Down
6 changes: 4 additions & 2 deletions plumage/templates/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ <h4 class="card-title">{{ project.name }}</h4>
{% endfor %}
{% if projects is defined %}
<div class="row" data-masonry='{"percentPosition": true }'>
{% block project_pre_content %}{% endblock project_pre_content %}
{% block project_pre_content %}
{% endblock project_pre_content %}
{% set active_projects = [] %}
{% set inactive_projects = [] %}
{% for project in projects %}
Expand All @@ -102,7 +103,8 @@ <h4 class="card-title">{{ project.name }}</h4>
<div class="col-sm-6 col-lg-4 mb-4">{{ render_card(all_tags, project) }}</div>
{% endfor %}
{% endfor %}
{% block project_post_content %}{% endblock project_post_content %}
{% block project_post_content %}
{% endblock project_post_content %}
</div>
{% endif %}
{% endmacro %}
Expand Down
4 changes: 3 additions & 1 deletion plumage/templates/tag.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %}{{ tag }}{% endblock title %}
{% block title %}
{{ tag }}
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ tag.url }}"
Expand Down
4 changes: 3 additions & 1 deletion plumage/templates/tags.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}
{% block title %}All tags{% endblock title %}
{% block title %}
All tags
{% endblock title %}
{% block top_center %}
<h1>
<a href="{{ SITEURL }}/{{ TAGS_SAVE_AS }}"
Expand Down