#Can I render an Astro page from within a framework client component?

4 messages · Page 1 of 1 (latest)

haughty fog
#

I am building a website that resembles an OS. I am using Astro for content (blog posts) and other pages and layouts with SolidJS as a client-side framework.

On this project, I want pages to render their contents as full screen windows, which works well with Astro templates.

However, I also want to allow users to continue navigating dynamically, by adding new windows based on different pages.

For example:

  1. User enters page /blog/test and that page renders
  2. User clicks a menu and selects content that would come from a different page
  3. The code would fetch that page, change the URL with history.push, and append the page content inside a modal (representing a window that can be dragged, maximized, etc)

Is this something that would require an entire new adapter, or is it something an integration can accomplish?

#

Can I render an Astro page from within a framework client component?

agile umbra
#

Hm, this is an interesting idea for sure. I know Astro can render routes as fragments, so the manual fetching piece should work fine. Is the issue that you don't want mywebsite.com/blog/test to return the page, instead making it a sort of virtual page?

haughty fog
#

I want both, if I visit it directly I’ll render it as the first window maximized.

If a user is on another page they can click menus and open the same content but on top of what they’re viewing. For that I’d need to handle the routing manually.

I guess what I want is isomorphic collection/page access?