Skip to content

Conversation

@UiP9AV6Y
Copy link

render the SPA differently based on the route. if a page is available as RSS feed, inject a link element into the head element of the HTML variant. this ensures feeds are discoverable.

this change replaces the middleware with custom router handlers to serve either assets from the embedded filesystem or the SPA document.

closes #4276

@UiP9AV6Y UiP9AV6Y requested a review from boojack as a code owner December 20, 2025 11:27
@UiP9AV6Y
Copy link
Author

the <!-- {{ printf "memos.metadata.head %s>" "--" }} in the index.html ensures that the file remains valid HTML in case of debugging the site with Vite alone without a backend service. when rendered as template the resulting HTML will end up with two commends with injected code in between

<!-- memos.metadata.head -->
<!-- -->

i also use text/template instead of html/template as the latter removes comments from templates and i could not find any information if the memos.metadata. comments serve any logic purpose which would break where the comments removed.

@UiP9AV6Y UiP9AV6Y force-pushed the feature/rss-discovery branch from 9050c41 to 6ac2513 Compare December 20, 2025 11:48
render the SPA differently based on the route. if a page is
available as RSS feed, inject a link element into the head
element of the HTML variant. this ensures feeds are discoverable.

this change replaces the middleware with custom router handlers
to serve either assets from the embedded filesystem or the SPA
document.

closes usememos#4276
@UiP9AV6Y UiP9AV6Y force-pushed the feature/rss-discovery branch from 6ac2513 to 2741a1c Compare December 22, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autodiscoverable RSS feeds: <link>s in statically served HTML

1 participant