Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
Latest Articles list fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlkonig committed Mar 16, 2019
1 parent 5383d43 commit e98fb8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
## 03/16/2019

1. [](#new)
* Categories can now have landing pages like authors do (optional), thanks again to @awrog.
* Categories can now have landing pages like authors do (optional), thanks to @awrog.
* Duth translation added, thanks to @awrog.

1. [](#bugfix)
* Comments section hidden if `comments` plugin not present.
* The "Latest Articles" list now finds all articles regardless of folder structure.

# v2.0.1
## 12/11/2018
Expand Down
22 changes: 12 additions & 10 deletions templates/partials/sidebar.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{% set homeroute = '/home' %}
{% if grav.theme.config.params.articleroot is defined %}
{% set homeroute = grav.theme.config.params.articleroot %}
{% endif %}
{% if grav.theme.config.params.articles.root is defined %}
{% set homeroute = grav.theme.config.params.articles.root %}
{% endif %}

{% set options = { items: {'@page.descendants': homeroute}, 'order': {'by': 'date', 'dir': 'desc'}} %}
{% set my_collection = page.collection(options) %}

{% set catlist = taxonomy.taxonomy["category"]|keys %}
{% set blist = [] %}
{% if grav.theme.config.params.articles.blacklist is defined %}
Expand All @@ -11,14 +22,6 @@
{% set catlist = tmplst %}
{% endif %}

{% set homeroute = '/home' %}
{% if grav.theme.config.params.articleroot is defined %}
{% set homeroute = grav.theme.config.params.articleroot %}
{% endif %}
{% if grav.theme.config.params.articles.root is defined %}
{% set homeroute = grav.theme.config.params.articles.root %}
{% endif %}

{% if grav.theme.config.params.sidebar.show.categories %}
<div>
<h1><span>{{ 'CATEGORIES'|t }}</span></h1>
Expand Down Expand Up @@ -75,9 +78,8 @@
{% if grav.theme.config.params.sidebar.show.latest %}
<div class="topiclist">
<h1><span>{{ 'LATEST_ARTICLES'|t }}</span></h1>
{% set articles = page.find(homeroute).children.order('date', 'desc') %}
{% set tmplst = [] %}
{% for page in articles %}
{% for page in my_collection %}
{% set blisted = false %}
{% for bcat in blist %}
{% if bcat in page.taxonomy["category"] or (page.header.published is defined and not page.header.published) %}
Expand Down

0 comments on commit e98fb8f

Please sign in to comment.