-
Notifications
You must be signed in to change notification settings - Fork 617
Pro 8178 add prepend append main #5068
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
Conversation
| <div data-apos-refreshable> | ||
| {% block beforeMain %}{% endblock %} | ||
| {% block mainAnchor %}<a name="main"></a>{% endblock %} | ||
| {% component '@apostrophecms/template:inject' with { where: 'main', end: 'prepend', when: 'hmr' } %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this line with hmr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when: 'hmr' means "inject only when in HMR mode". It wasn't added probably due to performance reasons (with the idea "add it if/when needed".
boutell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't actually go inside the <main> element, which is supplied by project level layout.
So this is essentially beforeMain and afterMain in node injection form. So I would go with those names.
boutell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually my suggestion is not possible because of the way "prependNodes" and "appendNodes" work.
So I'm going to approve this as written because I don't have a better suggestion.
Summary
Add
prepend-mainandappend-mainWhat are the specific steps to test this change?
Please check apostrophecms/starter-kit-astro-apollo-assembly#1
What kind of change does this PR introduce?
(Check at least one)
Make sure the PR fulfills these requirements:
If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.
Other information: