Skip to content

[Feature request] custom themeLayoutPath #600

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

Closed
tyrion-yu opened this issue Jun 17, 2018 · 1 comment
Closed

[Feature request] custom themeLayoutPath #600

tyrion-yu opened this issue Jun 17, 2018 · 1 comment
Labels
type: feature request Request to add a new feature version: next Planned to do or already included in the next(1.0.0) version

Comments

@tyrion-yu
Copy link

Feature request

What problem does this feature solve?

VuePress resolves theme by using path as vuepress-theme-${siteConfig.theme}/Layout.vue.
But for some security reason, some companies have their own npm registry. And the VuePress themes using in the company should only publish in the private npm registry. For no conflict with the public npm registry, the private npm packages published in the company should with a scope like @cip/vuepress-theme-security.

What does the proposed API look like?

in .vuepress/config.js

module.exports = {
  themeConfig:{
    layoutPath: `@cip/vuepress-theme-security`
  }
}

How should this be implemented in your opinion?

// resolve theme
const useDefaultTheme = (
  !siteConfig.theme &&
  !siteConfig.layoutPath &&
  !fs.existsSync(path.resolve(vuepressDir, 'theme'))
)

// prepare.js
try {
  const layoutPath = siteConfig.layoutPath? `${siteConfig.layoutPath}/Layout.vue`
    : `vuepress-theme-${siteConfig.theme}/Layout.vue`
  themeLayoutPath = require.resolve(layoutPath, {
    paths: [
      path.resolve(__dirname, '../node_modules'),
      path.resolve(sourceDir)
    ]
  })
  themePath = path.dirname(themeLayoutPath)
}

Are you willing to work on this yourself?**

I'm not sure.

@ulivz ulivz added the type: feature request Request to add a new feature label Jun 17, 2018
@andreasvirkus
Copy link

We should be able to copy this logic from vue-cli plugin lookup. I can look into it over the coming weekend, if there's no takers beforehand

@ulivz ulivz added the version: next Planned to do or already included in the next(1.0.0) version label Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request Request to add a new feature version: next Planned to do or already included in the next(1.0.0) version
Projects
None yet
Development

No branches or pull requests

3 participants