Skip to content

Commit 17eeacc

Browse files
committed
Load TinyPine from CDN and fix markdown path references
1 parent 17b798e commit 17eeacc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<link href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&display=swap" rel="stylesheet">
1212
<link rel="stylesheet" href="./style.css">
1313
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css">
14+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/tinypine.min.js"></script>
1415
</head>
1516
<body class="h-full bg-gradient-to-br from-gray-50 via-pine-50/30 to-gray-50 dark:from-gray-900 dark:via-pine-950/20 dark:to-gray-900 transition-all duration-500">
1617

main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import TinyPine from 'tinypine';
21
import { marked } from 'marked'
32
import hljs from 'highlight.js'
43

@@ -146,7 +145,7 @@ window.app = function() {
146145
const contentDiv = document.getElementById('markdown-content')
147146

148147
try {
149-
const response = await fetch(`/docs/${path}.md`)
148+
const response = await fetch(`./docs/${path}.md`)
150149

151150
if (!response.ok) {
152151
throw new Error('Document not found')
@@ -242,7 +241,9 @@ document.addEventListener('DOMContentLoaded', () => {
242241
}
243242

244243
// Now that window.app is defined, initialize TinyPine
245-
TinyPine.init();
244+
if (window.TinyPine) {
245+
window.TinyPine.init();
246+
}
246247

247248
// Wait a moment for TinyPine to process directives, then trigger app init
248249
setTimeout(() => {

0 commit comments

Comments
 (0)