1
0
mirror of https://github.com/avitex/avitex.github.io synced 2024-11-16 17:39:57 +00:00
1bit.pw/templates/macros.html

30 lines
739 B
HTML
Raw Normal View History

2018-08-22 13:30:07 +00:00
{% macro link(url) %}
{%- if url is starting_with("/") or url is starting_with("./") -%}
2020-04-14 02:23:38 +00:00
{{ get_url(path=url, trailing_slash=false) | safe }}
2018-08-22 13:30:07 +00:00
{%- else -%}
2020-04-14 02:23:38 +00:00
{{ url | safe }}
2018-08-22 13:30:07 +00:00
{%- endif -%}
{% endmacro link %}
{% macro is_active_nav(url, curr_url) %}
{%- if url == get_url(path="/") -%}
{{ url == curr_url }}
{%- else -%}
{{ curr_url is starting_with(url) }}
{%- endif -%}
2020-04-11 17:22:25 +00:00
{% endmacro is_active_nav %}
2020-04-14 02:23:38 +00:00
{% macro meta_desc(ctx) %}
2020-04-14 09:17:47 +00:00
{%- if ctx.description -%}
2020-04-14 02:23:38 +00:00
{{ ctx.description }}
{%- else -%}
{%- if ctx.summary -%}
{{ ctx.summary | striptags | replace(from="
", to=" ") | trim }}
{%- else -%}
{{ ctx.content | striptags | replace(from="
", to=" ") | trim }}
{%- endif -%}
{%- endif -%}
{% endmacro meta_desc %}