Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page router doesn't mount components. Refresh needed to properly mount. #263

Closed
Korab-Doroci opened this issue Apr 18, 2024 · 2 comments · Fixed by #271
Closed

Page router doesn't mount components. Refresh needed to properly mount. #263

Korab-Doroci opened this issue Apr 18, 2024 · 2 comments · Fixed by #271
Assignees
Labels

Comments

@Korab-Doroci
Copy link

Minimum reproducible scenario:

Index.html:
image

Site.yaml: (when router is false it works as intended)
image

Page index.html:
image

Component.nue:
image

Before clicking the button:
image

After clicking the button:
image

After refreshing:
image

@tipiirai
Copy link
Contributor

Thanks! Need to check this out

@mszmida
Copy link
Contributor

mszmida commented May 1, 2024

@Korab-Doroci The Nue layout system is based on <header>, <main> and <footer> tags. Page router is searching for these tags to replace its content.

In your example code should look like this:

// index.html
<main>
  <a href="/page">go to page</a>
</main>
// page/index.html
<main>
  <component />
</main>

However the page router indeed does not mount components correctly. I prepared a PR with fix for this functionality in #271.

mszmida added a commit to mszmida/nue that referenced this issue May 7, 2024
tipiirai added a commit that referenced this issue May 8, 2024
fix: page router fixed and tests added - #263
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants