Skip to content

Commit

Permalink
feat: v4.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Aug 27, 2023
1 parent d788bb0 commit 96bdfef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "surmon.me",
"version": "4.19.1",
"version": "4.19.2",
"description": "Surmon.me blog",
"author": "Surmon",
"license": "MIT",
Expand Down
14 changes: 10 additions & 4 deletions src/pages/category.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { useStores } from '/@/stores'
import { getExtendValue } from '/@/transforms/state'
import { firstUpperCase } from '/@/transforms/text'
import { getStaticURL, getStaticPath, isOriginalStaticURL } from '/@/transforms/url'
import { scrollToNextScreen } from '/@/utils/scroller'
import ArticleListHeader from '/@/components/flow/desktop/header.vue'
import ArticleList from '/@/components/flow/desktop/list.vue'
Expand All @@ -13,20 +14,25 @@
categorySlug: string
}>()
const { i18n: _i18n, seoMeta, isZhLang } = useEnhancer()
const { i18n: _i18n, seoMeta, cdnDomain, isZhLang } = useEnhancer()
const { articleList: articleListStore, category: categoryStore } = useStores()
const currentCategory = computed(() => {
return categoryStore.data.find((category) => category.slug === props.categorySlug)
})
const currentCategoryIcon = computed(() => {
return getExtendValue(currentCategory.value?.extends || [], 'icon') || 'icon-category'
})
const currentCategoryImage = computed(() => {
return getExtendValue(currentCategory.value?.extends || [], 'background')
})
const currentCategoryColor = computed(() => {
return getExtendValue(currentCategory.value?.extends || [], 'bgcolor')
})
const currentCategoryImage = computed(() => {
const value = getExtendValue(currentCategory.value?.extends || [], 'background')
if (isOriginalStaticURL(value)) {
return getStaticURL(cdnDomain, getStaticPath(value!))
} else {
return value
}
})
const loadmoreArticles = async () => {
await articleListStore.fetch({
Expand Down
12 changes: 10 additions & 2 deletions src/pages/tag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { useTagStore, getTagEnName } from '/@/stores/tag'
import { getExtendValue } from '/@/transforms/state'
import { firstUpperCase } from '/@/transforms/text'
import { getStaticURL, getStaticPath, isOriginalStaticURL } from '/@/transforms/url'
import { scrollToNextScreen } from '/@/utils/scroller'
import ArticleListHeader from '/@/components/flow/desktop/header.vue'
import ArticleList from '/@/components/flow/desktop/list.vue'
Expand All @@ -14,13 +15,20 @@
tagSlug: string
}>()
const { seoMeta, isZhLang } = useEnhancer()
const { seoMeta, cdnDomain, isZhLang } = useEnhancer()
const articleListStore = useArticleListStore()
const tagStore = useTagStore()
const currentTag = computed(() => tagStore.data.find((tag) => tag.slug === props.tagSlug))
const currentTagIcon = computed(() => getExtendValue(currentTag.value?.extends || [], 'icon') || 'icon-tag')
const currentTagImage = computed(() => getExtendValue(currentTag.value?.extends || [], 'background'))
const currentTagColor = computed(() => getExtendValue(currentTag.value?.extends || [], 'bgcolor'))
const currentTagImage = computed(() => {
const value = getExtendValue(currentTag.value?.extends || [], 'background')
if (isOriginalStaticURL(value)) {
return getStaticURL(cdnDomain, getStaticPath(value!))
} else {
return value
}
})
const loadmoreArticles = async () => {
await articleListStore.fetch({
Expand Down

0 comments on commit 96bdfef

Please sign in to comment.