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

have site <head> tags (<meta> / <title> / <script> / etc) update when using staticRouter #306

Open
1 of 5 tasks
thescientist13 opened this issue Mar 22, 2020 · 4 comments
Labels
CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) Router
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Mar 22, 2020

Type of Change

  • New Feature Request
  • Documentation / Website
  • Improvement / Suggestion
  • Bug
  • Other (please clarify below)

Summary

A follow up from #300 to implement the correct lifecycle and / or logic to watch the URL and update the <title> when loading a new page.

For example, navigate to any page and observe the title in the browser tab. Navigate to another page and you'll the <title> will be the same.

Details

Now that <title> can be generated per page through data, it should also support the <title> when navigating from page to page after initial page load. Maybe we could use something like idiomorph ?

This could be done as part of #304 .


Also noticed this in #529 that without this, you could land on a page that uses front matter imports and those scripts would not get loaded since the router will cache the template, and the router partials only include <body> content.

Effectively, we need to include <head> tags in router partials and load those too.

@thescientist13 thescientist13 added the enhancement Improve something existing (e.g. no docs, new APIs, etc) label Mar 22, 2020
@thescientist13 thescientist13 added this to the MVP milestone Mar 22, 2020
@thescientist13 thescientist13 self-assigned this Mar 22, 2020
@thescientist13
Copy link
Member Author

Maybe this is something lit-redux-router could help with, if it uses pushState?

@thescientist13 thescientist13 changed the title have page <title> update when navigating in SPA (hyrdration) mode have site <meta> / <title> update when navigating in SPA (hyrdration) mode Mar 22, 2020
@thescientist13
Copy link
Member Author

Probably just need to create our own reducer to listen for activeRoute?
Screen Shot 2020-03-26 at 7 45 50 PM

@thescientist13
Copy link
Member Author

Will want to defer this for our next project to allow for #477 and recent outcomes from #304

@thescientist13 thescientist13 changed the title have site <meta> / <title> update when navigating in SPA (hyrdration) mode have site <head> tags (<meta> / <title> / <script> / etc) update when navigating in MPA mode Apr 24, 2021
@thescientist13 thescientist13 changed the title have site <head> tags (<meta> / <title> / <script> / etc) update when navigating in MPA mode have site <head> tags (<meta> / <title> / <script> / etc) update when navigating in MPA mode Apr 24, 2021
@thescientist13 thescientist13 changed the title have site <head> tags (<meta> / <title> / <script> / etc) update when navigating in MPA mode have site <head> tags (<meta> / <title> / <script> / etc) update when using staticRouter Feb 27, 2022
@thescientist13 thescientist13 removed this from the 1.0 milestone Mar 15, 2022
@thescientist13 thescientist13 removed their assignment Mar 15, 2022
@thescientist13
Copy link
Member Author

Probably some overlap with #1033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI enhancement Improve something existing (e.g. no docs, new APIs, etc) Router
Projects
None yet
Development

No branches or pull requests

1 participant