-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Discussion] Roadmap #198
Comments
nice to centralize info :) . I'll just finish to create a vue cli plugin for vuepress maybe add that inside project features. https://github.com/dgpgdev/vue-cli-plugin-vuepress |
Before work algolia docsearch maybe merge pullrequest validated. I don't think blog are useless... vuepress is perfect for documentation. |
One extra thing we need to finalize in core: API for custom themes to write additional files during build. |
Or we can implement things in a theme, then once they are proven or popular look to migrating them into the core. As long as the core is flexible enough for themes to do this extra useful common features can be backported into the core so that more themes can take advantage of them. For these, we need a way for themes to write additional files like @yyx990803 suggests. I have attempted to introduce this in #196 but we should probably take about the implementations details a bit more. In short, it loads One thing it does not expose is a way to hint to the build about extra routes that should be generated (such as routes added in enchanceApp.js like in #143) |
@mdaffin @dacsang97 Thanks for your two guys' contribution for the plugin support (#196 & #216). Let me summarize for that here. 1. Figure out the reponsibility of plugin.Obviously, VuePress core's prepare process is only to do some So the interface exposedOptions {
sourceDir: string; // readable
outDir: string; // readable
publicPath: string; // readable
markdown: Object; // readable
themePath: string; // readable, theme component entry
useDefaultTheme: boolean; // readable
notFoundPath: string; // readable,404 component entry
siteConfig: Object;
pageFiles: string[]; // A list containing relative paths of source makrdown files
siteData: Object;
}
interface Page {
path: string;
title: string;
headers: Array<{ level: number, title: string, slug: string }>;
frontmatter: { [key: string]: string };
}
interface siteData {
title: string,
description: string,
base: string,
pages: Page
} 2. Determine the timing of the plugin's execution.At the moment, I found out that both of yours put the excution timing at the end of 3. Deciding on the plugin's API.Obviously, I think everyone supports pure function API, However, at this stage we have two options:
The extra module.exports = ({siteConfig, siteData, pageFiles, pluginOptions}) => {}
Also from @dacsang97: module.exports = (pluginOptions) => ({siteConfig, siteData, pageFiles}) => {} Let's vote: It is worth mentioned that the plugin should support the 4. Deciding on the usage of pluginsUser can add extra plugins via
module.exports = {
plugins: [
require('./rssPlugin.js')
]
}
module.exports = {
plugins: [
'pluginName', // will to load 'vuepress-plugin-${pluginName}'
'vuepress-plugin-rss', // also support full name
]
}
This configuration style comes from babel: module.exports = {
plugins: [
[
'rss',
{
option1: '1',
option2: '2'
// ...
}
]
]
}
This configuration style comes from @dacsang97: module.exports = {
plugins: {
resolve: 'rss', // resolve => 'name' ?
options: {
option1: '1',
option2: '2'
}
}
} I think that the first two style are sure to support. so we need to make choices in the latter two: Thank you for all of your guys' participation! |
I had implemented to run |
@dacsang97 I have seen your change, cool, but |
I agree on the options side, my pull request was just an experiment to figure out what would be required. Your object looks reasonable but I think it might be worth adding a It is also worth adding a base URL to
I vote for 1. First-order function as it looks cleaner to plugin developers and it is only ever going to be a run once function.
I prefer the Object in Array like the way Nuxt does it:
Keeping things similar to Nuxt is a good way to go as I suspect there will be a crossover of the user base here. |
Also, what about theme/site plugins? ie ones that are baked into a theme or site like in my original implementation. I think we can get rid of the site ones as that is covered by the plugins array in the config, but there should be a way for themes to add to the list of plugins, maybe a |
i love how vue cli use plugin maybe can we use same for vuepress to install and manage plugin . |
i agree, but often we need same configuration (rssfeed, sitemap...) (vue cli presets) for many project. |
@dgpgdev all dependencies of a project should be inside the If you want to use the same plugins/base structure for many projects you should use vue cli to create a template for vuepress with all your plugins and desired config in the template. Vuepress does not need to know or understand vue cli at all and yarn/npm are the tools you should be using for managing project level dependencies. |
as vue-cli is moving away from templates, it makes sense to create a vue-cli plugin that create a vuepress project with a bunch of vuepress plugin options to be selected during |
Another point to consider: allowing plugins a hook into the client side code to allow them to register new dynamic components or otherwise change the client-side behaviour in a similar way to the |
+1 for Additional content sources... such as Contentful, WordPress Headless etc at build time! |
Headless CMS, data via REST / GraphQLA lot of the static site generators hook to data-driven content sources, such as headless headless CMS like DatoCMS, StoryBlok, Netlify, Snipcart, ButterCMS, etc. For my less technical staff, I was considering a headless CMS for topic editing as opposed to a Markdown or AsciiDoc file editor. |
One cloud CMS which would integrate quite easily is Dato, which —in addition to REST and soon GraphQL APIs— provides a workflow where all content can be 'dumped' to markdown files and then processed by a further the build process |
I am currently trying to finagle a workflow for DatoCMS import at build time that involves another SSG running a build, then grabbing JSON from that build to add to VuePress. To have Dato or other headless CMSs import-able (?) and configurable directly within VuePress would be amazing. |
@EnMod check out this dato documentation WRT metalsmith, it walks through how to dump your data in to markdown files, and it should give you an idea how to configure the script to output in the directory / naming scheme required by VuePress. https://www.datocms.com/docs/metalsmith/ Alternately you can dump Dato data to YML or JSON, and just |
@lunelson Thanks for that, very nifty! I'm managing a slider gallery as one of my models, so I might either:
Either way, metalsmith's integration a good solution. Having DatoCMS's data right there in VuePress, ready at build time, would save quite a bit of trouble though haha. |
Hey guys, about the next direction or planning of VuePress, specially set up a "channel" to discuss here.
Above all, we need to make clear that the original intention of VuePress is to write documents to Vue and its sub projects. As mentioned in the document, VuePress is composed of two parts:
If we leave everything to the default theme, then when you decide to develop a new theme, you would repeat many things. so for some of our new features, we should consider whether it is handled in
1
or2
.In fact, I expect to complete the development of the core functionality as soon as possible, Only core is STABLE can we focus on migrating the documents and blog theme development (Maybe need to create a separate repo called
vuepress-theme-blog
). Of course, the premise is that we have prepared useful enough data and APIs for the beginning of the custom theme.At present, the core function I think is probably only Algolia DocSearch Integration. If you think there are other deserved suitable core needs, feel free to tell us here.
Regards,
Thanks.
Radmap
The text was updated successfully, but these errors were encountered: