fix: adjusted list_page option, typos

This commit is contained in:
Ahmed M Alaa 2022-12-04 23:19:16 +02:00
parent 06e0d3f649
commit 2d7be35ef5
No known key found for this signature in database
GPG key ID: 754EEB8AD6C08BF2
5 changed files with 27 additions and 11 deletions

View file

@ -24,13 +24,22 @@ theme = "no-style-please"
### Pages list in homepage ### Pages list in homepage
To enable listing of pages in homepage add the following in `content\_index.md` frontmatter To enable listing of pages in homepage add the following in `config.toml`
```toml ```toml
[exta] [extra]
list_pages = false list_pages = false
``` ```
### Add TOC to pages
In a page frontmatter, set `extra.add_toc` to `true`
```toml
[extra]
add_toc = true
```
### Extra data ### Extra data
- `author` can be set in both main config and in pages metadata - `author` can be set in both main config and in pages metadata

View file

@ -3,7 +3,6 @@ title = "no style, please!"
description = "A (nearly) no-CSS, fast, minimalist Zola theme." description = "A (nearly) no-CSS, fast, minimalist Zola theme."
compile_sass = true compile_sass = true
build_search_index = false
generate_feed = true generate_feed = true
taxonomies = [ taxonomies = [

View file

@ -1,6 +1,4 @@
--- ---
extra:
list_pages: false
--- ---
- info - info

View file

@ -8,31 +8,41 @@
{% if page.title %} {% if page.title %}
{% set title = page.title %} {% set title = page.title %}
{% else %} {% elif section.title %}
{% set title = section.title %}
{% elif config.title %}
{% set title = config.title %} {% set title = config.title %}
{% endif %} {% endif %}
{% if page.extra.author %} {% if page.extra.author %}
{% set author = page.extra.author %} {% set author = page.extra.author %}
{% else %} {% elif section.extra.author %}
{% set author = section.extra.author %}
{% elif config.extra.author %}
{% set author = config.extra.author %} {% set author = config.extra.author %}
{% endif %} {% endif %}
{% if page.description %} {% if page.description %}
{% set description = page.description | truncate(length=150) %} {% set description = page.description | truncate(length=150) %}
{% else %} {% elif section.description %}
{% set description = section.description | truncate(length=150) %}
{% elif config.description %}
{% set description = config.description | truncate(length=150) %} {% set description = config.description | truncate(length=150) %}
{% endif %} {% endif %}
{% if page.extra.image %} {% if page.extra.image %}
{% set image = get_url(path=page.extra.image, trailing_slash=false) %} {% set image = get_url(path=page.extra.image, trailing_slash=false) %}
{% else %} {% elif section.extra.image %}
{% set image = get_url(path=section.extra.image, trailing_slash=false) %}
{% elif config.extra.logo %}
{% set image = get_url(path=config.extra.logo, trailing_slash=false) %} {% set image = get_url(path=config.extra.logo, trailing_slash=false) %}
{% endif %} {% endif %}
{% if page.permalink %} {% if page.permalink %}
{% set url = page.permalink %} {% set url = page.permalink %}
{% else %} {% elif section.permalink %}
{% set url = section.permalink %}
{% elif config.base_url %}
{% set url = config.base_url %} {% set url = config.base_url %}
{% endif %} {% endif %}

View file

@ -3,7 +3,7 @@
{% block content %} {% block content %}
{{ section.content | safe }} {{ section.content | safe }}
{% if section.extra.list_pages %} {% if config.extra.list_pages %}
{% if paginator %} {% if paginator %}
{% set pages = paginator.pages %} {% set pages = paginator.pages %}
{% else %} {% else %}