Skip to content

Commit

Permalink
Merge branch 'dev' and release 1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
chihuo2104 committed May 1, 2023
2 parents 2b5736e + 6f7c124 commit 331ac82
Show file tree
Hide file tree
Showing 10 changed files with 1,021 additions and 15 deletions.
1 change: 1 addition & 0 deletions .browserlistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> 0.1% and not dead,iOS >= 12
11 changes: 9 additions & 2 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ import posts from './mocks/posts'
const runtimeConfig = useRuntimeConfig()
let confdata = conf
const config = useConfig()
let confdata = {
model: config.value.model,
settings: config.value.url
}
if (runtimeConfig.chiblogConfigType !== '' && runtimeConfig.chiblogConfigUrl !== '' && process.server) {
config.value.model = runtimeConfig.chiblogConfigType
config.value.url = runtimeConfig.chiblogConfigUrl
confdata.model = runtimeConfig.chiblogConfigType
confdata.settings = runtimeConfig.chiblogConfigUrl
console.log(runtimeConfig.chiblogConfigType)
Expand Down Expand Up @@ -296,7 +303,7 @@ useHead({
function renderNumber (num){
if (num > 100000) {
return Math.round((num / 10000) * 100) / 10 + 'w'
return Math.round((num / 10000) * 100) / 100 + 'w'
} else if (num > 1000) {
return Math.round((num / 10000) * 100) / 10 + 'k'
} else {
Expand Down
2 changes: 1 addition & 1 deletion components/ArticleCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function renderTime (time) {
}
function renderNumber (num){
if (num > 100000) {
return Math.round((num / 10000) * 100) / 10 + 'w'
return Math.round((num / 10000) * 100) / 100 + 'w'
} else if (num > 1000) {
return Math.round((num / 10000) * 100) / 10 + 'k'
} else {
Expand Down
7 changes: 6 additions & 1 deletion components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const props = defineProps({
s: String,
textCount: String
})
import { nextTick, ref } from 'vue'
const tickTime = ref(new Date())
nextTick(() => {
tickTime.value = new Date()
})
const settings = props.settings
</script>
<template>
Expand All @@ -15,7 +20,7 @@ const settings = props.settings
<div id="footer">
<div id="cpr" v-show="settings.site.showcopyright">本页面由<a :href="settings.site.author.url" target="_blank">{{settings.site.author.name}}</a>进行维护。版权所有&copy;{{settings.site.copyright.startyear}}-{{ new Date().getFullYear() }}。</div>
<div>
<span v-show="settings.site.showstats">页面生成于{{ s }},最后渲染于{{(new Date()).toLocaleString()}}。加载&nbsp;{{ loadTime }}ms&nbsp;渲染&nbsp;{{ renderTime }}ms</span>
<span v-show="settings.site.showstats">页面生成于{{tickTime.toLocaleString()}},最后渲染于{{ s }}。加载&nbsp;{{ loadTime }}ms&nbsp;渲染&nbsp;{{ renderTime }}ms</span>
<span v-show="settings.site.textcount.global">&nbsp;站点总字数:{{ textCount }}</span> <br/>
<span v-show="settings.site.count.enabled && settings.site.count.site">本站总访问次数:<span id="busuanzi_value_site_pv">加载中...</span>&nbsp;|&nbsp;本站访客数:<span id="busuanzi_value_site_uv">加载中...</span></span>
</div>
Expand Down
9 changes: 9 additions & 0 deletions composables/useConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const useConfig = () => {
const modifyData = useState('config', () => {
return {
model: 'mocks',
url: ''
}
})
return modifyData
}
12 changes: 11 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import browserslist from 'browserslist'
const browserslistConfig = browserslist.loadConfig({ path: '.' })
import legacy from '@vitejs/plugin-legacy'
export default defineNuxtConfig({
// Global page headers: https://go.nuxtjs.dev/config-head
app: {
Expand Down Expand Up @@ -35,5 +38,12 @@ export default defineNuxtConfig({
runtimeConfig: {
chiblogConfigType: '',
chiblogConfigUrl: ''
}
},
vite: {
plugins: [
legacy({
targets: browserslistConfig,
})
]
}
})
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "chiblog",
"version": "1.1.5",
"version": "1.1.6",
"private": true,
"author": "chihuo2104<[email protected]>",
"author": "chi Network Contributors<[email protected]>",
"scripts": {
"build": "nuxi build",
"dev": "nuxi dev",
Expand All @@ -13,6 +13,8 @@
"devDependencies": {},
"dependencies": {
"@mdi/js": "^7.1.96",
"@vitejs/plugin-legacy": "^4.0.3",
"browserslist": "^4.21.5",
"marked": "^4.2.5",
"md5": "^2.3.0",
"nuxi": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion pages/posts/[path].vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const updtime = computed(() => { return (renderTime(post.value.updtime)) })
function renderNumber (num){
if (num > 100000) {
return Math.round((num / 10000) * 100) / 10 + 'w'
return Math.round((num / 10000) * 100) / 100 + 'w'
} else if (num > 1000) {
return Math.round((num / 10000) * 100) / 10 + 'k'
} else {
Expand Down
6 changes: 3 additions & 3 deletions version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
version: '1.1.5',
versionReleaseDate: '20230415',
versionDisplay: '1.1.5(20230415)',
version: '1.1.6',
versionReleaseDate: '20230501',
versionDisplay: '1.1.6(20230501)',
supportVersionDate: '20230401',
supportVersion: '1.1.4'
}
Loading

0 comments on commit 331ac82

Please sign in to comment.