"open in browser" and in-editor preview not working correctly #47

Closed
opened 2026-07-20 10:52:38 +00:00 by hugo · 1 comment
Owner

Open in browser is not related to a single post, it should always open a full browser view of the blog, if non post is open in the post editor. If a post is open, it should of course start on the URL for that post. The URL structure of the preview browser must follow the generated website, so that I can click on links and the site behaves as if I am on the actual site. Only difference to rendering is that content is taken from the database if an element is in draft, otherwise from the filesystem.

The in-editor preview of posts must work the same as the preview browser, it just always opens on the post in the editor and renders it to the preview as it would be rendered when published. Again, if the post is in draft, content comes from the database, otherwise from the filesystem.

The in-editor preview must use the preview server, so that it is running the same kind of preview and the preview code itself must use the normal rendering code, just including draft content. Referenced assets must come from the filesystem where they are stored for the website, so that we are sure that the preview uses the same components and styles as the rendered site later will be.

THe general behaviour can be seen in ../bDS2, as that already does all the above.

Open in browser is not related to a single post, it should always open a full browser view of the blog, if non post is open in the post editor. If a post is open, it should of course start on the URL for that post. The URL structure of the preview browser must follow the generated website, so that I can click on links and the site behaves as if I am on the actual site. Only difference to rendering is that content is taken from the database if an element is in draft, otherwise from the filesystem. The in-editor preview of posts must work the same as the preview browser, it just always opens on the post in the editor and renders it to the preview as it would be rendered when published. Again, if the post is in draft, content comes from the database, otherwise from the filesystem. The in-editor preview must use the preview server, so that it is running the same kind of preview and the preview code itself must use the normal rendering code, just including draft content. Referenced assets must come from the filesystem where they are stored for the website, so that we are sure that the preview uses the same components and styles as the rendered site later will be. THe general behaviour can be seen in ../bDS2, as that already does all the above.
hugo added the bug label 2026-07-20 10:52:38 +00:00
hugo changed title from open in browser and in-editor preview not working correctly to "open in browser" and in-editor preview not working correctly 2026-07-20 10:53:01 +00:00
Author
Owner

Implemented in commit 49adfed. Open in Browser now starts the complete localhost site at the root when no post editor is active and at the active post canonical generated URL otherwise; the embedded post preview uses the same canonical preview-server route. The preview universe includes drafts and published posts while excluding archived posts, reads draft post and translation bodies from the database, reads published bodies from Markdown files, and serves project media, assets, images, Pagefind files, calendar data, RSS, Atom, and feed output. Requests render only the selected generated page to keep the 10,304-post real project responsive, and translated page menu paths now retain the required separator. The implementation was reviewed against issue #47, bDS2 preview routing, and the Allium preview/rendering contracts. Verification: cargo test --workspace; cargo clippy --workspace --all-targets -- -D warnings; cargo build --workspace; cargo fmt --all -- --check; git diff --check; allium check and analyse for all specs; cargo machete --with-metadata; cargo outdated --workspace --root-deps-only --exit-code 1; cargo bundle-macos; packaged UI and Chrome checks for root, embedded draft, canonical post, navigation, and feeds. Real-project timings were about 1.40s for root, 0.76s for a post, and 0.26s for RSS.

Implemented in commit 49adfed. Open in Browser now starts the complete localhost site at the root when no post editor is active and at the active post canonical generated URL otherwise; the embedded post preview uses the same canonical preview-server route. The preview universe includes drafts and published posts while excluding archived posts, reads draft post and translation bodies from the database, reads published bodies from Markdown files, and serves project media, assets, images, Pagefind files, calendar data, RSS, Atom, and feed output. Requests render only the selected generated page to keep the 10,304-post real project responsive, and translated page menu paths now retain the required separator. The implementation was reviewed against issue #47, bDS2 preview routing, and the Allium preview/rendering contracts. Verification: cargo test --workspace; cargo clippy --workspace --all-targets -- -D warnings; cargo build --workspace; cargo fmt --all -- --check; git diff --check; allium check and analyse for all specs; cargo machete --with-metadata; cargo outdated --workspace --root-deps-only --exit-code 1; cargo bundle-macos; packaged UI and Chrome checks for root, embedded draft, canonical post, navigation, and feeds. Real-project timings were about 1.40s for root, 0.76s for a post, and 0.26s for RSS.
hugo closed this issue 2026-07-20 15:13:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hugo/RuDS#47