From b299a35f3970c94f7fb5987801fa72c374937584 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Fri, 10 Jun 2022 22:25:01 -0700 Subject: Meta Data Options --- templates/macros/macros.html | 87 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 77 insertions(+), 10 deletions(-) (limited to 'templates/macros') 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) %} -

{{ page.title }}

- - {%- if page.taxonomies.authors and config.taxonomies %} - {%- for author in page.taxonomies.authors %} + + + {#- Author #} + {%- if page.taxonomies.authors and config.taxonomies %} + {%- for author in page.taxonomies.authors %} + {%- if author_flag %} and {% endif %} + {{ author }} + {%- set_global author_flag = true %} + {%- endfor %} + {%- elif config.extra.author and config.extra.meta_post.author %} + {%- if config.extra.icon_author %}{%- 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 %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %} + {%- endif %} + {%- endif %} + + {#- ReadTime #} + {%- if config.extra.meta_post.readtime %} {%- if config.extra.icon_read %}{%- 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 %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %}{%- endif %}{%- endif %} + + {#- Date #} + {%- if config.extra.meta_post.date %} {%- if config.extra.icon_date %}{%- endif %}{{ page.date | date(format="%B %d, %Y") }} + {#- divider #} + {%- if config.extra.meta_post.categories_tags %} + {%- if config.extra.meta_post.divider %}{{ config.extra.meta_post.divider | safe }}{%- else %} {%- endif %}{%- endif %}{% endif %} + + {#- Categories #} + {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}{%- endif %}[{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} + + {#- Tags #} + {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} +{%- endmacro title %} + + +{%- macro title_index(page) %} + + + {#- Author #} + {%- if page.taxonomies.authors and config.taxonomies %} + {%- for author in page.taxonomies.authors %} {%- if author_flag %} and {% endif %} {{ author }} {%- set_global author_flag = true %} - {%- endfor %} - {%- elif config.extra.author and config.extra.author_show %}{{ config.extra.author }} - {%- endif %} {{ page.date | date(format="%B %d, %Y") }} -{%- if page.taxonomies.categories %} [{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} -{%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} -{%- if config.extra.readtime %} {{ page.reading_time }} {{ config.extra.readtime_string | default(value="min") }} {% endif %} + {%- endfor %} + {%- elif config.extra.author and config.extra.meta_index.author %} + {%- if config.extra.icon_author %}{%- 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 %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %} + {%- endif %} + {%- endif %} + + {#- ReadTime #} + {%- if config.extra.meta_index.readtime %} {%- if config.extra.icon_read %}{%- 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 %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %}{%- endif %}{%- endif %} + + {#- Date #} + {%- if config.extra.meta_index.date %} {%- if config.extra.icon_date %}{%- endif %}{{ page.date | date(format="%B %d, %Y") }} + {#- divider #} + {%- if config.extra.meta_index.categories_tags %} + {%- if config.extra.meta_index.divider %}{{ config.extra.meta_index.divider | safe }}{%- else %} {%- endif %}{%- endif %}{% endif %} + + {#- Categories #} + {%- if page.taxonomies.categories %} {%- if config.extra.icon_info %}{%- endif %}[{% for cat in page.taxonomies.categories %}{{ cat }}{% endfor %}]{% endif %} + + {#- Tags #} + {%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #{{ tag }} {% endfor -%}{%- endif %} {%- endmacro title %} + + {%- macro footer(page) %}

Back to top

{%- endmacro footer %} -- cgit v1.3.1