mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
✨ feat: 在設置裏配置js/css(CDN_USE)時可以設定其他參數 closes #152
✨ feat: readmode下可以切換darkmode和lightmode 💄 fix: 高分辨率下的界面適配 closes #163 🐛 fix: 修復DarkMode下,note標簽的顯示bug
This commit is contained in:
23
scripts/helpers/my-html.js
Normal file
23
scripts/helpers/my-html.js
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
|
||||
hexo.extend.helper.register("my_html", function(type, data) {
|
||||
var result = "";
|
||||
var tag = type === "css" ? "css" : "script";
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var src = data[i].split("||")[0].trim();
|
||||
var other = data[i].split("||")[1] ? data[i].split("||")[1].trim() : "";
|
||||
|
||||
if (tag === "css") {
|
||||
result +=
|
||||
'<link rel="stylesheet" href="' +
|
||||
this.url_for(src) +
|
||||
'" ' +
|
||||
other +
|
||||
">";
|
||||
} else {
|
||||
result +=
|
||||
'<script src="' + this.url_for(src) + '" ' + other + "></script>";
|
||||
}
|
||||
}
|
||||
return result;
|
||||
});
|
||||
Reference in New Issue
Block a user