diff --git a/README.md b/README.md
index 9f033fa..35dc918 100644
--- a/README.md
+++ b/README.md
@@ -28,10 +28,10 @@ I can *promise* you that there is no malicious code or dependency in this projec
The project depends on the following packages (installed when you ran `npm i`):
* express (a web server framework)
* nunjucks (a templating engine)
-* nunjucks-append (an extension that adds more functionality to nunjucks)
* nunjucks-markdown (markdown support in nunjucks)
* marked (markdown parser/compiler)
* highlight.js (syntax highlighting)
+* jsdom (an extension that can use the DOM server-side - used to render the ToC)
* chokidar (reload templates if they change on disk)
* fs (used for filesystem operations)
diff --git a/content/code/test.js b/content/code/test.js
deleted file mode 100644
index 84a7eda..0000000
--- a/content/code/test.js
+++ /dev/null
@@ -1,12 +0,0 @@
-const niceObject = {
- type: "the greatest",
- knownFor: [
- "indenting",
- "everything",
- {
- and: "wanting",
- to: "keep",
- it: "so"
- }
- ]
-}
\ No newline at end of file
diff --git a/content/components/toc.njk b/content/components/toc.njk
index 7c9613f..4dd0e44 100644
--- a/content/components/toc.njk
+++ b/content/components/toc.njk
@@ -1,9 +1,5 @@
{% macro header(size, text) %}
- {% append "toc" %}
- {{ text }}
- {% endappend %}
-
-
+
<{{ size }}>
{{ text }}
{{ size }}>
diff --git a/content/pages/article/how-to.njk b/content/pages/article/how-to.njk
deleted file mode 100644
index c92e133..0000000
--- a/content/pages/article/how-to.njk
+++ /dev/null
@@ -1,106 +0,0 @@
-{% extends "templates/article.njk" %}
-{% import "components/toc.njk" as toc with context %}
-
-{% block header %}
- How to - Article template
-{% endblock %}
-
-{% block toc %}
- {% output "toc" %}{% endoutput %}
-{% endblock %}
-
-{% block body %}
-
-
- {{ toc.header("h1", "Introduction", tocList) }}
-
- I want to start off by saying that this article template (as of now) is really fricking shit.
- The code base is somewhat okay in complexity, but I do not feel like it is done in a efficient/good
- way and won't work without CSS enabled (although, most people don't disable CSS).
- Please use with causition until I've implemented something better that would work without CSS.
-
-
- {{ toc.header("h2", "Terminology", tocList) }}
-
- Whenever I say "ToC" in this article I am refering to "Table of Contents". (I couldn't be bothered
- writing it out all the times...)
-
-
- {{ toc.header("h1", "Usage", tocList ) }}
-
- To use the template you would simply extend templates/article.njk
and
- import components/toc.njk
:
-
-
- {{ '
-{% extends "templates/article.njk" %}
-{% import "components/toc.njk" as toc with context %}
-
-{% block header %}
- Your header
-{% endblock %}
-
-{% block body %}
-
-
- Your content goes here
-
-
-{% endblock %}' | escape | replace("\n", "", 1) | replace("\n", "
") | replace(" ", " ") }}
-
-
- You would use the header
block to define a header, and then you place your
- content inside a div
with the class content
in your body
-block.
-
-
- {{ toc.header("h2", "Adding headers to the ToC", tocList) }}
-
- Adding headers is kind of easy, {% raw %}{% import "components/toc.njk" as toc with context %}{% endraw %}
- imports a macro that will create a header and automatically add it to the table of contents. You use it as such:
-
-
- {{ '{{ toc.header(size, text, tocList) }}' }}
-
-
- size
is a string and is a header level (aka h1
, h2
, h3
, etc.),
- text
is a string that holds the text you would want to display, and finally tocList
is a
- variable inherited from template/article.njk
that keeps a hold of which headers should go in the ToC.
-
- If you would want to display an {{ '' }}
with the text "Introduction" you would do:
-
-
- {{ '{{ toc.header("h1", "Introduction", tocList) }}' }}
-
-
-
- {{ toc.header("h2", "Generate the ToC", tocList) }}
-
- Sadly it isn't enough to just add the heading to the ToC. You will have to generate the ToC as well, but
- this isn't hard at all to do. You simply add {{ '{{ toc.generate(tocList) }}' }}
to the end
- of your body
-block.
-
-
- {{ toc.header("h1", "Example code", tocList) }}
-
- {{ '
-{% extends "templates/article.njk" %}
-{% import "components/toc.njk" as toc with context %}
-
-{% block header %}
- Your header
-{% endblock %}
-
-{% block body %}
-
- {{ toc.header("h1", "Introduction", tocList) }}
-
- Your introduction goes here...
-
-
-
- {{ toc.generate(tocList) }}
-{% endblock %}' | escape | replace("\n", "", 1) | replace("\n", "
") | replace(" ", " ") }}
-
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/content/pages/article/markdown.njk b/content/pages/article/markdown.njk
deleted file mode 100644
index 5672de6..0000000
--- a/content/pages/article/markdown.njk
+++ /dev/null
@@ -1,29 +0,0 @@
-{% extends "templates/article.njk" %}
-{% import "components/toc.njk" as toc with context %}
-{% import "components/code.njk" as code with context %}
-
-{% block header %}
- Markdown
-{% endblock %}
-
-{% block toc %}
- {% output "toc" %}{% endoutput %}
-{% endblock %}
-
-{% block body %}
- {% markdown %}
-# Test of markdown
-
-{{ code.import("code/test.js", "javascript") }}
-
-* A list item
-* A list item
-* A list item
-* A list item
-
-*italic* **bold**
-
-{{ toc.header("h1", "test header") }}
-
- {% endmarkdown %}
-{% endblock %}
\ No newline at end of file
diff --git a/content/pages/docs/main.njk b/content/pages/docs/main.njk
new file mode 100644
index 0000000..acda156
--- /dev/null
+++ b/content/pages/docs/main.njk
@@ -0,0 +1,25 @@
+{% extends "templates/article.njk" %}
+{% import "components/toc.njk" as toc with context %}
+
+{% block head %}
+
+ Our CMS can be used in multiple (different) ways thanks to the underlying technologies.
+ The basic idea is that every page is a file. Although how you treat that file is really
+ up to you. It can be plain HTML, nunjucks/njk (a templating language for HTML) or even
+ markdown (although not "plain markdown").
+
+ {{ toc.header("h2", "Views on bloat") }}
+
+ I do not want to bloat this CMS, but I must admit that it is bloated.
+ {{ hello }}
+
+{% endblock %}
\ No newline at end of file
diff --git a/content/pages/docs/main_md.njk b/content/pages/docs/main_md.njk
new file mode 100644
index 0000000..77eba6f
--- /dev/null
+++ b/content/pages/docs/main_md.njk
@@ -0,0 +1,16 @@
+{% extends "templates/article_md.njk" %}
+
+{% block head %}
+
- This is a paragraph. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Voluptate non ut commodi quisquam in, a dicta rem expedita tenetur quis ratione aut nesciunt corporis soluta similique eius accusantium, optio numquam? Dolorem, voluptates!
-
-
-