Skip to content

Commit

Permalink
feat: allow default theme to be copied as custom theme
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 15, 2018
1 parent e8d8559 commit 98e1665
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import Vue from 'vue'
import Router from 'vue-router'
import Content from './Content'
import ClientOnly from './ClientOnly'
import NotFound from '~notFound'
import dataMixin from './dataMixin'
import { routes } from './.temp/routes'
import { siteData } from './.temp/siteData'
import NotFound from '@notFound'
import { routes } from '@temp/routes'
import { siteData } from '@temp/siteData'

// suggest dev server restart on base change
if (module.hot) {
Expand Down
2 changes: 1 addition & 1 deletion lib/app/clientEntry.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global BASE_URL, GA_ID, ga, SW_ENABLED */

import './.temp/polyfill'
import '@temp/polyfill'
import { createApp } from './app'
import { register } from 'register-service-worker'

Expand Down
2 changes: 1 addition & 1 deletion lib/default-theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Home from './Home.vue'
import Navbar from './Navbar.vue'
import Page from './Page.vue'
import Sidebar from './Sidebar.vue'
import { pathToComponentName, getTitle, getLang } from '../app/util'
import { pathToComponentName, getTitle, getLang } from '@app/util'
import { resolveSidebarItems } from './util'
export default {
Expand Down
2 changes: 1 addition & 1 deletion lib/default-theme/styles/config.styl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ $MQNarrow = 959px
$MQMobile = 719px
$MQMobileNarrow = 419px

@import '../../app/.temp/override.styl' // generated from user config
@import '~@temp/override.styl' // generated from user config
2 changes: 1 addition & 1 deletion lib/prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ async function genRoutesFile ({ siteData: { pages }, sourceDir, pageFiles }) {
}

return (
`import Theme from '~theme'\n` +
`import Theme from '@theme'\n` +
`export const routes = [${pages.map(genRoute).join(',')}\n]`
)
}
Expand Down
8 changes: 5 additions & 3 deletions lib/webpack/createBaseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ module.exports = function createBaseConfig ({
config.resolve
.set('symlinks', true)
.alias
.set('~theme', themePath)
.set('~notFound', notFoundPath)
.set('~source', sourceDir)
.set('@theme', themePath)
.set('@notFound', notFoundPath)
.set('@source', sourceDir)
.set('@app', path.resolve(__dirname, '../app'))
.set('@temp', path.resolve(__dirname, '../app/.temp'))
.end()
.extensions
.merge(['.js', '.jsx', '.vue', '.json'])
Expand Down

0 comments on commit 98e1665

Please sign in to comment.