feature: svekyll preprocessor architecture #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/svekyll-preprocessor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goals
Replace current model (entire post body = single Svelte component) with a preprocessor approach.
Design
<!-- sprinkyll:svelte -->...<!-- /sprinkyll:svelte -->as Svelte block delimiterssprinkyll: type: "svekyll"frontmatter requirementArchitecture
Benefits
The template main.js hardcoded 'svekyll-app' as the Svelte mount target, but Hugo shortcodes generate IDs like 'svekyll-app-{slug}'. This caused the Svelte app to fail mounting with: Uncaught TypeError: can't access property '$$', i is undefined Instead of a generic wildcard fallback (which would break with multiple Svelte apps on one page), sprinkyll now replaces a SPRINKYLL_TARGET_ID placeholder in main.js with the correct slug-specific ID at build time. This ensures each svekyll bundle mounts to its own container element, supporting multiple Svelte apps per page.- Add preprocessor module to extract <!-- sprinkyll:svelte --> blocks from markdown - Replace old svekyll model (entire post = single Svelte component) with preprocessor - Each Svelte block is compiled independently and inlined via Hugo shortcode - No longer requires sprinkyll: type: "svekyll" frontmatter - Builder now processes all .md files looking for sprinkyll:svelte markers - Hugo shortcode updated to use block ID and inline assets from static/sprinkyll/{id}/ - main.js uses wildcard selector for mounting to any sprinkyll-{id} container- Fix shortcode braces: Zig's fmt.allocPrint treats {{ as escape for literal {, so concatenate braces separately to produce {{< >}} syntax - Remove debug logging from preprocessor and builder - Verify end-to-end build works with mixed-svelte.md test postView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.