aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed M Alaa <aa@4b.cx>2022-12-04 23:19:16 +0200
committerAhmed M Alaa <aa@4b.cx>2022-12-04 23:19:16 +0200
commit2d7be35ef50d37f5057248d20cbeb1f06fd5cde0 (patch)
treea735e70bd255b3cb7aa3a011df5dc33500a01495
parent06e0d3f6499fefa06f78247caddcf34018af180c (diff)
fix: adjusted list_page option, typos
-rw-r--r--README.md13
-rw-r--r--config.toml1
-rw-r--r--content/_index.md2
-rw-r--r--templates/base.html20
-rw-r--r--templates/index.html2
5 files changed, 27 insertions, 11 deletions
diff --git a/README.md b/README.md
index af74eee..e3b69c3 100644
--- a/README.md
+++ b/README.md
@@ -24,13 +24,22 @@ theme = "no-style-please"
### 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
-[exta]
+[extra]
list_pages = false
```
+### Add TOC to pages
+
+In a page frontmatter, set `extra.add_toc` to `true`
+
+```toml
+[extra]
+add_toc = true
+```
+
### Extra data
- `author` can be set in both main config and in pages metadata
diff --git a/config.toml b/config.toml
index 6d8fcb4..41c9b64 100644
--- a/config.toml
+++ b/config.toml
@@ -3,7 +3,6 @@ title = "no style, please!"
description = "A (nearly) no-CSS, fast, minimalist Zola theme."
compile_sass = true
-build_search_index = false
generate_feed = true
taxonomies = [
diff --git a/content/_index.md b/content/_index.md
index 7bbef8a..5ef0a42 100644
--- a/content/_index.md
+++ b/content/_index.md
@@ -1,6 +1,4 @@
---
-extra:
- list_pages: false
---
- info
diff --git a/templates/base.html b/templates/base.html
index e50dc0a..e00a202 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -8,31 +8,41 @@
{% if page.title %}
{% set title = page.title %}
- {% else %}
+ {% elif section.title %}
+ {% set title = section.title %}
+ {% elif config.title %}
{% set title = config.title %}
{% endif %}
{% if 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 %}
{% endif %}
{% if page.description %}
{% 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) %}
{% endif %}
{% if page.extra.image %}
{% 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) %}
{% endif %}
{% if page.permalink %}
{% set url = page.permalink %}
- {% else %}
+ {% elif section.permalink %}
+ {% set url = section.permalink %}
+ {% elif config.base_url %}
{% set url = config.base_url %}
{% endif %}
diff --git a/templates/index.html b/templates/index.html
index 146df3b..40487bc 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -3,7 +3,7 @@
{% block content %}
{{ section.content | safe }}
-{% if section.extra.list_pages %}
+{% if config.extra.list_pages %}
{% if paginator %}
{% set pages = paginator.pages %}
{% else %}