Skip to content

Commit

Permalink
fix github pages baseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
ganlvtech committed Sep 17, 2018
1 parent dbf2b92 commit ba30926
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ matrix:
- php php/crawl.php
- php php/format.php
- npm install
- export BUILD_GITHUB_PAGES=true
- npm run build
deploy:
provider: pages
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ npm run serve
php php/crawl.php
php php/format.php
npm install
echo "BUILD_GITHUB_PAGES=true" > .env.local
npm run build
```

Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<body>
<nav class="navbar navbar-expand-lg navbar-dark no-select">
<div class="container">
<a class="navbar-brand" href="/">爱盘 - 在线破解工具包</a>
<a class="navbar-brand" href="<%= BASE_URL %>">爱盘 - 在线破解工具包</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
mounted() {
toastr.info('爱盘搜索扩展插件加载完成,正在加载文件列表');
axios.get(`/list.json?t=${this.todayTimestamp}`)
axios.get(`${process.env.BASE_URL}list.json?t=${this.todayTimestamp}`)
.then(response => {
this.data = prepareFiles(response.data);
this.path = this.data;
Expand Down
1 change: 1 addition & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports = {
css: {
extract: true
},
baseUrl: process.env.BUILD_GITHUB_PAGES ? '/down_52pojie_cn/' : undefined,
assetsDir: process.env.USE_FANCY_INDEX ? process.env.FANCY_INDEX_DIR : undefined,
chainWebpack: config => {
if (process.env.USE_FANCY_INDEX) {
Expand Down

0 comments on commit ba30926

Please sign in to comment.