Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
fix: #114 (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby authored Mar 28, 2020
1 parent 11ba386 commit 3fca6fc
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 72 deletions.
62 changes: 31 additions & 31 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build-jsdelivr": "vue-cli-service build --mode jsdelivr",
"build:jsdelivr": "vue-cli-service build --mode jsdelivr",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit"
},
"dependencies": {
"ant-design-vue": "^1.5.0-rc.5",
"ant-design-vue": "^1.5.0-rc.7",
"axios": "^0.19.2",
"enquire.js": "^2.1.6",
"filepond": "^4.13.0",
Expand Down
8 changes: 0 additions & 8 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
<style>
body {height: 100%;background-color: #f5f5f5;}#loader{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;border:solid 3px #e5e5e5;border-top-color:#333;border-radius:50%;width:30px;height:30px;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}
</style>
<!-- require cdn assets css -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
<% } %>
</head>

<body>
Expand All @@ -26,10 +22,6 @@
<div id="app">
<div id="loader"></div>
</div>
<!-- require cdn assets js -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
<!-- built files will be auto injected -->
</body>

Expand Down
6 changes: 3 additions & 3 deletions src/views/post/components/PostSettingDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
</a-form-item>
<a-form-item label="文章别名:">
<template slot="help">
<span v-if="options.post_permalink_type === 'DEFAULT'">{{ options.blog_url }}/{{ options.archives_prefix }}/{{ selectedPost.slug?selectedPost.slug:'${slug}' }}{{ options.path_suffix }}</span>
<span v-else-if="options.post_permalink_type === 'DATE'">{{ options.blog_url }}{{ selectedPost.createTime?selectedPost.createTime:new Date() | moment_post_date }}{{ selectedPost.slug?selectedPost.slug:'${slug}' }}{{ options.path_suffix }}</span>
<span v-else-if="options.post_permalink_type === 'DAY'">{{ options.blog_url }}{{ selectedPost.createTime?selectedPost.createTime:new Date() | moment_post_day }}{{ selectedPost.slug?selectedPost.slug:'${slug}' }}{{ options.path_suffix }}</span>
<span v-if="options.post_permalink_type === 'DEFAULT'">{{ options.blog_url }}/{{ options.archives_prefix }}/{{ selectedPost.slug?selectedPost.slug:'${slug}' }}{{ (options.path_suffix?options.path_suffix:'') }}</span>
<span v-else-if="options.post_permalink_type === 'DATE'">{{ options.blog_url }}{{ selectedPost.createTime?selectedPost.createTime:new Date() | moment_post_date }}{{ selectedPost.slug?selectedPost.slug:'${slug}' }}{{ (options.path_suffix?options.path_suffix:'') }}</span>
<span v-else-if="options.post_permalink_type === 'DAY'">{{ options.blog_url }}{{ selectedPost.createTime?selectedPost.createTime:new Date() | moment_post_day }}{{ selectedPost.slug?selectedPost.slug:'${slug}' }}{{ (options.path_suffix?options.path_suffix:'') }}</span>
<span v-else-if="options.post_permalink_type === 'ID'">{{ options.blog_url }}/?p={{ selectedPost.id?selectedPost.id:'${id}' }}</span>
</template>
<a-input v-model="selectedPost.slug" />
Expand Down
29 changes: 1 addition & 28 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,13 @@ function resolve(dir) {
return path.join(__dirname, dir)
}

const isProd = process.env.NODE_ENV === 'production'

const assetsCDN = {
externals: {
vue: 'Vue',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
marked: 'marked'
},
css: [],
js: [
'https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js',
'https://cdn.jsdelivr.net/npm/[email protected]/dist/vue-router.min.js',
'https://cdn.jsdelivr.net/npm/[email protected]/dist/vuex.min.js',
'https://cdn.jsdelivr.net/npm/[email protected]/dist/axios.min.js',
'https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js'
]
}

// vue.config.js
module.exports = {
publicPath: process.env.PUBLIC_PATH,
configureWebpack: {
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
],
externals: isProd ? assetsCDN.externals : {}
]
},

chainWebpack: (config) => {
Expand Down Expand Up @@ -60,12 +39,6 @@ module.exports = {
.options({
name: 'assets/[name].[hash:8].[ext]'
})
if (isProd) {
config.plugin('html').tap(args => {
args[0].cdn = assetsCDN
return args
})
}
},

css: {
Expand Down

0 comments on commit 3fca6fc

Please sign in to comment.