Skip to content

Commit

Permalink
Fix router (#3)
Browse files Browse the repository at this point in the history
* Add router base

* Fix router and favicon

* Use dotfiles true to fix problem

nuxt/nuxt#2636

* Fix favicon too
  • Loading branch information
itsmichaeldiego committed Jun 24, 2018
1 parent 6b4a865 commit 8cd430b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 13 additions & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* nuxt.config.js */
// only add `router.base = '/<repository-name>/'` if `DEPLOY_ENV` is `GH_PAGES`
const routerBase = process.env.DEPLOY_ENV === 'GH_PAGES' ? {
router: {
base: '/website/',
}
} : {};

module.exports = {
/*
** Headers of the page
Expand All @@ -10,10 +18,14 @@ module.exports = {
{ hid: 'description', name: 'description', content: 'Michael Diego&apos;s website' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
{ rel: 'icon', type: 'image/x-icon', href: 'favicon.ico' }
]
},
/*
** Router config
*/
...routerBase,
/*
** Customize the progress bar color
*/
loading: { color: '#3B8070' },
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint",
"predeploy": "npm run generate",
"deploy": "gh-pages -d dist"
"build:gh-pages": "DEPLOY_ENV=GH_PAGES nuxt build",
"generate:gh-pages": "DEPLOY_ENV=GH_PAGES nuxt generate",
"predeploy": "npm run generate:gh-pages",
"deploy": "gh-pages -d dist --dotfiles=true"
},
"dependencies": {
"nuxt": "^1.0.0"
Expand Down

0 comments on commit 8cd430b

Please sign in to comment.