From b0487865472e82760614c4285804f2275cd04e09 Mon Sep 17 00:00:00 2001 From: Miha Kralj Date: Wed, 11 Mar 2026 18:39:40 -0700 Subject: [PATCH] fix: use docsify routes config for .pine files to prevent 404 Replace beforeEach hook with docsify's routes config that intercepts .pine URL patterns before docsify attempts to fetch them as .md files. The route handler fetches the actual .pine file and wraps it in a markdown code fence, giving each .pine file a unique URL hash. --- index.html | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/index.html b/index.html index c07df444..fa63cb9f 100644 --- a/index.html +++ b/index.html @@ -220,6 +220,25 @@ alias: { '/.*/_sidebar.md': '/_sidebar.md', }, + // Route handler for .pine files — fetch and wrap in markdown code fence + routes: { + '/(.+\\.pine)': function(route, matched, next) { + var pinePath = matched; + var absUrl = new URL(pinePath, document.baseURI).href; + fetch(absUrl).then(function(r) { + if (!r.ok) throw new Error(r.status); + return r.text(); + }).then(function(text) { + if (text.trimStart().startsWith('