added better markdown view pages and enabled subscription button to know when your logged in

This commit is contained in:
Keep Creating Online
2025-02-06 15:15:29 -05:00
parent 6cf1d53624
commit 7e661ba0fd
24 changed files with 487 additions and 3240 deletions

52
views/ipns.html Normal file
View File

@@ -0,0 +1,52 @@
<!-- views/ipns.html -->
<section class="mb-8">
<!--
Added "text-gray-900" here to ensure we override
any global white text color that might be inherited.
-->
<div class="bg-white p-6 rounded-lg shadow-md text-gray-900">
<h2 class="text-2xl font-bold mb-4 text-gray-700">IPNS Gateways</h2>
<!--
"markdown-body" can be any class name; its just so markdown.css
can style headings, lists, etc.
-->
<div id="markdown-container" class="markdown-body">
<p class="text-gray-500">Loading content...</p>
</div>
</div>
</section>
<script>
(async () => {
try {
const response = await fetch("content/ipns.md");
if (!response.ok) {
throw new Error("Failed to load IPNS markdown file.");
}
const markdownText = await response.text();
// Convert to HTML with Marked (make sure "marked" is loaded globally)
const html = marked.parse(markdownText);
// Insert final HTML into #markdown-container
const container = document.getElementById("markdown-container");
if (container) {
container.innerHTML = html;
}
// Optional: highlight code blocks (requires "hljs" loaded globally)
document.querySelectorAll("pre code").forEach((block) => {
hljs.highlightBlock(block);
});
} catch (err) {
console.error("Error loading IPNS content:", err);
const container = document.getElementById("markdown-container");
if (container) {
container.innerHTML = `
<p class="text-red-500">Error loading content. Please try again later.</p>
`;
}
}
})();
</script>