diff --git a/README.md b/README.md index a601615..f78ab1b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Zulma +A Bulma theme for Zola. + ## Contents - [Zulma](#zulma) @@ -44,7 +46,7 @@ All the source javascript files live in `javascript/src`. This is a list of the - `zulma_switchcss.js` - Used for swapping themes (if enabled). Created by me. ### Building - These are transpiled by babel, minified by webpack, sourcemaps are generated and then everything placed in `static/js`. The repo already contains the transpiled and minified files along with their corrosponding sourcemaps so you don't need to do anything to use these. If you would prefer to build it yourself, feel free to inspect the js files and then run the build process yourself (please ensure that you have [node, npm](https://nodejs.org/en/) and [yarn](https://yarnpkg.com/lang/en/) installed.): + The javascript files are transpiled by babel, minified by webpack, sourcemaps are generated and then everything placed in `static/js`. The repo already contains the transpiled and minified files along with their corrosponding sourcemaps so you don't need to do anything to use these. If you would prefer to build it yourself, feel free to inspect the js files and then run the build process yourself (please ensure that you have [node, npm](https://nodejs.org/en/) and optionally [yarn](https://yarnpkg.com/lang/en/) installed.): ``` cd javascript @@ -83,7 +85,7 @@ authors = ["Joe Bloggs"] will cause that metadata to appear on the post, either on the header for the name, or at the bottom for tags and categories, and enable those pages. -Making your own taxonomies is also designed to be as easy as possible, however it does seem to require adding files directly to the theme (someone please let me know if this isn't the case!). First, add it to your cargo.tml +Making your own taxonomies is also designed to be as easy as possible. First, add it to your cargo.tml ```toml taxonomies = [ @@ -91,26 +93,25 @@ taxonomies = [ ] ``` -and make the corrosponding folder in the theme templates, in this case: `themes\zulma\templates\links`, and the necessary files: `themes\zulma\templates\links\list.html` and `themes\zulma\templates\links\single.html` +and make the corrosponding folder in your templates, in this case: `templates\links`, and the necessary files: `templates\links\list.html` and `templates\links\single.html` -And then for each, just inherit the master page, render the block `content`, and set a variable called `title` for the hero to display on that page. +And then for each, just inherit the zulma master page, render the block `content`. You may optionally set a variable called `title` for the hero to display on that page, otherwise it will use the default for that taxonomy. -In `list.html`: +In `single.html`: ```handlebars -{% extends "taxonomy_list.html" %} +{% extends "Zulma/templates/taxonomy_single.html" %} {% block content %} -{% set title = "All Links"%} {{ super() }} {% endblock content %} ``` -In `single.html`: +In `list.html`: ```handlebars -{% extends "taxonomy_single.html" %} +{% extends "Zulma/templates/taxonomy_list.html" %} {% block content %} -{% set title = "Link: " ~ term.name %} +{% set title = "These are all the Links"%} {{ super() }} {% endblock content %} ``` diff --git a/sass/_blog.scss b/sass/_blog.scss index a71d319..5e120b9 100644 --- a/sass/_blog.scss +++ b/sass/_blog.scss @@ -2,6 +2,13 @@ html, body { font-family: 'Open Sans', sans-serif; font-size: 14px; + display: flex; + min-height: 100vh; + flex-direction: column; +} + +main { + flex: 1; } .navbar-brand .brand-text { @@ -48,6 +55,7 @@ body { .article-footer, .article-body { margin: 2rem 0; + @include desktop { margin: 2rem 6rem; } @@ -60,7 +68,7 @@ body { .article-footer { font-style: italic; padding: 1.5rem; - width:100%; + width: 100%; .button, .tag { @@ -111,19 +119,20 @@ body { height: 100%; } -input#search::placeholder{ +input#search::placeholder { color: $grey-darker; } -.footer{ +.footer { margin-top: 4rem; padding: 2rem; } -.pagination-previous, .pagination-next { +.pagination-previous, +.pagination-next { flex-grow: 0; } -.theme-select-container{ - margin-left:auto; +.theme-select-container { + margin-left: auto; } \ No newline at end of file diff --git a/templates/authors/list.html b/templates/authors/list.html index c081bbc..b14bf0a 100644 --- a/templates/authors/list.html +++ b/templates/authors/list.html @@ -1,6 +1,5 @@ {% extends "taxonomy_list.html" %} {% block content %} -{% set title = "All Authors"%} {{ super() }} {% endblock content %} \ No newline at end of file diff --git a/templates/authors/single.html b/templates/authors/single.html index d7db147..19f7ebd 100644 --- a/templates/authors/single.html +++ b/templates/authors/single.html @@ -1,6 +1,5 @@ {% extends "taxonomy_single.html" %} {% block content %} -{% set title = "Author: " ~ term.name %} {{ super() }} {% endblock content %} \ No newline at end of file diff --git a/templates/categories/list.html b/templates/categories/list.html index f03f898..b14bf0a 100644 --- a/templates/categories/list.html +++ b/templates/categories/list.html @@ -1,6 +1,5 @@ {% extends "taxonomy_list.html" %} {% block content %} -{% set title = "All Categories"%} {{ super() }} {% endblock content %} \ No newline at end of file diff --git a/templates/categories/single.html b/templates/categories/single.html index bec1ac0..19f7ebd 100644 --- a/templates/categories/single.html +++ b/templates/categories/single.html @@ -1,6 +1,5 @@ {% extends "taxonomy_single.html" %} {% block content %} -{% set title = "Category: " ~ term.name %} {{ super() }} {% endblock content %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index ca9a155..2886980 100644 --- a/templates/index.html +++ b/templates/index.html @@ -59,7 +59,7 @@
{% if config.extra.zulma_title %} - {{ index_macros::hero(title=config.extra.zulma_title) }} + {{ index_macros::hero(title=config.extra.zulma_title, primary=true) }} {% endif %}
diff --git a/templates/index_macros.html b/templates/index_macros.html index 563256c..e1a405a 100644 --- a/templates/index_macros.html +++ b/templates/index_macros.html @@ -1,5 +1,9 @@ -{% macro hero(title) %} -
+{% macro hero(title, primary) %} +{% set class = "is-bold" %} +{% if primary %} +{% set class = class ~ " hero is-primary" %} +{% endif %} +
@@ -30,7 +34,8 @@ {% if paginator.previous %} « Previous {% else %} - « Previous + « + Previous {% endif %}
  • Page {{ paginator.current_index }} of {{ paginator.number_pagers }}
  • diff --git a/templates/tags/list.html b/templates/tags/list.html index 5871d1e..b14bf0a 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -1,6 +1,5 @@ {% extends "taxonomy_list.html" %} {% block content %} -{% set title = "All Tags"%} {{ super() }} {% endblock content %} \ No newline at end of file diff --git a/templates/tags/single.html b/templates/tags/single.html index 80979cd..19f7ebd 100644 --- a/templates/tags/single.html +++ b/templates/tags/single.html @@ -1,6 +1,5 @@ {% extends "taxonomy_single.html" %} {% block content %} -{% set title = "Tag: " ~ term.name %} {{ super() }} {% endblock content %} \ No newline at end of file diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html index 9fdfcf2..7ab683c 100644 --- a/templates/taxonomy_list.html +++ b/templates/taxonomy_list.html @@ -10,7 +10,10 @@
    - {{ index_macros::hero(title=title) }} + {% if not title %} + {% set title = "All " ~ taxonomy.name | title %} + {% endif %} + {{ index_macros::hero(title=title,primary=false) }} {{ taxonomy_macros::list(terms=terms) }} diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index fd2e997..b4aac24 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -11,7 +11,10 @@
    - {{ index_macros::hero(title=title) }} + {% if not title %} + {% set title = taxonomy.name ~ ": " ~ term.name | capitalize %} + {% endif %} + {{ index_macros::hero(title=title,primary=false) }}