hexo-theme-ayeria 1.9.10 → 1.9.11
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.
- package/layout/_partial/sidebar.ejs +17 -2
- package/package.json +1 -1
- package/source/dist/main.js +1 -1
|
@@ -6,9 +6,24 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
<% } %>
|
|
8
8
|
<ul class="nav nav-main">
|
|
9
|
-
<% for (var
|
|
9
|
+
<% for (var key in theme.menu) {
|
|
10
|
+
var item = theme.menu[key];
|
|
11
|
+
var isObj = typeof item === 'object';
|
|
12
|
+
var url = isObj ? item.url : item;
|
|
13
|
+
var target = isObj ? (item.target || 'current') : 'current';
|
|
14
|
+
%>
|
|
10
15
|
<li class="nav-item">
|
|
11
|
-
<a class="nav-item-link"
|
|
16
|
+
<a class="nav-item-link"
|
|
17
|
+
href="<%- url_for(url) %>"
|
|
18
|
+
<% if (target === 'blank') { %>
|
|
19
|
+
target="_blank" rel="noopener noreferrer"
|
|
20
|
+
<% } else if (target === 'popup') { %>
|
|
21
|
+
data-target="popup"
|
|
22
|
+
data-popup-name="popup-<%= key %>"
|
|
23
|
+
data-popup-width="<%= item.popup_width || 380 %>"
|
|
24
|
+
data-popup-height="<%= item.popup_height || 620 %>"
|
|
25
|
+
<% } %>
|
|
26
|
+
><%= key %></a>
|
|
12
27
|
</li>
|
|
13
28
|
<% } %>
|
|
14
29
|
</ul>
|
package/package.json
CHANGED
package/source/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e;function t(e,t){e=e.replace(/<%-sUrl%>/g,encodeURIComponent(t.sUrl)).replace(/<%-sTitle%>/g,encodeURIComponent(t.sTitle)).replace(/<%-sDesc%>/g,encodeURIComponent(t.sDesc)).replace(/<%-sPic%>/g,encodeURIComponent(t.sPic));window.open(e)}function a(){var e=document.querySelector(".share-wrap");e&&e.classList.remove("open")}function s(){var e=document.querySelector(".share-wrap");e&&(e.classList.contains("open")?a():function(){var e=document.querySelector(".share-wrap");e&&e.classList.add("open")}())}function
|
|
1
|
+
!function(){"use strict";var e;function t(e,t){e=e.replace(/<%-sUrl%>/g,encodeURIComponent(t.sUrl)).replace(/<%-sTitle%>/g,encodeURIComponent(t.sTitle)).replace(/<%-sDesc%>/g,encodeURIComponent(t.sDesc)).replace(/<%-sPic%>/g,encodeURIComponent(t.sPic));window.open(e)}function a(){var e=document.querySelector(".share-wrap");e&&e.classList.remove("open")}function s(){var e=document.querySelector(".share-wrap");e&&(e.classList.contains("open")?a():function(){var e=document.querySelector(".share-wrap");e&&e.classList.add("open")}())}function o(){var e=document.querySelector(".wx-share-modal"),t=document.querySelector("#share-mask");e&&e.classList.remove("visible"),t&&t.classList.remove("active")}function r(e,a){"weibo"===e?t("http://service.weibo.com/share/share.php?url=<%-sUrl%>&title=<%-sTitle%>&pic=<%-sPic%>",a):"qq"===e?t("http://connect.qq.com/widget/shareqq/index.html?url=<%-sUrl%>&title=<%-sTitle%>&source=<%-sDesc%>",a):"douban"===e?t("https://www.douban.com/share/service?image=<%-sPic%>&href=<%-sUrl%>&name=<%-sTitle%>&text=<%-sDesc%>",a):"qzone"===e?t("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=<%-sUrl%>&title=<%-sTitle%>&pics=<%-sPic%>&summary=<%-sDesc%>",a):"facebook"===e?t("https://www.facebook.com/sharer/sharer.php?u=<%-sUrl%>",a):"twitter"===e?t("https://twitter.com/intent/tweet?text=<%-sTitle%>&url=<%-sUrl%>",a):"google"===e?t("https://plus.google.com/share?url=<%-sUrl%>",a):"weixin"===e&&function(){var e=document.querySelector(".wx-qrcode-img");e&&e.dataset.url&&!e.dataset.loaded&&(e.src=e.dataset.url,e.dataset.loaded="1");var t=document.querySelector(".wx-share-modal"),a=document.querySelector("#share-mask");t&&t.classList.add("visible"),a&&a.classList.add("active")}()}!function(e){let t=e(".search-form-wrap"),a=!1;e(".nav-item-search").on("click",()=>{var s;a||(a=!0,t.addClass("on"),s=function(){e(".local-search-input").focus()},setTimeout(function(){a=!1,s&&s()},200))}),e(document).on("mouseup",a=>{const s=e(".local-search");s.is(a.target)||0!==s.has(a.target).length||t.removeClass("on")}),e(".local-search").length&&e.getScript("/js/search.js",function(){searchFunc("/search.xml","local-search-input","local-search-result")}),e("img.lazy").lazyload({effect:"fadeIn"}),e("#gallery").justifiedGallery({rowHeight:200,margins:5}),e(document).ready(function(e){e(".anchor").on("click",function(t){t.preventDefault(),e("main").animate({scrollTop:e(".cover").height()},"smooth")})}),(()=>{const t=e("#totop");t.hide(),e(".content").on("scroll",()=>{e(".content").scrollTop()>1e3?e(t).stop().fadeTo(200,.6):e(t).stop().fadeTo(200,0)}),e(t).on("click",()=>(e(".content").animate({scrollTop:0},1e3),!1))})(),e(".article-entry").each(function(t){e(this).find("img").each(function(){if(e(this).parent().is("a"))return;const{alt:t}=this;t&&e(this).after('<span class="caption">'+t+"</span>")})});const s=e(".content"),o=e(".sidebar");function r(e){var t=document.querySelector("iframe.giscus-frame");t&&t.contentWindow.postMessage({giscus:{setConfig:{theme:e}}},"https://giscus.app")}e(".navbar-toggle").on("click",()=>{e(".content,.sidebar").addClass("anim"),s.toggleClass("on"),o.toggleClass("on")}),e(".nav-main").on("click",'.nav-item-link[data-target="popup"]',function(t){t.preventDefault();var a=e(this);window.open(a.attr("href"),a.data("popup-name"),"width="+a.data("popup-width")+",height="+a.data("popup-height"))}),e(document).on("click",".reward-trigger, #reward-btn",function(){var t=e("#reward"),a=e("#mask");t.length&&(a.fadeIn(150),t.addClass("visible"))}),e(document).on("click","#reward .reward-close, #mask",function(){e("#mask").fadeOut(100),e("#reward").removeClass("visible")}),e(document).on("click",".reward-tab",function(){var t=e(this),a=t.data("index");e(".reward-tab").removeClass("active"),t.addClass("active"),e(".reward-panel").removeClass("active"),e('.reward-panel[data-index="'+a+'"]').addClass("active")}),e(document).on("click",".reward-sub-tab",function(){var t=e(this),a=t.data("parent"),s=t.data("sub"),o=e('.reward-panel[data-index="'+a+'"]');o.find(".reward-sub-tab").removeClass("active"),t.addClass("active"),o.find(".reward-sub-panel").removeClass("active"),o.find('.reward-sub-panel[data-sub="'+s+'"]').addClass("active")}),e(document).on("keydown",function(t){"Escape"===t.key&&(e("#mask").fadeOut(100),e("#reward").removeClass("visible"))}),0==sessionStorage.getItem("darkmode")?(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"),r("light")):(e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"),r("dark")),e("#todark").on("click",()=>{0==sessionStorage.getItem("darkmode")?(e("body").addClass("darkmode"),e("#todark i").removeClass("ri-moon-line").addClass("ri-sun-line"),sessionStorage.setItem("darkmode",1),r("dark")):(e("body").removeClass("darkmode"),e("#todark i").removeClass("ri-sun-line").addClass("ri-moon-line"),sessionStorage.setItem("darkmode",0),r("light"))});console.log("%c%s%c%s%c%s","background-color: #49b1f5; color: #fff; padding: 8px; font-size: 14px;","主题不错?⭐star 支持一下 ->","background-color: #ffbca2; padding: 8px; font-size: 14px;","https://github.com/KaleidScoper/hexo-theme-ayeria","background-color: #eaf8ff;","\n\n _ __ _______ _____ \n / \\ \\ \\ / / ____| _ \\ \n / _ \\ \\ V /| _| | |_) | \n / ___ \\ | | | |___| _ < \n /_/ \\_\\ _| |_____|_| \\__\\ \n")}(jQuery),e={id:"JGjrOr2rebvP6q2a",ck:"JGjrOr2rebvP6q2a"},function(){var t=window,a=document,s=e,o="".concat("https:"===a.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),r=a.createElement("script"),n=a.getElementsByTagName("script")[0];r.type="text/javascript",r.setAttribute("charset","UTF-8"),r.async=!0,r.src=o,r.id="LA_COLLECT",s.d=r;var c=function(){t.LA.ids.push(s)};t.LA?t.LA.ids&&c():(t.LA=e,t.LA.ids=[],c()),n.parentNode.insertBefore(r,n)}();(()=>{var e=document.querySelector(".share-outer");if(e){var t=window.location.href,n=document.querySelector("title").innerHTML,c=document.querySelectorAll(".article-entry img"),i=c.length?c[0].getAttribute("src"):"";""===i||/^(http:|https:)?\/\//.test(i)||(i=window.location.origin+i);var l={sUrl:t,sPic:i,sTitle:n,sDesc:n};e.addEventListener("click",s),document.addEventListener("click",function(e){e.target.closest(".share-btn")||a()}),document.querySelectorAll(".share-sns[data-type]").forEach(function(e){e.addEventListener("click",function(){a(),r(e.getAttribute("data-type"),l)})});var d=document.querySelector("#share-mask"),u=document.querySelector(".wx-modal-close");d&&d.addEventListener("click",o),u&&u.addEventListener("click",o)}})()}();
|