Skip to content

Route layout#1506

Merged
marvinhagemeister merged 9 commits into
freshframework:mainfrom
mcgear:route-layout
Jul 26, 2023
Merged

Route layout#1506
marvinhagemeister merged 9 commits into
freshframework:mainfrom
mcgear:route-layout

Conversation

@mcgear

@mcgear mcgear commented Jul 22, 2023

Copy link
Copy Markdown
Contributor

This is an initial implementation of a _layout file implementation that allows for applying layouts to routes. It supports cascading _layout files in route sub directories and treats them all as optional.

There are a good number of tests that were broken when I forked, so could use some pointers on where to add additional tests for this.

@mcgear mcgear mentioned this pull request Jul 22, 2023
@mcgear

mcgear commented Jul 22, 2023

Copy link
Copy Markdown
Contributor Author

I was able to make some additions to the fixture. So if you run deno task fixture, you should be able to navigate to the following paths to see it in action:
/route-layout
/route-layout/sub
/route-layout/skip
/route-layout/skip/sub

Those were some of the use cases i was checking out. You can see that it has no impact on existing pages:
/
/islands
/books

@mcgear

mcgear commented Jul 22, 2023

Copy link
Copy Markdown
Contributor Author

My bad on that, forgot to rerun deno fmt after adding the fixture tests. Hopefully that resolves what i saw in the workflow error.

@deer

deer commented Jul 23, 2023

Copy link
Copy Markdown
Contributor

I haven't looked at this in detail yet, but just noting that we have a similar PR: #870. If we go with this one, then we should close 870.

Comment thread docs/concepts/route-layout.md

@marvinhagemeister marvinhagemeister left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Took the liberty of adding a couple of tests. Thank you so much for adding this to Fresh ❤️

@marvinhagemeister marvinhagemeister merged commit 1ed93ce into freshframework:main Jul 26, 2023
@mcgear mcgear deleted the route-layout branch July 26, 2023 13:52
@bendik

bendik commented Aug 17, 2023

Copy link
Copy Markdown

How should i go about toggling routeConfig wrapper layouts based on a header? 'hx-request' in my case.

@marvinhagemeister

Copy link
Copy Markdown
Contributor

@bendik Can you please open a new issue instead of commenting on merged PRs?

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.

6 participants