mytheme workflow

This commit is contained in:
Daniel Hládek 2020-10-01 14:52:17 +02:00
parent e64004f199
commit b0d7993926
9 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# v0.1.0
## 09/30/2020
1. [](#new)
* ChangeLog started...

21
themes/mytheme/LICENSE Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 sadf
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.

7
themes/mytheme/README.md Normal file
View File

@ -0,0 +1,7 @@
# Mytheme Theme
The **Mytheme** Theme is for [Grav CMS](http://github.com/getgrav/grav). This README.md file should be modified to describe the features, installation, configuration, and general usage of this theme.
## Description
mytheme

View File

@ -0,0 +1,18 @@
name: Mytheme
slug: mytheme
type: theme
version: 0.1.0
description: mytheme
icon: rebel
author:
name: sadf
email: dhladek@mgial.com
homepage: https://github.com/asdf/grav-theme-mytheme
demo: http://demo.yoursite.com
keywords: grav, theme, etc
bugs: https://github.com/asdf/grav-theme-mytheme/issues
readme: https://github.com/asdf/grav-theme-mytheme/blob/develop/README.md
license: MIT
dependencies:
- { name: grav, version: '>=1.6.0' }

View File

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

View File

@ -0,0 +1,8 @@
streams:
schemes:
theme:
type: ReadOnlyStream
prefixes:
'':
- user/themes/mytheme
- user/themes/knowledge-base

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

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 %}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB