Compare commits

..

3 Commits

5 changed files with 1071 additions and 225 deletions

View File

@ -192,7 +192,7 @@ const nodeTypeCounts = {
</div> </div>
</div> </div>
<div class="full-post-footer"> <div class="full-post-footer">
<a href="#" id="full-post-link" class="full-post-link" target="_self" rel="noopener noreferrer"> <a href="#" id="full-post-link" class="full-post-link" target="_blank" rel="noopener noreferrer"> <!-- Changed target to _blank -->
Read Full Article Read Full Article
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path> <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
@ -878,42 +878,7 @@ const nodeTypeCounts = {
// Reset graph view if "All" is selected // Reset graph view if "All" is selected
cy.elements().removeClass('highlighted faded filtered'); cy.elements().removeClass('highlighted faded filtered');
const allFilterBtn = document.querySelector('.graph-filter[data-filter="all"]'); const allFilterBtn = document.querySelector('.graph-filter[data-filter="all"]');
// Add event listener to prevent redirect in fullscreen mode // Listen for ESC key to exit fullscreen
if (fullPostLink) {
fullPostLink.addEventListener('click', (e) => {
if (isFullscreen) {
// If in fullscreen, prevent default behavior to keep the user in the graph view
e.preventDefault();
// Instead, display a message to exit fullscreen to visit the full article
const message = document.createElement('div');
message.className = 'fullscreen-message';
message.textContent = 'Exit fullscreen to visit the full article page';
message.style.position = 'absolute';
message.style.bottom = '70px'; // Adjust as needed
message.style.left = '50%';
message.style.transform = 'translateX(-50%)';
message.style.background = 'rgba(0, 0, 0, 0.75)';
message.style.color = 'white';
message.style.padding = '8px 16px';
message.style.borderRadius = '4px';
message.style.zIndex = '1000';
message.style.transition = 'opacity 0.3s ease';
fullPostContent.appendChild(message);
// Remove the message after 3 seconds
setTimeout(() => {
message.style.opacity = '0';
setTimeout(() => {
message.remove();
}, 300);
}, 3000);
}
});
}
// Listen for ESC key to exit fullscreen
document.addEventListener('keydown', (e) => { document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && isFullscreen) { if (e.key === 'Escape' && isFullscreen) {
toggleFullscreen(); toggleFullscreen();
@ -958,41 +923,6 @@ const nodeTypeCounts = {
// Dispatch graphReady event for external listeners // Dispatch graphReady event for external listeners
document.dispatchEvent(new CustomEvent('graphReady', { detail: { cy } })); document.dispatchEvent(new CustomEvent('graphReady', { detail: { cy } }));
// Add event listener to prevent redirect in fullscreen mode
if (fullPostLink) {
fullPostLink.addEventListener('click', (e) => {
if (isFullscreen) {
// If in fullscreen, prevent default behavior to keep the user in the graph view
e.preventDefault();
// Instead, display a message to exit fullscreen to visit the full article
const message = document.createElement('div');
message.className = 'fullscreen-message';
message.textContent = 'Exit fullscreen to visit the full article page';
message.style.position = 'absolute';
message.style.bottom = '70px'; // Adjust as needed
message.style.left = '50%';
message.style.transform = 'translateX(-50%)';
message.style.background = 'rgba(0, 0, 0, 0.75)';
message.style.color = 'white';
message.style.padding = '8px 16px';
message.style.borderRadius = '4px';
message.style.zIndex = '1000';
message.style.transition = 'opacity 0.3s ease';
fullPostContent.appendChild(message);
// Remove the message after 3 seconds
setTimeout(() => {
message.style.opacity = '0';
setTimeout(() => {
message.remove();
}, 300);
}, 3000);
}
});
}
// Listen for ESC key to exit fullscreen // Listen for ESC key to exit fullscreen
document.addEventListener('keydown', (e) => { document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && isFullscreen) { if (e.key === 'Escape' && isFullscreen) {

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,12 @@
--- ---
title: Secure Remote Access with Cloudflare Tunnels title: This is a test
description: How to set up Cloudflare Tunnels for secure remote access to your home lab services description: How to set up Cloudflare Tunnels for secure remote access to your home lab services
pubDate: Jul 22 2023 pubDate: Jul 22 2023
heroImage: /images/posts/prometheusk8.png heroImage: /images/posts/prometheusk8.png
category: networking category: networking
tags: tags:
- cloudflare - Tag A
- networking - Tag B
- security - Tag C
- homelab
- tunnels
readTime: "7 min read" readTime: "7 min read"
--- ---

View File

@ -2,7 +2,8 @@
import BaseLayout from './BaseLayout.astro'; import BaseLayout from './BaseLayout.astro';
import Header from '../components/Header.astro'; import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro'; import Footer from '../components/Footer.astro';
import MiniKnowledgeGraph from '../components/MiniKnowledgeGraph.astro'; // Restore original or keep if needed // import MiniKnowledgeGraph from '../components/MiniKnowledgeGraph.astro'; // Keep if needed elsewhere, but remove from main content
import MiniGraph from '../components/MiniGraph.astro'; // Add import for MiniGraph
import { getCollection } from 'astro:content'; import { getCollection } from 'astro:content';
interface Props { interface Props {
@ -137,11 +138,11 @@ const displayImage = frontmatter.heroImage || '/images/placeholders/default.jpg'
</div> </div>
)} )}
{/* Content Connections - Knowledge Graph */} {/* Content Connections - Removed MiniKnowledgeGraph from here */}
<div class="content-connections"> {/* <div class="content-connections">
<h3 class="connections-title">Post Connections</h3> <h3 class="connections-title">Post Connections</h3>
<MiniKnowledgeGraph currentPost={currentPost} relatedPosts={relatedPosts} /> <MiniKnowledgeGraph currentPost={currentPost} relatedPosts={relatedPosts} />
</div> </div> */}
{/* Main Content Area */} {/* Main Content Area */}
<div class="blog-post-content prose prose-invert max-w-none"> <div class="blog-post-content prose prose-invert max-w-none">
@ -194,6 +195,24 @@ const displayImage = frontmatter.heroImage || '/images/placeholders/default.jpg'
</div> </div>
</div> </div>
{/* MiniGraph Component - Placed after Author Card */}
<MiniGraph
slug={slug}
title={frontmatter.title}
tags={frontmatter.tags}
category={frontmatter.category}
/>
{/* Tags Section - Placed after MiniGraph */}
<div class="sidebar-card">
<h3 class="sidebar-title">Tags</h3>
<div class="tags">
{frontmatter.tags && frontmatter.tags.map(tag => (
<a href={`/tag/${tag}`} class="tag">{tag}</a>
))}
</div>
</div>
{/* Table of Contents Card */} {/* Table of Contents Card */}
<div class="sidebar-card toc-card"> <div class="sidebar-card toc-card">
<h3>Table of Contents</h3> <h3>Table of Contents</h3>
@ -306,6 +325,37 @@ const displayImage = frontmatter.heroImage || '/images/placeholders/default.jpg'
font-style: italic; font-style: italic;
font-size: 0.9rem; font-size: 0.9rem;
} }
/* Add styles for Tags in the sidebar */
.tags {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.tag {
color: var(--accent-secondary);
text-decoration: none;
font-size: 0.85rem;
transition: all 0.3s ease;
font-family: var(--font-mono);
background-color: rgba(59, 130, 246, 0.1);
padding: 0.3rem 0.6rem;
border-radius: 4px;
display: inline-block;
}
.tag:hover {
color: var(--accent-primary);
background-color: rgba(6, 182, 212, 0.15);
transform: translateY(-2px);
}
.sidebar-title {
font-size: 1.1rem;
margin-bottom: 1rem;
color: var(--text-primary);
}
</style> </style>
<style> <style>

View File

@ -2,6 +2,7 @@
// src/pages/posts/[slug].astro // src/pages/posts/[slug].astro
import { getCollection } from 'astro:content'; import { getCollection } from 'astro:content';
import BaseLayout from '../../layouts/BaseLayout.astro'; import BaseLayout from '../../layouts/BaseLayout.astro';
import MiniGraph from '../../components/MiniGraph.astro';
// Required getStaticPaths function for dynamic routes // Required getStaticPaths function for dynamic routes
export async function getStaticPaths() { export async function getStaticPaths() {
@ -10,7 +11,7 @@ export async function getStaticPaths() {
const allPosts = await getCollection('posts', ({ data }) => { const allPosts = await getCollection('posts', ({ data }) => {
return import.meta.env.PROD ? !data.draft : true; return import.meta.env.PROD ? !data.draft : true;
}); });
return allPosts.map(post => ({ return allPosts.map(post => ({
params: { slug: post.slug }, params: { slug: post.slug },
props: { post, allPosts }, props: { post, allPosts },
@ -57,10 +58,10 @@ const getISODate = (date) => {
// Find related posts by tags // Find related posts by tags
const getRelatedPosts = (currentPost, allPosts, maxPosts = 3) => { const getRelatedPosts = (currentPost, allPosts, maxPosts = 3) => {
if (!currentPost || !allPosts) return []; if (!currentPost || !allPosts) return [];
// Get current post tags // Get current post tags
const postTags = currentPost.data.tags || []; const postTags = currentPost.data.tags || [];
// If no tags, just return recent posts // If no tags, just return recent posts
if (postTags.length === 0) { if (postTags.length === 0) {
return allPosts return allPosts
@ -72,7 +73,7 @@ const getRelatedPosts = (currentPost, allPosts, maxPosts = 3) => {
}) })
.slice(0, maxPosts); .slice(0, maxPosts);
} }
// Score posts by matching tags // Score posts by matching tags
const scoredPosts = allPosts const scoredPosts = allPosts
.filter(p => p.slug !== currentPost.slug && !p.data.draft) .filter(p => p.slug !== currentPost.slug && !p.data.draft)
@ -85,20 +86,20 @@ const getRelatedPosts = (currentPost, allPosts, maxPosts = 3) => {
.sort((a, b) => { .sort((a, b) => {
// Sort by score first // Sort by score first
if (b.score !== a.score) return b.score - a.score; if (b.score !== a.score) return b.score - a.score;
// If scores are equal, sort by date // If scores are equal, sort by date
const dateA = a.post.data.pubDate ? new Date(a.post.data.pubDate) : new Date(0); const dateA = a.post.data.pubDate ? new Date(a.post.data.pubDate) : new Date(0);
const dateB = b.post.data.pubDate ? new Date(b.post.data.pubDate) : new Date(0); const dateB = b.post.data.pubDate ? new Date(b.post.data.pubDate) : new Date(0);
return dateB.getTime() - dateA.getTime(); return dateB.getTime() - dateA.getTime();
}) })
.slice(0, maxPosts); .slice(0, maxPosts);
// If we don't have enough related posts by tags, add recent posts // If we don't have enough related posts by tags, add recent posts
if (scoredPosts.length < maxPosts) { if (scoredPosts.length < maxPosts) {
const recentPosts = allPosts const recentPosts = allPosts
.filter(p => { .filter(p => {
return p.slug !== currentPost.slug && return p.slug !== currentPost.slug &&
!p.data.draft && !p.data.draft &&
!scoredPosts.some(sp => sp.post.slug === p.slug); !scoredPosts.some(sp => sp.post.slug === p.slug);
}) })
.sort((a, b) => { .sort((a, b) => {
@ -107,10 +108,10 @@ const getRelatedPosts = (currentPost, allPosts, maxPosts = 3) => {
return dateB.getTime() - dateA.getTime(); return dateB.getTime() - dateA.getTime();
}) })
.slice(0, maxPosts - scoredPosts.length); .slice(0, maxPosts - scoredPosts.length);
return [...scoredPosts.map(sp => sp.post), ...recentPosts]; return [...scoredPosts.map(sp => sp.post), ...recentPosts];
} }
return scoredPosts.map(sp => sp.post); return scoredPosts.map(sp => sp.post);
}; };
@ -118,7 +119,7 @@ const getRelatedPosts = (currentPost, allPosts, maxPosts = 3) => {
const relatedPosts = getRelatedPosts(post, allPosts); const relatedPosts = getRelatedPosts(post, allPosts);
// Check for explicitly related posts in frontmatter // Check for explicitly related posts in frontmatter
const explicitRelatedPosts = post.data.related_posts const explicitRelatedPosts = post.data.related_posts
? allPosts.filter(p => post.data.related_posts.includes(p.slug)) ? allPosts.filter(p => post.data.related_posts.includes(p.slug))
: []; : [];
@ -143,19 +144,42 @@ const { Content } = await post.render();
{post.data.author && <div class="author">By {post.data.author}</div>} {post.data.author && <div class="author">By {post.data.author}</div>}
</div> </div>
</header> </header>
{post.data.heroImage && (
<div class="hero-image">
<img src={post.data.heroImage} alt={post.data.title} />
</div>
)}
<div class="post-content"> <div class="post-content">
<div class="post-body"> <div class="post-main-column">
<Content /> {post.data.heroImage && (
<div class="hero-image">
<img src={post.data.heroImage} alt={post.data.title} />
</div>
)}
<div class="post-body">
<Content />
</div>
</div> </div>
<aside class="post-sidebar"> <aside class="post-sidebar">
{post.data.author && (
<div class="author-section sidebar-block">
<h3>Author</h3>
<div class="author-card">
<div class="author-name">{post.data.author}</div>
{/* Add more author details if needed */}
</div>
</div>
)}
<div class="knowledge-graph-section sidebar-block">
<MiniGraph
slug={post.slug}
title={post.data.title}
tags={post.data.tags || []}
category={post.data.category || "Uncategorized"}
allPosts={allPosts}
content={""} {/* Pass empty string for content */}
/>
</div>
{post.data.tags && post.data.tags.length > 0 && ( {post.data.tags && post.data.tags.length > 0 && (
<div class="tags-section sidebar-block"> <div class="tags-section sidebar-block">
<h3>Tags</h3> <h3>Tags</h3>
@ -166,7 +190,7 @@ const { Content } = await post.render();
</div> </div>
</div> </div>
)} )}
{post.data.category && ( {post.data.category && (
<div class="category-section sidebar-block"> <div class="category-section sidebar-block">
<h3>Category</h3> <h3>Category</h3>
@ -175,7 +199,7 @@ const { Content } = await post.render();
</a> </a>
</div> </div>
)} )}
{post.data.categories && post.data.categories.length > 0 && ( {post.data.categories && post.data.categories.length > 0 && (
<div class="categories-section sidebar-block"> <div class="categories-section sidebar-block">
<h3>Categories</h3> <h3>Categories</h3>
@ -188,7 +212,7 @@ const { Content } = await post.render();
</div> </div>
</div> </div>
)} )}
{combinedRelatedPosts.length > 0 && ( {combinedRelatedPosts.length > 0 && (
<div class="related-posts-section sidebar-block"> <div class="related-posts-section sidebar-block">
<h3>Related Articles</h3> <h3>Related Articles</h3>
@ -208,7 +232,7 @@ const { Content } = await post.render();
)} )}
</aside> </aside>
</div> </div>
<div class="post-navigation"> <div class="post-navigation">
<a href="/blog" class="back-to-blog"> <a href="/blog" class="back-to-blog">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
@ -227,22 +251,22 @@ const { Content } = await post.render();
margin: 0 auto; margin: 0 auto;
padding: 0 var(--container-padding, 1.5rem); padding: 0 var(--container-padding, 1.5rem);
} }
.blog-post { .blog-post {
padding: 2rem 0; padding: 2rem 0;
} }
.post-header { .post-header {
margin-bottom: 2rem; margin-bottom: 2rem;
text-align: center; text-align: center;
} }
.post-header h1 { .post-header h1 {
font-size: var(--font-size-4xl, 2.25rem); font-size: var(--font-size-4xl, 2.25rem);
margin-bottom: 1rem; margin-bottom: 1rem;
line-height: 1.2; line-height: 1.2;
} }
.post-meta { .post-meta {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -252,58 +276,69 @@ const { Content } = await post.render();
font-size: var(--font-size-sm, 0.875rem); font-size: var(--font-size-sm, 0.875rem);
font-family: var(--font-mono); font-family: var(--font-mono);
} }
.hero-image {
margin-bottom: 2rem;
border-radius: 12px;
overflow: hidden;
border: 1px solid var(--border-primary);
}
.hero-image img {
width: 100%;
height: auto;
display: block;
}
.post-content { .post-content {
display: grid; display: grid;
grid-template-columns: 3fr 1fr; grid-template-columns: 3fr 1fr;
gap: 2rem; gap: 2rem;
} }
.post-main-column {
display: flex;
flex-direction: column;
}
.hero-image {
margin-bottom: 2rem;
border-radius: 12px;
overflow: hidden;
border: 1px solid var(--border-primary);
/* Hero image now contained within post-main-column */
width: 100%;
}
.hero-image img {
width: 100%;
height: auto;
display: block;
}
.post-body { .post-body {
background: var(--card-bg); background: var(--card-bg);
border-radius: 12px; border-radius: 12px;
padding: 2rem; padding: 2rem;
border: 1px solid var(--border-primary); border: 1px solid var(--border-primary);
} }
.post-sidebar { .post-sidebar {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.5rem; gap: 1.5rem;
} }
.sidebar-block { .sidebar-block {
background: var(--card-bg); background: var(--card-bg);
border-radius: 12px; border-radius: 12px;
padding: 1.5rem; padding: 1.5rem;
border: 1px solid var(--border-primary); border: 1px solid var(--border-primary);
} }
.sidebar-block h3 { .sidebar-block h3 {
font-size: var(--font-size-lg, 1.125rem); font-size: var(--font-size-lg, 1.125rem);
margin-bottom: 1rem; margin-bottom: 1rem;
color: var(--text-primary); color: var(--text-primary);
} }
.knowledge-graph-section {
padding: 1rem; /* Adjusted padding */
}
.tags { .tags {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.5rem; gap: 0.5rem;
} }
.tag { .tag {
display: inline-block; display: inline-block;
padding: 0.25rem 0.75rem; padding: 0.25rem 0.75rem;
@ -314,18 +349,18 @@ const { Content } = await post.render();
text-decoration: none; text-decoration: none;
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.tag:hover { .tag:hover {
background: rgba(16, 185, 129, 0.2); background: rgba(16, 185, 129, 0.2);
transform: translateY(-2px); transform: translateY(-2px);
} }
.category, .categories { .category, .categories {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.5rem; gap: 0.5rem;
} }
.category { .category {
display: inline-block; display: inline-block;
padding: 0.5rem 1rem; padding: 0.5rem 1rem;
@ -338,27 +373,42 @@ const { Content } = await post.render();
transition: all 0.3s ease; transition: all 0.3s ease;
text-align: center; text-align: center;
} }
.category:hover { .category:hover {
transform: translateY(-2px); transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
} }
/* Author Card */
.author-card {
/* Simplified author card for this example */
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.author-name {
font-weight: 600;
margin-top: 0.5rem;
color: var(--text-primary);
}
/* Related Posts */ /* Related Posts */
.related-posts { .related-posts {
list-style: none; list-style: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
.related-posts li { .related-posts li {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
.related-posts li:last-child { .related-posts li:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.related-post { .related-post {
display: block; display: block;
padding: 0.75rem; padding: 0.75rem;
@ -367,20 +417,20 @@ const { Content } = await post.render();
text-decoration: none; text-decoration: none;
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.related-post:hover { .related-post:hover {
background: rgba(6, 182, 212, 0.05); background: rgba(6, 182, 212, 0.05);
border-color: var(--accent-primary); border-color: var(--accent-primary);
transform: translateY(-2px); transform: translateY(-2px);
} }
.related-post-title { .related-post-title {
color: var(--text-primary); color: var(--text-primary);
font-size: 0.9rem; font-size: 0.9rem;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
font-weight: 500; font-weight: 500;
} }
.related-post-meta { .related-post-meta {
font-size: 0.75rem; font-size: 0.75rem;
color: var(--text-tertiary); color: var(--text-tertiary);
@ -393,7 +443,7 @@ const { Content } = await post.render();
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
.back-to-blog { .back-to-blog {
display: flex; display: flex;
align-items: center; align-items: center;
@ -407,57 +457,57 @@ const { Content } = await post.render();
font-weight: 500; font-weight: 500;
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.back-to-blog:hover { .back-to-blog:hover {
border-color: var(--accent-primary); border-color: var(--accent-primary);
background: var(--bg-tertiary); background: var(--bg-tertiary);
transform: translateY(-2px); transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
} }
/* Content Styling */ /* Content Styling */
.post-body { .post-body {
font-size: 1.05rem; font-size: 1.05rem;
line-height: 1.7; line-height: 1.7;
color: var(--text-primary); color: var(--text-primary);
} }
.post-body h2 { .post-body h2 {
font-size: 1.8rem; font-size: 1.8rem;
margin: 2rem 0 1rem; margin: 2rem 0 1rem;
color: var(--text-primary); color: var(--text-primary);
} }
.post-body h3 { .post-body h3 {
font-size: 1.4rem; font-size: 1.4rem;
margin: 1.75rem 0 0.75rem; margin: 1.75rem 0 0.75rem;
color: var(--text-primary); color: var(--text-primary);
} }
.post-body p { .post-body p {
margin-bottom: 1.25rem; margin-bottom: 1.25rem;
} }
.post-body a { .post-body a {
color: var(--accent-primary); color: var(--accent-primary);
text-decoration: none; text-decoration: none;
border-bottom: 1px dashed var(--accent-primary); border-bottom: 1px dashed var(--accent-primary);
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.post-body a:hover { .post-body a:hover {
color: var(--accent-secondary); color: var(--accent-secondary);
border-bottom-style: solid; border-bottom-style: solid;
} }
.post-body ul, .post-body ol { .post-body ul, .post-body ol {
margin: 1rem 0 1.5rem 1.5rem; margin: 1rem 0 1.5rem 1.5rem;
} }
.post-body li { .post-body li {
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
.post-body blockquote { .post-body blockquote {
margin: 1.5rem 0; margin: 1.5rem 0;
padding: 1rem 1.5rem; padding: 1rem 1.5rem;
@ -467,7 +517,7 @@ const { Content } = await post.render();
color: var(--text-secondary); color: var(--text-secondary);
font-style: italic; font-style: italic;
} }
.post-body code { .post-body code {
font-family: var(--font-mono); font-family: var(--font-mono);
background: rgba(15, 23, 42, 0.3); background: rgba(15, 23, 42, 0.3);
@ -475,7 +525,7 @@ const { Content } = await post.render();
border-radius: 4px; border-radius: 4px;
font-size: 0.9em; font-size: 0.9em;
} }
.post-body pre { .post-body pre {
background: rgba(15, 23, 42, 0.3); background: rgba(15, 23, 42, 0.3);
padding: 1rem; padding: 1rem;
@ -484,54 +534,54 @@ const { Content } = await post.render();
margin: 1.5rem 0; margin: 1.5rem 0;
border: 1px solid var(--border-primary); border: 1px solid var(--border-primary);
} }
.post-body pre code { .post-body pre code {
background: transparent; background: transparent;
padding: 0; padding: 0;
font-size: 0.9em; font-size: 0.9em;
color: var(--text-primary); color: var(--text-primary);
} }
.post-body img { .post-body img {
max-width: 100%; max-width: 100%;
height: auto; height: auto;
border-radius: 8px; border-radius: 8px;
margin: 1.5rem 0; margin: 1.5rem 0;
} }
.post-body table { .post-body table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
margin: 1.5rem 0; margin: 1.5rem 0;
} }
.post-body th, .post-body td { .post-body th, .post-body td {
border: 1px solid var(--border-primary); border: 1px solid var(--border-primary);
padding: 0.75rem; padding: 0.75rem;
} }
.post-body th { .post-body th {
background: rgba(15, 23, 42, 0.3); background: rgba(15, 23, 42, 0.3);
font-weight: 600; font-weight: 600;
text-align: left; text-align: left;
} }
/* Responsive Adjustments */ /* Responsive Adjustments */
@media (max-width: 1024px) { @media (max-width: 1024px) {
.post-header h1 { .post-header h1 {
font-size: var(--font-size-3xl, 1.875rem); font-size: var(--font-size-3xl, 1.875rem);
} }
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.post-content { .post-content {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.post-header h1 { .post-header h1 {
font-size: var(--font-size-2xl, 1.5rem); font-size: var(--font-size-2xl, 1.5rem);
} }
.post-body { .post-body {
padding: 1.5rem; padding: 1.5rem;
} }
@ -547,7 +597,7 @@ const { Content } = await post.render();
// Already links, no need for additional JS // Already links, no need for additional JS
}); });
}); });
// Add scroll-to-top button when scrolling down // Add scroll-to-top button when scrolling down
const scrollToTop = document.createElement('button'); const scrollToTop = document.createElement('button');
scrollToTop.className = 'scroll-to-top'; scrollToTop.className = 'scroll-to-top';
@ -557,7 +607,7 @@ const { Content } = await post.render();
</svg> </svg>
`; `;
document.body.appendChild(scrollToTop); document.body.appendChild(scrollToTop);
// Show/hide scroll-to-top button // Show/hide scroll-to-top button
window.addEventListener('scroll', () => { window.addEventListener('scroll', () => {
if (window.scrollY > 500) { if (window.scrollY > 500) {
@ -566,7 +616,7 @@ const { Content } = await post.render();
scrollToTop.classList.remove('visible'); scrollToTop.classList.remove('visible');
} }
}); });
// Scroll to top when clicked // Scroll to top when clicked
scrollToTop.addEventListener('click', () => { scrollToTop.addEventListener('click', () => {
window.scrollTo({ window.scrollTo({
@ -600,18 +650,18 @@ const { Content } = await post.render();
transform: translateY(20px); transform: translateY(20px);
z-index: 100; z-index: 100;
} }
.scroll-to-top.visible { .scroll-to-top.visible {
opacity: 1; opacity: 1;
visibility: visible; visibility: visible;
transform: translateY(0); transform: translateY(0);
} }
.scroll-to-top:hover { .scroll-to-top:hover {
transform: translateY(-5px); transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.scroll-to-top { .scroll-to-top {
width: 40px; width: 40px;
@ -619,7 +669,7 @@ const { Content } = await post.render();
bottom: 20px; bottom: 20px;
right: 20px; right: 20px;
} }
.scroll-to-top svg { .scroll-to-top svg {
width: 20px; width: 20px;
height: 20px; height: 20px;