taxonomy titles are now chosen programatically; footer is now always at the bottom; updated taxonomies and readme;
This commit is contained in:
parent
599a6f9af0
commit
0f57726bc4
12 changed files with 43 additions and 28 deletions
21
README.md
21
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 %}
|
||||
```
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "taxonomy_list.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% set title = "All Authors"%}
|
||||
{{ super() }}
|
||||
{% endblock content %}
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "taxonomy_single.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% set title = "Author: " ~ term.name %}
|
||||
{{ super() }}
|
||||
{% endblock content %}
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "taxonomy_list.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% set title = "All Categories"%}
|
||||
{{ super() }}
|
||||
{% endblock content %}
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "taxonomy_single.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% set title = "Category: " ~ term.name %}
|
||||
{{ super() }}
|
||||
{% endblock content %}
|
|
@ -59,7 +59,7 @@
|
|||
<main class="index">
|
||||
<!-- START HERO TITLE -->
|
||||
{% if config.extra.zulma_title %}
|
||||
{{ index_macros::hero(title=config.extra.zulma_title) }}
|
||||
{{ index_macros::hero(title=config.extra.zulma_title, primary=true) }}
|
||||
{% endif %}
|
||||
<!-- END HERO TITLE -->
|
||||
<div class="container">
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
{% macro hero(title) %}
|
||||
<section class="hero is-primary is-bold">
|
||||
{% macro hero(title, primary) %}
|
||||
{% set class = "is-bold" %}
|
||||
{% if primary %}
|
||||
{% set class = class ~ " hero is-primary" %}
|
||||
{% endif %}
|
||||
<section class="{{class}}">
|
||||
<header>
|
||||
<div class="hero-body">
|
||||
<div class="container has-text-centered">
|
||||
|
@ -30,7 +34,8 @@
|
|||
{% if paginator.previous %}
|
||||
<a class="button is-primary pagination-previous" href="{{ paginator.previous }}">« Previous</a>
|
||||
{% else %}
|
||||
<a class="button is-primary pagination-previous" disabled title="This is the first page">« Previous</a>
|
||||
<a class="button is-primary pagination-previous" disabled title="This is the first page">«
|
||||
Previous</a>
|
||||
{% endif %}
|
||||
<ul class="pagination-list">
|
||||
<li>Page {{ paginator.current_index }} of {{ paginator.number_pagers }}</li>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "taxonomy_list.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% set title = "All Tags"%}
|
||||
{{ super() }}
|
||||
{% endblock content %}
|
|
@ -1,6 +1,5 @@
|
|||
{% extends "taxonomy_single.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% set title = "Tag: " ~ term.name %}
|
||||
{{ super() }}
|
||||
{% endblock content %}
|
|
@ -10,7 +10,10 @@
|
|||
<!-- END NAV -->
|
||||
<main>
|
||||
<!-- START HERO TITLE -->
|
||||
{{ index_macros::hero(title=title) }}
|
||||
{% if not title %}
|
||||
{% set title = "All " ~ taxonomy.name | title %}
|
||||
{% endif %}
|
||||
{{ index_macros::hero(title=title,primary=false) }}
|
||||
<!-- END HERO TITLE -->
|
||||
<!-- START TAXONOMY LIST -->
|
||||
{{ taxonomy_macros::list(terms=terms) }}
|
||||
|
|
|
@ -11,7 +11,10 @@
|
|||
<!-- END NAV -->
|
||||
<main>
|
||||
<!-- START HERO TITLE -->
|
||||
{{ index_macros::hero(title=title) }}
|
||||
{% if not title %}
|
||||
{% set title = taxonomy.name ~ ": " ~ term.name | capitalize %}
|
||||
{% endif %}
|
||||
{{ index_macros::hero(title=title,primary=false) }}
|
||||
<!-- END HERO TITLE -->
|
||||
<div class="container">
|
||||
<!-- START ARTICLE FEED -->
|
||||
|
|
Loading…
Add table
Reference in a new issue