Skip to content

Commit

Permalink
Merge pull request #161 from terwer/release-please--branches--main--c…
Browse files Browse the repository at this point in the history
…omponents--release-please-action

chore(main): release 1.8.4
  • Loading branch information
terwer committed Aug 10, 2023
2 parents b396664 + 5ad7565 commit e938bc1
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 24 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
@@ -1,7 +1,14 @@
# Changelog

## [1.8.3](https://github.com/terwer/siyuan-plugin-blog/compare/v1.8.2...v1.8.3) (2023-07-03)
## [1.8.4](https://github.com/terwer/siyuan-plugin-blog/compare/v1.8.3...v1.8.4) (2023-08-10)
### Bug Fixes
* **deps:** bump pnpm/action-setup from 2.2.4 to 2.4.0 ([30aefbf](https://github.com/terwer/siyuan-plugin-blog/commit/30aefbf89f3a58498d6e9e5adf2a0112c01e73c6))
* 修复授权码模式发布预览失效问题 ([91fe1b0](https://github.com/terwer/siyuan-plugin-blog/commit/91fe1b09bc0d3f1200cfb82f74982b042146ceae))
* 升级依赖 ([5c9df8a](https://github.com/terwer/siyuan-plugin-blog/commit/5c9df8ab0c6955b5dd830a10375b18dd378a2276))
* 更新183 版本 docker 镜像 ([0d20e35](https://github.com/terwer/siyuan-plugin-blog/commit/0d20e35b8527b0691251eb7a1af3d83e6877f2d4))
### Miscellaneous
* **deps-dev:** bump @nuxt/devtools from 0.6.7 to 0.7.6 ([6c7c117](https://github.com/terwer/siyuan-plugin-blog/commit/6c7c1171381a958e528f5ffcfc5dd63cf71f7d80))
## [1.8.3](https://github.com/terwer/siyuan-plugin-blog/compare/v1.8.2...v1.8.3) (2023-07-03)
* 修复取消分享错误 ([ea0d550](https://github.com/terwer/siyuan-plugin-blog/commit/ea0d550bdaa91b91a636eded634c35954d62072a))
## [1.8.2](https://github.com/terwer/siyuan-plugin-blog/compare/v1.8.1...v1.8.2) (2023-07-02)
* 优化消息提示 ([1f0c1f5](https://github.com/terwer/siyuan-plugin-blog/commit/1f0c1f5c28fbb8e768a47022c37d29495aeea03e))
Expand All @@ -26,7 +33,6 @@
* 修正图标大小展示异常问题 ([3141c4b](https://github.com/terwer/siyuan-plugin-blog/commit/3141c4b434c91b84071b3def734189a6aad01923))
* 支持授权码模式下的分享(实验性) ([d759412](https://github.com/terwer/siyuan-plugin-blog/commit/d7594127fecb1bd4838c7f22cc35bb738353ef87))
* **deps:** bump zhi-siyuan-api from 1.23.0 to 1.25.5 ([cdd7274](https://github.com/terwer/siyuan-plugin-blog/commit/cdd7274071ada5417901ab0b0945bfa945763755))
### Miscellaneous
* **deps-dev:** bump @nuxt/devtools from 0.6.2 to 0.6.4 ([1eda6a9](https://github.com/terwer/siyuan-plugin-blog/commit/1eda6a907487fc24c78346521169905bb914833f))
* **deps-dev:** bump @vueuse/nuxt from 10.2.0 to 10.2.1 ([c186148](https://github.com/terwer/siyuan-plugin-blog/commit/c186148ef3588c430e98a0da42c5d7072239c9da))
* **deps-dev:** bump @vueuse/router from 10.2.0 to 10.2.1 ([cc8a45c](https://github.com/terwer/siyuan-plugin-blog/commit/cc8a45c159c9353a322a936f91fbd55afcca8fe1))
Expand Down
30 changes: 20 additions & 10 deletions composables/useCommonShareType.ts
Expand Up @@ -23,7 +23,7 @@
* questions.
*/

import { JsonUtil, ObjectUtil } from "zhi-common"
import { JsonUtil, ObjectUtil, StrUtil } from "zhi-common"
import { ShareType } from "~/models/ShareType"
import { ShareTypeEnum } from "~/enums/ShareTypeEnum"
import { createAppLogger } from "~/common/appLogger"
Expand All @@ -38,7 +38,6 @@ export const useCommonShareType = () => {
const { fetchPublicText } = useAuthModeFetch()
const shareTypeJsonFile = "share-type.json"
const route = useRoute()
const id = (route.params.id ?? "") as string

/**
* 获取分享类型
Expand All @@ -48,17 +47,28 @@ export const useCommonShareType = () => {
const shareType = JsonUtil.safeParse(resText, {} as any)
logger.info("get shareType from store", shareType)

// 预览当做公共分享处理,因为在内部
const { currentPost, setCurrentPost } = usePost()
await setCurrentPost(id)
const attrs = JsonUtil.safeParse<any>(currentPost.post?.attrs ?? "{}", {})
const isPreview = attrs["custom-publish-status"] === "preview"
logger.info(`get custom-publish-status isPreview=> ${isPreview}`)

if (ObjectUtil.isEmptyObject(shareType) || isPreview) {
if (ObjectUtil.isEmptyObject(shareType)) {
return ShareTypeEnum.ShareType_Public
}

// 预览当做公共分享处理,因为在内部
// 要考虑不在分享页面的情况
const id = (route.params.id ?? "") as string
if (!StrUtil.isEmptyString(id)) {
try {
const { currentPost, setCurrentPost } = usePost()
await setCurrentPost(id)
const attrs = JsonUtil.safeParse<any>(currentPost.post?.attrs ?? "{}", {})
const isPreview = attrs["custom-publish-status"] === "preview"
logger.info(`get custom-publish-status isPreview=> ${isPreview}`)
if (isPreview) {
return ShareTypeEnum.ShareType_Public
}
} catch (e) {
logger.info("Not in inner, ignore")
}
}

return shareType.shareType
}

Expand Down
36 changes: 28 additions & 8 deletions nuxt.config.ts
Expand Up @@ -9,7 +9,7 @@ const generateDynamicV = () => {
}

const isDev = process.env.NODE_ENV === "development"
const appBase = "/"
const appBase = "/plugins/siyuan-blog/"
const staticV = generateDynamicV()

// https://nuxt.com/docs/api/configuration/nuxt-config
Expand All @@ -28,7 +28,14 @@ export default defineNuxtConfig({
},

// build modules
modules: ["@vueuse/nuxt", "@nuxtjs/i18n", "@element-plus/nuxt", "@nuxtjs/color-mode", "@pinia/nuxt", "@nuxt/image"],
modules: [
"@vueuse/nuxt",
"@nuxtjs/i18n-edge",
"@element-plus/nuxt",
"@nuxtjs/color-mode",
"@pinia/nuxt",
"@nuxt/image",
],

// vueuse
vueuse: {
Expand All @@ -51,7 +58,7 @@ export default defineNuxtConfig({
define: {
"process.env.DEV_MODE": `"${isDev}"`,
"process.env.APP_BASE": `"${appBase}"`,
"process.env.SSR": `"true"`,
"process.env.SSR": `"false"`,
},
plugins: [],
},
Expand All @@ -62,6 +69,14 @@ export default defineNuxtConfig({
themes: ["dark"],
},

// https://nuxt.com/docs/guide/going-further/custom-routing#hash-mode-spa
ssr: false,
router: {
options: {
hashMode: true,
},
},

css: ["~/assets/siyuan/style.styl", "~/assets/siyuan/index.styl"],

app: {
Expand Down Expand Up @@ -98,12 +113,17 @@ export default defineNuxtConfig({

// 环境变量
runtimeConfig: {
siyuanAuthToken: process.env.NUXT_SIYUAN_AUTH_TOKEN,
siyuanCookie: process.env.NUXT_SIYUAN_COOKIE,
// siyuanAuthToken: process.env.NUXT_SIYUAN_AUTH_TOKEN,
siyuanAuthToken: "",
// siyuanCookie: process.env.NUXT_SIYUAN_COOKIE,
siyuanCookie: "",
public: {
defaultType: process.env.NUXT_PUBLIC_DEFAULT_TYPE ?? "siyuan",
siyuanApiUrl: process.env.NUXT_PUBLIC_SIYUAN_API_URL ?? "http://127.0.0.1:6806",
waitTime: process.env.NUXT_PUBLIC_WAIT_TIME,
// defaultType: process.env.NUXT_PUBLIC_DEFAULT_TYPE,
defaultType: "siyuan",
// siyuanApiUrl: process.env.NUXT_PUBLIC_SIYUAN_API_URL,
siyuanApiUrl: "",
// waitTime: process.env.NUXT_PUBLIC_WAIT_TIME,
waitTime: "0",
},
},
})
4 changes: 4 additions & 0 deletions nuxt.vercel.config.ts
Expand Up @@ -97,6 +97,10 @@ export default defineNuxtConfig({
},
},

nitro: {
preset: "vercel",
},

// 环境变量
runtimeConfig: {
siyuanAuthToken: process.env.NUXT_SIYUAN_AUTH_TOKEN,
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "siyuan-blog",
"version": "1.8.3",
"version": "1.8.4",
"description": "The notions sharing function you want is here too",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan-blog",
"author": "terwer",
"url": "https://github.com/terwer/siyuan-plugin-blog",
"version": "1.8.3",
"version": "1.8.4",
"minAppVersion": "2.9.0",
"backends": [
"windows",
Expand Down
1 change: 0 additions & 1 deletion public/resources/stage/build/app/base.css

This file was deleted.

1 change: 0 additions & 1 deletion public/resources/stage/build/app/version.txt

This file was deleted.

1 comment on commit e938bc1

@vercel
Copy link

@vercel vercel bot commented on e938bc1 Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.