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

Commit

Permalink
A couple bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlkonig committed Jun 22, 2017
1 parent baaa219 commit bd67c8b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.3.3
## 06/22/2017

1. [](#bugfix)
* The "Popular Articles" sidebar now actually ignores deleted pages.
* The "Latest Articles" sidebar fixed to respect `articles.root`.

# v1.3.2
## 05/17/2017

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Knowledge Base
version: 1.3.2
version: 1.3.3
description: A theme for a knowledge base or FAQ
icon: database
author:
Expand Down
22 changes: 13 additions & 9 deletions templates/partials/sidebar.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
{% set catlist = tmplst %}
{% endif %}

{% set homeroute = '/home' %}
{% if config.themes['knowledge-base'].params.articleroot is defined %}
{% set homeroute = config.themes['knowledge-base'].params.articleroot %}
{% endif %}
{% if config.themes['knowledge-base'].params.articles.root is defined %}
{% set homeroute = config.themes['knowledge-base'].params.articles.root %}
{% endif %}

{% if config.themes['knowledge-base'].params.sidebar.show.categories %}
<div>
<h1><span>{{ 'CATEGORIES'|t }}</span></h1>
Expand All @@ -31,16 +39,12 @@
<div class="topiclist">
{% set counts = config.plugins['count-views'].counts|sort|reverse %}
{% set popular = [] %}
{% set homeroute = '/home' %}
{% if config.themes['knowledge-base'].params.articleroot is defined %}
{% set homeroute = config.themes['knowledge-base'].params.articleroot %}
{% endif %}
{% if config.themes['knowledge-base'].params.articles.root is defined %}
{% set homeroute = config.themes['knowledge-base'].params.articles.root %}
{% endif %}
{% for route,views in counts %}
{% if route starts with homeroute %}
{% set popular = popular|merge([page.find(route)]) %}
{% set thispage = page.find(route) %}
{% if thispage is not null %}
{% set popular = popular|merge([thispage]) %}
{% endif %}
{% endif %}
{% endfor %}
{% set tmplst = [] %}
Expand All @@ -64,7 +68,7 @@
{% if config.themes['knowledge-base'].params.sidebar.show.latest %}
<div class="topiclist">
<h1><span>{{ 'LATEST_ARTICLES'|t }}</span></h1>
{% set articles = page.find('/home').children.order('date', 'desc') %}
{% set articles = page.find(homeroute).children.order('date', 'desc') %}
{% set tmplst = [] %}
{% for page in articles %}
{% set blisted = false %}
Expand Down

0 comments on commit bd67c8b

Please sign in to comment.