diff --git a/website/src/_includes/footer.html b/website/src/_includes/footer.html new file mode 100644 index 0000000000..0144be0c0e --- /dev/null +++ b/website/src/_includes/footer.html @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/website/src/_includes/layouts/article.html b/website/src/_includes/layouts/article.html index 22fb171b0a..ab67b29a81 100644 --- a/website/src/_includes/layouts/article.html +++ b/website/src/_includes/layouts/article.html @@ -18,50 +18,9 @@
{{ content | safe }}
+ {% include "footer.html" %} - - - + diff --git a/website/src/js/article.js b/website/src/js/article.js new file mode 100644 index 0000000000..e38f489e5a --- /dev/null +++ b/website/src/js/article.js @@ -0,0 +1,22 @@ +// Convert relative blog extension (from .md to .html) +document.querySelectorAll("a").forEach((a) => { + const dotSepList = a.getAttribute("href").split("."); + if (dotSepList[0] == "") { + const hashSepList = dotSepList[dotSepList.length - 1].split("#") + if (hashSepList[0] == "md") { + let str = `.${dotSepList[1]}`; + for (let i = 2; i < dotSepList.length; i++) { + if (dotSepList[i].substring(0, 2) != "md") { + str += "." + dotSepList[i]; + } else { + str += ".html"; + break; + }; + } + if (hashSepList[1]) { + str += "#" + hashSepList[1]; + } + a.setAttribute("href", str); + } + } +}); \ No newline at end of file