Compare commits

..

1 commit
main ... katex

Author SHA1 Message Date
Jan Christian Grünhage da0687696e feat: add katex support 2020-08-31 21:33:36 +02:00
7 changed files with 12 additions and 55 deletions

View file

@ -8,14 +8,13 @@
- [Options](#options)
- [Top menu](#top-menu)
- [Title](#title)
- [Author](#author)
## Installation
First download this theme to your `themes` directory:
```bash
cd themes
git clone https://github.com/getzola/after-dark.git
$ cd themes
$ git clone https://github.com/getzola/after-dark.git
```
and then enable it in your `config.toml`:
@ -36,8 +35,8 @@ The theme requires tags and categories taxonomies to be enabled in your `config.
```toml
taxonomies = [
# You can enable/disable RSS
{name = "categories", feed = true},
{name = "tags", feed = true},
{name = "categories", rss = true},
{name = "tags", rss = true},
]
```
If you want to paginate taxonomies pages, you will need to overwrite the templates
@ -66,23 +65,6 @@ The site title is shown on the homepage. As it might be different from the `<tit
element that the `title` field in the config represents, you can set the `after_dark_title`
instead.
### Author
You can set this on a per page basis or in the config file.
`config.toml`:
```toml
[extra]
author = "John Smith"
```
In a page (wrap this in +++):
```toml
title = "..."
date = 1970-01-01
[extra]
author = "John Smith"
```
### KaTeX math formula support
This theme contains math formula support using [KaTeX](https://katex.org/),

View file

@ -5,8 +5,8 @@ description = ""
generate_feed = true
taxonomies = [
{name = "categories", feed = true},
{name = "tags", feed = true},
{name = "categories", rss = true},
{name = "tags", rss = true},
]
[extra]

View file

@ -1,8 +0,0 @@
[build]
command = "zola build"
[build.environment]
ZOLA_VERSION = "0.16.0"
[context.deploy-preview]
command = "zola build --base-url $DEPLOY_PRIME_URL"

View file

@ -19,11 +19,6 @@ h1, h2, h3, h4, h5, h6 {
line-height: 1.3em
}
img {
max-width: 100%;
height: auto;
}
fieldset {
border: none;
padding: 0;
@ -303,7 +298,7 @@ a:hover {
}
.hack pre code:after, .hack pre code:before {
content: none
content: ''
}
.hack code {

View file

@ -48,7 +48,8 @@
<a itemprop="url"
class="{% if item.url | replace(from="$BASE_URL", to=config.base_url) == current_url %}active{% endif %}"
href="{{ item.url | safe | replace(from="$BASE_URL", to=config.base_url) }}">
<span itemprop="name">{{ item.name }}</span></a>
<span itemprop="name">{{ item.name }}
</span></a>
{% endfor %}
</nav>
</header>
@ -61,11 +62,6 @@
<h1>{{ config.extra.after_dark_title }}</h1>
</header>
{% endif %}
{% if section.content %}
<div>
{{ section.content | safe }}
</div>
{% endif %}
{% for page in paginator.pages %}
{{ post_macros::page_in_list(page=page) }}
{% endfor %}

View file

@ -19,9 +19,7 @@
<footer>
<hr>
<p>
{% if page.extra.author %}
Published by {{ page.extra.author }}
{% elif config.extra.author %}
{% if config.extra.author %}
Published by {{ config.extra.author }}
{% endif %}
{% if page.taxonomies.categories %}
@ -29,8 +27,7 @@
in <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}">{{ category }}</a>
{% endif %}
{% if page.taxonomies.tags %}
{% if page.taxonomies.categories %}and{% endif %}
tagged
and tagged
{% for tag in page.taxonomies.tags %}
<a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">{{ tag }}</a>
{% if page.taxonomies.tags | length > 1 %}
@ -52,3 +49,4 @@
</article>
{% endblock content %}

View file

@ -28,12 +28,6 @@
{{ page.summary | safe }}
<nav class="readmore"><a itemprop="url" href="{{ page.permalink | safe }}">Read More&nbsp;&raquo;</a></nav>
</div>
{% else %}
<div itemprop="summary">
{{ page.content | striptags | truncate | safe }}
<nav class="readmore"><a itemprop="url" href="{{ page.permalink | safe }}">Read More&nbsp;&raquo;</a></nav>
</div>
{% endif %}
</article>
{% endmacro page_in_list %}