Skip to content

Commit

Permalink
Adding latest and updating version
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed Sep 29, 2023
1 parent 3f9f015 commit 51f1740
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devdojo/static",
"version": "1.0.18",
"version": "1.0.19",
"description": "Static Site Generator",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = {

let staticJS = "window.toc = JSON.parse('" + JSON.stringify(tableOfContents.json).replace(/'/g, "\\'") + "'); window.frontmatter=JSON.parse('" + JSON.stringify(contentAttributes).replace(/'/g, "\\'") + "'); localStorage.setItem('toc', '" + JSON.stringify(tableOfContents.json).replace(/'/g, "\\'") + "'); localStorage.setItem('frontmatter', '" + JSON.stringify(contentAttributes).replace(/'/g, "\\'") + "');";
let staticJSEvent = "window.dispatchEvent(new CustomEvent('static:content', { detail: { frontmatter: '" + JSON.stringify(tableOfContents.json).replace(/'/g, "\\'") + "', toc: '" + JSON.stringify(tableOfContents.json).replace(/'/g, "\\'") + "' } }));";
let attrTags = "<script>document.addEventListener('DOMContentLoaded', (event) => { " + staticJS + " }); " + staticJSEvent + "</script>";
let attrTags = "<script>" + staticJS + staticJSEvent + "</script>";

// process frontmatter conditions
page = this.processFrontMatterConditions(page, contentAttributes);
Expand Down

0 comments on commit 51f1740

Please sign in to comment.