Post Links and the Knowledge Graph
Internal Links Create a Graph
This blog automatically discovers links between posts and builds an interactive knowledge graph. When you visit a post, you'll see a visualization of related posts in the sidebar—a feature inspired by tools like Obsidian and Quartz.
How to Link Posts
To link to another post from your current post, use the link template tag (imported as l) from $lib/tags:
import { link as l } from '$lib/tags';
// In your post:
// See {l`example-code-blocks`} for more details. The link tag transforms the slug into a proper HTML anchor at build time.
This link is type-safe — the preprocessor validates that the target post exists.
Linking to Specific Sections
You can link to specific sections within a post using the hash syntax:
// Link to the "Getting Started" section of another post
{l`example-getting-started#using-math-and-links`} The preprocessor ensures the link is valid at build time. Try linking to example getting started to see how it works.
The Knowledge Graph Visualization
Each post includes a LocalGraph visualization showing its connected posts. You'll see it above this section showing all posts linked to this one.
Navigate to /graph in the navigation to see your entire knowledge graph.
It shows all posts as nodes and connections (links) between them. You can:
- Hover over nodes to highlight related posts
- Click nodes to navigate to that post
- Pan and zoom to explore the graph
- See the local graph for each post (connected posts only)
Building Your Content Network
The more you link between related posts, the richer your knowledge graph becomes. This creates a non-linear way for readers to explore your content. Instead of scrolling through chronological lists, they can follow threads of connected ideas through links like example code blocks, example math, and others.
Seeing the Local Graph
At the bottom of each post (or via the local graph viewer), you'll see a visualization of posts linked to the current post. This helps readers understand where this post sits in your larger knowledge base.
No Dead Links
Since links are validated at compile time from actual posts, you never have to worry about broken internal links. If a post doesn't exist, the build will fail with an error message telling you exactly which link is broken.