Skip to content

Commit c857251

Browse files
committed
fix
1 parent 2a6f1d0 commit c857251

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/samengine-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "samengine-cli",
3-
"version": "2.0.5",
3+
"version": "2.0.6",
44
"description": "CLI Tools and other useful helper for samengine",
55
"scripts": {
66
"build": "tsc",

packages/samengine-cli/src/cli/minisite.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import fs from "fs";
22
import path from "path";
33
import { parseMarkdown, exportCompressedMarkdownCSS } from "../index.js";
44

5-
const TEMPLATE_HTML = `<!doctype html><html lang="de"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>MiniSite</title><style>__CSS__{}</style></head><body><main id="app" class="md-body"></main><script> const pages = __PAGES__; const app = document.getElementById("app"); function normalizeRoute(route) { route = route.trim(); route = route.replace(/^\/+/, ""); if ( route === "" || route === "/" || route === "index" ) { return "index"; } return route; } function render() { let route = location.hash.slice(1); route = normalizeRoute(route); const html = pages[route] ?? pages["404"] ?? \`<h1>404</h1><p>This Page was not found!</p><p><a href="#">Back Home</a></p><p><a href="javascript:location.hash = '#/' + lastValid">Back to the last Page</a></p>\`; app.innerHTML = html; } window.addEventListener("hashchange", render); window.addEventListener("DOMContentLoaded", render); </script></body></html>
5+
const TEMPLATE_HTML = `<!doctype html><html lang="de"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>MiniSite</title><style>/*__CSS__{}*/</style></head><body><main id="app" class="md-body"></main><script> const pages = __PAGES__; const app = document.getElementById("app"); function normalizeRoute(route) { route = route.trim(); route = route.replace(/^\/+/, ""); if ( route === "" || route === "/" || route === "index" ) { return "index"; } return route; } function render() { let route = location.hash.slice(1); route = normalizeRoute(route); const html = pages[route] ?? pages["404"] ?? \`<h1>404</h1><p>This Page was not found!</p><p><a href="#">Back Home</a></p><p><a href="javascript:location.hash = '#/' + lastValid">Back to the last Page</a></p>\`; app.innerHTML = html; } window.addEventListener("hashchange", render); window.addEventListener("DOMContentLoaded", render); </script></body></html>
66
`;
77

88
export function newProj() {
@@ -44,7 +44,7 @@ export function compile() {
4444

4545
const html = template
4646
.replace("__PAGES__", JSON.stringify(pages))
47-
.replace("__CSS__{}", exportCompressedMarkdownCSS());
47+
.replace("/*__CSS__{}*/", exportCompressedMarkdownCSS());
4848

4949
fs.writeFileSync("index.html", html);
5050

packages/samengine-cli/src/cli/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>MiniSite</title>
77

88
<style>
9-
__CSS__ {}
9+
/*__CSS__{}*/
1010
</style>
1111
</head>
1212

0 commit comments

Comments
 (0)