Skip to content

Commit

Permalink
Update to gutenberg 0.4 (#4)
Browse files Browse the repository at this point in the history
* Update to gutenberg 0.4

* Fix site not working on firefox
  • Loading branch information
Keats authored and Guilherme Diego committed Aug 8, 2018
1 parent d7e1af7 commit 1b70df9
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 25 deletions.
8 changes: 7 additions & 1 deletion config.toml
Expand Up @@ -6,6 +6,12 @@ compile_sass = true
highlight_code = true
build_search_index = false

taxonomies = [
{name = "categories"},
{name = "tags"},
]


[extra]
blog_title="Dinkleberg"
label_tags = "Tags"
Expand Down Expand Up @@ -33,4 +39,4 @@ sidebar = [
{name="Facebook", url=""},
{name="Outro", url=""},
]}
]
]
4 changes: 3 additions & 1 deletion content/hello-world.md
Expand Up @@ -2,7 +2,9 @@
title = "Understanding Atomics"
description = "Explains the basic of atomics in Rust. Comes with a bonus: spinlock implementation."
date=2018-05-30
category = "Data Type"

[taxonomies]
categories = ["Data Type"]
tags = ["atomic", "utils", "bla"]

[extra]
Expand Down
4 changes: 3 additions & 1 deletion content/relative_sample/other-hello-world.md
Expand Up @@ -2,7 +2,9 @@
title = "Understanding Atomics"
description = "Explains the basic of atomics in Rust. Comes with a bonus: spinlock implementation."
date=2018-05-30
category = "Data Type"

[taxonomies]
categories = ["Data Type"]
tags = ["atomic", "utils", "bla"]

[extra]
Expand Down
2 changes: 1 addition & 1 deletion sass/site.scss
Expand Up @@ -142,4 +142,4 @@ code {
}
}

@import "post.scss"
@import "post.scss";
Expand Up @@ -3,7 +3,7 @@
<main class="main">
<h3 class="page-title"> {{ config.extra.label_categories }} </h3>
<ul class="base-list">
{% for category in categories %}
{% for category in terms %}
<li>
<a href="{{ category.permalink }}">{{ category.name }}</a>({{ category.pages | length }})
</li>
Expand Down
4 changes: 2 additions & 2 deletions templates/category.html → templates/categories/single.html
@@ -1,8 +1,8 @@
{% extends "index.html" %}
{% block content %}
<main class="main">
<h3 class="page-title"> Categoria: {{category.name}} </h3>
{% for page in category.pages %}
<h3 class="page-title"> Categoria: {{term.name}} </h3>
{% for page in term.pages %}
{{ macro::post(page=page) }}
{% endfor %}
</main>
Expand Down
4 changes: 2 additions & 2 deletions templates/index.html
Expand Up @@ -66,8 +66,8 @@
{% endif %}

{% block css %}
<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Code+Pro" as="style" onload="this.rel='stylesheet'">
<link rel="preload" href="{{ get_url(path="site.css", trailing_slash=false) }}" as="style" onload="this.rel='stylesheet'">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600|Source+Code+Pro">
<link rel="stylesheet" href="{{ get_url(path="site.css", trailing_slash=false) }}">
{% endblock css %}
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions templates/macros.html
Expand Up @@ -8,7 +8,7 @@
<meta itemprop="image" content="{{config.extra.og_image}}">
{% endif %}
{% endif %}
<span class="category">{{page.category}}</span>
{% if page.taxonomies.categories %}<span class="category">{{page.taxonomies.categories[0]}}</span>{% endif %}
<h2 class="title" itemprop="headline">{{page.title}}</h2>
<span class="description">{{page.description}}</span>

Expand Down Expand Up @@ -43,4 +43,4 @@ <h2 class="title" itemprop="headline">{{page.title}}</h2>
<div {% if itemprop %} itemprop="{{itemprop}}" {% endif %}
itemscope itemtype="http://schema.org/Organization">
</div>
{% endmacro %}
{% endmacro %}
18 changes: 9 additions & 9 deletions templates/page.html
Expand Up @@ -17,23 +17,23 @@
{% endif %}
{% endif %}
<header>
{% if page.category %}
<a class="category" href="{{ get_taxonomy_url(kind="category", name=page.category) }}">
{{ page.category }}
{% if page.taxonomies.categories %}
<a class="category" href="{{ get_taxonomy_url(kind="categories", name=page.taxonomies.categories[0]) }}">
{{ page.taxonomies.categories[0] }}
</a>
{% endif %}
<h1 class="title" itemprop="headline">{{ page.title }}</h1>
<address itemprop="author" itemscope itemtype="https://schema.org/Person">
<span itemprop="name">{{page.extra.author}}</span>
</address>
<div class="extra">
{% if page.tags %}
{% if page.taxonomies.tags %}
{{config.extra.label_tags}}:
{% for tag in page.tags %}
<a href="{{ get_taxonomy_url(kind="tag", name=tag) }}">{{ tag }}</a>
{% if page.tags | length > 1 %}
{% if loop.index != page.tags | length %}
{% if loop.index == page.tags | length - 1 %}
{% for tag in page.taxonomies.tags %}
<a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a>
{% if page.taxonomies.tags | length > 1 %}
{% if loop.index != page.taxonomies.tags | length %}
{% if loop.index == page.taxonomies.tags | length - 1 %}
e
{% else %}
,
Expand Down
2 changes: 1 addition & 1 deletion templates/tags.html → templates/tags/list.html
Expand Up @@ -3,7 +3,7 @@
<main class="main">
<h3 class="page-title"> {{ config.extra.label_tag }} </h3>
<ul class="base-list">
{% for tag in tags %}
{% for tag in terms %}
<li>
<a href="{{ tag.permalink }}">{{ tag.name }}</a>({{ tag.pages | length }})
</li>
Expand Down
4 changes: 2 additions & 2 deletions templates/tag.html → templates/tags/single.html
@@ -1,8 +1,8 @@
{% extends "index.html" %}
{% block content %}
<main class="main">
<h3 class="page-title"> {{ config.extra.label_tag }}: {{tag.name}} </h3>
{% for page in tag.pages %}
<h3 class="page-title"> {{ config.extra.label_tag }}: {{term.name}} </h3>
{% for page in term.pages %}
{{ macro::post(page=page) }}
{% endfor %}
</main>
Expand Down
4 changes: 2 additions & 2 deletions theme.toml
Expand Up @@ -2,8 +2,8 @@ name = "dinkleberg"
description = "The Rust BR theme for Gutenberg"
license = "MIT"
homepage = "https://github.com/rust-br/dinkleberg"

min_version = "0.3"
min_version = "0.4.0"
demo = "https://rust-br.github.io/blog/"

[author]
name = "Guilherme Diego"
Expand Down

0 comments on commit 1b70df9

Please sign in to comment.