Skip to content

Commit b29c354

Browse files
committed
easier way to get a TOC
1 parent a0b52e7 commit b29c354

File tree

3 files changed

+5
-39
lines changed

3 files changed

+5
-39
lines changed

content/about/project.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
+++
22
title = "The CodeRefinery project"
3-
template = "page-with-toc.html"
43
+++
54

5+
<!-- toc -->
6+
67
## Objectives
78

89
CodeRefinery improves science by providing training and infrastructure

templates/page-with-toc.html

Lines changed: 0 additions & 37 deletions
This file was deleted.

templates/page.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{% import "macros.html" as macros %}
2+
13
{% extends "base.html" %}
24

35
{% block content %}
@@ -6,6 +8,6 @@ <h1>{{ page.title }}</h1>
68
{% endif %}
79

810
{% if page.content %}
9-
{{ page.content | safe }}
11+
{{ page.content | replace(from="<!-- toc -->", to=macros::toc(page=page)) | safe }}
1012
{% endif %}
1113
{% endblock content %}

0 commit comments

Comments
 (0)