Skip to content

Commit

Permalink
Upating theme to work with Grav v1.7.13 and above
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrylDias committed Apr 25, 2021
1 parent f016738 commit 3e78295
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 29 deletions.
8 changes: 4 additions & 4 deletions blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Sidewalk
version: 0.0.5
description: "A clean and simple blog theme for **Grav**"
icon: empire
version: 0.0.6
description: "A simple and content first theme for Grav CMS"
icon: rocket
author:
name: Darryl Dias
email: [email protected]
email: [email protected]
url: http://darryldias.me
homepage: https://github.com/DarrylDias/Sidewalk
keywords: sidewalk, clean, simple, blog, core, modern, fast, responsive, html5, css3
Expand Down
2 changes: 1 addition & 1 deletion templates/blog.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% embed 'partials/base.html.twig' %}

{% set collection = page.collection() %}
{% set base_url = page.url %}
{% set base_url = page.url %}

{% block content %}
<ul class="article-list">
Expand Down
14 changes: 2 additions & 12 deletions templates/partials/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
{% block stylesheets %}
{% do assets.addCss('//fonts.googleapis.com/css?family=Open+Sans:400', 200) %}
{% do assets.addCss('//fonts.googleapis.com/css?family=Source+Code+Pro:400,600', 200) %}
{% do assets.addCss('theme://css/screen.css', 200) %}
{% do assets.addCss('theme://css/screen.min.css', 200) %}
{% endblock %}
{% endblock %}

Expand All @@ -101,7 +101,7 @@
<body>
<header id="page-header">
<div id="masthead">
<a href="{{ base_url_absolute }}"><h1 id="site-title">{{ site.title }}</h1></a>
<a href="{{ home_url }}"><h1 id="site-title">{{ site.title }}</h1></a>
<p id="site-slogan">{{ site.metadata.description }}</p>
</div>
</header>
Expand All @@ -121,16 +121,6 @@
{% endfor %}
</ul>

<ul>
<li>
<a href="{{ base_url_absolute }}/random">Random Post</a>
</li>
</ul>
<ul>
<li>
<a href="{{ base_url_absolute }}/blog.atom">Feed</a>
</li>
</ul>
{% if config.themes.Sidewalk.github_account %}
<ul>
<li>
Expand Down
6 changes: 3 additions & 3 deletions templates/partials/pagination.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<ul class="pagination">
{% if pagination.hasPrev %}
<li><a rel="prev" href="{{ base_url }}/blog{{ pagination.prevUrl }}">&laquo;</a></li>
<li><a rel="prev" href="{{ pagination.prevUrl }}">&laquo;</a></li>
{% else %}
<li><span>&laquo;</span></li>
{% endif %}
Expand All @@ -12,14 +12,14 @@
{% if paginate.isCurrent %}
<li><span>{{ paginate.number }}</span></li>
{% elseif paginate.isInDelta %}
<li><a href="{{ base_url }}/blog{{ paginate.url }}">{{ paginate.number }}</a></li>
<li><a href="{{ paginate.url }}">{{ paginate.number }}</a></li>
{% elseif paginate.isDeltaBorder %}
<li class="gap"><span>&hellip;</span></li>
{% endif %}

{% endfor %}
{% if pagination.hasNext %}
<li><a rel="next" href="{{ base_url }}/blog{{ pagination.nextUrl }}">&raquo;</a></li>
<li><a rel="next" href="{{ pagination.nextUrl }}">&raquo;</a></li>
{% else %}
<li><span>&raquo;</span></li>
{% endif %}
Expand Down
20 changes: 11 additions & 9 deletions templates/post.html.twig
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{% embed 'partials/base.html.twig' %}
{% extends 'partials/base.html.twig' %}

{% set hero_image = page.media.images|first %}

{% block content %}
<article class="post">
<h2>{{ page.title }}</h2>
<div class="meta">{{ page.date|date("d") }}&ensp;{{ page.date|date("M") }}&ensp;{{ page.date|date("Y") }} in {% for tag in page.taxonomy.tag %}<a href="{{ base_url }}/blog/tag:{{tag}}">{{ tag }}</a>&ensp;{% endfor %}</div>
{% if big_header %}
{{ page.media.images|first.cropResize(900,600).html }}
{% else %}
{{ page.media.images|first.cropZoom(900,300).html }}
{% endif %}
{{ page.content }}

<div class="hero-image">
<img src="{{ hero_image.cropZoom(800,400).url|raw }}">
</div>
{{ page.content | raw }}

{% if config.themes.Sidewalk.disqus_shortname %}
{% if header.comments == 'false' %}
Expand All @@ -17,5 +20,4 @@
{% endif%}
{% endif %}
</article>
{% endblock %}
{% endembed %}
{% endblock %}

0 comments on commit 3e78295

Please sign in to comment.