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

Parametrize pattern of pages resolved #1700

Closed
eduardcotmrf opened this issue Jul 16, 2019 · 0 comments · Fixed by #1705 · May be fixed by adamlaska/osmos-cosmos-sdk#5
Closed

Parametrize pattern of pages resolved #1700

eduardcotmrf opened this issue Jul 16, 2019 · 0 comments · Fixed by #1705 · May be fixed by adamlaska/osmos-cosmos-sdk#5
Labels
has PR Has a related PR type: feature request Request to add a new feature

Comments

@eduardcotmrf
Copy link
Contributor

Feature request

Right now the pattern configuration of what files should be resolved as pages is hardcoded in core module of vuepress (APP.js line 319). The intention it's to open the door to parametrizing this pattern configuration from the siteConfig.

What problem does this feature solve?

To remove folders of specific files matching some pattern from the final vuepress site. A common scenario is where you are documenting a project that has a bunch of vue files you don't want to expose as documentation.

With this approach we could change this pattern:
['**/*.md', '**/*.vue', '!.vuepress', '!node_modules']

To have something like:
['**/*.md', '!.vuepress', '!node_modules']

Or like this:
['**/*.md', '**/*.vue', '!**/vue-folder/*.vue', '!.vuepress', '!node_modules']

How should this be implemented in your opinion?

The proposal it's to add the logic in resolvePages method to retrieve the pattern from siteConfig, if not use the default one:

  async resolvePages () {
    // resolve pageFiles
    const patterns = this.siteConfig.patterns ? this.siteConfig.patterns : ['**/*.md', '**/*.vue']
    patterns.push('!.vuepress', '!node_modules');

So it can be easily configured from config.js:

module.exports = {
  title: 'Hello VuePress',
  description: '# Hello, VuePress!',
  dest: 'vuepress',
  base: 'vuepress',
  patterns: ['**/*.md', '**/*.vue', '!**/deploy.*'],
  head: [
    ['link', { rel: 'icon', href: '/logo.png' }]
  ]
}

Are you willing to work on this yourself?

Yes, it's a necessity we have in our current project and i would like to work on it.

@kefranabg kefranabg added has PR Has a related PR type: feature request Request to add a new feature labels Aug 12, 2019
flozero pushed a commit that referenced this issue Oct 8, 2019
* feat($core): config pattern of resolved files

Thank's for your work @eduardcotmrf  good job

fix #1700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has PR Has a related PR type: feature request Request to add a new feature
Projects
None yet
2 participants