Skip to content
Snippets Groups Projects
Verified Commit a2f5607e authored by Jake's avatar Jake :speech_balloon:
Browse files

updated theme

parent 61a76160
Branches
Tags
No related merge requests found
Pipeline #313905 failed
{%- macro tag_by_name(tagname, lang) -%} {%- macro tag_by_name(tagname, lang) -%}
{%- set ns = namespace(tagpage=None, tagcolor=config.theme.default_tag_color, tagtitle=tagname) -%} {%- set tag = tags[tagname] -%}
{%- set tagpageslug = ["tag", tagname]|join('-') -%} {{ tag.name }}
{%- set ns = namespace(tagpage=None, tagcolor=config.theme.default_tag_color, tagtitle=tag.name) -%}
{%- set tagpageslug = ["tag", tag.name]|join('-') -%}
{%- if tagpageslug in pages[lang] -%} {%- if tagpageslug in pages[lang] -%}
{%- set ns.tagpage = pages[lang][tagpageslug] -%} {%- set ns.tagpage = pages[lang][tagpageslug] -%}
...@@ -10,7 +12,7 @@ ...@@ -10,7 +12,7 @@
{%- endcall -%} {%- endcall -%}
{%- endif -%} {%- endif -%}
{{- caller(ns.tagtitle, ns.tagcolor, [lang, 'tag', tagname + '.html']|join('/') , ns.tagpage, tags[lang][tagname]) -}} {{- caller(ns.tagtitle, ns.tagcolor, [lang, 'tag', tag.name + '.html']|join('/') , ns.tagpage, tag.pages[lang]) -}}
{%- endmacro -%} {%- endmacro -%}
{%- macro metadata_entry(slug, lang, key) -%} {%- macro metadata_entry(slug, lang, key) -%}
......
...@@ -34,10 +34,10 @@ ...@@ -34,10 +34,10 @@
{%- endmacro -%} {%- endmacro -%}
{%- macro render_tag(tag, lang) -%} {%- macro render_tag(tag, lang) -%}
{%- set url = ['tag',tag]|join(':') -%} {%- set url = ['tag',tag.name]|join(':') -%}
{%- call(parsedurl, anchor, reflang, is_external, reftype, refid, refpage, tagcattitle, tagcatcolor) parse_url(url, lang) -%} {%- call(parsedurl, anchor, reflang, is_external, reftype, refid, refpage, tagcattitle, tagcatcolor) parse_url(url, lang) -%}
{%- set attr = {"classes": ["tag-link"], "style": {"--category-color": tagcatcolor}} -%} {%- set attr = {"classes": ["tag-link"], "style": {"--category-color": tagcatcolor}} -%}
{{ render(url,None,lang,attr=attr,title=tag) }} {{ render(url,None,lang,attr=attr,title=tag.name) }}
{%- endcall -%} {%- endcall -%}
{%- endmacro -%} {%- endmacro -%}
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
{%- call(page) get.page_by_slug(ns.refid, ns.reflang) -%} {%- call(page) get.page_by_slug(ns.refid, ns.reflang) -%}
{%- set ns.url = [siteurl, page.url]|join('/') -%} {%- set ns.url = [siteurl, page.url]|join('/') -%}
{%- set ns.page = page -%} {%- set ns.page = page -%}
{%- call(tagcattitle, tagcatcolor, caturl, catpage, catpages) get.tag_by_name(page.category, ns.reflang) -%} {%- call(tagcattitle, tagcatcolor, caturl, catpage, catpages) get.tag_by_name(page.category.name, ns.reflang) -%}
{%- set ns.tagcattitle = tagcattitle -%} {%- set ns.tagcattitle = tagcattitle -%}
{%- set ns.tagcatcolor = tagcatcolor -%} {%- set ns.tagcatcolor = tagcatcolor -%}
{%- endcall -%} {%- endcall -%}
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
{%- endmacro -%} {%- endmacro -%}
{%- macro render_breadcrumb_menu(cat, lang, slug = None) -%} {%- macro render_breadcrumb_menu(cat, lang, slug = None) -%}
{%- call(cattitle, catcolor, caturl, catpage, catpages) get.tag_by_name(cat, lang) -%} {%- call(cattitle, catcolor, caturl, catpage, catpages) get.tag_by_name(cat.name, lang) -%}
<nav class="breadcrumb" {% if catcolor -%}style="--category-color: {{ catcolor }}"{%- endif -%}> <nav class="breadcrumb" {% if catcolor -%}style="--category-color: {{ catcolor }}"{%- endif -%}>
<ul> <ul>
<li>{{ link.render(['slug',config.theme.homepage_slug]|join(':'), None, lang) }}</li> <li>{{ link.render(['slug',config.theme.homepage_slug]|join(':'), None, lang) }}</li>
<li>{{ link.render(['tag',cat]|join(':'), None, lang) }}</li> <li>{{ link.render(['tag',cat.name]|join(':'), None, lang) }}</li>
{%- if slug -%} {%- if slug -%}
<li>{{ link.render(['slug',slug]|join(':'), None, lang) }}</li> <li>{{ link.render(['slug',slug]|join(':'), None, lang) }}</li>
{%- endif -%} {%- endif -%}
......
...@@ -40,7 +40,11 @@ ...@@ -40,7 +40,11 @@
{%- endmacro -%} {%- endmacro -%}
{%- macro section_tag(s, lang) -%} {%- macro section_tag(s, lang) -%}
{%- call(tagtitle, tagcolor, tagurl, tagpage, tagpages) get.tag_by_name(s.tag, lang) -%} {%- set ns = namespace(tagname=s.tag) -%}
{%- if ns.tagname is not string -%}
{%- set ns.tagname = ns.tagname.name -%}
{%- endif -%}
{%- call(tagtitle, tagcolor, tagurl, tagpage, tagpages) get.tag_by_name(ns.tagname, lang) -%}
{%- if s.title is not defined -%} {%- if s.title is not defined -%}
<header> <header>
<h2 {% if s.id is defined -%}id="{{ s.id }}"{%- endif %}>{{ softbreak_span(tagtitle) }}</h2> <h2 {% if s.id is defined -%}id="{{ s.id }}"{%- endif %}>{{ softbreak_span(tagtitle) }}</h2>
......
{% extends "base.html" %} {% extends "base.html" %}
{% block title -%} {% block title -%}
{%- call(tagtitle, tagcolor, tagurl, tagpage, tagpages) get.tag_by_name(tag, l) -%} {%- call(tagtitle, tagcolor, tagurl, tagpage, tagpages) get.tag_by_name(tag.name, l) -%}
{{ t[l].title_prefix }}{{ t[l].sitename }}{{ t[l].title_suffix }} - {{ render.softbreak_span(tagtitle) }} {{ t[l].title_prefix }}{{ t[l].sitename }}{{ t[l].title_suffix }} - {{ render.softbreak_span(tagtitle) }}
{%- endcall -%} {%- endcall -%}
{%- endblock -%} {%- endblock -%}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment