first commit
This commit is contained in:
81
templates/partials/base.html.twig
Normal file
81
templates/partials/base.html.twig
Normal file
@@ -0,0 +1,81 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ grav.language.getActive ?: grav.config.site.default_lang }}">
|
||||
<head>
|
||||
{% set theme_config = attribute(config.themes, config.system.pages.theme) %}
|
||||
{% block head %}
|
||||
<meta charset="utf-8" />
|
||||
<title>{% if header.title %}{{ header.title }} | {% endif %}{{ site.title }}</title>
|
||||
{% include 'partials/metadata.html.twig' %}
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
{% if theme_config.favicon %}
|
||||
{% set favicon_file = (theme_config.favicon|first).name %}
|
||||
<link rel="icon" type="{{ theme_config.favicon|first.type }}" href="{{ url('theme://images/favicon/' ~ favicon_file) }}" />
|
||||
{% else %}
|
||||
<link rel="icon" type="image/png" href="{{ url('theme://assets/favicon.png') }}" />
|
||||
{% endif %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel='stylesheet' id='twentyfifteen-fonts-css' href='https://fonts.googleapis.com/css?family=Noto+Sans%3A400italic%2C700italic%2C400%2C700%7CNoto+Serif%3A400italic%2C700italic%2C400%2C700%7CInconsolata%3A400%2C700&subset=latin%2Clatin-ext' type='text/css' media='all' />
|
||||
<link rel='stylesheet' id='twentyfifteen-style-css' href='{{ url('theme://css/style.css') }}' type='text/css' media='all' />
|
||||
{% do assets.addCss('theme://assets/fontawesome/css/all.css') %}
|
||||
{% do assets.addCss('theme://css/ksite.css') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% do assets.add('jquery',101) %}
|
||||
{% endblock %}
|
||||
|
||||
{% block color_scheme %}
|
||||
{% if theme_config.current_preset and theme_config.current_preset != 'default' %}
|
||||
{% include 'partials/color_scheme.html.twig' %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block assets deferred %}
|
||||
{{ assets.css()|raw }}
|
||||
{{ assets.js()|raw }}
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
<body class="home blog">
|
||||
<div id="page" class="hfeed site">
|
||||
{% block sidebar %}
|
||||
{% include 'partials/sidebar.html.twig' %}
|
||||
{% endblock %}
|
||||
{% block body %}
|
||||
<div id="content" class="site-content">
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main" role="main">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
<footer id="colophon" class="site-footer" role="contentinfo">
|
||||
<div class="site-info">
|
||||
© {{ "now"|date('Y') }} {{ config.theme.footer }}
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
{% block javascripts_bottom %}
|
||||
{{ assets.js('bottom')|raw }}
|
||||
<script type='text/javascript'>
|
||||
/* <![CDATA[ */
|
||||
var screenReaderText = {"expand":"<span class=\"screen-reader-text\">expand child menu<\/span>","collapse":"<span class=\"screen-reader-text\">collapse child menu<\/span>"};
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<!--[if lte IE 8]><script type='text/javascript' src='{{ url('theme://js/html5.js') }}'></script><![endif]-->
|
||||
<script type='text/javascript' src='{{ url('theme://js/jquery-migrate.min.js') }}'></script>
|
||||
<script type='text/javascript' src='{{ url('theme://js/functions.js') }}'></script>
|
||||
<script type='text/javascript' src='{{ url('theme://js/skip-link-focus-fix.js') }}'></script>
|
||||
{% endblock %}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
148
templates/partials/blog_item.html.twig
Normal file
148
templates/partials/blog_item.html.twig
Normal file
@@ -0,0 +1,148 @@
|
||||
<article class="post type-post post-excerpt format-standard hentry {% if page.media.images %}has-post-thumbnail{% endif %}">
|
||||
|
||||
<div class="post-thumbnail">
|
||||
{{ page.media.images|first.cropZoom(1038,437).html(page.title, page.title, 'attachment-post-thumbnail wp-post-image')|raw }}
|
||||
</div>
|
||||
|
||||
<header class="entry-header">
|
||||
{% if page.header.link %}
|
||||
<h2 class="entry-title">
|
||||
{% if page.header.continue_link is not sameas(false) %}
|
||||
<a href="{{ page.url }}"></a>
|
||||
{% endif %}
|
||||
<a href="{{ page.header.link }}">{{ page.title }}</a>
|
||||
</h2>
|
||||
{% else %}
|
||||
<h2 class="entry-title"><a href="{{ page.url }}">{{ page.title }}</a></h2>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
<div class="entry-content">
|
||||
{% if page.header.continue_link is sameas(false) %}
|
||||
{{ page.content|raw }}
|
||||
{% if not truncate %}
|
||||
{% set show_prev_next = true %}
|
||||
{% endif %}
|
||||
{% elseif truncate and page.summary != page.content %}
|
||||
{{ page.summary|raw }}
|
||||
<a class="more-link" href="{{ page.url }}">{{ 'READ_MORE'|t }}</a>
|
||||
{% elseif truncate %}
|
||||
{{ page.content|truncate(550)|raw }}
|
||||
<a class="more-link" href="{{ page.url }}">{{ 'READ_MORE'|t }}</a>
|
||||
{% else %}
|
||||
{{ page.content|raw }}
|
||||
{% set show_prev_next = true %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% set author = authors[page.header.aura.author] %}
|
||||
{% if author %}
|
||||
{% set social = [
|
||||
'linkedin',
|
||||
'youtube',
|
||||
'facebook',
|
||||
'instagram',
|
||||
'pinterest',
|
||||
'website',
|
||||
] %}
|
||||
|
||||
{% if not truncate %}
|
||||
<div class="author-info">
|
||||
<h2 class="author-heading">
|
||||
{{ 'PUBLISHED_BY'|t }}
|
||||
</h2>
|
||||
<div class="author-avatar">
|
||||
{% if author.image %}
|
||||
{{ media['user://images/' ~ author.image|first.name].cropZoom(56,56).html('', author.name, 'avatar avatar-56')|raw }}
|
||||
{{ page.media.images[page.header.avatar].cropZoom(56,56).html(page.header.avatar,page.header.avatar, 'avatar avatar-56')|raw }}
|
||||
{% endif %}
|
||||
{% if author.name or author.description %}
|
||||
<div class="author-description">
|
||||
{% if author.name %}
|
||||
<h3 class="author-title">
|
||||
{{ author.name }}
|
||||
</h3>
|
||||
{% endif %}
|
||||
{% if author.description %}
|
||||
<p class="author-bio">
|
||||
{{ author.description }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<footer class="entry-footer">
|
||||
<span class="posted-on">
|
||||
<time class="entry-date published updated" datetime="{{ page.date|date(config.system.pages.dateformat.short) }}">{{ 'MONTHS_OF_THE_YEAR'|ta(page.date|date('n') - 1) }} {{ page.date|date(config.system.pages.dateformat.default) }}</time>
|
||||
</span>
|
||||
{% if author.name %}
|
||||
<span class="byline">
|
||||
<span class="author vcard">
|
||||
{{ author.name }}
|
||||
</span>
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if page.taxonomy.tag %}
|
||||
<span class="tags-links">
|
||||
{% for tag in page.taxonomy.tag %}
|
||||
<a href="{{ base_url }}/tag{{ config.system.param_sep }}{{ tag }}">{{ tag }}{% if not loop.last %},{% endif %}</a>
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
{% if not truncate %}
|
||||
{% if config.plugins.comments.enabled %}
|
||||
<div id="comments" class="comments-area">
|
||||
{% include 'partials/comments.html.twig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if config.plugins.jscomments.enabled %}
|
||||
<div id="comments" class="comments-area">
|
||||
{{ jscomments()|raw }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if show_prev_next %}
|
||||
{% if page.nextSibling.media.images %}
|
||||
<style type="text/css">
|
||||
.post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); }
|
||||
</style>
|
||||
{% endif %}
|
||||
{% if page.prevSibling.media.images %}
|
||||
<style type="text/css">
|
||||
.post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); }
|
||||
</style>
|
||||
{% endif %}
|
||||
|
||||
<nav class="navigation post-navigation" role="navigation">
|
||||
<h2 class="screen-reader-text">Post navigation</h2>
|
||||
<div class="nav-links">
|
||||
{% if not page.isLast %}
|
||||
<div class="nav-previous" {% if page.prevSibling.media.images %}style="background-image: url({{ page.prevSibling.media.images|first.cropZoom(1038,437).url }}");{% endif %}>
|
||||
<a href="{{ page.prevSibling.url }}" rel="prev">
|
||||
<span class="meta-nav" aria-hidden="true" {% if page.prevSibling.media.images %}style="color: #fff;"{% endif %}>{{ 'PREVIOUS'|t }}</span>
|
||||
<span class="screen-reader-text">{{ 'PREVIOUS'|t }}</span>
|
||||
<span class="post-title" {% if page.prevSibling.media.images %}style="color: #fff;"{% endif %}>{{ page.prevSibling.header.title }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if not page.isFirst %}
|
||||
<div class="nav-next" {% if page.nextSibling.media.images %}style="background-image: url({{ page.nextSibling.media.images|first.cropZoom(1038,437).url }}");{% endif %}>
|
||||
<a href="{{ page.nextSibling.url }}" rel="next">
|
||||
<span class="meta-nav" aria-hidden="true" {% if page.nextSibling.media.images %}style="color: #fff;"{% endif %}>{{ 'NEXT'|t }}</span>
|
||||
<span class="screen-reader-text">{{ 'NEXT'|t }}</span>
|
||||
<span class="post-title" {% if page.nextSibling.media.images %}style="color: #fff;"{% endif %}>{{ page.nextSibling.header.title }}</span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
62
templates/partials/sidebar.html.twig
Normal file
62
templates/partials/sidebar.html.twig
Normal file
@@ -0,0 +1,62 @@
|
||||
<div id="sidebar" class="sidebar" >
|
||||
<header id="masthead" class="site-header" role="banner">
|
||||
<div class="site-branding">
|
||||
{% if config.theme.logo %}
|
||||
{% set logo_file = (config.theme.logo|first).name %}
|
||||
<a href="{{ base_url_absolute }}">
|
||||
<img src="{{ url('theme://images/logo/' ~ logo_file) }}" style="width: auto; height: 32px;" alt="{{ site.title|t }}" />
|
||||
</a>
|
||||
{% else %}
|
||||
<h1 class="site-title"><a href="{{ base_url_absolute }}">{{ config.site.title|t }}</a></h1>
|
||||
{% endif %}
|
||||
<p class="site-description">{{ config.theme.tagline|t }}</p>
|
||||
<button class="secondary-toggle">Menu and widgets</button>
|
||||
</div>
|
||||
</header>
|
||||
<div id="secondary" class="secondary">
|
||||
<div id="widget-area" class="widget-area" role="complementary">
|
||||
{% include 'partials/navigation.html.twig' %}
|
||||
{% if site.social %}
|
||||
{% include 'partials/social.html.twig' %}
|
||||
{% endif %}
|
||||
{% if config.plugins.simplesearch.enabled %}
|
||||
<aside class="widget search">
|
||||
{% include 'partials/simplesearch_searchbox.html.twig' %}
|
||||
</aside>
|
||||
{% endif %}
|
||||
{% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
|
||||
<aside class="widget widget_meta">
|
||||
<h2 class="widget-title">{{ 'RELATED_POSTS'|t }}</h2>
|
||||
{% include 'partials/relatedpages.html.twig' %}
|
||||
</aside>
|
||||
{% endif %}
|
||||
{% if config.plugins.random.enabled %}
|
||||
<aside class="widget text-style1">
|
||||
<h2 class="widget-title">{{ 'RANDOM_ARTICLE'|t }}</h2>
|
||||
<a href="{{ base_url_relative }}/random"><i class="fa fa-retweet"></i> I'm Feeling Lucky!</a>
|
||||
</aside>
|
||||
{% endif %}
|
||||
{% if config.plugins.taxonomylist.enabled %}
|
||||
<aside class="widget widget_meta">
|
||||
<h2 class="widget-title">{{ 'POPULAR_TAGS'|t }}</h2>
|
||||
{% include 'partials/taxonomylist.html.twig' with {'taxonomy':'tag'} %}
|
||||
</aside>
|
||||
{% endif %}
|
||||
{% if config.plugins.archives.enabled %}
|
||||
<aside class="widget widget_meta">
|
||||
<h2 class="widget-title">{{ 'ARCHIVES'|t }}</h2>
|
||||
{% include 'partials/archives.html.twig' %}
|
||||
</aside>
|
||||
{% endif %}
|
||||
{% if config.plugins.feed.enabled %}
|
||||
<aside class="widget widget_meta">
|
||||
<h2 class="widget-title">{{ 'SUBSCRIBE'|t }}</h2>
|
||||
<ul>
|
||||
<li><a class="button" href="{{ feed_url }}.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a></li>
|
||||
<li><a class="button" href="{{ feed_url }}.rss"><i class="fa fa-rss-square"></i> RSS</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
15
templates/partials/social.html.twig
Normal file
15
templates/partials/social.html.twig
Normal file
@@ -0,0 +1,15 @@
|
||||
{% if theme_config.social_enabled %}
|
||||
<nav id="social-navigation" role="navigation" class="social-navigation">
|
||||
<div class="menu-social-links-container">
|
||||
<ul id="menu-social-links" class="menu">
|
||||
{% for item in theme_config.social %}
|
||||
<li id="menu-item-{{ loop.index }}" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-181">
|
||||
<a href="{{ item.url }}" title="{{ item.name }}">
|
||||
<i class="{{ item.icon }} fa-lg"></i>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
{% endif %}
|
||||
17
templates/partials/taxonomylist.html.twig
Normal file
17
templates/partials/taxonomylist.html.twig
Normal file
@@ -0,0 +1,17 @@
|
||||
{# Customized from taxonomylist plugin #}
|
||||
|
||||
{% set taxlist = children_only is defined ? taxonomylist.getChildPagesTags() : taxonomylist.get() %}
|
||||
|
||||
{% set limit = 20 %} {# show only the first x items #}
|
||||
{% set treshold = 1 %} {# at least this number of times used #}
|
||||
|
||||
{% if taxlist %}
|
||||
<span class="tags">
|
||||
{% set i = 0 %}
|
||||
{% for tax,value in taxlist[taxonomy] if (((limit is not defined) or (i < limit)) and (treshold is not defined or (value >= treshold))) %}
|
||||
{% set active = uri.param(taxonomy) == tax? 'active' : '' %}
|
||||
<a class="{{ active }}" href="{{ base_url }}/{{ taxonomy }}{{ config.system.param_sep }}{{ tax }}">{{ tax }} ({{ value }})</a>
|
||||
{% set i = i + 1 %}
|
||||
{% endfor %}
|
||||
</span>
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user