Trying to get the section looking good.
This commit is contained in:
parent
171ae2214a
commit
0a543d02aa
|
@ -7,6 +7,8 @@ compile_sass = true
|
|||
# Whether to build a search index to be used later on by a JavaScript library
|
||||
build_search_index = true
|
||||
|
||||
title = "Elf's Notes"
|
||||
|
||||
[markdown]
|
||||
# Whether to do syntax highlighting
|
||||
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
|
||||
|
|
|
@ -3,7 +3,7 @@ title = "Zola"
|
|||
description = "Zola is a static site generator"
|
||||
date = 2025-05-01T18:00:00+00:00
|
||||
updated = 2021-05-01T18:00:00+00:00
|
||||
template = "section.html"
|
||||
template = "docs/section.html"
|
||||
sort_by = "weight"
|
||||
weight = 4
|
||||
draft = false
|
||||
|
@ -65,6 +65,16 @@ that comes after it.
|
|||
|
||||
### Statements
|
||||
|
||||
#### `block`
|
||||
|
||||
The `block` is probably the most important statement; it defines a chunk of
|
||||
content. When a template is created, it can define its whole content as a
|
||||
block, and it can define subsections (note: section is a heavily overloaded
|
||||
word) of itself. These blocks can be used as-is, or replaced when another
|
||||
template inherits them and overwrites them.
|
||||
|
||||
|
||||
|
||||
#### `set`
|
||||
|
||||
Variables are set in a given scope with `set`:
|
||||
|
@ -101,8 +111,8 @@ The list of `is` tests that are shipped with Zola are:
|
|||
- `ending_with(string)`: Returns true if the given variable is a string and ends with the arg given.
|
||||
- `containing(val)`: Returns true if the given variable contains the arg given.
|
||||
- strings: is the arg a substring?
|
||||
- arrays: is the arg given one of the members of the array?
|
||||
- maps: is the arg given a key of the map?
|
||||
- arrays: is the arg one of the members of the array?
|
||||
- maps: is the arg a key of the map?
|
||||
- `matching(regexp)`: Returns true if the given variable is a string and matches the regex in the argument.
|
||||
|
||||
#### `for`
|
||||
|
@ -169,6 +179,9 @@ And an example of this macro (again, in the `header.html` file) would look like
|
|||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```jinja2
|
||||
{% raw %}Content {{ goes here }}{% endraw %}
|
||||
```
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
{% block header %}
|
||||
{% set current_section = "docs" %}
|
||||
{{ macros_header::header(current_section=current_section)}}
|
||||
{{ header::header(current_section=current_section)}}
|
||||
{% endblock header %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -2,28 +2,6 @@
|
|||
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block seo %}
|
||||
{{ super() }}
|
||||
{% set title_addition = "" %}
|
||||
|
||||
{% if section.title and config.title %}
|
||||
{% set title = section.title %}
|
||||
{% set title_addition = title_separator ~ config.title %}
|
||||
{% elif section.title %}
|
||||
{% set title = section.title %}
|
||||
{% else %}
|
||||
{% set title = config.title %}
|
||||
{% endif %}
|
||||
|
||||
{% if section.description %}
|
||||
{% set description = section.description %}
|
||||
{% else %}
|
||||
{% set description = config.description %}
|
||||
{% endif %}
|
||||
|
||||
{{ macros_head::seo(title=title, title_addition=title_addition, description=description) }}
|
||||
{% endblock seo %}
|
||||
|
||||
{% block body %}
|
||||
{% if section.extra.class %}
|
||||
{% set page_class = section.extra.class %}
|
||||
|
|
Loading…
Reference in New Issue