Skip to content

Commit e938bc1

Browse files
authored
Merge pull request #161 from terwer/release-please--branches--main--components--release-please-action
chore(main): release 1.8.4
2 parents b396664 + 5ad7565 commit e938bc1

File tree

8 files changed

+62
-24
lines changed

8 files changed

+62
-24
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Changelog
22

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

composables/useCommonShareType.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* questions.
2424
*/
2525

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

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

51-
// 预览当做公共分享处理,因为在内部
52-
const { currentPost, setCurrentPost } = usePost()
53-
await setCurrentPost(id)
54-
const attrs = JsonUtil.safeParse<any>(currentPost.post?.attrs ?? "{}", {})
55-
const isPreview = attrs["custom-publish-status"] === "preview"
56-
logger.info(`get custom-publish-status isPreview=> ${isPreview}`)
57-
58-
if (ObjectUtil.isEmptyObject(shareType) || isPreview) {
50+
if (ObjectUtil.isEmptyObject(shareType)) {
5951
return ShareTypeEnum.ShareType_Public
6052
}
6153

54+
// 预览当做公共分享处理,因为在内部
55+
// 要考虑不在分享页面的情况
56+
const id = (route.params.id ?? "") as string
57+
if (!StrUtil.isEmptyString(id)) {
58+
try {
59+
const { currentPost, setCurrentPost } = usePost()
60+
await setCurrentPost(id)
61+
const attrs = JsonUtil.safeParse<any>(currentPost.post?.attrs ?? "{}", {})
62+
const isPreview = attrs["custom-publish-status"] === "preview"
63+
logger.info(`get custom-publish-status isPreview=> ${isPreview}`)
64+
if (isPreview) {
65+
return ShareTypeEnum.ShareType_Public
66+
}
67+
} catch (e) {
68+
logger.info("Not in inner, ignore")
69+
}
70+
}
71+
6272
return shareType.shareType
6373
}
6474

nuxt.config.ts

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const generateDynamicV = () => {
99
}
1010

1111
const isDev = process.env.NODE_ENV === "development"
12-
const appBase = "/"
12+
const appBase = "/plugins/siyuan-blog/"
1313
const staticV = generateDynamicV()
1414

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

3030
// build modules
31-
modules: ["@vueuse/nuxt", "@nuxtjs/i18n", "@element-plus/nuxt", "@nuxtjs/color-mode", "@pinia/nuxt", "@nuxt/image"],
31+
modules: [
32+
"@vueuse/nuxt",
33+
"@nuxtjs/i18n-edge",
34+
"@element-plus/nuxt",
35+
"@nuxtjs/color-mode",
36+
"@pinia/nuxt",
37+
"@nuxt/image",
38+
],
3239

3340
// vueuse
3441
vueuse: {
@@ -51,7 +58,7 @@ export default defineNuxtConfig({
5158
define: {
5259
"process.env.DEV_MODE": `"${isDev}"`,
5360
"process.env.APP_BASE": `"${appBase}"`,
54-
"process.env.SSR": `"true"`,
61+
"process.env.SSR": `"false"`,
5562
},
5663
plugins: [],
5764
},
@@ -62,6 +69,14 @@ export default defineNuxtConfig({
6269
themes: ["dark"],
6370
},
6471

72+
// https://nuxt.com/docs/guide/going-further/custom-routing#hash-mode-spa
73+
ssr: false,
74+
router: {
75+
options: {
76+
hashMode: true,
77+
},
78+
},
79+
6580
css: ["~/assets/siyuan/style.styl", "~/assets/siyuan/index.styl"],
6681

6782
app: {
@@ -98,12 +113,17 @@ export default defineNuxtConfig({
98113

99114
// 环境变量
100115
runtimeConfig: {
101-
siyuanAuthToken: process.env.NUXT_SIYUAN_AUTH_TOKEN,
102-
siyuanCookie: process.env.NUXT_SIYUAN_COOKIE,
116+
// siyuanAuthToken: process.env.NUXT_SIYUAN_AUTH_TOKEN,
117+
siyuanAuthToken: "",
118+
// siyuanCookie: process.env.NUXT_SIYUAN_COOKIE,
119+
siyuanCookie: "",
103120
public: {
104-
defaultType: process.env.NUXT_PUBLIC_DEFAULT_TYPE ?? "siyuan",
105-
siyuanApiUrl: process.env.NUXT_PUBLIC_SIYUAN_API_URL ?? "http://127.0.0.1:6806",
106-
waitTime: process.env.NUXT_PUBLIC_WAIT_TIME,
121+
// defaultType: process.env.NUXT_PUBLIC_DEFAULT_TYPE,
122+
defaultType: "siyuan",
123+
// siyuanApiUrl: process.env.NUXT_PUBLIC_SIYUAN_API_URL,
124+
siyuanApiUrl: "",
125+
// waitTime: process.env.NUXT_PUBLIC_WAIT_TIME,
126+
waitTime: "0",
107127
},
108128
},
109129
})

nuxt.vercel.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export default defineNuxtConfig({
9797
},
9898
},
9999

100+
nitro: {
101+
preset: "vercel",
102+
},
103+
100104
// 环境变量
101105
runtimeConfig: {
102106
siyuanAuthToken: process.env.NUXT_SIYUAN_AUTH_TOKEN,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "siyuan-blog",
3-
"version": "1.8.3",
3+
"version": "1.8.4",
44
"description": "The notions sharing function you want is here too",
55
"type": "module",
66
"scripts": {

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "siyuan-blog",
33
"author": "terwer",
44
"url": "https://github.com/terwer/siyuan-plugin-blog",
5-
"version": "1.8.3",
5+
"version": "1.8.4",
66
"minAppVersion": "2.9.0",
77
"backends": [
88
"windows",

public/resources/stage/build/app/base.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/resources/stage/build/app/version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)