diff --git a/content/components/toc.njk b/content/components/toc.njk new file mode 100644 index 0000000..679f39b --- /dev/null +++ b/content/components/toc.njk @@ -0,0 +1,13 @@ +{% macro header(size, text, tocList) %} + {% set tocList = (tocList.push([size, text]), tocList) %} + + <{{ size }}> + {{ text }} + +{% endmacro %} + +{% macro generate(tocList) %} + {% for size, text in tocList %} + {{ text }} + {% endfor %} +{% endmacro %} \ No newline at end of file diff --git a/content/pages/wiki/index.njk b/content/pages/wiki/index.njk new file mode 100644 index 0000000..e8319a9 --- /dev/null +++ b/content/pages/wiki/index.njk @@ -0,0 +1,18 @@ +{% extends "templates/article.njk" %} +{% import "components/toc.njk" as toc with context %} + +{% block body %} + {{ super() }} + +
+ {{ toc.header("h1", "Testing", tocList) }} +

Hello World!

+ + {{ toc.header("h1", "Development", tocList) }} +

Lorem ipsum dolor sit amet consectetur adipisicing elit. Fugiat optio earum unde reiciendis cumque, corrupti ipsum quia nemo deleniti officia quos laudantium error nobis at! Praesentium, officia vero! Ut, saepe vitae maiores velit ad quis! Cum quisquam ipsam nulla laudantium rerum sint eos magni, sunt porro fuga hic nihil obcaecati iure animi impedit repellendus nisi voluptas dolore, alias tenetur fugiat? Maiores quibusdam corporis recusandae unde eaque consectetur, officia harum optio fuga architecto beatae, reprehenderit aspernatur magnam debitis consequatur. Vero recusandae obcaecati harum minus facilis illo aliquid quis! Ipsam assumenda molestiae molestias quisquam illum nesciunt. Quam dolorem fuga saepe ratione labore tenetur in laborum, quae beatae quisquam, possimus doloremque iusto eum ex odit! Suscipit iste molestias nam cupiditate distinctio veniam sint laborum, culpa odio, voluptatem fugiat exercitationem, incidunt at.

+
+ +
+ {{ toc.generate(tocList) }} +
+{% endblock %} \ No newline at end of file diff --git a/content/templates/article.njk b/content/templates/article.njk new file mode 100644 index 0000000..496133b --- /dev/null +++ b/content/templates/article.njk @@ -0,0 +1,18 @@ + + + + {% include "./defaultTags.njk" %} + {% block head %} + {{ serverName }} + {% endblock %} + + + {% set tocList = [] %} + +
+ {% block body %} + + {% endblock %} +
+ + \ No newline at end of file