(Grav GitSync) Automatic Commit from dano

This commit is contained in:
Daniel Hládek 2020-10-02 13:16:04 +00:00 committed by GitSync
parent 29723746cc
commit 78623e11a3
28 changed files with 1425 additions and 0 deletions

0
themes/.gitkeep Normal file
View File

View File

@ -0,0 +1,117 @@
# v2.1.1
## 07/30/2020
1. [](#new)
* If you reference media in the page content directly, then you may not want that media resummarized at the end of the post. You can now set a page header named `hide_mediasummary` to suppress the summary for that page.
# v2.1.0
## 03/16/2019
1. [](#new)
* 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
1. [](#new)
* French translation added, thanks to @TheFlighteur.
1. [](#bugfix)
* Fixed a dropdown bug, thanks to @Lipository.
# v2.0.0
## 08/09/2018
1. [](#new)
* **This update is not necessarily backwards compatible!** If you have used theme inheritance to customize this theme, please carefully read the "Updating" section of the docs.
* Changed the way the templates pull information from the theme config files so that inheritance is properly supported.
# v1.3.6
## 07/17/2018
1. [](#bugfix)
* Now works with the latest version of the `count-views` plugin.
# v1.3.5
## 04/24/2018
1. [](#bugfix)
* Fixed duplicate "Related Articles" heading on the article page, thanks to @sebasvisser.
# v1.3.4
## 04/12/2018
1. [](#bugfix)
* Added a check for the `published` header, thanks to @hctagalong.
1. [](#new)
* Spanish and Galican translations added, thanks to @lucasvieites.
# 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
1. [](#new)
* Polish translation added thanks to @AvantaR.
# v1.3.1
## 05/14/2017
1. [](#bugfix)
* Pages now sort as was originally intended.
# v1.3.0
## 05/14/2017
1. [](#new)
* Added `params:articles:blacklist` setting to allow you to omit categories.
# v1.2.1
## 04/04/2017
1. [](#new)
* Some styling refinements. Thanks, @rapsli!
# v1.2.0
## 02/25/2017
1. [](#new)
* Made various components of the sidebar and article display optional. If all components of a specific unit are hidden, then the entire unit is hidden.
* The config variable `params:articleroot` is now deprecated. Use `params:articles:root` instead. Backwards compatibility will be removed at the next major release.
# v1.1.1
## 02/21/2017
1. [](#new)
* Simplified Chinese tranlsation added. Thanks, @lazyyz!
# v1.1.0
## 02/19/2017
1. [](#new)
* Theme now configured to allow for translations
* Czech translation added
* Many thanks to @rbukovansky for these changes!
# v1.0.1
## 11/05/2016
1. [](#bugfix)
* Added plugin dependencies to the blueprint
# v1.0.0
## 10/22/2016
1. [](#new)
* ChangeLog started...

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Aaron Dalton
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,191 @@
# Knowledge Base Theme
![](screenshot.jpg)
This is a basic theme for a knowledge base for [Grav CMS](http://getgrav.org). It is minimal by design and is easy to customize. It is based on [Yahoo's Pure.css framework](http://purecss.io/).
## Installation
Installing the Knowledge Base theme can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the theme with a simple terminal command, while the manual method enables you to do so via a zip file.
The theme by itself is useful, but you may have an easier time getting up and running by installing the skeleton. [The Knowledge Base skeleton](https://github.com/Perlkonig/grav-skeleton-knowledge-base) is a complete site with the theme itself, required plugins and configuration, and sample content.
### GPM Installation (Preferred)
The simplest way to install this theme is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's Terminal (also called the command line). From the root of your Grav install type:
bin/gpm install knowledge-base
This will install the Knowledge Base theme into your `/user/themes` directory within Grav. Its files can be found under `/your/site/grav/user/themes/knowledge-base`.
### Manual Installation
To install this theme, just download the zip version of this repository and unzip it under `/your/site/grav/user/themes`. Then, rename the folder to `knowledge-base`. You can find these files either on [GitHub](https://github.com/Perlkonig/grav-theme-knowledge-base) or via [GetGrav.org](http://getgrav.org/downloads/themes).
You should now have all the theme files under
/your/site/grav/user/themes/knowledge-base
**NOTE:** This theme is a modular component for Grav which requires the [CMS itself](http://github.com/getgrav/grav) and the following plugins to properly function as written (you can of course modify the theme once installed):
* [Error](https://github.com/getgrav/grav-theme-error)
* [Problems](https://github.com/getgrav/grav-plugin-problems)
* [Simple Search](https://github.com/getgrav/grav-plugin-simplesearch)
* [Count Views](https://github.com/Perlkonig/grav-plugin-count-views) (for the "Popular Articles" sidebar)
* [Reading Time](https://github.com/getgrav/grav-plugin-readingtime) (for displaying the reading time at the top of each article)
* [Related Pages](https://github.com/getgrav/grav-plugin-relatedpages) (for the "Related Articles" section at the bottom of each article)
## Updating
**Backwards Compatibility Alert:** *If you are updating from 1.x and have used theme inheritance to customize the theme, then you must copy the contents of your customized `knowledge-base.yaml` file into your new theme's configuration file.*
*Furthermore, if you have overridden any template files, please note the following change. All instances of `config.themes['knowledge-base']` have been replaced with `grav.theme.config`.*
As development for the Knowledge Base theme continues, new versions may become available that add additional features and functionality, improve compatibility with newer Grav releases, and generally provide a better user experience. Updating Knowledge Base is easy, and can be done through Grav's GPM system or manually.
### GPM Update (Preferred)
The simplest way to update this theme is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm). You can do this with this by navigating to the root directory of your Grav install using your system's terminal (also called command line) and typing the following:
bin/gpm update knowledge-base
This command will check your Grav install to see if your Knowledge Base theme is due for an update. If a newer release is found, you will be asked whether or not you wish to update. To continue, type `y` and hit enter. The theme will automatically update and clear Grav's cache.
### Manual Update
Manually updating Knowledge Base is pretty simple. Here is what you will need to do to get this done:
* Delete the `your/site/user/themes/knowledge-base` directory.
* Download the new version of the Knowledge Base theme from either [GitHub](https://github.com/Perlkonig/grav-plugin-knowledge-base) or [GetGrav.org](http://getgrav.org/downloads/themes).
* Unzip the zip file in `your/site/user/themes` and rename the resulting folder to `knowledge-base`.
* Clear the Grav cache. The simplest way to do this is by going to the root Grav directory in terminal and typing `bin/grav clear-cache`.
> Note: Any changes you have made to any of the files listed under this directory will also be removed and replaced by the new set. Any files located elsewhere (for example a YAML settings file placed in `user/config/themes`) will remain intact.
## Customizing
To modify or customize this theme, you must first [read and follow the documentation on theme inheritance](https://learn.getgrav.org/themes/customization#theme-inheritance). Following these instructions is the only way to ensure that your changes are not lost when the theme gets updated.
**NOTE**: You will need to copy and paste the contents of `knowledge-base.yaml` into your newly created `<themename>.yaml`!
### Configuration
This theme can be configured in two places: `knowledge-base.yaml` and `site.yaml`.
#### `knowledge-base.yaml`
Here is the default configuration, which is commented to explain what the different settings do:
```yaml
params:
articles:
root: /home # the route where the articles themselves live
blacklist: ['scratch'] # list of categories to ignore
show: # if all are set to false, the article header is removed
date: true # show article date in the article header
authors: true # show article authors in the article header
topics: true # show assigned topics in the article header
time: true # show reading time in the article header
front: # params for the front page content
maxrows: 3 # the maximum number of rows on the front page
maxentries: 5 # maximum number of articles displayed for each category
sidebar: # params for the sidebar
maxentries: 5 # maximum number of articles to display in "Popular" and "Latest" sections
show: # if all are set to false, the sidebar is removed
categories: true # show Category list in the sidebar
popular: true # show the Popular Articles sidebar
latest: true # show the Latest Articles sidebar
```
**Notes on `params:articles:blacklist`:** Any articles containing a blacklisted category will not appear on the front page, in the sidebar, or in the list of articles by a given author.
#### `site.yaml`
Your `site.yaml` must specify three taxonomies:
```yaml
taxonomies: [category,tag,author]
```
The only theme-specific customization looked for here is the text for the footer. You can change the footer text without touching the templates by adding something like the following to `user/config/site.yaml`:
```yaml
footertext: |
<p>
First footer line.
</p>
<p>
Here's a second.
</p>
```
### CSS
The template loads `theme://css/custom.css` if it exists. The simplest way to customize the CSS is to create this file in your inherited theme and add what styles you need. This way the base `css/knowledge-base.css` can be updated without losing your customizations.
### Templates
To override templates, simply copy the file from the base theme into the same place in your inherited theme and edit as desired. If you configured your inheritied theme correctly, the Grav system will first look for files in your inherited theme. If it's not present, it will pull the file from the base theme.
## Content
### Templates
The following templates are available:
* `author` is used for displaying information about an author and articles they have authored.
* `default` is a blank template that just dumps a page's content.
* `error` is used for displaying error messages.
* `front` is only used for generating the front page. The front page is organzed by the `category` taxonomy.
* `item` is used for an article.
* `taxonomy` is used to display articles by taxonomy (i.e., category, tag, author).
### Structure
Hopefully you're working with [the skeleton packge that contains all the sample content](https://github.com/Perlkonig/grav-skeleton-knowledge-base). If not, at least have a look at that repository so you can follow along.
The theme expects three routes under the `user/pages` folder:
* `/home` (or whatever was specified in `user/config/themes/knowledge-base.yaml` as `articleroot`)
This is where all the knowlege base articles live. Each article should have its own folder containing an `item.md` file. There are a few prerequisites for the page front matter:
* It must contain a `title` field.
* It must contain an explicit `date` field representing the published date.
* It must have at least one `category` assigned for it to appear on the front page. `tag` is completely optional. `author` is recommended. Multiple values are supported in any taxonomy.
Two different icons are currently supported. By default, all articles are marked with a "text" icon. If the article contains media (usually video), then add `media: video` to the front matter. The "video" icon should then be used.
* `/taxonomy`
This is where users can get lists of articles by taxonomy. The `taxonomy.md` file can be titled in any way you wish, and it is recommended that caching be disabled. If no query parameters are passed, then it will display a list of known taxonomies. If a taxonomy is passed via the `name` parameter, then it will list valid values for that taxonomy. If the taxonomy value is also passed (via the `val` parameter), then a list of *all* articles matching that specific taxonomy will be listed.
A note about authors: If a specific author page exists (see `/authors` route below), then the author's name will link to it. If no such page exists, then a generic list of articles will be generated.
* `/authors`
This folder should contain a top-level page that contains the following front matter:
```yaml
redirect: taxonomy?name=author
```
All other content and headers will be ignored.
The folder should then contain folders for each author (optional). The slug is determined by the built-in `hyphenize` twig filter. Each of those folders should contain an `author.md` file. *The page's front matter must include an `author` field containing the properly capitalized and spaced name of the author.* The template will create an initial heading, dump the page content (including images), and then follow with a list of articles this person authored. If no such folder exists, then the `/taxonomy` page will create a simple list of articles written by that author.
The sample content also shows a "Contact Us" page that you will need to configure yourself.
## Credits
This is my first theme. Feedback and pull requests are warmly welcomed.
I decided to try this after a forum post asking if such a template already existed. The poster linked to [a theme called "knowhow" by Hero Themes](http://demo.herothemes.com/#knowhow). That theme inspired this one, but this one was coded completely from scratch with no reference to the original code.

View File

@ -0,0 +1,21 @@
name: Knowledge Base
version: 2.1.1
description: A theme for a knowledge base or FAQ
icon: database
author:
name: Aaron Dalton
email: aaron@daltons.ca
homepage: https://github.com/Perlkonig/grav-theme-knowledge-base
demo: http://perlkonig.com/knowledge-base
keywords: grav, theme, faq, knowledge base, responsive, css3, html5, purecss
bugs: https://github.com/Perlkonig/grav-theme-knowledge-base/issues
readme: https://github.com/Perlkonig/grav-theme-knowledge-base/blob/master/README.md
license: MIT
dependencies:
- error
- problems
- relatedpages
- simplesearch
- readingtime
- 'count-views'

View File

@ -0,0 +1,305 @@
/* Core Stuff */
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#top {
max-width: 1200px;
margin: 0 auto;
}
body {
font-size: 1rem;
line-height: 1.7;
color: #606d6e;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: #454B4D;
}
a {
color: #1F8CD6;
text-decoration: none;
}
a:hover {
color: #175E91;
}
pre {
background: #F0F0F0;
margin: 1rem 0;
border-radius: 2px;
font-family: 'Inconsolata', monospace;
}
code {
font-family: 'Inconsolata', monospace;
}
blockquote {
border-left: 10px solid #eee;
margin: 0;
padding: 0 2rem;
}
/* Utility Classes */
.wrapper {
margin: 0 3rem;
}
.padding {
padding: 3rem 1rem;
}
.left {
float: left;
}
.right {
float: right
}
.rightpad {
padding-right: 1rem;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.text-left {
text-align: left;
}
/* Content Styling */
.header .padding {
padding: 1rem 0;
}
.pure-g .header {
width: 100%
}
/*.header {
background-color: #1F8DD6;
color: #eee;
}
.header a {
color: #fff;
}
*/
.header .logo {
font-size: 1.7rem;
/*text-transform: uppercase;*/
}
.footer {
padding: 1rem 0;
background-color: #eee;
text-align: center;
}
/* Font Family */
html, button, input, select, textarea,
.pure-g [class *= "pure-u"] {
/* Set your content font stack here: */
font-family: 'Lato', sans-serif;
}
.topiclist .count {
font-weight: normal;
font-size: smaller;
padding-left: 0.25rem;
}
.topiclist ul {
list-style-type: none;
margin-left: 0;
padding-left: 0;
}
.topiclist li.text:before {
content: "\f0f6";
font-family: FontAwesome;
display: inline-block;
vertical-align: middle;
padding-right: 0.5rem;
}
.topiclist li.video:before {
content: "\f1c8";
font-family: FontAwesome;
display: inline-block;
vertical-align: middle;
padding-right: 0.5rem;
}
/*.topiclist h2:before {
content: "\f114";
font-family: FontAwesome;
display: inline-block;
vertical-align: middle;
padding-left: -2rem;
}
*/
#sidebar h1 {
font-size: 1.25rem;
}
.frontrow {
border-top: #eee solid 1px;
}
#sidebar h1 {
border-bottom: 3px double #eee;
line-height: 0;
padding-top: 1em;
}
#sidebar h1 span {
background: #fff;
padding-right: 0.5em;
}
.header .search {
background: #eee;
padding: 1em;
}
section.header .details {
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
padding: 0.5em 0;
font-size: smaller;
}
section.header .details span {
padding-right: 1rem;
}
/** tables */
table {
table-layout: fixed;
width: 100%;
}
th {
color:#D5DDE5;;
background:#1b1e24;
border-bottom:4px solid #9ea7af;
border-right: 1px solid #343a45;
font-weight: 100;
padding:15px;
text-align:left;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
vertical-align:middle;
}
th:first-child {
border-top-left-radius:3px;
}
th:last-child {
border-top-right-radius:3px;
border-right:none;
}
tr {
border-top: 1px solid #C1C3D1;
border-bottom-: 1px solid #C1C3D1;
color:#666B85;
font-weight:normal;
text-shadow: 0 1px 1px rgba(256, 256, 256, 0.1);
}
tr:hover td {
background:#4E5066;
color:#FFFFFF;
border-top: 1px solid #22262e;
border-bottom: 1px solid #22262e;
}
tr:first-child {
border-top:none;
}
tr:last-child {
border-bottom:none;
}
tr:nth-child(odd) td {
background:#EBEBEB;
}
tr:nth-child(odd):hover td {
background:#4E5066;
}
tr:last-child td:first-child {
border-bottom-left-radius:3px;
}
tr:last-child td:last-child {
border-bottom-right-radius:3px;
}
td {
background:#FFFFFF;
padding:10px;
text-align:left;
vertical-align:middle;
font-weight:300;
text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.1);
border-right: 1px solid #C1C3D1;
word-wrap: break-word;
}
td:last-child {
border-right: 0px;
}
th.text-left {
text-align: left;
}
th.text-center {
text-align: center;
}
th.text-right {
text-align: right;
}
td.text-left {
text-align: left;
}
td.text-center {
text-align: center;
}
td.text-right {
text-align: right;
}
.itemscreenshot {
border:5px solid #666;
padding: 5px;
width: 100%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -0,0 +1,9 @@
<?php
namespace Grav\Theme;
use Grav\Common\Theme;
class KnowledgeBase extends Theme
{
// Access plugin events in this class
}

View File

@ -0,0 +1,22 @@
enabled: true
dropdown:
enabled: true
params:
articles:
root: /home # the route where the articles themselves live
blacklist: ['scratch'] # list of categories to ignore
show:
date: true # show article date in the article header
authors: true # show article authors in the article header
topics: true # show assigned topics in the article header
time: true # show reading time in the article header
front: # params for the front page content
maxrows: 3 # the maximum number of rows on the front page
maxentries: 5 # maximum number of articles displayed for each category
sidebar: # params for the sidebar
maxentries: 5 # maximum number of articles to display in "Popular" and "Latest" sections
show:
categories: true # show Category list in the sidebar
popular: true # show the Popular Articles sidebar
latest: true # show the Latest Articles sidebar

View File

@ -0,0 +1,96 @@
en:
FOOTER_TEXT: <p><a href="https://github.com/Perlkonig/grav-theme-knowledge-base">This theme</a> was <i class="fa fa-code"></i> with <i class="fa fa-heart"></i> by <a href="http://perlkonig.com">Perlk&ouml;nig</a>.</p>
CATEGORIES: Categories
POPULAR_ARTICLES: Popular Articles
LATEST_ARTICLES: Latest Articles
AUTHOR: "Author:"
ALL_AUTHOR_POSTS: All posts by this author
ERROR: Error!
ARTICLE_CATEGORIES: Article Categories
RELATED_ARTICLES: Related Articles
COMMENTS: Comments
CATEGORY: "Category:"
fr:
FOOTER_TEXT: <p><a href="https://github.com/Perlkonig/grav-theme-knowledge-base">Ce thème</a> à été <i class="fa fa-code"></i> avec <i class="fa fa-heart"></i> par <a href="http://perlkonig.com">Perlk&ouml;nig</a>.</p>
CATEGORIES: Catégories
POPULAR_ARTICLES: Articles Populaires
LATEST_ARTICLES: Derniers Articles
AUTHOR: "Auteur : "
ALL_AUTHOR_POSTS: Tous les articles par cet auteur
ERROR: Erreur!
ARTICLE_CATEGORIES: Catégories d'article
RELATED_ARTICLES: Articles similaires
COMMENTS: Commentaires
CATEGORY: "Catégorie : "
cs:
FOOTER_TEXT: <p><a href="https://github.com/Perlkonig/grav-theme-knowledge-base">Tento motiv</a> byl <i class="fa fa-code"></i>-án s <i class="fa fa-heart"></i> uživatelem <a href="http://perlkonig.com">Perlk&ouml;nig</a>.</p>
CATEGORIES: Kategorie
POPULAR_ARTICLES: Oblíbené články
LATEST_ARTICLES: Poslední články
AUTHOR: "Autor:"
ALL_AUTHOR_POSTS: Všechny autorovy články
ERROR: Chyba!
ARTICLE_CATEGORIES: Kategorie článků
RELATED_ARTICLES: Související články
COMMENTS: Komentáře
CATEGORY: "Kategorie:"
zh-CN:
FOOTER_TEXT: <p><a href="https://github.com/Perlkonig/grav-theme-knowledge-base">This theme</a> was <i class="fa fa-code"></i> with <i class="fa fa-heart"></i> by <a href="http://perlkonig.com">Perlk&ouml;nig</a>.</p>
CATEGORIES: 分类
POPULAR_ARTICLES: 热门文章
LATEST_ARTICLES: 最新文章
AUTHOR: "作者:"
ALL_AUTHOR_POSTS: 该作者所有文章
ERROR: 错误!
ARTICLE_CATEGORIES: 文章分类
RELATED_ARTICLES: 相关文章
COMMENTS: 评论
CATEGORY: "分类:"
pl:
FOOTER_TEXT: <p><a href="https://github.com/Perlkonig/grav-theme-knowledge-base">Ten szablon</a> został <i class="fa fa-code"></i> z <i class="fa fa-heart"></i> przez <a href="http://perlkonig.com">Perlk&ouml;nig</a>.</p>
CATEGORIES: Kategorie
POPULAR_ARTICLES: Popularne artykuły
LATEST_ARTICLES: Ostatnie artykuły
AUTHOR: "Autor:"
ALL_AUTHOR_POSTS: Wszystkie posty tego autora
ERROR: Błąd!
ARTICLE_CATEGORIES: Kategorie artykułów
RELATED_ARTICLES: Powiązane artykuły
COMMENTS: Komentarze
CATEGORY: "Kategoria:"
es:
FOOTER_TEXT: <p><a href="https://github.com/Perlkonig/grav-theme-knowledge-base">Este tema</a> ha sido <i class="fa fa-code"></i> con <i class="fa fa-heart"></i> por <a href="http://perlkonig.com">Perlk&ouml;nig</a>.</p>
CATEGORIES: Categorías
POPULAR_ARTICLES: Artículos
LATEST_ARTICLES: Artículos más nuevos
AUTHOR: "Autor:"
ALL_AUTHOR_POSTS: Todos los artículos de este autor
ERROR: Error!
ARTICLE_CATEGORIES: Categorías de artículos
RELATED_ARTICLES: Artículos relacionados
COMMENTS: Comentarios
CATEGORY: "Categoría:"
gl:
FOOTER_TEXT: <p><a href="https://github.com/Perlkonig/grav-theme-knowledge-base">Este tema</a> foi <i class="fa fa-code"></i> con <i class="fa fa-heart"></i> por <a href="http://perlkonig.com">Perlk&ouml;nig</a>.</p>
CATEGORIES: Categorías
POPULAR_ARTICLES: Artigos
LATEST_ARTICLES: Artigos máis novos
AUTHOR: "Autor:"
ALL_AUTHOR_POSTS: Tódolos artigos deste autor
ERROR: Erro!
ARTICLE_CATEGORIES: Categorías de artigos
RELATED_ARTICLES: Artigos relacionados
COMMENTS: Comentarios
CATEGORY: "Categoría:"
nl:
FOOTER_TEXT: <p><a href="https://github.com/Perlkonig/grav-theme-knowledge-base">Dit thema</a> was <i class="fa fa-code"></i> met <i class="fa fa-heart"></i> door <a href="http://perlkonig.com">Perlk&ouml;nig</a>.</p>
CATEGORIES: Categorieën
POPULAR_ARTICLES: Populaire artikelen
LATEST_ARTICLES: Recente artikelen
AUTHOR: "Auteur:"
ALL_AUTHOR_POSTS: Alle artikelen van deze auteur
ERROR: Fout!
ARTICLE_CATEGORIES: Artikelcategorieën
RELATED_ARTICLES: Zie ook
COMMENTS: Commentaren
CATEGORY: "Categorie:"

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

View File

@ -0,0 +1,11 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
<h1>{{ 'AUTHOR'|t }} {{ page.header.author }}</h1>
{{ page.content }}
<h2>{{ 'ALL_AUTHOR_POSTS'|t }}</h2>
{% include 'partials/authorposts.html.twig' with {'author': page.header.author} %}
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
<h1>{{ 'CATEGORY'|t }} {{ page.header.category }}</h1>
{{ page.content }}
<h2>{{ 'RELATED_ARTICLES'|t }}</h2>
{% include 'partials/categoryposts.html.twig' with {'category': page.header.category} %}
{% endblock %}

View File

@ -0,0 +1,5 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
{{ page.content }}
{% endblock %}

View File

@ -0,0 +1,8 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
<div class="lead text-center">
<h1>{{ 'ERROR'|t }}</h1>
{{ page.content }}
</div>
{% endblock %}

View File

@ -0,0 +1,50 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
{% set catlist = taxonomy.taxonomy["category"]|keys %}
{% 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 rows=[] %}
{% set node=[] %}
{% set maxrows = 3 %}
{% if grav.theme.config.params.front.maxrows is defined %}
{% set maxrows = grav.theme.config.params.front.maxrows %}
{% endif %}
{% for cat in catlist|sort|slice(0,maxrows*2) %}
{% set node = node|merge([cat]) %}
{% if (node|length == 2) or (loop.last) %}
{% set rows = rows|merge([node]) %}
{% set node = [] %}
{% endif %}
{% endfor %}
{% set maxcount = 5 %}
{% if grav.theme.config.params.front.maxentries is defined %}
{% set maxcount = grav.theme.config.params.front.maxentries %}
{% endif %}
<section id="articlelist">
<div class="pure-g">
<div class="pure-u-1">
<h1>{{ 'ARTICLE_CATEGORIES'|t }}</h1>
</div>
{% for row in rows %}
{% for cat in row %}
<div class="pure-u-1 pure-u-md-1-2 frontrow">
{% include 'partials/frontlist.html.twig' with {'category': cat, 'maxcount': maxcount} %}
</div>
{% endfor %}
{% endfor %}
</div>
</section>
{% endblock %}

View File

@ -0,0 +1,79 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
<article>
<section class="header">
<h1>
{% if page.header.media == 'video' %}
<i class="fa fa-file-video-o rightpad"></i>
{% else %}
<i class="fa fa-file-text-o rightpad"></i>
{% endif %}
{{ page.title|e }}
</h1>
{% if (grav.theme.config.params.articles.show.date) or (grav.theme.config.params.articles.show.authors) or (grav.theme.config.params.articles.show.topics) or (grav.theme.config.params.articles.show.time) %}
<div class="details">
{% if grav.theme.config.params.articles.show.date %}
<span>{{ page.date|date("F j, Y") }}</span>
{% endif %}
{% if grav.theme.config.params.articles.show.authors %}
{% set authorlist = [] %}
{% for author in page.taxonomy['author'] %}
{# Check to see if a dedicated author page exists #}
{% set slug = author|hyphenize|url_encode %}
{% set p = page.find('/authors/'~slug) %}
{% if p == null %}
{% set authorlist = authorlist|merge(['<a href="'~base_url~'/taxonomy?name=author&amp;val='~(author|url_encode)~'">'~author~'</a>']) %}
{% else %}
{% set authorlist = authorlist|merge(['<a href="'~base_url~'/authors/'~slug~'">'~author~'</a>']) %}
{% endif %}
{% endfor %}
<span><i class="fa fa-user"></i> {{ authorlist|join(', ') }}</span>
{% endif %}
{% if grav.theme.config.params.articles.show.topics %}
{% set catlist = [] %}
{% for cat in page.taxonomy.category %}
{% set catlist = catlist|merge(['<a href="'~base_url~'/taxonomy?name=category&amp;val='~(cat|url_encode)~'">'~cat~'</a>']) %}
{% endfor %}
<span>{{ catlist|join(', ') }}</span>
{% endif %}
{% if grav.theme.config.params.articles.show.time %}
<span>{{ page.content|readingtime }}</span>
{% endif %}
</div>
{% endif %}
</section>
<section class="content">
{{ page.content }}
{% if not page.header.hide_mediasummary %}
<p></p>
{% for image in page.media.images %}
{{ image.cropResize(700, 400).html("title", "alt", "itemscreenshot") }}
{% endfor %}
{% endif %}
</section>
<section class="foot">
{% if page.taxonomy.tag|length > 0 %}
{% set taglist = [] %}
{% for tag in page.taxonomy.tag %}
{% set taglist = taglist|merge(['<a href="'~base_url~'/taxonomy?name=tag&amp;val='~(tag|url_encode)~'">'~tag~'</a>']) %}
{% endfor %}
<div class="tags">
<i class="fa fa-tags rightpad"></i>{{ taglist|join(', ') }}
</div>
{% endif %}
{% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
<div class="related topiclist">
<h2>{{ 'RELATED_ARTICLES'|t }}</h2>
{% include 'partials/relatedpages.html.twig' %}
</div>
{% endif %}
</section>
{% if config.plugins.comments.enabled %}
<section class="comments">
<h2>{{ 'COMMENTS'|t }}</h2>
</section>
{% endif %}
</article>
{% endblock %}

View File

@ -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,maxcount) %}
<section class="topiclist">
<ul>
{% for p in pages %}
{% if p.header.media == 'video' %}
<li class="video">
{% else %}
<li class="text">
{% endif %}
<a href="{{p.url}}">{{ p.title|e }}</a>
</li>
{% endfor %}
</ul>
</section>

View File

@ -0,0 +1,109 @@
{% set showsidebar = false %}
{% if (grav.theme.config.params.sidebar.show.categories) or (grav.theme.config.params.sidebar.show.popular) or (grav.theme.config.params.sidebar.show.latest) %}
{% set showsidebar = true %}
{% endif %}
<!DOCTYPE html>
<html lang="{{ grav.language.getActive ?: grav.theme.config.default_lang }}">
<head>
{% block head %}
<meta charset="utf-8" />
<title>{% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% include 'partials/metadata.html.twig' %}
<link rel="icon" type="image/png" href="{{ url('theme://images/logo.png') }}" />
<link rel="canonical" href="{{ page.url(true, true) }}" />
{% block stylesheets %}
{% do assets.addCss('https://fonts.googleapis.com/css?family=Inconsolata|Lato') %}
{% do assets.addCss('https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css', 100) %}
{% do assets.addCss('https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-responsive-min.css', 99) %}
{% do assets.addCss('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', 95) %}
{% do assets.addCss('theme://css/knowledge-base.css', 90) %}
{% do assets.addCss('theme://css/custom.css', 80) %}
{% endblock %}
{{ assets.css() }}
{% block javascripts %}
{% do assets.addJs('jquery', 100) %}
{% endblock %}
{{ assets.js() }}
{% endblock head%}
</head>
<body id="top" class="{{ page.header.body_classes }}">
<div class="pure-g wrapper">
{% block header %}
<div class="header">
<div class="pure-u-1 pure-u-md-2-5">
<div class="padding">
<a class="logo left" href="{{ base_url == '' ? '/' : base_url }}">
<i class="fa fa-rebel"></i>
{{ config.site.title }}
</a>
</div>
</div>
<div class="pure-u-1 pure-u-md-3-5">
<div class="padding">
{% block header_navigation %}
<nav class="pure-menu pure-menu-horizontal">
{% include 'partials/navigation.html.twig' %}
</nav>
{% endblock %}
</div>
</div>
<div class="pure-u-1 search">
<div class="padding">
{% include 'partials/simplesearch_searchbox.html.twig' %}
</div>
</div>
</div>
{% endblock %}
{% if showsidebar %}
<div class="pure-u-1 pure-u-md-16-24">
{% else %}
<div class="pure-u-1">
{% endif %}
{% block body %}
<section id="body">
<div class="padding">
{% block content %}{% endblock %}
</div>
</section>
{% endblock %}
</div> <!-- pure-u-16-24 -->
{% if showsidebar %}
<div class="pure-u-1 pure-u-md-8-24">
{% block sidebar %}
<section id="sidebar">
<div class="padding">
{% include 'partials/sidebar.html.twig' %}
</div>
</section>
{% endblock %}
</div> <!-- pure-u-8-24 -->
{% endif %}
<div class="pure-u-1">
{% block footer %}
{% set footertext = 'FOOTER_TEXT'|t %}
{% if config.site.footertext is defined %}
{% set footertext = config.site.footertext %}
{% endif %}
<div class="footer">
{{footertext}}
</div>
{% endblock %}
</div> <!-- pure-u-1 -->
</div> <!-- pure-g -->
{% block bottom %}
{{ assets.js('bottom') }}
{% endblock %}
</body>

View File

@ -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({'category': category}).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,maxcount) %}
<section class="topiclist">
<ul>
{% for p in pages %}
{% if p.header.media == 'video' %}
<li class="video">
{% else %}
<li class="text">
{% endif %}
<a href="{{p.url}}">{{ p.title|e }}</a>
</li>
{% endfor %}
</ul>
</section>

View File

@ -0,0 +1,15 @@
{% set articles = taxonomy.findTaxonomy({'category': category}).order('title') %}
<section class="topiclist">
<h2>
{# Check to see if a dedicated category page exists #}
{% set slug = category|hyphenize|url_encode %}
{% set p = page.find('/categories/'~slug) %}
{% if p == null %}
<a href="{{ base_url }}/taxonomy?name=category&amp;val={{ category|url_encode }}">{{ category|e }}</a>
{% else %}
<a href="{{ base_url }}/categories/{{slug}}">{{ category|e }}</a>
{% endif %}
<span class="count">({{ articles|length }})</span>
</h2>
{% include 'partials/topiclist.html.twig' with {'articles': articles, 'maxcount': maxcount} %}
</section>

View File

@ -0,0 +1,3 @@
{% for meta in page.metadata %}
<meta {% if meta.name %}name="{{ meta.name }}" {% endif %}{% if meta.http_equiv %}http-equiv="{{ meta.http_equiv }}" {% endif %}{% if meta.charset %}charset="{{ meta.charset }}" {% endif %}{% if meta.property %}property="{{ meta.property }}" {% endif %}{% if meta.content %}content="{{ meta.content }}" {% endif %}/>
{% endfor %}

View File

@ -0,0 +1,48 @@
{% macro loop(page) %}
{% for p in page.children.visible %}
{% set current_page = (p.active or p.activeChild) ? 'pure-menu-selected' : '' %}
{% if p.children.visible.count > 0 %}
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover {{ current_page }}">
<a class="pure-menu-link" href="{{ p.url }}">
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
{{ p.menu }}
</a>
<ul class="pure-menu-children">
{{ _self.loop(p) }}
</ul>
</li>
{% else %}
<li class="pure-menu-item {{ current_page }}">
<a class="pure-menu-link" href="{{ p.url }}">
{% if p.header.icon %}<i class="fa fa-{{ p.header.icon }}"></i>{% endif %}
{{ p.menu }}
</a>
</li>
{% endif %}
{% endfor %}
{% endmacro %}
<ul class="pure-menu-list">
{% if grav.theme.config.dropdown.enabled %}
{{ _self.loop(pages) }}
{% else %}
{% for page in pages.children.visible %}
{% set current_page = (page.active or page.activeChild) ? 'pure-menu-selected' : '' %}
<li class="pure-menu-item {{ current_page }}">
<a class="pure-menu-link" href="{{ page.url }}">
{% if page.header.icon %}<i class="fa fa-{{ page.header.icon }}"></i>{% endif %}
{{ page.menu }}
</a>
</li>
{% endfor %}
{% endif %}
{% for mitem in site.menu %}
<li class="pure-menu-item">
<a class="pure-menu-link" href="{{ mitem.url }}">
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
{{ mitem.text }}
</a>
</li>
{% endfor %}
</ul>

View File

@ -0,0 +1,17 @@
<ul class="related-pages">
{% for related_path, score in related_pages %}
{% set related = grav['pages'].get(related_path) %}
{% if related %}
{% if related.header.media == 'video' %}
<li class="video">
{% else %}
<li class="text">
{% endif %}
{% if config.plugins.relatedpages.show_score %}
<span class="score">{{ score }}</span>
{% endif %}
<a href="{{ related.url }}" title="{{ related.title }}">{{ related.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>

View File

@ -0,0 +1,97 @@
{% 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 %}
{% 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 %}
{% if grav.theme.config.params.sidebar.show.categories %}
<div>
<h1><span>{{ 'CATEGORIES'|t }}</span></h1>
<ul style="padding-left: 1rem">
{% for cat in catlist|sort %}
{# Check to see if a dedicated category page exists #}
{% set slug = cat|hyphenize|url_encode %}
{% set p = page.find('/categories/'~slug) %}
{% if p == null %}
<li><a href="{{ base_url }}/taxonomy?name=category&amp;val={{ cat|url_encode }}">{{ cat }}</a></li>
{% else %}
<li><a href="{{ base_url }}/categories/{{slug}}">{{ cat }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
{% set maxcount = 5 %}
{% if grav.theme.config.params.sidebar.maxentries is defined %}
{% set maxcount = grav.theme.config.params.sidebar.maxentries %}
{% endif %}
{% if grav.theme.config.params.sidebar.show.popular %}
<div class="topiclist">
{% set counts = viewcounts|sort|reverse %}
{% set popular = [] %}
{% for route,views in counts %}
{% if route starts with homeroute %}
{% set thispage = page.find(route) %}
{% if thispage is not null %}
{% set popular = popular|merge([thispage]) %}
{% endif %}
{% endif %}
{% endfor %}
{% set tmplst = [] %}
{% for page in popular %}
{% 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 popular = tmplst %}
<h1><span>{{ 'POPULAR_ARTICLES'|t }}</span></h1>
{% include 'partials/topiclist.html.twig' with {'articles': popular, 'maxcount': maxcount} %}
</div>
{% endif %}
{% if grav.theme.config.params.sidebar.show.latest %}
<div class="topiclist">
<h1><span>{{ 'LATEST_ARTICLES'|t }}</span></h1>
{% set tmplst = [] %}
{% 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) %}
{# Setting this to blacklisted when the category is in the blacklist OR if the page isn't yet published #}
{% set blisted = true %}
{% endif %}
{% endfor %}
{% if not blisted %}
{% set tmplst = tmplst|merge([page]) %}
{% endif %}
{% endfor %}
{% set articles = tmplst|slice(0,maxcount) %}
{% include 'partials/topiclist.html.twig' with {'articles': articles, 'maxcount': maxcount} %}
</div>
{% endif %}

View File

@ -0,0 +1,17 @@
{% if maxcount is not defined %}
{% set maxcount = (articles|length) + 1 %}
{% endif %}
<ul>
{% for p in articles|slice(0,maxcount) %}
{# If the page isn't published, don't show it... #}
{% if not p.header.published is defined or p.header.published %}
{% if p.header.media == 'video' %}
<li class="video">
{% else %}
<li class="text">
{% endif %}
<a href="{{p.url}}">{{ p.title|e }}</a>
</li>
{% endif %}
{% endfor %}
</ul>

View File

@ -0,0 +1,93 @@
{% extends 'partials/base.html.twig' %}
{% block content %}
{% set catlist = taxonomy.taxonomy["category"]|keys %}
{% 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 taxname = uri.query('name') %}
{% set taxval = uri.query('val') %}
{% if taxname %}
{% if taxname == 'category' %}
{% if taxval %}
<section class="topiclist">
<h1>{{ 'CATEGORY'|t }} {{ taxval }}</h1>
{% include 'partials/topiclist.html.twig' with {'articles': taxonomy.findTaxonomy({(taxname): taxval})} %}
</section>
{% else %}
<section>
<h1>Categories</h1>
<ul>
{% for cat in catlist|sort %}
{# Check to see if a dedicated category page exists #}
{% set slug = cat|hyphenize|url_encode %}
{% set p = page.find('/categories/'~slug) %}
{% if p == null %}
<li><a href="{{ base_url }}/taxonomy?name=category&amp;val={{ cat|url_encode }}">{{ cat }}</a></li>
{% else %}
<li><a href="{{ base_url }}/categories/{{slug}}">{{ cat }}</a></li>
{% endif %}
{% endfor %}
</ul>
</section>
{% endif %}
{% elseif taxname == 'tag' %}
{% if taxval %}
<section class="topiclist">
<h1>Tag: {{ taxval }}</h1>
{% include 'partials/topiclist.html.twig' with {'articles': taxonomy.findTaxonomy({(taxname): taxval})} %}
</section>
{% else %}
<section>
<h1>Tags</h1>
<ul>
{% for tag in taxonomy.taxonomy["tag"]|keys|sort %}
<li><a href="{{ base_url }}/taxonomy?name=tag&amp;val={{ tag|url_encode }}">{{ tag }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% elseif taxname == 'author' %}
{% if taxval %}
<section class="topiclist">
<h1>Author: {{ taxval }}</h1>
{% include 'partials/topiclist.html.twig' with {'articles': taxonomy.findTaxonomy({(taxname): taxval})} %}
</section>
{% else %}
<section>
<h1>Authors</h1>
<ul>
{% for author in taxonomy.taxonomy["author"]|keys|sort %}
{# Check to see if a dedicated author page exists #}
{% set slug = author|hyphenize|url_encode %}
{% set p = page.find('/authors/'~slug) %}
{% if p == null %}
<li><a href="{{ base_url }}/taxonomy?name=author&amp;val={{ author|url_encode }}">{{ author }}</a></li>
{% else %}
<li><a href="{{ base_url }}/authors/{{slug}}">{{ author }}</a></li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% else %}
<section>
<h1>Taxonomies</h1>
<ul>
<li><a href="{{ page.url }}?name=category">Categories</a></li>
<li><a href="{{ page.url }}?name=tag">Tags</a></li>
<li><a href="{{ page.url }}?name=author">Authors</a></li>
</ul>
</section>
{% endif %}
{% endblock %}

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB