From 0ba25b2c8e4a93987f9ad0527339df6ed901c00b Mon Sep 17 00:00:00 2001 From: liuyihui Date: Mon, 12 Feb 2024 18:54:58 +0800 Subject: [PATCH] archive --- .npmrc | 1 + languages/zh-CN.yml | 19 ++++- languages/zh-HK.yml | 10 ++- layout/_layout.pug | 3 + layout/_third-party/comments/waline.pug | 16 +++- .../css/_common/components/header/index.styl | 6 +- .../_common/components/plugins/friends.styl | 2 +- source/css/_custom/_common.styl | 82 +++++++++++++++++++ source/css/_custom/index.styl | 5 +- source/css/_variables/color.styl | 6 +- 10 files changed, 136 insertions(+), 14 deletions(-) create mode 100644 .npmrc create mode 100644 source/css/_custom/_common.styl diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..d470650d --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +store-dir=/home/ubuntu/.pnpm-store diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml index 116ce54e..120b8eb4 100644 --- a/languages/zh-CN.yml +++ b/languages/zh-CN.yml @@ -12,10 +12,21 @@ nav: # 导航栏菜单 menu: home: 首页 + article: 文章 archives: 归档 categories: 分类 tags: 标签 - about: 关于 + About: 关于 + site: 本站 + friends: 友人 + friendlink: 友链 + friendcircle: 友圈 + lab: 实验室 + run: 跑步 + statistics: 统计 + other: 其他 + boundfor: 开往 + goto: 虫洞 # 归档页、分类页、标签页 page: @@ -43,9 +54,9 @@ social: segmentfault: 思否 zhihu: 知乎 weibo: 微博 - wechat: 微信 - telegram: Telegram - qq: QQ + Bilibili: BiliBili + Email: 邮箱 + # 文章 post: diff --git a/languages/zh-HK.yml b/languages/zh-HK.yml index 9f607e0c..3e345fb9 100644 --- a/languages/zh-HK.yml +++ b/languages/zh-HK.yml @@ -12,10 +12,18 @@ nav: # 巡覽列選單 menu: home: 首頁 + article: 文章 archives: 歸檔 categories: 分類 tags: 標籤 - about: 關於 + About: 關於 + Author: 作者 + bb: 哔哔 + gallery: 相册 + reward: 打赏 + friends: 友链 + lab: 實驗室 + boundfor: 開往 # 歸檔頁、分類頁、標籤頁 page: diff --git a/layout/_layout.pug b/layout/_layout.pug index 281b9fc9..6e2eea4a 100644 --- a/layout/_layout.pug +++ b/layout/_layout.pug @@ -1,4 +1,5 @@ - + var SW_URL = '/sw_init.js'; var HEXO_URL = 'http://hexo.io/'; var STUN_URL = 'https://github.com/liuyib/hexo-theme-stun/'; var isNoHeader = !theme.header.enable || (is_post() && !theme.header.show_on.post); @@ -22,6 +23,8 @@ } var ccUrl = `https://creativecommons.org/licenses/${ccLicense}/4.0/deed.${ccLanguage}`; +script(src=SW_URL) + doctype html html(lang=config.language) head diff --git a/layout/_third-party/comments/waline.pug b/layout/_third-party/comments/waline.pug index 1757a9e7..06c5d04f 100644 --- a/layout/_third-party/comments/waline.pug +++ b/layout/_third-party/comments/waline.pug @@ -46,7 +46,21 @@ script&attributes(dataPjax). admin: '!{theme.waline.locale.admin}', placeholder: '!{theme.waline.locale.placeholder}' }, - reaction: !{theme.waline.reaction} + reaction: !{theme.waline.reaction}, + imageUploader: function(file) { + let formData = new FormData(); + let headers = new Headers(); + + formData.append('file', file); + headers.append('Authorization', '!{theme.waline.imageUploader.token}'); + headers.append('Accept', 'application/json'); + + return fetch('!{theme.waline.imageUploader.url}', { + method: 'POST', + headers: headers, + body: formData + }).then(resp => resp.json()).then(resp => resp.data.links.url); + } }); } diff --git a/source/css/_common/components/header/index.styl b/source/css/_common/components/header/index.styl index 6a1265f1..700699eb 100644 --- a/source/css/_common/components/header/index.styl +++ b/source/css/_common/components/header/index.styl @@ -102,12 +102,12 @@ if (hexo-config('header.nav.height') && match('%', hexo-config('header.nav.heigh &-menu-item__link { padding: 0 .5rem; - menuItemHover(#f4f5f5, #999); + menuItemHover(#2d2e30, #a09d9b); } &-submenu-item__link { padding: .75rem .5rem; - menuItemHover(#f4f5f5, #999); + menuItemHover(#2d2e30, #a09d9b); } &-menu { @@ -118,7 +118,7 @@ if (hexo-config('header.nav.height') && match('%', hexo-config('header.nav.heigh &-item { float: left; position: relative; - margin: 0 1rem 0 0; + margin: 0 0.25rem 0 0; height: header-nav-height; text-align: center; cursor: pointer; diff --git a/source/css/_common/components/plugins/friends.styl b/source/css/_common/components/plugins/friends.styl index f4393f4f..bea66aae 100644 --- a/source/css/_common/components/plugins/friends.styl +++ b/source/css/_common/components/plugins/friends.styl @@ -6,7 +6,7 @@ display: flex; float: left; padding: .5rem 1rem; - width: 50%; + width: 33%; height: 100px; transition: background-color .3s; align-items: center; diff --git a/source/css/_custom/_common.styl b/source/css/_custom/_common.styl new file mode 100644 index 00000000..a9b4e0d9 --- /dev/null +++ b/source/css/_custom/_common.styl @@ -0,0 +1,82 @@ +// 图片设置 +.content img { + border: none; + margin: 5px auto; + max-height: 300px; +} + +img.inline { + vertical-align: -4px; + display: inline-block; + height: 20px +} + +// 脚注 +.footnotes-list { + padding-inline-start: 20px; +} +.footnote-item { + line-height: 125% !important; + font-size: 12px; +} + +// 评论表情 +.wl-content img { + display: inline; +} + +.wl-content img[src^="https://img.t.sinajs.cn"] +{ + width: 1.25em; + margin: 0.25em; + vertical-align: middle; +} + +// 顶部栏 +@media (max-width: $md-width) { + .header-nav-menu-item__link { + color: #2d2e30; + } +} + +/*哔哩哔哩视频适配*/ +.bilibili { + position: relative; + width: 100%; +} +@media only screen and (max-width: 767px) { + .bilibili {height: 15em;max-width: 25em;} +} +@media only screen and (min-width: 768px) and (max-width: 991px) { + .bilibili {height: 20em;max-width: 30em;} +} +@media only screen and (min-width: 992px) and (max-width: 1199px) { + .bilibili {height: 30em;max-width: 40em;} +} +@media only screen and (min-width: 1200px) { + .bilibili {height: 40em;max-width: 50em;} +} + +// Module color +// ------------------------------------------- +// Header +$header-bg-color = #ffebd7 +$header-text-color = #2d2e30 +$header-nav-bg-color = #ffebd7 +$header-menu-hover-color = $blue-light + +// Footer +$footer-bg-color = #2d2e30 +$footer-text-color = #f5f6f7 +$footer-link-color = #c20808 +$footer-link-hover-color = #ed0b0b + +// 其他 +h1 { + margin: .67em 0; + font-size: 1.8em !important; +} + +.fa,.fa-brands,.fa-duotone,.fa-light,.fa-regular,.fa-solid { + line-height: inherit !important; +} \ No newline at end of file diff --git a/source/css/_custom/index.styl b/source/css/_custom/index.styl index 8b68738f..ace77002 100644 --- a/source/css/_custom/index.styl +++ b/source/css/_custom/index.styl @@ -1,3 +1,6 @@ // Custom styles by yourself. // You should always modify the style here, not in the source code. -// Otherwise, when the theme is updated, the code you modified will be overwritten. \ No newline at end of file +// Otherwise, when the theme is updated, the code you modified will be overwritten. + +// common +@import './_common.styl'; diff --git a/source/css/_variables/color.styl b/source/css/_variables/color.styl index 0d8dab22..7ccfdbf7 100644 --- a/source/css/_variables/color.styl +++ b/source/css/_variables/color.styl @@ -31,9 +31,9 @@ $hr-color = #b8dcfd // Module color // ------------------------------------------- // Header -$header-bg-color = #2d2e30 -$header-text-color = #f5f6f7 -$header-nav-bg-color = #2d2e30 +$header-bg-color = #ffebd7 +$header-text-color = #2d2e30 +$header-nav-bg-color = #ffebd7 $header-menu-hover-color = $blue-light // Footer