From d47730580e913e596303beddb7e01186f3f2a173 Mon Sep 17 00:00:00 2001 From: Daniel Hladek Date: Sat, 3 Oct 2020 11:40:01 +0200 Subject: [PATCH] zz --- .../templates/partials/authorposts.html.twig | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 themes/mytheme/templates/partials/authorposts.html.twig diff --git a/themes/mytheme/templates/partials/authorposts.html.twig b/themes/mytheme/templates/partials/authorposts.html.twig new file mode 100644 index 000000000..6d34f418f --- /dev/null +++ b/themes/mytheme/templates/partials/authorposts.html.twig @@ -0,0 +1,40 @@ +{% set blist = [] %} +{% if grav.theme.config.params.articles.blacklist is defined %} + {% set blist = grav.theme.config.params.articles.blacklist %} + {% set tmplst = [] %} + {% for cat in catlist %} + {% if cat not in blist %} + {% set tmplst = tmplst|merge([cat]) %} + {% endif %} + {% endfor %} + {% set catlist = tmplst %} +{% endif %} + +{% set pages = taxonomy.findTaxonomy({'author': author}).order('date', 'desc') %} +{% set tmplst = [] %} +{% for page in pages %} + {% set blisted = false %} + {% for bcat in blist %} + {% if bcat in page.taxonomy["category"] %} + {% set blisted = true %} + {% endif %} + {% endfor %} + {% if not blisted %} + {% set tmplst = tmplst|merge([page]) %} + {% endif %} +{% endfor %} +{% set pages = tmplst|slice(0,10) %} + +
+ +