diff --git a/themes/.gitkeep b/themes/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/themes/knowledge-base/CHANGELOG.md b/themes/knowledge-base/CHANGELOG.md new file mode 100644 index 00000000..b5786af8 --- /dev/null +++ b/themes/knowledge-base/CHANGELOG.md @@ -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... diff --git a/themes/knowledge-base/LICENSE b/themes/knowledge-base/LICENSE new file mode 100644 index 00000000..ff905acd --- /dev/null +++ b/themes/knowledge-base/LICENSE @@ -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. diff --git a/themes/knowledge-base/README.md b/themes/knowledge-base/README.md new file mode 100644 index 00000000..44a35129 --- /dev/null +++ b/themes/knowledge-base/README.md @@ -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 `.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: | +

+ First footer line. +

+

+ Here's a second. +

+``` + +### 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. + + + diff --git a/themes/knowledge-base/blueprints.yaml b/themes/knowledge-base/blueprints.yaml new file mode 100644 index 00000000..d66f1d7a --- /dev/null +++ b/themes/knowledge-base/blueprints.yaml @@ -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' diff --git a/themes/knowledge-base/css/knowledge-base.css b/themes/knowledge-base/css/knowledge-base.css new file mode 100644 index 00000000..65e7a2f6 --- /dev/null +++ b/themes/knowledge-base/css/knowledge-base.css @@ -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%; +} diff --git a/themes/knowledge-base/images/logo.png b/themes/knowledge-base/images/logo.png new file mode 100644 index 00000000..64be1a96 Binary files /dev/null and b/themes/knowledge-base/images/logo.png differ diff --git a/themes/knowledge-base/knowledge-base.php b/themes/knowledge-base/knowledge-base.php new file mode 100644 index 00000000..2fb68a20 --- /dev/null +++ b/themes/knowledge-base/knowledge-base.php @@ -0,0 +1,9 @@ +This theme was with by Perlkönig.

+ 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:

Ce thème à été avec par Perlkönig.

+ 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:

Tento motiv byl -án s uživatelem Perlkönig.

+ 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:

This theme was with by Perlkönig.

+ CATEGORIES: 分类 + POPULAR_ARTICLES: 热门文章 + LATEST_ARTICLES: 最新文章 + AUTHOR: "作者:" + ALL_AUTHOR_POSTS: 该作者所有文章 + ERROR: 错误! + ARTICLE_CATEGORIES: 文章分类 + RELATED_ARTICLES: 相关文章 + COMMENTS: 评论 + CATEGORY: "分类:" +pl: + FOOTER_TEXT:

Ten szablon został z przez Perlkönig.

+ 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:

Este tema ha sido con por Perlkönig.

+ 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:

Este tema foi con por Perlkönig.

+ 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:

Dit thema was met door Perlkönig.

+ 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:" diff --git a/themes/knowledge-base/screenshot.jpg b/themes/knowledge-base/screenshot.jpg new file mode 100644 index 00000000..1db5f11e Binary files /dev/null and b/themes/knowledge-base/screenshot.jpg differ diff --git a/themes/knowledge-base/templates/author.html.twig b/themes/knowledge-base/templates/author.html.twig new file mode 100644 index 00000000..b5bc0477 --- /dev/null +++ b/themes/knowledge-base/templates/author.html.twig @@ -0,0 +1,11 @@ +{% extends 'partials/base.html.twig' %} + +{% block content %} +

{{ 'AUTHOR'|t }} {{ page.header.author }}

+ {{ page.content }} + +

{{ 'ALL_AUTHOR_POSTS'|t }}

+ {% include 'partials/authorposts.html.twig' with {'author': page.header.author} %} +{% endblock %} + + diff --git a/themes/knowledge-base/templates/category.html.twig b/themes/knowledge-base/templates/category.html.twig new file mode 100644 index 00000000..a7c664c1 --- /dev/null +++ b/themes/knowledge-base/templates/category.html.twig @@ -0,0 +1,11 @@ +{% extends 'partials/base.html.twig' %} + +{% block content %} +

{{ 'CATEGORY'|t }} {{ page.header.category }}

+ {{ page.content }} + +

{{ 'RELATED_ARTICLES'|t }}

+ {% include 'partials/categoryposts.html.twig' with {'category': page.header.category} %} +{% endblock %} + + diff --git a/themes/knowledge-base/templates/default.html.twig b/themes/knowledge-base/templates/default.html.twig new file mode 100644 index 00000000..4dd67b69 --- /dev/null +++ b/themes/knowledge-base/templates/default.html.twig @@ -0,0 +1,5 @@ +{% extends 'partials/base.html.twig' %} + +{% block content %} + {{ page.content }} +{% endblock %} diff --git a/themes/knowledge-base/templates/error.html.twig b/themes/knowledge-base/templates/error.html.twig new file mode 100644 index 00000000..e724152c --- /dev/null +++ b/themes/knowledge-base/templates/error.html.twig @@ -0,0 +1,8 @@ +{% extends 'partials/base.html.twig' %} + +{% block content %} +
+

{{ 'ERROR'|t }}

+ {{ page.content }} +
+{% endblock %} diff --git a/themes/knowledge-base/templates/front.html.twig b/themes/knowledge-base/templates/front.html.twig new file mode 100644 index 00000000..2e868456 --- /dev/null +++ b/themes/knowledge-base/templates/front.html.twig @@ -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 %} +
+
+
+

{{ 'ARTICLE_CATEGORIES'|t }}

+
+{% for row in rows %} + {% for cat in row %} +
+ {% include 'partials/frontlist.html.twig' with {'category': cat, 'maxcount': maxcount} %} +
+ {% endfor %} +{% endfor %} +
+
+ +{% endblock %} \ No newline at end of file diff --git a/themes/knowledge-base/templates/item.html.twig b/themes/knowledge-base/templates/item.html.twig new file mode 100644 index 00000000..61491b28 --- /dev/null +++ b/themes/knowledge-base/templates/item.html.twig @@ -0,0 +1,79 @@ +{% extends 'partials/base.html.twig' %} + +{% block content %} +
+
+

+ {% if page.header.media == 'video' %} + + {% else %} + + {% endif %} + {{ page.title|e }} +

+ {% 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) %} +
+ {% if grav.theme.config.params.articles.show.date %} + {{ page.date|date("F j, Y") }} + {% 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([''~author~'']) %} + {% else %} + {% set authorlist = authorlist|merge([''~author~'']) %} + {% endif %} + {% endfor %} + {{ authorlist|join(', ') }} + {% endif %} + {% if grav.theme.config.params.articles.show.topics %} + {% set catlist = [] %} + {% for cat in page.taxonomy.category %} + {% set catlist = catlist|merge([''~cat~'']) %} + {% endfor %} + {{ catlist|join(', ') }} + {% endif %} + {% if grav.theme.config.params.articles.show.time %} + {{ page.content|readingtime }} + {% endif %} +
+ {% endif %} +
+
+ {{ page.content }} + {% if not page.header.hide_mediasummary %} +

+ {% for image in page.media.images %} + {{ image.cropResize(700, 400).html("title", "alt", "itemscreenshot") }} + {% endfor %} + {% endif %} + +
+
+ {% if page.taxonomy.tag|length > 0 %} + {% set taglist = [] %} + {% for tag in page.taxonomy.tag %} + {% set taglist = taglist|merge([''~tag~'']) %} + {% endfor %} +
+ {{ taglist|join(', ') }} +
+ {% endif %} + {% if config.plugins.relatedpages.enabled and related_pages|length > 0 %} + + {% endif %} +
+ {% if config.plugins.comments.enabled %} +
+

{{ 'COMMENTS'|t }}

+
+ {% endif %} +
+{% endblock %} diff --git a/themes/knowledge-base/templates/partials/authorposts.html.twig b/themes/knowledge-base/templates/partials/authorposts.html.twig new file mode 100644 index 00000000..3be598ef --- /dev/null +++ b/themes/knowledge-base/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,maxcount) %} + +
+ +
diff --git a/themes/knowledge-base/templates/partials/base.html.twig b/themes/knowledge-base/templates/partials/base.html.twig new file mode 100644 index 00000000..b723865a --- /dev/null +++ b/themes/knowledge-base/templates/partials/base.html.twig @@ -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 %} + + + +{% block head %} + + {% if header.title %}{{ header.title|e('html') }} | {% endif %}{{ site.title|e('html') }} + + + + {% include 'partials/metadata.html.twig' %} + + + + + {% 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%} + + + +
+{% block header %} +
+ +
+
+ {% block header_navigation %} + + {% endblock %} +
+
+ +
+{% endblock %} + +{% if showsidebar %} +
+{% else %} +
+{% endif %} +{% block body %} +
+
+ {% block content %}{% endblock %} +
+
+{% endblock %} +
+ +{% if showsidebar %} +
+{% block sidebar %} + +{% endblock %} +
+{% endif %} + +
+{% block footer %} + {% set footertext = 'FOOTER_TEXT'|t %} + {% if config.site.footertext is defined %} + {% set footertext = config.site.footertext %} + {% endif %} + +{% endblock %} +
+ +
+ +{% block bottom %} + {{ assets.js('bottom') }} +{% endblock %} + diff --git a/themes/knowledge-base/templates/partials/categoryposts.html.twig b/themes/knowledge-base/templates/partials/categoryposts.html.twig new file mode 100644 index 00000000..02d0f770 --- /dev/null +++ b/themes/knowledge-base/templates/partials/categoryposts.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({'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) %} + +
+
    + {% for p in pages %} + {% if p.header.media == 'video' %} +
  • + {% else %} +
  • + {% endif %} + {{ p.title|e }} +
  • + {% endfor %} +
+
diff --git a/themes/knowledge-base/templates/partials/frontlist.html.twig b/themes/knowledge-base/templates/partials/frontlist.html.twig new file mode 100644 index 00000000..88e092bd --- /dev/null +++ b/themes/knowledge-base/templates/partials/frontlist.html.twig @@ -0,0 +1,15 @@ +{% set articles = taxonomy.findTaxonomy({'category': category}).order('title') %} +
+

+ {# Check to see if a dedicated category page exists #} + {% set slug = category|hyphenize|url_encode %} + {% set p = page.find('/categories/'~slug) %} + {% if p == null %} + {{ category|e }} + {% else %} + {{ category|e }} + {% endif %} + ({{ articles|length }}) +

+ {% include 'partials/topiclist.html.twig' with {'articles': articles, 'maxcount': maxcount} %} +
diff --git a/themes/knowledge-base/templates/partials/metadata.html.twig b/themes/knowledge-base/templates/partials/metadata.html.twig new file mode 100644 index 00000000..2f08a0e5 --- /dev/null +++ b/themes/knowledge-base/templates/partials/metadata.html.twig @@ -0,0 +1,3 @@ +{% for meta in page.metadata %} + +{% endfor %} diff --git a/themes/knowledge-base/templates/partials/navigation.html.twig b/themes/knowledge-base/templates/partials/navigation.html.twig new file mode 100644 index 00000000..dee4ce83 --- /dev/null +++ b/themes/knowledge-base/templates/partials/navigation.html.twig @@ -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 %} +
  • + + {% if p.header.icon %}{% endif %} + {{ p.menu }} + +
      + {{ _self.loop(p) }} +
    +
  • + {% else %} +
  • + + {% if p.header.icon %}{% endif %} + {{ p.menu }} + +
  • + {% endif %} + {% endfor %} +{% endmacro %} + + + diff --git a/themes/knowledge-base/templates/partials/relatedpages.html.twig b/themes/knowledge-base/templates/partials/relatedpages.html.twig new file mode 100644 index 00000000..109647c6 --- /dev/null +++ b/themes/knowledge-base/templates/partials/relatedpages.html.twig @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/themes/knowledge-base/templates/partials/sidebar.html.twig b/themes/knowledge-base/templates/partials/sidebar.html.twig new file mode 100644 index 00000000..373cecf4 --- /dev/null +++ b/themes/knowledge-base/templates/partials/sidebar.html.twig @@ -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 %} +
    +

    {{ 'CATEGORIES'|t }}

    +
      + {% 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 %} +
    • {{ cat }}
    • + {% else %} +
    • {{ cat }}
    • + {% endif %} + {% endfor %} +
    +
    +{% 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 %} +
    + {% 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 %} +

    {{ 'POPULAR_ARTICLES'|t }}

    + {% include 'partials/topiclist.html.twig' with {'articles': popular, 'maxcount': maxcount} %} +
    +{% endif %} + +{% if grav.theme.config.params.sidebar.show.latest %} +
    +

    {{ 'LATEST_ARTICLES'|t }}

    + {% 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} %} +
    +{% endif %} diff --git a/themes/knowledge-base/templates/partials/topiclist.html.twig b/themes/knowledge-base/templates/partials/topiclist.html.twig new file mode 100644 index 00000000..dc46ebdb --- /dev/null +++ b/themes/knowledge-base/templates/partials/topiclist.html.twig @@ -0,0 +1,17 @@ +{% if maxcount is not defined %} + {% set maxcount = (articles|length) + 1 %} +{% endif %} + diff --git a/themes/knowledge-base/templates/taxonomy.html.twig b/themes/knowledge-base/templates/taxonomy.html.twig new file mode 100644 index 00000000..3d08fe23 --- /dev/null +++ b/themes/knowledge-base/templates/taxonomy.html.twig @@ -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 %} +
    +

    {{ 'CATEGORY'|t }} {{ taxval }}

    + {% include 'partials/topiclist.html.twig' with {'articles': taxonomy.findTaxonomy({(taxname): taxval})} %} +
    + {% else %} +
    +

    Categories

    +
      + {% 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 %} +
    • {{ cat }}
    • + {% else %} +
    • {{ cat }}
    • + {% endif %} + {% endfor %} +
    +
    + {% endif %} + {% elseif taxname == 'tag' %} + {% if taxval %} +
    +

    Tag: {{ taxval }}

    + {% include 'partials/topiclist.html.twig' with {'articles': taxonomy.findTaxonomy({(taxname): taxval})} %} +
    + {% else %} +
    +

    Tags

    +
      + {% for tag in taxonomy.taxonomy["tag"]|keys|sort %} +
    • {{ tag }}
    • + {% endfor %} +
    + {% endif %} + {% elseif taxname == 'author' %} + {% if taxval %} +
    +

    Author: {{ taxval }}

    + {% include 'partials/topiclist.html.twig' with {'articles': taxonomy.findTaxonomy({(taxname): taxval})} %} +
    + {% else %} +
    +

    Authors

    +
      + {% 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 %} +
    • {{ author }}
    • + {% else %} +
    • {{ author }}
    • + {% endif %} + {% endfor %} +
    + {% endif %} + {% endif %} + {% else %} +
    +

    Taxonomies

    + +
    + {% endif %} +{% endblock %} + diff --git a/themes/knowledge-base/thumbnail.jpg b/themes/knowledge-base/thumbnail.jpg new file mode 100644 index 00000000..c852bd44 Binary files /dev/null and b/themes/knowledge-base/thumbnail.jpg differ