-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Layout + template switching mechanism #1787
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
| export default { | ||
| name: 'RawOutputExample', | ||
| asyncData ({ store, route, context }) { | ||
| context.response.setHeader('Content-Type', 'text/xml') |
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.
Here You can now set from the Vue component level server response headers + choose template
| import RawOutputExample from './pages/RawOutputExample.vue' | ||
|
|
||
| export default [ | ||
| { path: '/raw-output-example.xml', component: RawOutputExample, serverOutputTemplate: '', meta: { layout: 'empty' } } |
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.
You can now also set the layout from the routes level
Basic + Minimal templates added Extended example to show minimal template in action Fix for #1788
…into develop Docs added
|
// removed unecessary AAnd of course - shouldn't this features be a separate modules? now we are adding new functionalities that may not be useful for some people. It'll also help to encapsulate the behavior |
|
Also, can we add posibility to server side render onlyc ertain pages (i know it's not connected but still alout SSR, there was an issue for this). This would prevent a lot of SSR errors that we have right now in pages that just don't need to use it. |
|
We can theoretically filter the urls from SSR routing - however I don’t see many use cases for that. How wupuld you like to use it? |
|
We can theoretically filter the urls from SSR routing - however I don’t see many use cases for that. How wupuld you like to use it? We discussed it earlier. For SEO ssr is useful only for homepage and catalog. By disabling ti on unnecesary pages people will be able to use client-side libs without any problems which will be a huge benefit in dev experience |
| new CaseSensitivePathsPlugin(), | ||
| new VueLoaderPlugin() | ||
| new VueLoaderPlugin(), | ||
| // generate output HTML |
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.
maybe this files should be provided in config or exported from some place that develoeprs can reach (not from core)?
Related issues
#1713, #1688
Short description and why it's useful
I've changed the way SSR pages are generated:
asyncDataand by doing so You can skip usingdist/index.html(which contains typical HTML5 elements - like<head...). This is important when we're going to generate AMPHTML pages (that can not contain any<script>tags) - either xml files - You name itmeta.layoutand by doing so switch the previously constantApp.vuelayout file - this is what @mercs600 proposed some time ago in slightly changed formUpgrade Notes and Changelog
The
themes/default/index.template.htmlandsrc/index.template.htmltemplate files have been modified by addingrenderStyles(),renderState()helpers. AFAIK nobody is modifying these templates - but if sbd. did - he/she must change it accordingly otherwise styles won't be rendered properlyContribution and curently important rules acceptance