269 Commits

Author SHA1 Message Date
Timothy DeHerrera
0d2c460f52 chore(fmt): add html formatting 2026-01-31 15:13:24 -07:00
Timothy DeHerrera
e200e94583 feat(templates): complete Tera migration, remove maud
Fully migrate from compile-time maud templates to runtime Tera:
- Rewrote main.rs to use TemplateEngine and discover_sections()
- Replaced hardcoded blog/projects with generic section loop
- Added Clone derive to Frontmatter and Content
- Fixed section_type dispatch via Section struct
- Deleted src/templates.rs, removed maud dependency

Users can now add sections without code changes.
2026-01-31 15:10:39 -07:00
Timothy DeHerrera
244b0ce85b feat(content): add Section struct and discover_sections()
Enable generic section processing by adding:
- Section struct with index, name, section_type, path
- Section::collect_items() to gather content in a section
- discover_sections() to find all directories with _index.md

Section type is determined from frontmatter `section_type` field,
falling back to directory name. Includes 5 unit tests.
2026-01-31 15:02:20 -07:00
Timothy DeHerrera
3df7fda26a feat(templates): add Tera runtime template engine
Lay groundwork for user-editable templates by adding Tera as a
runtime template engine alongside the existing maud templates.

Changes:
- Add tera dependency
- Create TemplateEngine struct with render methods
- Add TemplateLoad/TemplateRender error variants
- Add section_type/template fields to Frontmatter
- Create templates/ directory with base, page, section, and content templates

Dead code warnings are expected; TemplateEngine will be wired
in to replace maud in subsequent commits.
2026-01-31 14:59:49 -07:00
Timothy DeHerrera
1bf265f14b fix(feed): derive URLs from content paths
Replace hardcoded "/blog/{slug}.html" URL pattern with dynamic
path derivation using Content.output_path(). This ensures feed
URLs work correctly for any content location, not just blog posts.
2026-01-31 13:59:05 -07:00
Timothy DeHerrera
a5c56c2b2f feat(templates,main): wire dynamic nav through pipeline
Update all template functions to accept nav parameter and iterate
over discovered NavItem slice instead of hardcoded links.

Refactor main.rs:
- Call discover_nav() early in run()
- Thread nav to all template renders
- Replace hardcoded page list with dynamic discovery

Navigation is now fully driven by filesystem structure.
2026-01-31 13:56:16 -07:00
Timothy DeHerrera
b978edf4f2 feat(content): add filesystem-driven nav discovery
Add NavItem struct and discover_nav() function to scan content
directory and automatically build navigation from:
- Top-level .md files (pages)
- Directories with _index.md (sections)

Navigation is sorted by frontmatter weight, then alphabetically.
Custom nav_label field allows overriding title in nav menu.

Includes 5 unit tests covering page/section discovery, weight
ordering, and nav_label support.
2026-01-31 13:52:21 -07:00
Timothy DeHerrera
88b53b7a7b fix(mermaid): switch to crates.io and patch dagre_rust panic
Switch mermaid-rs-renderer from git dependency to crates.io 0.1.

Vendor and patch dagre_rust 0.0.5 to fix upstream panic in
remove_edge_label_proxies() where unwrap() is called on None
when processing edge label proxies without edge references.

This enables sequence diagrams and state diagrams that previously
crashed the build.
2026-01-28 20:52:05 -07:00
Timothy DeHerrera
d417e1c535 feat(mermaid): integrate diagram rendering into markdown pipeline
Intercept 'mermaid' code blocks in render.rs and call
mermaid::render_diagram() to convert to inline SVG.

- Use catch_unwind to handle upstream dagre_rust panics gracefully
- Graceful fallback: show raw code with mermaid-error class on failure
- Flowcharts render correctly; some diagram types hit upstream bugs
2026-01-28 20:36:45 -07:00
Timothy DeHerrera
abe465723c feat(mermaid): add mermaid-rs-renderer diagram module
Add src/mermaid.rs with render_diagram() wrapper around
mermaid-rs-renderer for build-time Mermaid-to-SVG conversion.

- Use mermaid-rs-renderer git dependency (SVG-only, no PNG)
- Configure with RenderOptions::modern() theme
- Include unit tests for flowchart and sequence diagrams
2026-01-28 20:31:40 -07:00
Timothy DeHerrera
eeec4a999b feat(render): integrate katex-rs math rendering
Enable ENABLE_MATH in pulldown-cmark options and implement
InlineMath/DisplayMath event handlers in the render pipeline.

- Inline math ($...$) renders via render_math(_, false)
- Display math ($$...$$) wrapped in <div class="math-display">
- Graceful degradation: errors logged to stderr, raw LaTeX shown
  with class="math-error" for styling
2026-01-28 20:18:36 -07:00
Timothy DeHerrera
ebe1fd3b6e feat(math): add katex-rs math rendering module
Add src/math.rs with render_math() wrapper around katex-rs for
build-time LaTeX to HTML conversion. Wire module into main.rs.

- Use KatexContext::default() for standard LaTeX function registry
- Settings: display_mode toggle, throw_on_error=false for graceful
  degradation
- Include unit tests for inline/display math rendering
2026-01-28 20:16:25 -07:00
Timothy DeHerrera
a7338f5418 feat: add Nix injection queries for embedded language highlighting
Adapted Helix nix/injections.scm for tree-sitter-highlight:
- Removed Helix-specific predicates
- Recognizes bash in buildPhase/installPhase, python in testScript,
  json in fromJSON, etc.
2026-01-26 23:54:59 -07:00
Timothy DeHerrera
b16246fba6 feat: use custom Nix highlight queries for richer syntax colors
- queries/nix-highlights.scm: Adapted from Helix editor queries.
  Properly identifies functions, properties, variable parameters,
  escape sequences, and string interpolation. Much richer than
  the bundled tree-sitter-nix query (99 lines vs 113 lines).

- src/highlight.rs: Load custom Nix query via include_str!
  instead of using bundled HIGHLIGHTS_QUERY.

- static/style.css: Fix variable (#e36209) and punctuation (#586069)
  colors to be distinct from text color.

Results: hl-function now appears (6 occurrences), hl-property
visible (17), hl-variable reduced from 43 to 17. Functions like
mkShell now render in purple/blue instead of orange.
2026-01-25 20:18:48 -07:00
Timothy DeHerrera
5b7805d753 fix: expand highlight captures for better Nix support
- src/highlight.rs: Add 7 new captures to HIGHLIGHT_NAMES:
  embedded, escape, function, punctuation.special, string.special,
  string.special.path, string.special.uri. Now 27 total captures.

- static/style.css: Add CSS variables and class rules for new
  captures in both light and dark themes. escape gets bold
  styling, string-special uses distinct color.

These captures are used by tree-sitter-nix but were previously
missing, causing sparse highlighting. Now functions, escapes,
and paths are properly highlighted.
2026-01-25 17:29:18 -07:00
Timothy DeHerrera
acb0ff3e15 feat: add syntax highlighting for 9 additional languages
- Cargo.toml: Add tree-sitter grammars for Nix, Python, JavaScript,
  TypeScript, Go, C, CSS, HTML, YAML. Upgrade tree-sitter-highlight
  to 0.26 for language version 15 compatibility.

- src/highlight.rs: Add Language enum variants and get_config()
  match arms for all new languages. Update render() callback for
  0.26 API (writes attributes to buffer). Add tests for Nix and
  Python highlighting.

TOML excluded due to incompatible API (tree-sitter 0.20 vs 0.26).
2026-01-25 17:20:00 -07:00
Timothy DeHerrera
a73359098e docs: humanize documentation and update architecture
- content/about.md: Rewrite with first-person voice, remove
  "next-generation" and "craft tools that emphasize" patterns.
  Add personality ("probably more than it should").

- content/collab.md: More direct language, remove "find value in"
  and "broader community" hedging. Shorter bullet lists.

- AGENTS.md: Remove "state-of-the-art", update architecture tree
  to reflect current modules (config, feed, templates), fix
  stale config section to show actual site.toml usage.
2026-01-24 22:28:38 -07:00
Timothy DeHerrera
3a36c2a909 chore: add Netlify deployment configuration
- netlify.toml: Configure cargo build --release and run compiler.
  Publish directory set to public/.

- static/_headers: Add security headers (X-Frame-Options, CSP, etc.)
  and cache control for static assets (1 year for css/images,
  1 hour for HTML, 1 hour for feed).
2026-01-24 22:17:59 -07:00
Timothy DeHerrera
51b947256d feat: add Atom feed generation
- src/feed.rs: New module with generate_atom_feed() that produces
  Atom 1.0 XML from blog posts. Uses config.base_url for absolute
  entry URLs. Includes xml_escape() helper.

- src/main.rs: Wire mod feed and call generate_feed() after blog
  index generation. Outputs to public/feed.xml.

- src/templates.rs: Add <link rel="alternate" type="application/atom+xml">
  autodiscovery link to page head using config.base_url.

Feed includes title, author, updated timestamp, and entries with
title, link, id, updated, and summary for each blog post.
2026-01-24 22:01:59 -07:00
Timothy DeHerrera
675050fd56 fix: correct depth calculation for relative paths
- src/templates.rs: Add path_depth() helper that counts directory
  segments minus filename, not raw slash count.
  "/blog/slug.html" → depth=1 (one directory level)
  "/index.html" → depth=0 (root level)

This fixes relative path generation after adding canonical URLs.
file:// navigation now works correctly alongside absolute
canonical URLs.
2026-01-24 21:52:12 -07:00
Timothy DeHerrera
d166e86435 feat: add TOML site config for metadata
- Cargo.toml: Add toml and serde dependencies
- site.toml: New config with title, author, base_url
- src/config.rs: SiteConfig struct with load() function
- src/error.rs: Add Error::Config for parse errors
- src/main.rs: Load site.toml, thread config and page paths
  through generators
- src/templates.rs: Use config.title in nav/titles,
  config.author in footer, config.base_url for canonical URLs.

All three config fields verified in generated HTML output.
2026-01-24 21:47:47 -07:00
Timothy DeHerrera
71d5ac1e37 refactor: switch to flat .html output (suckless style)
- src/content.rs: output_path() now returns slug.html instead of
  slug/index.html for regular content.

- src/templates.rs: All hrefs use explicit .html extension.
  Nav links point to index.html, blog.index.html, about.html.
  Blog post links use ./slug.html format.

- src/main.rs: Adjust depth values (root=0, blog posts=1).

No more directory-per-page overhead. file:// navigation works
without directory listings. True suckless structure.
2026-01-24 21:36:58 -07:00
Timothy DeHerrera
b9be21156d feat: implement relative paths for IPFS/decentralization
- src/templates.rs: Add depth parameter to all template functions.
  Add relative_prefix() helper that generates "./", "../", "../..", etc.
  All hrefs now use relative paths instead of absolute.
  Unit test for relative_prefix() added.

- src/main.rs: Pass depth to templates based on output location.
  Root=0, blog index/pages=1, blog posts=2.

Navigation works correctly when viewed via file:// protocol.
Site is now IPFS-compatible.
2026-01-24 21:22:03 -07:00
Timothy DeHerrera
7fa60d9b07 feat: add CSS minification via lightningcss
- Cargo.toml: Add lightningcss 1.0.0-alpha.70 dep
- src/css.rs: New module with minify_css() function.
  Uses StyleSheet::parse() + minify() + to_css() pipeline.
  3 unit tests: whitespace removal, comment removal, selector merge.
- src/main.rs: Integrate minification into copy_static_assets().
  CSS files minified before writing; size delta logged.

Result: style.css 5670→4165 bytes (~27% smaller)
2026-01-24 21:07:56 -07:00
Timothy DeHerrera
c145bf86b9 feat: integrate syntax highlighting into render pipeline
- src/render.rs: Rewrite with event-based pulldown-cmark parsing.
  Intercepts CodeBlock events and applies tree-sitter highlighting.
  4 new tests covering highlighted and unhighlighted code blocks.

- src/highlight.rs: Fix HtmlRenderer callback to return attributes
  only (not full span tags). Static HTML_ATTRS array for zero-alloc.

- static/style.css: Add 20 hl-* CSS classes with CSS variables.
  Light and dark mode via prefers-color-scheme.

Supported languages: rust, bash, json. Phase 2 complete.
2026-01-24 20:47:31 -07:00
Timothy DeHerrera
ba5e97dfb7 feat: add tree-sitter syntax highlighting module
- Cargo.toml: Add tree-sitter-highlight + grammar crates
  (rust, bash, json). TOML dropped due to API incompatibility.
- src/highlight.rs: Language enum, highlight_code() function,
  4 unit tests covering parsing and HTML generation.
- Uses static HTML_ATTRS array for zero-allocation rendering.
2026-01-24 20:38:02 -07:00
Timothy DeHerrera
5317da94c4 feat: add minimal base CSS with dark mode support
- static/style.css: CSS variable-based theming with:
  - Typography (system fonts, monospace for code)
  - Layout (centered content, nav/main/footer structure)
  - Dark mode via prefers-color-scheme
  - Component styles (posts, cards, tags, hero)

- src/main.rs: Add copy_static_assets() to copy static/
  directory to public/ during build

Phase 1 complete. Ready for syntax highlighting.
2026-01-24 20:27:22 -07:00
Timothy DeHerrera
d4003686a0 chore: add miniserve for testing 2026-01-24 19:36:10 -07:00
Timothy DeHerrera
06b7e0df64 feat: implement cohesive site structure
Add content type handling and multi-page generation:

- content.rs: Add ContentKind enum (Post, Page, Section, Project)
  and extend Frontmatter with weight/link_to fields
- templates.rs: Add render_page, render_homepage,
  render_blog_index, render_projects_index templates
- main.rs: Process all content types with dedicated handlers

Output structure:
- /index.html (homepage from _index.md)
- /blog/index.html (post listing, sorted by date)
- /blog/<slug>/index.html (individual posts)
- /about/index.html, /collab/index.html (standalone pages)
- /projects/index.html (project cards with external links)
2026-01-24 19:19:53 -07:00
Timothy DeHerrera
0cee5325d3 chore: migrate non-blog content to YAML frontmatter
Convert all content files to use YAML (---) instead of TOML (+++)
for consistent parsing:

- content/_index.md (homepage)
- content/about.md, content/collab.md
- content/blog/_index.md
- content/projects/_index.md + 14 project cards

Enables unified gray_matter YAML parser across all content.
2026-01-24 19:15:16 -07:00
Timothy DeHerrera
e07a9e87e6 feat: implement core markdown rendering pipeline
Add minimal e2e pipeline to transform content → HTML:

- src/error.rs: Custom error types with thiserror
- src/content.rs: YAML frontmatter parsing via gray_matter
- src/render.rs: Markdown → HTML via pulldown-cmark
- src/templates.rs: Maud templates for base layout and posts
- src/main.rs: Pipeline orchestrator

All 15 blog posts successfully rendered to public/blog/*/index.html.
Added thiserror and walkdir dependencies.
Added public/ and DepMap fragment to .gitignore and AGENTS.md.
2026-01-24 19:01:30 -07:00
Timothy DeHerrera
8df37127a1 chore(fmt): add treefmt and run it 2026-01-24 18:49:51 -07:00
Timothy DeHerrera
f4201e95ba feat: add nix flake with fenix rust toolchain
Configure hermetic development environment:

- fenix toolchain from rust-toolchain.toml
- clangStdenv for Tree-sitter C grammar compilation
- Multi-platform devShells (x86_64/aarch64, linux/darwin)
- Generated flake.lock with pinned inputs
2026-01-24 18:48:14 -07:00
Timothy DeHerrera
0be71ca374 feat: initialize rust project scaffold
Add minimal Rust project structure for bespoke site compiler:

- rust-toolchain.toml: stable channel with rustfmt, clippy, rust-src
- Cargo.toml: nrd-sh v0.1.0 with pulldown-cmark, gray_matter, maud
- src/main.rs: stub entrypoint

Verified with cargo check.
2026-01-24 18:41:59 -07:00
Timothy DeHerrera
3545b18875 docs: add AGENTS.md for rust architecture
Configure agent context for new bespoke static site compiler:

- Document interceptor pipeline architecture
- Enable rust.md predicate fragment
- Define build commands (nix develop, cargo build)
- Reference deprecated/ for legacy Zola code
2026-01-24 18:33:37 -07:00
Timothy DeHerrera
8b1e0d1f29 chore: move zola infrastructure to deprecated/
Relocate legacy static site generator configuration to clear
namespace for new Rust-based compiler:

- config.toml, netlify.toml
- sass/, templates/ directories
- themes/apollo submodule (updated .gitmodules path)

Content directory preserved at root for compatibility.
2026-01-24 18:30:58 -07:00
Timothy DeHerrera
ac644135af chore: add predicate submodule 2026-01-24 18:17:00 -07:00
Timothy DeHerrera
011d6affee refine: suggest family as Sacred 2025-12-26 20:56:35 -07:00
Timothy DeHerrera
d6eac340cc fix: introduce as axiosophy 2025-12-26 20:34:15 -07:00
Timothy DeHerrera
04656e06f1 edit: compromise is a bitch 2025-10-08 07:33:58 -06:00
Timothy DeHerrera
50f5b4857c fix(axiosophy): crucial distinction 2025-09-07 15:58:37 -06:00
Timothy DeHerrera
572a1456d5 edit(axiosophy): use physics analogy to reenforce 2025-09-07 15:44:26 -06:00
Timothy DeHerrera
c4328dde7b edit(axiosophy): minor refinements to tables 2025-09-07 15:41:10 -06:00
Timothy DeHerrera
1e7ef69569 fix(axiosophy): typo 2025-09-07 15:34:15 -06:00
Timothy DeHerrera
9d856d24d0 edit: strenthen Axiosophy's conclusions 2025-09-07 15:32:53 -06:00
Timothy DeHerrera
acbfb7c3a7 edit: note the prevelance of moral relativism 2025-09-07 15:17:31 -06:00
Timothy DeHerrera
391a4397eb edit: make the awkward concise 2025-09-07 15:16:53 -06:00
Timothy DeHerrera
9bf76d1e74 edit: more concise subtitle 2025-09-07 15:15:29 -06:00
Timothy DeHerrera
810f08591f fix: correct anchors 2025-09-07 15:14:12 -06:00
Timothy DeHerrera
1277929aca edit(axiosophy): cohere the logic more tightly
also add supporting edits to code of rebellion.
2025-09-07 15:09:16 -06:00