diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/base.html | 4 | ||||
| -rw-r--r-- | templates/index.html | 22 | ||||
| -rw-r--r-- | templates/macros/macros.html | 87 | ||||
| -rw-r--r-- | templates/page.html | 5 |
4 files changed, 96 insertions, 22 deletions
diff --git a/templates/base.html b/templates/base.html index 161e147..962cb88 100644 --- a/templates/base.html +++ b/templates/base.html @@ -48,7 +48,7 @@ <li><h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}">{{ i.name | safe }}</a></h2> </li> {%- endfor %} {%- if config.extra.js_theme %} - <li class="js"><i type="reset" id="mode" class="svgs contrast"></i> + <li class="js">{%- if config.extra.fontawesome %}<i type="reset" id="mode" class="svgs fa-solid fa-circle-half-stroke"></i>{%- else %}<i type="reset" id="mode" class="svgs contrast"></i>{%- endif %} {%- endif %} </li> </ul> @@ -112,5 +112,7 @@ </div> </footer> {%- endblock footer %} +{%- block gotop %} +{%- endblock gotop %} </body> </html>
\ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 03a652c..6d3bfe0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -22,11 +22,17 @@ {{- macros_head::seo(title=title, title_addition=title_addition, description=description, is_home=true) }} {%- endblock seo %} + + {%- block content %} <div> {%- for page in paginator.pages %} <article> <h1><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a></h1> + {%- if config.extra.meta_index.position %} + {%- if config.extra.meta_index.position == "top" or config.extra.meta_index.position == "both" %} + {{- macros::title_index(page=page) }} + {%- endif %}{%- endif %} <p class="sum"> {%- if page.summary %} {{ page.summary | markdown(inline=true) | safe }} @@ -38,17 +44,11 @@ {%- endif %} <a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">...more</a> </p> - <span class="info"> - {%- if page.taxonomies.authors and config.taxonomies %} - <span class="rpad">{%- for author in page.taxonomies.authors %} - {%- if author_flag %} and {% endif %} - <a href="{{ get_taxonomy_url(kind='authors', name=author) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ author }}</a> - {%- set_global author_flag = true %} - {%- endfor %}</span> - {%- elif config.extra.author and config.extra.author_show %}<span class="rpad">{{ config.extra.author }}</span> - {%- endif %} <span class="rpad">{{ page.date | date(format="%Y %B %d") }}</span>{%- if config.extra.readtime %}<span class="rpad"> {{ page.reading_time }} {{ config.extra.readtime_string | default(value="min") }} </span>{% endif %} -{%- if page.taxonomies.categories %}<span class="rpad"> [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ cat }}</a>{% endfor %}]</span>{% endif %} -{%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span> + {%- if config.extra.meta_index.position %} + {%- if config.extra.meta_index.position == "bottom" or config.extra.meta_index.position == "both" %} + {{- macros::title_index(page=page) }} + {%- endif %} + {%- endif %} </article> {%- endfor %} {{- macros::pagination(paginator=paginator) }} diff --git a/templates/macros/macros.html b/templates/macros/macros.html index 4b6c7d5..e818bfd 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,20 +1,87 @@ {%- macro title(page) %} - <h1><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a></h1> - <span> - {%- if page.taxonomies.authors and config.taxonomies %} - <span class="hpad"><b>{%- for author in page.taxonomies.authors %} + <span{%- if config.extra.meta_post.size %} class="{{ config.extra.meta_post.size }}"{% endif %}> + + {#- Author #} + {%- if page.taxonomies.authors and config.taxonomies %} + {%- for author in page.taxonomies.authors %} + {%- if author_flag %} and {% endif %} + <a href="{{ get_taxonomy_url(kind='authors', name=author) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ author }}</a> + {%- set_global author_flag = true %} + {%- endfor %} + {%- elif config.extra.author and config.extra.meta_post.author %} + {%- if config.extra.icon_author %}<i class="{{ config.extra.icon_author }}"></i>{%- endif %}{{ config.extra.author }} + {%- endif %} + + {#- divider #} + {%- if config.extra.meta_post.author %} + {%- if config.extra.meta_post.readtime or config.extra.meta_post.date or config.extra.meta_post.categories_tags %} + {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} {%- endif %} + {%- endif %} + {%- endif %} + + {#- ReadTime #} + {%- if config.extra.meta_post.readtime %} {%- if config.extra.icon_read %}<i class="{{ config.extra.icon_read }}"></i>{%- endif %}{{ page.reading_time }} {{ config.extra.meta_post.readstring | default(value="min") }} + {#- divider #} + {%- if config.extra.meta_post.date or config.extra.meta_post.categories_tags %} + {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} {%- endif %}{%- endif %}{%- endif %} + + {#- Date #} + {%- if config.extra.meta_post.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i>{%- endif %}{{ page.date | date(format="%B %d, %Y") }} + {#- divider #} + {%- if config.extra.meta_post.categories_tags %} + {%- if config.extra.meta_post.divider %}<span class="hpad">{{ config.extra.meta_post.divider | safe }}</span>{%- else %} {%- endif %}{%- endif %}{% endif %} + + {#- Categories #} + {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i>{%- endif %}[{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ cat }}</a>{% endfor %}]{% endif %} + + {#- Tags #} + {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span> +{%- endmacro title %} + + +{%- macro title_index(page) %} + <span{%- if config.extra.meta_index.size %} class="{{ config.extra.meta_index.size }}"{% endif %}> + + {#- Author #} + {%- if page.taxonomies.authors and config.taxonomies %} + {%- for author in page.taxonomies.authors %} {%- if author_flag %} and {% endif %} <a href="{{ get_taxonomy_url(kind='authors', name=author) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ author }}</a> {%- set_global author_flag = true %} - {%- endfor %}</b></span> - {%- elif config.extra.author and config.extra.author_show %}<span class="hpad"><b>{{ config.extra.author }}</b></span> - {%- endif %}<span class="rpad"> {{ page.date | date(format="%B %d, %Y") }}</span> -{%- if page.taxonomies.categories %}<span class="rpad"> [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ cat }}</a>{% endfor %}]</span>{% endif %} -{%- if page.taxonomies.tags %}<span class="rpad"> {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}</span>{%- endif %} -{%- if config.extra.readtime %}<span class="rpad"> {{ page.reading_time }} {{ config.extra.readtime_string | default(value="min") }} </span>{% endif %}</span> + {%- endfor %} + {%- elif config.extra.author and config.extra.meta_index.author %} + {%- if config.extra.icon_author %}<i class="{{ config.extra.icon_author }}"></i>{%- endif %}{{ config.extra.author }} + {%- endif %} + + {#- divider #} + {%- if config.extra.meta_index.author %} + {%- if config.extra.meta_index.readtime or config.extra.meta_index.date or config.extra.meta_index.categories_tags %} + {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} {%- endif %} + {%- endif %} + {%- endif %} + + {#- ReadTime #} + {%- if config.extra.meta_index.readtime %} {%- if config.extra.icon_read %}<i class="{{ config.extra.icon_read }}"></i>{%- endif %}{{ page.reading_time }} {{ config.extra.meta_index.readstring | default(value="min") }} + {#- divider #} + {%- if config.extra.meta_index.date or config.extra.meta_index.categories_tags %} + {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} {%- endif %}{%- endif %}{%- endif %} + + {#- Date #} + {%- if config.extra.meta_index.date %} {%- if config.extra.icon_date %}<i class="{{ config.extra.icon_date }}"></i>{%- endif %}{{ page.date | date(format="%B %d, %Y") }} + {#- divider #} + {%- if config.extra.meta_index.categories_tags %} + {%- if config.extra.meta_index.divider %}<span class="hpad">{{ config.extra.meta_index.divider | safe }}</span>{%- else %} {%- endif %}{%- endif %}{% endif %} + + {#- Categories #} + {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}<i class="{{ config.extra.icon_info }}"></i>{%- endif %}[{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind='categories', name=cat) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ cat }}</a>{% endfor %}]{% endif %} + + {#- Tags #} + {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind='tags', name=tag) | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ tag }}</a> {% endfor -%}{%- endif %}</span> {%- endmacro title %} + + {%- macro footer(page) %} <p><b><a href="#">Back to top</a></b></p> {%- endmacro footer %} diff --git a/templates/page.html b/templates/page.html index 736a11e..c653018 100644 --- a/templates/page.html +++ b/templates/page.html @@ -32,6 +32,7 @@ {%- block content %} <article> + <h1><a href="{{ page.permalink | safe }}{%- if config.extra.uglyurls %}index.html{%- endif %}">{{ page.title }}</a></h1> {{- macros::title(page=page) }} {{ page.content | safe }} {%- block page_footer %} @@ -63,3 +64,7 @@ {%- endif %} {%- endblock toc %} {%- endblock content %} + +{%- block gotop %} +<a href="#" class="top">⋏</a> +{%- endblock gotop %}
\ No newline at end of file |
