hexo-theme-stellar 1.30.4 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/_config.yml +30 -16
  2. package/_data/icons.yml +3 -3
  3. package/_data/widgets.yml +0 -1
  4. package/layout/_partial/comments/artalk/script.ejs +1 -2
  5. package/layout/_partial/comments/layout.ejs +1 -1
  6. package/layout/_partial/head.ejs +20 -1
  7. package/layout/_partial/main/navbar/ghinfo.ejs +1 -1
  8. package/layout/_partial/scripts/defines.ejs +9 -0
  9. package/layout/_partial/scripts/theme.ejs +3 -3
  10. package/layout/_partial/sidebar/index_leftbar.ejs +9 -9
  11. package/layout/_partial/widgets/ghissues.ejs +1 -1
  12. package/layout/_partial/widgets/ghrepo.ejs +2 -2
  13. package/layout/_partial/widgets/ghuser.ejs +1 -1
  14. package/layout/index.ejs +3 -1
  15. package/layout/layout.ejs +3 -1
  16. package/package.json +4 -2
  17. package/scripts/events/index.js +46 -4
  18. package/scripts/events/lib/fix_image_tags.js +44 -0
  19. package/scripts/events/lib/get_image_ratios.js +88 -0
  20. package/scripts/events/lib/version-check.js +86 -0
  21. package/scripts/helpers/json_ld.js +118 -0
  22. package/scripts/tags/lib/albums.js +2 -1
  23. package/scripts/tags/lib/friends.js +2 -1
  24. package/scripts/tags/lib/ghcard.js +3 -2
  25. package/scripts/tags/lib/image.js +16 -6
  26. package/scripts/tags/lib/posters.js +2 -1
  27. package/scripts/tags/lib/sites.js +2 -1
  28. package/scripts/tags/lib/timeline.js +1 -1
  29. package/scripts/tags/lib/video.js +4 -4
  30. package/source/css/_common/base.styl +1 -2
  31. package/source/css/_common/canonical.styl +32 -0
  32. package/source/css/_common/device.styl +6 -4
  33. package/source/css/_common/highlight.styl +1 -1
  34. package/source/css/_components/layout.styl +11 -10
  35. package/source/css/_components/list.styl +3 -0
  36. package/source/css/_components/main.styl +1 -1
  37. package/source/css/_components/md.styl +4 -2
  38. package/source/css/_components/pages/archives.styl +2 -2
  39. package/source/css/_components/pages/article-story.styl +6 -0
  40. package/source/css/_components/pages/article-tech.styl +1 -1
  41. package/source/css/_components/pages/notebook.styl +1 -1
  42. package/source/css/_components/partial/article-banner.styl +4 -1
  43. package/source/css/_components/partial/footer.styl +1 -1
  44. package/source/css/_components/partial/navbar.styl +2 -1
  45. package/source/css/_components/sidebar/nav-area.styl +1 -1
  46. package/source/css/_components/sidebar/search.styl +44 -21
  47. package/source/css/_components/sidebar/sidebar.styl +22 -18
  48. package/source/css/_components/tag-plugins/banner.styl +1 -1
  49. package/source/css/_components/tag-plugins/button.styl +3 -4
  50. package/source/css/_components/tag-plugins/copy.styl +1 -1
  51. package/source/css/_components/tag-plugins/friends.styl +1 -1
  52. package/source/css/_components/tag-plugins/gallery.styl +6 -0
  53. package/source/css/_components/tag-plugins/image.styl +10 -0
  54. package/source/css/_components/tag-plugins/media.styl +1 -1
  55. package/source/css/_components/tag-plugins/note.styl +1 -1
  56. package/source/css/_components/tag-plugins/override.styl +1 -1
  57. package/source/css/_components/tag-plugins/quot.styl +2 -2
  58. package/source/css/_components/tag-plugins/tabs.styl +4 -3
  59. package/source/css/_components/tag-plugins/timeline.styl +2 -2
  60. package/source/css/_components/tag-plugins/toc.styl +1 -1
  61. package/source/css/_components/widgets/list.styl +1 -3
  62. package/source/css/_components/widgets/markdown.styl +0 -7
  63. package/source/css/_components/widgets/toc.styl +6 -4
  64. package/source/css/_components/widgets/widgets.styl +0 -5
  65. package/source/css/_custom.styl +5 -7
  66. package/source/css/_defines/const.styl +1 -1
  67. package/source/css/_defines/func.styl +9 -5
  68. package/source/css/_defines/theme.styl +4 -15
  69. package/source/css/_plugins/comments/artalk.styl +114 -2
  70. package/source/css/_plugins/comments/twikoo.styl +3 -3
  71. package/source/css/_plugins/index.styl +5 -5
  72. package/source/css/_plugins/lazyload.styl +49 -2
  73. package/source/js/main.js +50 -0
  74. package/source/js/plugins/download-file.js +1 -1
  75. package/source/js/search/local-search.js +163 -151
  76. package/source/js/services/artalk_latest_comment.js +1 -1
  77. package/source/js/services/mdrender.js +0 -1
  78. package/layout/_partial/widgets/search.ejs +0 -0
@@ -0,0 +1,86 @@
1
+ const https = require('https');
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+ const packageName = 'hexo-theme-stellar';
5
+ const cacheFile = path.join(__dirname, '../../.cache/stellar-version.json');
6
+
7
+ function getLocalVersion() {
8
+ try {
9
+ return require(path.join(__dirname, '../../../package.json')).version;
10
+ } catch {
11
+ return '0.0.0';
12
+ }
13
+ }
14
+
15
+ function fetchLatestVersion(callback) {
16
+ const options = {
17
+ hostname: 'registry.npmjs.org',
18
+ path: `/${encodeURIComponent(packageName)}`,
19
+ headers: {
20
+ 'User-Agent': 'Hexo-Theme-Version-Check'
21
+ }
22
+ };
23
+
24
+ https.get(options, (res) => {
25
+ let rawData = '';
26
+ res.on('data', chunk => rawData += chunk);
27
+ res.on('end', () => {
28
+ try {
29
+ const data = JSON.parse(rawData);
30
+ const latest = data['dist-tags'].latest;
31
+ callback(null, latest);
32
+ } catch (err) {
33
+ callback(err);
34
+ }
35
+ });
36
+ }).on('error', err => callback(err));
37
+ }
38
+
39
+ function shouldCheck() {
40
+ if (!fs.existsSync(cacheFile)) return true;
41
+ try {
42
+ const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));
43
+ const time = new Date().toISOString().slice(0, 16); // 精确到分钟,例如 "2025-06-21T15:08"
44
+ return cache.time !== time;
45
+ } catch {
46
+ return true;
47
+ }
48
+ }
49
+
50
+ function writeCache(latestVersion) {
51
+ try {
52
+ fs.mkdirSync(path.dirname(cacheFile), { recursive: true });
53
+ fs.writeFileSync(cacheFile, JSON.stringify({
54
+ time: new Date().toISOString().slice(0, 16),
55
+ latest: latestVersion
56
+ }));
57
+ } catch {
58
+ // 忽略错误
59
+ }
60
+ }
61
+
62
+ module.exports = (ctx, options = { useCache: true }) => {
63
+ if (process.env.STELLAR_VERSION_CHECKED === '1') return;
64
+ process.env.STELLAR_VERSION_CHECKED = '1';
65
+
66
+ const localVersion = getLocalVersion();
67
+ if (options.useCache && !shouldCheck()) return;
68
+
69
+ fetchLatestVersion((err, latest) => {
70
+ if (err) return;
71
+ if (localVersion !== latest) {
72
+ console.log(``);
73
+ const line = '------------------------------------------------';
74
+ ctx.log.warn(`\x1b[33m${line}\x1b[0m`);
75
+ ctx.log.warn(``);
76
+ ctx.log.warn(` 本地版本: \x1b[33m${localVersion}\x1b[0m >>>> 最新版本: \x1b[32m${latest}\x1b[0m`);
77
+ ctx.log.warn(``);
78
+ ctx.log.warn(` 请尽快升级: npm i ${packageName}@latest`);
79
+ ctx.log.warn(``);
80
+ ctx.log.warn(`\x1b[33m${line}\x1b[0m`);
81
+ console.log(``);
82
+ }
83
+ if (options.useCache) writeCache(latest);
84
+ });
85
+
86
+ };
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Builds JSON-LD structured data for current page according to its type (page or post).
3
+ *
4
+ * @returns {string} - JSON-LD structured data
5
+ */
6
+ 'use strict';
7
+
8
+ const util = require('hexo-util');
9
+
10
+ hexo.extend.helper.register('json_ld', function(args) {
11
+ const page = this.page;
12
+ const config = this.config;
13
+ const structured_data = this.theme.structured_data;
14
+ const authorEmail = config.email;
15
+ const authorImage = config.avatar || (authorEmail ? this.gravatar(authorEmail) : null);
16
+
17
+ const author = {
18
+ '@type': 'Person',
19
+ name: config.author,
20
+ sameAs: structured_data.sameAs || []
21
+ };
22
+ // Google does not accept `Person` as item type for the publisher property
23
+ const publisher = Object.assign({}, author, {'@type': 'Organization'});
24
+ let schema = {};
25
+
26
+ if (authorImage) {
27
+ author.image = authorImage;
28
+ publisher.image = authorImage;
29
+ publisher.logo = {
30
+ '@type': 'ImageObject',
31
+ url: authorImage
32
+ };
33
+ }
34
+
35
+ if (this.is_post()) {
36
+ schema = {
37
+ '@context': 'https://schema.org',
38
+ '@type': 'BlogPosting',
39
+ author: author,
40
+ // articleBody: this.strip_html(page.content),
41
+ dateCreated: page.date.format(),
42
+ dateModified: page.updated.format(),
43
+ datePublished: page.date.format(),
44
+ description: this.strip_html(page.excerpt),
45
+ headline: page.title,
46
+ mainEntityOfPage: {
47
+ '@type': 'WebPage',
48
+ '@id': this.url_for(page.permalink)
49
+ },
50
+ publisher,
51
+ url: this.url_for(page.permalink)
52
+ };
53
+
54
+ if (page.tags && page.tags.length > 0) {
55
+ schema.keywords = page.tags.map((tag) => tag.name).join(', ');
56
+ }
57
+
58
+ let images = [];
59
+ if (page.photos && page.photos.length > 0) {
60
+ images = images.concat(page.photos);
61
+ }
62
+
63
+ if (page.cover?.length > 0) {
64
+ images = images.unshift(page.cover);
65
+ } else if (page.banner?.length > 0) {
66
+ images = images.unshift(page.banner);
67
+ }
68
+
69
+ schema.thumbnailUrl = page.cover || page.banner;
70
+ schema.image = images;
71
+
72
+ } else if (this.is_page() || this.is_home()) {
73
+
74
+ const url = this.is_home() ? config.url : this.url_for(page.permalink);
75
+ schema = {
76
+ '@context': 'https://schema.org',
77
+ '@type': 'Website',
78
+ '@id': url,
79
+ author: author,
80
+ name: page.title || config.title,
81
+ description: config.description,
82
+ url: url
83
+ };
84
+
85
+ if (config.keywords && config.keywords.length) {
86
+ if (Array.isArray(args)) {
87
+ schema.keywords = config.keywords.join(', ');
88
+ } else {
89
+ schema.keywords = config.keywords;
90
+ }
91
+ }
92
+ if (!this.is_home()) {
93
+
94
+ if (page.excerpt || page.description) {
95
+ schema.description = this.strip_html(page.description || page.excerpt);
96
+ } else {
97
+ schema.description = util.truncate(this.strip_html(page.content), {length: 200});
98
+ }
99
+
100
+ }
101
+
102
+ } else {
103
+
104
+ // default to WebPage for other layouts
105
+ schema = {
106
+ '@context': 'https://schema.org',
107
+ '@type': 'Website',
108
+ '@id': config.url,
109
+ author: author,
110
+ name: config.title,
111
+ description: config.description,
112
+ url: config.url
113
+ };
114
+
115
+ }
116
+
117
+ return `<script type="application/ld+json">${JSON.stringify(schema)}</script>`;
118
+ });
@@ -9,6 +9,7 @@
9
9
 
10
10
  module.exports = ctx => function(args) {
11
11
  var args = ctx.args.map(args, ['repo', 'api', 'size'], ['group'])
12
+ const host = ctx.theme.config.api_host.ghraw
12
13
  if (args.size == null) {
13
14
  args.size = 's'
14
15
  }
@@ -16,7 +17,7 @@ module.exports = ctx => function(args) {
16
17
  if (args.api) {
17
18
  api = args.api
18
19
  } else if (args.repo) {
19
- api = 'https://api.vlts.cc/output_data/v2/' + args.repo
20
+ api = `https://${host}/${args.repo}/output/v2/data.json`
20
21
  }
21
22
 
22
23
  var el = ''
@@ -9,11 +9,12 @@
9
9
 
10
10
  module.exports = ctx => function(args) {
11
11
  args = ctx.args.map(args, ['repo', 'api', 'posts'], ['group'])
12
+ const host = ctx.theme.config.api_host.ghraw
12
13
  var api
13
14
  if (args.api) {
14
15
  api = args.api
15
16
  } else if (args.repo) {
16
- api = 'https://api.vlts.cc/output_data/v2/' + args.repo
17
+ api = `https://${host}/${args.repo}/output/v2/data.json`
17
18
  }
18
19
 
19
20
  var el = `<div class="tag-plugin ${args.posts ? 'users-posts-wrap' : 'users-wrap'}">`
@@ -17,6 +17,7 @@ module.exports = ctx => function(args) {
17
17
  var params = ['show_owner', 'theme', 'title_color', 'text_color', 'icon_color', 'bg_color', 'hide_border', 'cache_seconds', 'locale']
18
18
  args = ctx.args.map(args, params, ['repo'])
19
19
  const path = args.repo
20
+ const host = ctx.theme.config.api_host.ghcard
20
21
  var el = ''
21
22
  el += '<div class="tag-plugin ghcard">'
22
23
  el += '<a class="ghcard" rel="external nofollow noopener noreferrer" href="https://github.com/' + path + '">'
@@ -24,10 +25,10 @@ module.exports = ctx => function(args) {
24
25
  if (path.includes('/')) {
25
26
  // is repo
26
27
  const ps = path.split('/')
27
- url += 'https://github-readme-stats.xaoxuu.com/api/pin/?username=' + ps[0] + '&repo=' + ps[1]
28
+ url = `https://${host}/api/pin/?username=${ps[0]}&repo=${ps[1]}`
28
29
  } else {
29
30
  // is user
30
- url += 'https://github-readme-stats.xaoxuu.com/api/?username=' + path
31
+ url = `https://${host}/api/?username=${path}`
31
32
  }
32
33
  url += '&' + ctx.args.joinURLParams(args, params)
33
34
  if (!url.includes('&show_owner=')) {
@@ -2,13 +2,13 @@
2
2
  * image.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
3
3
  * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
4
  *
5
- * {% image src [alt] [width:400px] [bg:#eee] [download:true/false/url] [fancybox:true/false/url] %}
5
+ * {% image src [alt] [width:400px] [bg:#eee] [download:true/false/url] [fancybox:true/false/url] [ratio] %}
6
6
  */
7
7
 
8
8
  'use strict'
9
9
 
10
10
  module.exports = ctx => function(args) {
11
- args = ctx.args.map(args, ['width', 'height', 'bg', 'download', 'padding', 'fancybox'], ['src', 'alt'])
11
+ args = ctx.args.map(args, ['width', 'height', 'bg', 'download', 'padding', 'fancybox', 'ratio'], ['src', 'alt'])
12
12
  var style = ''
13
13
  if (args.width) {
14
14
  style += 'width:' + args.width + ';'
@@ -39,7 +39,7 @@ module.exports = ctx => function(args) {
39
39
 
40
40
  function img(src, alt, style) {
41
41
  let img = ''
42
- img += '<img src="' + src + '"'
42
+ img += `<img src="${src}" data-src="${src}"`
43
43
  let a = '<a data-fancybox'
44
44
  if (alt) {
45
45
  img += ' alt="' + alt + '"'
@@ -48,9 +48,10 @@ module.exports = ctx => function(args) {
48
48
  if (fancybox && !fancyboxHref) {
49
49
  img += ` data-fancybox="${fancybox}"`
50
50
  }
51
- if (style.length > 0) {
51
+ if (style.length > 0 && !args.ratio) {
52
52
  img += ' style="' + style + '"'
53
53
  }
54
+ img += `onerror="this.src=&quot;${ctx.theme.config.default.image_onerror}&quot;"`
54
55
  img += '/>'
55
56
 
56
57
  if (fancyboxHref) {
@@ -65,8 +66,8 @@ module.exports = ctx => function(args) {
65
66
  // wrap
66
67
  el += '<div class="tag-plugin image">'
67
68
  // bg
68
- el += '<div class="image-bg"'
69
- if (args.bg || args.padding) {
69
+ el += `<div class="image-bg"`
70
+ if (args.bg || args.padding || args.ratio || style) {
70
71
  el += ' style="'
71
72
  if (args.bg && args.bg.length > 0) {
72
73
  el += 'background:' + args.bg + ';'
@@ -74,6 +75,15 @@ module.exports = ctx => function(args) {
74
75
  if (args.padding) {
75
76
  el += 'padding:' + args.padding + ';'
76
77
  }
78
+ if (args.ratio) {
79
+ el += 'aspect-ratio:' + args.ratio + ';'
80
+ if (style) {
81
+ el += style
82
+ }
83
+ } else if (style) {
84
+ // 如果设置了图片宽度,但没有长宽比,那背景区就要铺满宽度
85
+ el += 'width:100%;'
86
+ }
77
87
  el += '"'
78
88
  }
79
89
  el += '>'
@@ -9,6 +9,7 @@
9
9
 
10
10
  module.exports = ctx => function(args) {
11
11
  var args = ctx.args.map(args, ['repo', 'api', 'size'], ['group'])
12
+ const host = ctx.theme.config.api_host.ghraw
12
13
  if (args.size == null) {
13
14
  args.size = 'm'
14
15
  }
@@ -16,7 +17,7 @@ module.exports = ctx => function(args) {
16
17
  if (args.api) {
17
18
  api = args.api
18
19
  } else if (args.repo) {
19
- api = 'https://api.vlts.cc/output_data/v2/' + args.repo
20
+ api = `https://${host}/${args.repo}/output/v2/data.json`
20
21
  }
21
22
 
22
23
  var el = ''
@@ -9,11 +9,12 @@
9
9
 
10
10
  module.exports = ctx => function(args) {
11
11
  args = ctx.args.map(args, ['repo', 'api'], ['group'])
12
+ const host = ctx.theme.config.api_host.ghraw
12
13
  var api
13
14
  if (args.api) {
14
15
  api = args.api
15
16
  } else if (args.repo) {
16
- api = 'https://api.vlts.cc/output_data/v2/' + args.repo
17
+ api = `https://${host}/${args.repo}/output/v2/data.json`
17
18
  }
18
19
 
19
20
  var el = '<div class="tag-plugin sites-wrap">'
@@ -18,7 +18,7 @@ function layoutNodeTitle(ctx, content) {
18
18
  var el = ''
19
19
  el += '<div class="header">'
20
20
  if (content && content.length > 0) {
21
- el += content
21
+ el += `<span>${content}</span>`
22
22
  }
23
23
  el += '</div>'
24
24
  return el
@@ -14,7 +14,7 @@ module.exports = ctx => function (args) {
14
14
  args.width = '100%'
15
15
  }
16
16
  if (args.bilibili) {
17
- return `<div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16 / 9};max-width:${args.width};">
17
+ return `<div class="tag-plugin video-player" style="aspect-ratio:${args.ratio || 16 / 9};max-width:${args.width};">
18
18
  <iframe src="https://player.bilibili.com/player.html?bvid=${args.bilibili}&autoplay=${args.autoplay || 'false'}" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true">
19
19
  </iframe>
20
20
  </div>
@@ -26,14 +26,14 @@ module.exports = ctx => function (args) {
26
26
  } else {
27
27
  args.autoplay = '0'
28
28
  }
29
- return `<div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16 / 9};max-width:${args.width};">
29
+ return `<div class="tag-plugin video-player" style="aspect-ratio:${args.ratio || 16 / 9};max-width:${args.width};">
30
30
  <iframe style="border:none" src="https://www.youtube.com/embed/${args.youtube}?rel=0&disablekb=1&playsinline=1&autoplay=${args.autoplay}" picture-in-picture="true" allowfullscreen="true" >
31
31
  </iframe>
32
32
  </div>
33
33
  `
34
34
  }
35
- return `<div class="tag-plugin video" style="max-width:${args.width};">
36
- <video controls preload>
35
+ return `<div class="tag-plugin video-player" style="max-width:${args.width};">
36
+ <video controls preload playsinline webkit-playsinline>
37
37
  <source src="${args.src}" type="${args.type || 'video/mp4'}">Your browser does not support the video tag.
38
38
  </video>
39
39
  </div>
@@ -23,7 +23,6 @@ hr
23
23
  img
24
24
  max-width: 100%
25
25
 
26
-
27
26
  li
28
27
  font-size: 'calc(%s - 1px)' % var(--fsp)
29
28
 
@@ -46,7 +45,7 @@ table:not([class])
46
45
  background: var(--block)
47
46
  td,th
48
47
  padding: 0.5em 1em
49
- border: 1px solid var(--block-hover)
48
+ border: 1px solid var(--block-border)
50
49
  line-height: 1.5
51
50
  tr
52
51
  word-break: keep-all
@@ -0,0 +1,32 @@
1
+ .canonical-tip
2
+ position: fixed
3
+ text-align: center
4
+ bottom: 4rem
5
+ left: 50%
6
+ transform: translateX(-50%)
7
+ max-width: 90%
8
+ background-color: var(--block-border)
9
+ color: var(--text-p1)
10
+ font-size: 1rem
11
+ font-family: #fff8e1
12
+ z-index: 9999999
13
+ box-shadow: 0 2px 8px rgba(black, .1), 0 4px 16px rgba(black, .1), 0 8px 32px rgba(black, .1)
14
+ border-radius: 6px
15
+ .headline
16
+ font-size: $fsh2
17
+ a
18
+ display: block
19
+ color: inherit
20
+ padding: 1rem 2rem
21
+
22
+ .canonical-tip.unofficial
23
+ background-color: hsl(5, 100%, 60%)
24
+ color: white
25
+ animation: breathe 3s ease-in-out infinite
26
+ @keyframes breathe
27
+ 0%
28
+ background-color: hsl(5, 100%, 60%)
29
+ 50%
30
+ background-color: hsl(5, 100%, 30%)
31
+ 100%
32
+ background-color: hsl(5, 100%, 60%)
@@ -10,14 +10,13 @@
10
10
  .float-panel
11
11
  position: sticky
12
12
  grid-column-end: span 3
13
- padding: 4px
14
13
  --inset: 2rem
15
14
  right: 0
16
15
  bottom: calc(var(--inset) * 2)
17
16
  margin-left: auto
18
17
  margin-right: var(--inset)
19
18
  float: right
20
- z-index: 10
19
+ z-index: 999999
21
20
  display: flex
22
21
  justify-content: center
23
22
  flex-direction: column
@@ -26,6 +25,9 @@
26
25
  margin-right: 3rem
27
26
  overflow: hidden
28
27
  trans1: all
28
+ &:before,&:after
29
+ border-radius: 64px
30
+
29
31
  newblur()
30
32
 
31
33
 
@@ -34,8 +36,8 @@
34
36
  cursor: pointer
35
37
  color: var(--text)
36
38
  background: none
37
- width: 40px
38
- height: 40px
39
+ width: 48px
40
+ height: 48px
39
41
  line-height: 0
40
42
  font-size: 28px
41
43
  margin: 0
@@ -36,7 +36,7 @@ p>code:not([class]),li>code:not([class])
36
36
  display: block
37
37
  border-bottom-left-radius: $border-button
38
38
  border-bottom-right-radius: $border-button
39
- background: var(--block-hover)
39
+ background: var(--block-border)
40
40
  >table
41
41
  overflow: auto
42
42
  display: block
@@ -1,7 +1,9 @@
1
1
  .l_body
2
2
  display: grid
3
3
  grid-template-columns: 1fr minmax(200px,var(--width-main)) 1fr
4
- grid-gap: var(--gap-margin)
4
+ grid-gap: calc(var(--gap-margin) * 4)
5
+ @media screen and (max-width: $device-desktop)
6
+ grid-gap: calc(var(--gap-margin) * 2)
5
7
  margin: auto
6
8
  font-size: var(--fsp)
7
9
 
@@ -16,11 +18,10 @@
16
18
 
17
19
  .l_body .l_left
18
20
  justify-self: right
19
- top: 8px
21
+ top: calc(var(--gap-margin) * 2)
20
22
  .l_body .l_right
21
23
  justify-self: left
22
- --gap-margin: 0px
23
- max-height: calc(100% - 8px * 2)
24
+ max-height: calc(100% - calc(var(--gap-margin) * 2) * 2)
24
25
  .widgets
25
26
  height: 100%
26
27
  overflow visible
@@ -32,16 +33,16 @@
32
33
  .laptop-only
33
34
  display: block !important
34
35
  .l_body
36
+ grid-gap: calc(var(--gap-margin) * 1)
35
37
  .l_right
36
- top: 8px
37
38
  position: fixed
38
39
  transform: translateX(320px)
39
40
  transition: transform .38s ease-out
40
41
  margin: 0
41
42
  --inset: 8px
42
43
  right: var(--inset)
43
- top: var(--inset)
44
- max-height: 'calc(%s - %s)' % (100vh $rightbar-bottom-margin)
44
+ top: calc(var(--gap-margin) * 2)
45
+ max-height: 'calc(%s - %s * 2 - %s)' % (100vh var(--gap-margin) $rightbar-bottom-margin)
45
46
  box-shadow: $boxshadow-card-float
46
47
  z-index: 10
47
48
  background: var(--site-bg)
@@ -70,11 +71,11 @@
70
71
  margin: 0
71
72
  --inset: 8px
72
73
  left: var(--inset)
73
- top: var(--inset)
74
- max-height: 'calc(%s - %s)' % (100vh $leftbar-bottom-margin)
74
+ top: calc(var(--gap-margin) * 2)
75
+ max-height: 'calc(%s - %s * 2 - %s)' % (100vh var(--gap-margin) $leftbar-bottom-margin)
75
76
  .leftbar-container
76
77
  --inset: 8px
77
- height: 'calc(%s - %s)' % (100vh $leftbar-bottom-margin)
78
+ height: 'calc(%s - %s * 2 - %s)' % (100vh var(--gap-margin) $leftbar-bottom-margin)
78
79
  box-shadow: $boxshadow-card-float
79
80
  z-index: 10
80
81
  .l_main
@@ -120,13 +120,16 @@
120
120
  right: 0
121
121
  height: var(--blur-height)
122
122
  backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
123
+ -webkit-backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
123
124
  trans1 all
124
125
  &[position=top]:before
125
126
  top: 0
126
127
  mask: linear-gradient(black, rgba(black, 0.75), transparent)
128
+ -webkit-mask: linear-gradient(black, rgba(black, 0.75), transparent)
127
129
  &[position=bottom]:before
128
130
  bottom: 0
129
131
  mask: linear-gradient(transparent, rgba(black, 0.75), black)
132
+ -webkit-mask: linear-gradient(transparent, rgba(black, 0.75), black)
130
133
  .cover-info
131
134
  padding: 1.5rem 1rem
132
135
  position: absolute
@@ -2,7 +2,7 @@
2
2
  position: relative
3
3
  padding-bottom: var(--gap-max)
4
4
  @media screen and (min-width: $device-mobile-max)
5
- padding-top: 8px
5
+ padding-top: calc(var(--gap-margin) * 2)
6
6
  header
7
7
  margin: 2rem 1rem 1rem
8
8
  .logo-wrap
@@ -24,7 +24,7 @@
24
24
  ul:not(:last-child),
25
25
  ol:not(:last-child)
26
26
  padding-bottom: .5rem
27
- margin: 0
27
+ margin: 0 .25rem
28
28
  blockquote,ul,ol
29
29
  p,ul,ol
30
30
  --fsp: $fsp1
@@ -75,9 +75,11 @@
75
75
 
76
76
  // 图片样式
77
77
  .md-text img
78
- border-radius: $border-image
79
78
  margin: auto
80
79
  display: block
80
+ .md-text.content
81
+ p>img, .tag-plugin.image .image-bg
82
+ border-radius: $border-image
81
83
 
82
84
  // 链接样式
83
85
  li:not([class]) a:not([class])
@@ -67,7 +67,7 @@
67
67
  opacity: .5
68
68
  font-size: $fs-12
69
69
  &:hover
70
- background: var(--block-hover)
70
+ background: var(--block-border)
71
71
  color: var(--text)
72
72
  .badge
73
73
  opacity: 1
@@ -99,7 +99,7 @@
99
99
  color $color-theme
100
100
  opacity: 1
101
101
  color: var(--text)
102
- background: var(--block-hover)
102
+ background: var(--block-border)
103
103
 
104
104
  @media screen and (min-width: $device-mobile)
105
105
  .post-list.author #archive
@@ -1,5 +1,9 @@
1
1
  .l_body[type=story] .md-text.content
2
2
  --fsp: 'calc(%s + 1px)' % $fs-body
3
+ --gap-p: 2rem
4
+ div.tag-plugin,p>img
5
+ margin-top: 2.4rem
6
+ margin-bottom: 2.4rem
3
7
  // 段落标题
4
8
  h1,h2,h3,h4,h5,h6
5
9
  color: var(--text)
@@ -116,6 +120,8 @@
116
120
  text-indent: 0
117
121
  text-align: convert(hexo-config('style.text-align'))
118
122
 
123
+ p>img, .tag-plugin.image .image-bg
124
+ border-radius: $border-image-l
119
125
 
120
126
 
121
127
  .l_body[type=story] .article.banner .content .bottom.only-title
@@ -1,4 +1,4 @@
1
- .l_body[type='tech'] .md-text
1
+ .l_body[type='tech'] article.content
2
2
  h1,h2,h3,h4,h5,h6
3
3
  color: var(--text)
4
4
  line-height: 1.8
@@ -24,7 +24,7 @@
24
24
  color $color-theme
25
25
  opacity: 1
26
26
  color: var(--text)
27
- background: var(--block-hover)
27
+ background: var(--block-border)
28
28
 
29
29
  .post-list .post-card .meta.cap .tag
30
30
  &:before