diff --git a/layout/includes/page/says.pug b/layout/includes/page/says.pug index 9188cfe2..f0aae3d1 100644 --- a/layout/includes/page/says.pug +++ b/layout/includes/page/says.pug @@ -55,4 +55,4 @@ if theme.says.enable if theme.says.strip === -1 = _p('essay.tip0') else - = _p('essay.tip1').replace('{count}', theme.says.strip) + = _p('essay.tip1').replace('#{count}', theme.says.strip) diff --git a/layout/includes/widgets/page/about/skillsinfo.pug b/layout/includes/widgets/page/about/skillsinfo.pug index 0145441c..eef6bb00 100644 --- a/layout/includes/widgets/page/about/skillsinfo.pug +++ b/layout/includes/widgets/page/about/skillsinfo.pug @@ -10,10 +10,12 @@ if skills || careers span.author-content-item-title= skills.subtitle .skills-style-group .tags-group-all - .tags-group-wrapper + - let times = 4 * (skills.tags.length? Math.ceil(20/skills.tags.length):0) + - let length = times * skills.tags.length + - let duration = length * 1200 - 900 + .tags-group-wrapper(style=`animation-duration: ${duration}ms`) - var pair = [] - - let times = skills.tags.length? Math.ceil(20/skills.tags.length):0 - - for (let i = 0; i < 4 * times; i++) + - for (let i = 0; i < times; i++) each tag, index in skills.tags - pair.push(tag) if pair.length === 2 diff --git a/layout/includes/widgets/page/links/banner.pug b/layout/includes/widgets/page/links/banner.pug index 2297b7c7..0274f5e7 100644 --- a/layout/includes/widgets/page/links/banner.pug +++ b/layout/includes/widgets/page/links/banner.pug @@ -14,18 +14,18 @@ - if (site.data.links.swiper !== false) .tags-group-all.nowrapMove - .tags-group-wrapper - - const data = site.data.links.links - - var links = [] - each x in data - each y in x.link_list - - links.push(y) - - if (links.length) - - let originalLinks = links - - while (links.length<20) - - links = links.concat(originalLinks) - each i in [1,2] - - links = links.concat(links) + - const data = site.data.links.links + - var links = [] + each x in data + each y in x.link_list + - links.push(y) + - let times = 4 * (links.length? Math.ceil(20/links.length):0) + - let length = times * links.length + - let duration = length * 1500 - 1400 + - let originalLinks = links + - for (let i = 1; i < times; i++) + - links = links.concat(originalLinks) + .tags-group-wrapper(style=`animation-duration: ${duration}ms`) - var pairs = [] each link, index in links if (index % 2 === 0) diff --git a/package.json b/package.json index 2d376940..81706112 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-theme-solitude", - "version": "2.1.15", + "version": "2.1.16", "description": "A beautiful, powerful, and efficient Hexo theme developed by everfu.", "main": "package.json", "scripts": { diff --git a/scripts/helper/page.js b/scripts/helper/page.js index 355fb66b..e118d402 100644 --- a/scripts/helper/page.js +++ b/scripts/helper/page.js @@ -13,5 +13,6 @@ hexo.extend.helper.register('page_description', function () { }) hexo.extend.helper.register("urlNoIndex", function (url = null) { - return prettyUrls(url || this.url, { trailing_index: false, trailing_html: true }); + const { config } = this + return prettyUrls(url || this.url, config.pretty_urls); }); \ No newline at end of file diff --git a/source/js/main.js b/source/js/main.js index bbe12749..ad7d2d21 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -691,7 +691,7 @@ class tabs { const { expire } = GLOBAL_CONFIG; if (!expire) return; const list = document.querySelectorAll('.post-meta-date time'); - const post_date = list.length ? list[list.length - 1] : document.querySelector('.datatime'); + const post_date = list.length ? list[list.length - 1] : document.querySelector('.datetime'); if (!post_date) return; const ex = Math.ceil((new Date().getTime() - new Date(post_date.getAttribute('datetime')).getTime()) / 1000 / 60 / 60 / 24); if (expire.time > ex) return; @@ -734,7 +734,7 @@ const forPostFn = () => { window.refreshFn = () => { const { is_home, is_page, page, is_post } = PAGE_CONFIG; const { runtime, lazyload, lightbox, randomlink, covercolor, post_ai, lure, expire } = GLOBAL_CONFIG; - const timeSelector = (is_home ? '.post-meta-date time' : is_post ? '.post-meta-date time' : '.datatime') + ', .webinfo-item time'; + const timeSelector = (is_home ? '.post-meta-date time' : is_post ? '.post-meta-date time' : '.datetime') + ', .webinfo-item time'; document.body.setAttribute('data-type', page); sco.changeTimeFormat(document.querySelectorAll(timeSelector)); runtime && sco.addRuntime(); diff --git a/source/js/right_menu.js b/source/js/right_menu.js index f169967b..618163c5 100644 --- a/source/js/right_menu.js +++ b/source/js/right_menu.js @@ -123,7 +123,7 @@ window.oncontextmenu = (ele) => { rm.menuItems.copy.style.display = selectTextNow && window.getSelection() ? "flex" : "none"; GLOBAL_CONFIG.comment && (rm.menuItems.comment.style.display = selectTextNow && window.getSelection() ? "flex" : "none"); - rm.menuItems.search.style.display = selectTextNow && window.getSelection() ? "flex" : "none"; + rm.menuItems.search && (rm.menuItems.search.style.display = selectTextNow && window.getSelection() ? "flex" : "none"); rm.menuItems.new.style.display = link ? "flex" : "none"; rm.menuItems.copyLink.style.display = link ? "flex" : "none"; @@ -198,4 +198,4 @@ window.oncontextmenu = (ele) => { addEventListener(rm.menuItems.downloadImg, "click", () => rm.downloadImage() && rm.hideRightMenu()); addEventListener(rm.menuItems.copyImg, "click", () => rm.copyImage() && rm.hideRightMenu()); addEventListener(rm.menuItems.copyLink, "click", () => rm.copyText(rm.domhref) && rm.hideRightMenu()); -})(); \ No newline at end of file +})();