Starting another project with AI assistance
Instead of jumping headfirst into Cursor IDE for this project, I thought it'd be prudent to plan out the details using Phind first.
complete reset
When I jumped into cursor to modify this site I didn't take the time to fully understand the underlying architecture. in spite of documenting the changes I can't really make heads or tails of what's what anymore. I've gone back to a clean slate so I can do things in a more organized fasion. I'm thinking of documenting everything in a way that makes sense to me, before letting an AI model loose on my site again.
Fixing Wiki Link Rendering
Identified and fixed a bug in the Eleventy configuration (.eleventy.js
). The regular expression used in the link
filter to parse Obsidian-style wiki links was incorrect and only handled links with aliases (Alias
), causing build errors when encountering simple links (Link
).
Corrected the regex to properly handle both formats, resolving the build error and ensuring all wiki links should now render correctly.
Fixing Link Previews and Graph Visualization
Fixed issues with two key features of the digital garden that weren't working properly:
Link Previews
Fixed Obsidian-style hover previews on internal wiki links:
- Corrected logical operators in the settings object in
meta.js
to properly default to showing previews - Added robust error handling to the preview component to gracefully handle missing elements
- Improved preview styling with responsive design for mobile devices
- Added debugging tools to help identify and troubleshoot preview issues
- Enhanced visibility of internal links with subtle styling
Graph Visualization
Fixed the Connected Pages graph that shows relationships between notes:
- Added comprehensive error handling to the graph data fetching process
- Changed script loading order to ensure dependencies are available when needed
- Force Graph now loads synchronously before use
- Alpine.js now uses
defer
instead ofasync
for proper initialization
- Added console logging for easier debugging
- Added safety checks to prevent rendering attempts when prerequisites aren't met
- Provided default empty data structures to prevent null reference errors
These fixes ensure both the link preview functionality and the graph visualization now display and function correctly by default.
flowchart TD %% Main nodes and process flow SourceFiles("Markdown Notes\n(src/site/notes/)") --> EleventyBuild("Eleventy Build Process") EleventyBuild --> OutputFiles("HTML Static Site\n(dist/)") OutputFiles --> Deployment("Deployment\n(Vercel)") %% Detailed breakdown of the build process subgraph "Eleventy Build Process" direction TB DataCollection("Data Collection\n- Environment Variables\n- _data/ Files") --> TemplatePrep TemplatePrep("Template Preparation\n- Layouts\n- Components") MarkdownProcessing("Markdown Processing") --> TemplateRendering subgraph "Markdown Processing" direction TB md1["Parse Frontmatter\n(title, tags, dg-publish)"] md2["Process Wiki Links\nlink → HTML anchors"] md3["Process Tags\n#tag → clickable tags"] md4["Process Admonitions\n> [!note]"] md5["Process CodeBlocks\n(mermaid, plantuml)"] md6["Process Transclusions"] md7["Format Images\n(responsive)"] md1 --> md2 --> md3 --> md4 --> md5 --> md6 --> md7 end GraphGeneration("Graph Generation\n- Note interconnections\n- Backlinks") --> TemplateRendering TemplateRendering("Template Rendering\n- Apply Nunjucks templates\n- Insert content into layouts") --> PostProcessing PostProcessing("Post-Processing\n- HTML Transforms\n- Minification") end %% Styling classDef process fill:#f9f9f9,stroke:#333,stroke-width:1px; classDef file fill:#e1f5fe,stroke:#0277bd,stroke-width:1px; classDef markdown fill:#e8f5e9,stroke:#2e7d32,stroke-width:1px; classDef output fill:#fff8e1,stroke:#ff8f00,stroke-width:1px; class SourceFiles,OutputFiles file; class EleventyBuild,TemplatePrep,TemplateRendering,PostProcessing process; class MarkdownProcessing,md1,md2,md3,md4,md5,md6,md7 markdown; class Deployment,GraphGeneration output;