From 18aef4454ee4330691de836f1626c1cfe68f5f42 Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <17683872107czx> Date: Tue, 10 Oct 2023 11:25:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Open=20Graph?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- settings.yaml | 10 +++++++ templates/about.html | 10 +++++-- templates/album.html | 10 +++++-- templates/archives.html | 12 ++++++--- templates/bangumis.html | 10 +++++-- templates/categories.html | 10 +++++-- templates/category.html | 10 +++++-- templates/comments.html | 10 +++++-- templates/equipment.html | 10 +++++-- templates/fcircle.html | 10 +++++-- templates/index.html | 10 +++++-- templates/links.html | 9 ++++++- templates/modules/common/open-graph.html | 34 ++++++++++++++++++++++++ templates/modules/layouts/layout.html | 6 ++++- templates/moments.html | 10 +++++-- templates/music.html | 10 +++++-- templates/new_comment.html | 10 +++++-- templates/page.html | 10 +++++-- templates/page_links.html | 9 ++++++- templates/photos.html | 10 +++++-- templates/post.html | 10 +++++-- templates/tag.html | 10 +++++-- templates/tags.html | 9 ++++++- templates/todolist.html | 10 +++++-- 24 files changed, 218 insertions(+), 41 deletions(-) create mode 100644 templates/modules/common/open-graph.html diff --git a/settings.yaml b/settings.yaml index 6b5ce64a..9eeca749 100644 --- a/settings.yaml +++ b/settings.yaml @@ -2800,6 +2800,16 @@ spec: validation: required value: 'https://npm.onmicrosoft.cn/hao-theme-static@1.3.7/templates/assets' help: '默认为npmJs的onmicrosoft加速地址,如果你有自己的cdn地址(请确保链接下assets文件夹下主题静态资源文件),可以填写,否则请勿修改! ' + - $formkit: group + name: opengraph + label: Open Graph + value: + image: + children: + - $formkit: attachment + name: image + label: 默认图片 + help: 如果页面没有设置图片,那么将会使用此图片作为 Open Graph 图片 - $formkit: group name: vanillaLazyload label: 懒加载 diff --git a/templates/about.html b/templates/about.html index 48a4ab0b..6af69693 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'about',title = ${'关于' + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/album.html b/templates/album.html index 2e7436dd..45972497 100644 --- a/templates/album.html +++ b/templates/album.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'page',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/archives.html b/templates/archives.html index 00f94424..a2a3e8cb 100644 --- a/templates/archives.html +++ b/templates/archives.html @@ -1,12 +1,18 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'archive',title = ${'文章归档' + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/bangumis.html b/templates/bangumis.html index 641fd935..98d9c0a2 100644 --- a/templates/bangumis.html +++ b/templates/bangumis.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'bangumis',title = ${'追番' + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/categories.html b/templates/categories.html index 4e3f4146..169a272d 100644 --- a/templates/categories.html +++ b/templates/categories.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'category',title = ${'分类' + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/category.html b/templates/category.html index 1d80cbdb..2afaba10 100644 --- a/templates/category.html +++ b/templates/category.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'category',title = ${'分类' + ': ' + category.spec.displayName + ' | ' + site.title}, head = ~{::head})}" > + + +
diff --git a/templates/comments.html b/templates/comments.html index b64295e4..2408c003 100644 --- a/templates/comments.html +++ b/templates/comments.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'comments',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/equipment.html b/templates/equipment.html index 56367221..11348790 100644 --- a/templates/equipment.html +++ b/templates/equipment.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'page',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/fcircle.html b/templates/fcircle.html index 8ee78d51..fbd147e0 100644 --- a/templates/fcircle.html +++ b/templates/fcircle.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'fcircle',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head} )}"> + + +
diff --git a/templates/index.html b/templates/index.html index 6d0af0be..451160e1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'index', title = null, head = ~{::head})}"> + + +
diff --git a/templates/links.html b/templates/links.html index e5abe507..71d770aa 100644 --- a/templates/links.html +++ b/templates/links.html @@ -1,6 +1,13 @@ + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'links',title = ${'友链' + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/modules/common/open-graph.html b/templates/modules/common/open-graph.html new file mode 100644 index 00000000..c19189ee --- /dev/null +++ b/templates/modules/common/open-graph.html @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/modules/layouts/layout.html b/templates/modules/layouts/layout.html index 23da3d7f..192b0380 100644 --- a/templates/modules/layouts/layout.html +++ b/templates/modules/layouts/layout.html @@ -1,5 +1,5 @@ - + + + + diff --git a/templates/moments.html b/templates/moments.html index 40aa6875..b3ee604a 100644 --- a/templates/moments.html +++ b/templates/moments.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'moments',title = ${title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/music.html b/templates/music.html index c9f7e3d6..15c9beb7 100644 --- a/templates/music.html +++ b/templates/music.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'music',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/new_comment.html b/templates/new_comment.html index babb3837..31c07154 100644 --- a/templates/new_comment.html +++ b/templates/new_comment.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'newComment',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/page.html b/templates/page.html index 48a82efd..2a3e4fb9 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'page',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/page_links.html b/templates/page_links.html index 8239cb2c..e8c86744 100644 --- a/templates/page_links.html +++ b/templates/page_links.html @@ -1,6 +1,13 @@ + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'page',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/photos.html b/templates/photos.html index bf70448f..3931ba00 100644 --- a/templates/photos.html +++ b/templates/photos.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content},htmlType = 'photos',title = ${title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/post.html b/templates/post.html index 9e7223f1..b44dbf33 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'post',title = ${post.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/tag.html b/templates/tag.html index 1d1ea940..ab75f4e2 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'tag',title = ${'标签' + ': ' + tag.spec.displayName + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/tags.html b/templates/tags.html index 526d7c87..735050f3 100644 --- a/templates/tags.html +++ b/templates/tags.html @@ -1,7 +1,14 @@ + th:replace="~{modules/layouts/layout :: layout(content = ~{::content},htmlType = 'tag',title = ${'标签' + ' | ' + site.title}, head = ~{::head})}"> + + +
diff --git a/templates/todolist.html b/templates/todolist.html index 07033fb6..d5fcd46b 100644 --- a/templates/todolist.html +++ b/templates/todolist.html @@ -1,7 +1,13 @@ - + th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'page',title = ${singlePage.spec.title + ' | ' + site.title}, head = ~{::head})}"> + + +
From de4a4c695be442a0bc452e228a077664f2377549 Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <17683872107czx> Date: Tue, 10 Oct 2023 12:42:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Open=20Graph?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/modules/layouts/layout.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/modules/layouts/layout.html b/templates/modules/layouts/layout.html index 192b0380..ad9840a1 100644 --- a/templates/modules/layouts/layout.html +++ b/templates/modules/layouts/layout.html @@ -137,9 +137,8 @@