Added support for dates of articles. :)

master
BurnyLlama 2021-08-08 18:32:09 +02:00
parent 53bd81a8af
commit 7fa8f0b308
4 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,11 @@ article > header {
margin-bottom: 2rem;
}
article > header > i {
color: var(--accent);
display: block;
}
.toc-container {
grid-area: toc;
display: grid;

View File

@ -1,6 +1,7 @@
%%-
title: qwik cms
header: qwik cms intro
date: 8th August 2021
-%%
# Introduction

View File

@ -10,6 +10,7 @@
<article>
<header>
{{ externalMeta.header }}
<i>{{ externalMeta.date }}</i>
</header>
<div class="toc-container">

View File

@ -1,6 +1,10 @@
import fs from 'fs'
import { JSDOM } from 'jsdom'
import { parseExternalContext } from './externalContext.js'
const ConfigFile = fs.readFileSync('./config.json')
const Config = JSON.parse(ConfigFile)
function generateToc(dom) {
// Get all ToC anchors from the DOM
const tocAnchors = dom.window.document.querySelectorAll(".toc-anchor")