commit
909c11d920
66 changed files with 3458 additions and 2330 deletions
@ -0,0 +1,82 @@ |
||||
--- |
||||
name: 帮助流程A:使用遇到问题(主题未经修改) |
||||
about: 此流程适用于直接使用主题搭建博客的用户,在仅仅修改了主题配置文件、Hexo配置文件、增加了自己的文章,这种情况下无法成功搭建或者部署的问题。 |
||||
title: '' |
||||
labels: 'help-a' |
||||
assignees: '' |
||||
|
||||
--- |
||||
|
||||
<!-- 如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 --> |
||||
|
||||
## 自检报告 |
||||
|
||||
分类:使用遇到问题(主题未经修改) |
||||
|
||||
<!-- 如果您未按照模板中的步骤进行自检,我们可能不会阅读您的 Issue。 --> |
||||
<!-- 90% 的问题可通过自检解决。 --> |
||||
|
||||
<!-- Change [ ] to [x] to select (将 [ ] 换成 [x] 来完成选择) --> |
||||
|
||||
### 第一步 <!-- 60% 的问题通过这一步就解决了。 --> |
||||
|
||||
- [ ] 在 [Volantis](https://volantis.js.org) 文档中搜索关键词,并未找到相关内容。 |
||||
- [ ] 在 [Hexo](https://hexo.io/zh-cn/docs/) 官方文档 中搜索关键词,并未找到相关内容。 |
||||
|
||||
### 第二步 <!-- 30% 的问题通过这一步就解决了。 --> |
||||
|
||||
下载[文档源码](https://github.com/xaoxuu/volantis-docs/),然后下载主题源码到 themes/volantis ,执行 `npm install` 安装依赖包,执行 `hexo s` 运行,查看结果是否存在相同的问题。 |
||||
|
||||
- A. 如果正常,请一步一步将配置文件修改为您原来的设定,直至找到出问题的地方。 |
||||
- B. 如果依然存在异常,请检查 Hexo 环境配置,或者重新安装 Hexo。 |
||||
|
||||
- [ ] 我已完成上述操作,结果是:____ |
||||
|
||||
### 第三步 |
||||
|
||||
- [ ] 我已经将主题升级到最新版本。 |
||||
|
||||
## 问题描述 |
||||
|
||||
<!-- 尽可能详细地描述您的问题 --> |
||||
|
||||
## 环境信息 |
||||
|
||||
<!-- 请务必提供以下信息 --> |
||||
|
||||
### 复现地址: |
||||
<!-- 如果使用文档官网源码本地运行也存在异常,可以不用提供复现地址。 --> |
||||
|
||||
### 截图: |
||||
<!-- 不同系统、浏览器效果可能不同,提供截图有助于发现问题所在。 --> |
||||
|
||||
### 浏览器、操作系统 |
||||
|
||||
|
||||
### 站点配置文件 |
||||
<!-- 只粘贴 `blog/_config.yml` 中修改过的部分 --> |
||||
```yml |
||||
|
||||
``` |
||||
|
||||
### 主题配置文件 |
||||
<!-- 只粘贴 `themes/volantis/_config.yml` 中修改过的部分 --> |
||||
```yml |
||||
|
||||
``` |
||||
|
||||
#### 更多信息 |
||||
|
||||
<!-- 要求提供时再回来补全即可 --> |
||||
|
||||
#### node.js & npm |
||||
<!-- 粘贴 `node -v && npm -v` 输出的信息 --> |
||||
``` |
||||
|
||||
``` |
||||
|
||||
#### package.json |
||||
<!-- 粘贴 `npm ls --depth 0` 输出的信息 --> |
||||
``` |
||||
|
||||
``` |
@ -0,0 +1,80 @@ |
||||
--- |
||||
name: 帮助流程B:使用遇到问题(主题文件 ejs、js、css、第三方插件等有修改) |
||||
about: 此流程适用于 fork 主题并对主题文件(ejs、js、css 等)进行了修改后搭建博客的用户,无法成功搭建或者部署的问题。 |
||||
title: '' |
||||
labels: 'help-b' |
||||
assignees: '' |
||||
|
||||
--- |
||||
|
||||
<!-- 如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 --> |
||||
|
||||
## 自检报告 |
||||
|
||||
分类:使用遇到问题(主题文件 ejs、js、css、第三方插件等有修改) |
||||
|
||||
<!-- 如果您未按照模板中的步骤进行自检,我们可能不会阅读您的 Issue。 --> |
||||
<!-- 80% 的问题可通过自检解决。 --> |
||||
|
||||
<!-- Change [ ] to [x] to select (将 [ ] 换成 [x] 来完成选择) --> |
||||
|
||||
### 第一步 <!-- 80% 的问题通过这一步就解决了。 --> |
||||
|
||||
查看未经修改的主题是否也存在此问题: |
||||
|
||||
- A. 未经修改的主题也存在此问题,请使用 issue 模板「帮助流程A. 使用遇到问题(主题未经修改)」。 |
||||
- B. 未经修改的主题不存在此问题,在 git 历史中新建分支还原修改,直至找到出问题的地方。 |
||||
|
||||
- [ ] 我已完成上述操作,结果是:____ |
||||
|
||||
### 第二步 |
||||
|
||||
这部分内容是否与第三方插件有关? |
||||
|
||||
- A. 是主题文档中提到过的第三方插件(意味着有主动兼容),请在问题描述中描述清楚。 |
||||
- B. 是主题文档中没有提到过的第三方插件,可能存在没有兼容的情况,请使用 issue 模板「提交一个建议」。 |
||||
|
||||
## 问题描述 |
||||
|
||||
<!-- 尽可能详细地描述您的问题 --> |
||||
|
||||
## 环境信息 |
||||
|
||||
<!-- 请务必提供以下信息 --> |
||||
|
||||
### 复现地址: |
||||
<!-- 如果使用文档官网源码本地运行也存在异常,可以不用提供复现地址。 --> |
||||
|
||||
### 截图: |
||||
<!-- 不同系统、浏览器效果可能不同,提供截图有助于发现问题所在。 --> |
||||
|
||||
### 浏览器、操作系统 |
||||
|
||||
|
||||
### 站点配置文件 |
||||
<!-- 只粘贴 `blog/_config.yml` 中修改过的部分 --> |
||||
```yml |
||||
|
||||
``` |
||||
|
||||
### 主题配置文件 |
||||
<!-- 只粘贴 `themes/volantis/_config.yml` 中修改过的部分 --> |
||||
```yml |
||||
|
||||
``` |
||||
|
||||
#### 更多信息 |
||||
|
||||
<!-- 要求提供时再回来补全即可 --> |
||||
|
||||
#### node.js & npm |
||||
<!-- 粘贴 `node -v && npm -v` 输出的信息 --> |
||||
``` |
||||
|
||||
``` |
||||
|
||||
#### package.json |
||||
<!-- 粘贴 `npm ls --depth 0` 输出的信息 --> |
||||
``` |
||||
|
||||
``` |
@ -1,67 +1,72 @@ |
||||
--- |
||||
name: Bug Report |
||||
about: Something isn't working as expected |
||||
name: 反馈一个明确的BUG |
||||
about: 此流程适用于您已经定位到了问题的具体所在,不需要协助定位问题。希望开发者予以修正。 |
||||
title: '' |
||||
labels: 'new,question' |
||||
labels: 'bug-report' |
||||
assignees: '' |
||||
|
||||
--- |
||||
|
||||
If you delete this template, we may close your issue without conducting an investigation. |
||||
如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 |
||||
<!-- 如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 --> |
||||
|
||||
Please check if your Issue fulfills the following requirements. This will guide you to resolve the issue quickly. |
||||
请务必确认您在提交此 Issue 前已经查看并完成了下列检查单中的所有事项。这会指导您快速地解决问题。 |
||||
## BUG描述 |
||||
|
||||
## Issue Checklist <!-- 我确认我已经查看了 --> |
||||
<!-- Change [ ] to [x] to select (将 [ ] 换成 [x] 来选择) --> |
||||
<!-- 尽可能详细地描述您的问题,包括预期与实际表现的区别 --> |
||||
|
||||
- [ ] I am using [the latest](https://github.com/xaoxuu/hexo-theme-volantis/releases/latest) version of Volantis. |
||||
- [ ] I have reviewed [guidelines for Volantis](https://volantis.js.org), which does not help me. |
||||
- [ ] I have reviewed the latest Roadmap on GitHub and searched for current issues, which does not help me. |
||||
## 复现报告 |
||||
|
||||
*** |
||||
分类:反馈一个明确的BUG |
||||
|
||||
## Expected behavior <!-- 预期行为 --> |
||||
<!-- 如果您未按照模板中的步骤进行自检,我们可能不会阅读您的 Issue。 --> |
||||
|
||||
<!-- Change [ ] to [x] to select (将 [ ] 换成 [x] 来完成选择) --> |
||||
|
||||
## Actual behavior <!-- 实际行为 --> |
||||
<!-- Please provide at least one of the following information (请至少提供以下的一项信息) --> |
||||
- [ ] 将主题升级至最新版本。 |
||||
- [ ] 下载主题官网源码运行,经过一定的步骤,可以复现此BUG。 |
||||
|
||||
- Links to demo site with this issue: N/A |
||||
- Links to repository or source code of the blog: N/A |
||||
### 复现步骤 |
||||
|
||||
1. xxx |
||||
2. xxx |
||||
3. xxx |
||||
|
||||
## Steps to reproduce the behavior <!-- 重现步骤 --> |
||||
1. N/A |
||||
2. N/A |
||||
3. N/A |
||||
## 环境信息 |
||||
|
||||
<!-- 请务必提供以下信息 --> |
||||
|
||||
## Environment Information |
||||
### 复现地址: |
||||
<!-- 如果使用文档官网源码本地运行也存在异常,可以不用提供复现地址。 --> |
||||
|
||||
### Node.js and NPM Information |
||||
<!-- Paste output from `node -v && npm -v` (粘贴 `node -v && npm -v` 输出的信息) --> |
||||
``` |
||||
### 截图: |
||||
<!-- 不同系统、浏览器效果可能不同,提供截图有助于发现问题所在。 --> |
||||
|
||||
``` |
||||
### 浏览器、操作系统 |
||||
|
||||
### Package dependencies Information |
||||
<!-- Paste output from `npm ls --depth 0` (粘贴 `npm ls --depth 0` 输出的信息) --> |
||||
``` |
||||
|
||||
### 站点配置文件 |
||||
<!-- 只粘贴 `blog/_config.yml` 中修改过的部分 --> |
||||
```yml |
||||
|
||||
``` |
||||
|
||||
### Hexo Configuration |
||||
<!-- Paste configuration from Hexo `_config.yml` (粘贴 Hexo `_config.yml` 中的内容) --> |
||||
### 主题配置文件 |
||||
<!-- 只粘贴 `themes/volantis/_config.yml` 中修改过的部分 --> |
||||
```yml |
||||
|
||||
``` |
||||
|
||||
### Volantis Configuration |
||||
<!-- Paste ONLY CHANGED CONFIGURATION from Volantis `_config.yml` (只粘贴 Volantis 主题配置文件 `_config.yml` 中修改过的部分) --> |
||||
```yml |
||||
#### 更多信息 |
||||
|
||||
<!-- 要求提供时再回来补全即可 --> |
||||
|
||||
#### node.js & npm |
||||
<!-- 粘贴 `node -v && npm -v` 输出的信息 --> |
||||
``` |
||||
|
||||
``` |
||||
|
||||
## Other Information <!-- (Like Browser, System, Screenshots) --> |
||||
#### package.json |
||||
<!-- 粘贴 `npm ls --depth 0` 输出的信息 --> |
||||
``` |
||||
|
||||
``` |
||||
|
@ -1,21 +1,21 @@ |
||||
--- |
||||
name: Feature Request |
||||
about: Suggest an idea for this project |
||||
name: 提交一个建议 |
||||
about: 希望增加或者调整某项功能 |
||||
title: '' |
||||
labels: 'new,suggest' |
||||
labels: 'suggest' |
||||
assignees: '' |
||||
|
||||
--- |
||||
|
||||
If you delete this template, we may close your issue without conducting an investigation. |
||||
如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 |
||||
<!-- 如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 --> |
||||
|
||||
Please check if your Issue fulfills the following requirements. This will guide you to resolve the issue quickly. |
||||
请务必确认您在提交此 Issue 前已经查看并完成了下列检查单中的所有事项。这会指导您快速地解决问题。 |
||||
### 自检报告 |
||||
|
||||
## Issue Checklist <!-- 我确认我已经查看了 --> |
||||
<!-- Change [ ] to [x] to select (将 [ ] 换成 [x] 来选择) --> |
||||
|
||||
- [ ] I am using [the latest](https://github.com/xaoxuu/hexo-theme-volantis/releases/latest) version of Volantis. |
||||
- [ ] I have reviewed [guidelines for Volantis](https://volantis.js.org), which does not help me. |
||||
- [ ] I have reviewed the latest Roadmap on GitHub and searched for current issues, which does not help me. |
||||
- [ ] 我已阅读主题文档,确认不存在此功能。 |
||||
- [ ] 我已阅读Hexo官方文档,确认不存在此功能。 |
||||
|
||||
## 需求描述 |
||||
|
||||
<!-- 如果能够提供参考链接或者示意图更好 --> |
||||
|
@ -1,21 +1,14 @@ |
||||
--- |
||||
name: Other Issue |
||||
about: Others |
||||
about: 要表述的内容不属于上述模板的范围 |
||||
title: '' |
||||
labels: 'new' |
||||
labels: '' |
||||
assignees: '' |
||||
|
||||
--- |
||||
|
||||
If you delete this template, we may close your issue without conducting an investigation. |
||||
如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 |
||||
<!-- 如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 --> |
||||
|
||||
Please check if your Issue fulfills the following requirements. This will guide you to resolve the issue quickly. |
||||
请务必确认您在提交此 Issue 前已经查看并完成了下列检查单中的所有事项。这会指导您快速地解决问题。 |
||||
|
||||
## Issue Checklist <!-- 我确认我已经查看了 --> |
||||
<!-- Change [ ] to [x] to select (将 [ ] 换成 [x] 来选择) --> |
||||
|
||||
- [ ] I am using [the latest](https://github.com/xaoxuu/hexo-theme-volantis/releases/latest) version of Volantis. |
||||
- [ ] I have reviewed [guidelines for Volantis](https://volantis.js.org), which does not help me. |
||||
- [ ] I have reviewed the latest Roadmap on GitHub and searched for current issues, which does not help me. |
||||
- [ ] 我要说的内容与帮助或者BUG、建议都无关。(如果有关,请使用相关模板) |
||||
|
@ -1,55 +0,0 @@ |
||||
--- |
||||
name: Question Report |
||||
about: I have a question for Volantis (e.g. Customize) |
||||
title: '' |
||||
labels: 'new,question' |
||||
assignees: '' |
||||
|
||||
--- |
||||
|
||||
If you delete this template, we may close your issue without conducting an investigation. |
||||
如果您删除此模版,我们可能会在不进行调查的情况下关闭您的 Issue。 |
||||
|
||||
Please check if your Issue fulfills the following requirements. This will guide you to resolve the issue quickly. |
||||
请务必确认您在提交此 Issue 前已经查看并完成了下列检查单中的所有事项。这会指导您快速地解决问题。 |
||||
|
||||
## Issue Checklist <!-- 我确认我已经查看了 --> |
||||
<!-- Change [ ] to [x] to select (将 [ ] 换成 [x] 来选择) --> |
||||
|
||||
- [ ] I am using [the latest](https://github.com/xaoxuu/hexo-theme-volantis/releases/latest) version of Volantis. |
||||
- [ ] I have reviewed [guidelines for Volantis](https://volantis.js.org), which does not help me. |
||||
- [ ] I have reviewed the latest Roadmap on GitHub and searched for current issues, which does not help me. |
||||
|
||||
*** |
||||
|
||||
## Describe your question <!-- 描述您的问题 --> |
||||
|
||||
|
||||
|
||||
## Environment Information |
||||
|
||||
### Node.js and NPM Information |
||||
<!-- Paste output from `node -v && npm -v` (粘贴 `node -v && npm -v` 输出的信息) --> |
||||
``` |
||||
|
||||
``` |
||||
|
||||
### Package dependencies Information |
||||
<!-- Paste output from `npm ls --depth 0` (粘贴 `npm ls --depth 0` 输出的信息) --> |
||||
``` |
||||
|
||||
``` |
||||
|
||||
### Hexo Configuration |
||||
<!-- Paste configuration from Hexo `_config.yml` (粘贴 Hexo `_config.yml` 中的内容) --> |
||||
```yml |
||||
|
||||
``` |
||||
|
||||
### Volantis Configuration |
||||
<!-- Paste ONLY CHANGED CONFIGURATION from Volantis `_config.yml` (只粘贴 Volantis 主题配置文件 `_config.yml` 中修改过的部分) --> |
||||
```yml |
||||
|
||||
``` |
||||
|
||||
## Other Information <!-- (Like Browser, System, Screenshots) --> |
@ -1,15 +1,13 @@ |
||||
<% if(isPostList){ %> |
||||
<h2 class="title"> |
||||
<a href="<%- url_for(post.link || post.path) %>"> |
||||
<%- post.title ? post.title : date(post.date, theme.meta.date.format) %> |
||||
<%- (post.title || post.seo_title) ? (post.title || post.seo_title) : date(post.date, theme.meta.date.format) %> |
||||
</a> |
||||
</h2> |
||||
<% } else { %> |
||||
<% if (post.title || page.title || config.title) { %> |
||||
<h1 class="title"> |
||||
<a href="<%- url_for(post.link || post.path) %>"> |
||||
<%- post.title ? post.title : date(post.date, theme.meta.date.format) %> |
||||
</a> |
||||
</h1> |
||||
<% } %> |
||||
<h1 class="title"> |
||||
<a href="<%- url_for(post.link || post.path) %>"> |
||||
<%- (post.title || post.seo_title) ? (post.title || post.seo_title) : date(post.date, theme.meta.date.format) %> |
||||
</a> |
||||
</h1> |
||||
<% } %> |
||||
|
@ -1,18 +1,43 @@ |
||||
<script src="<%- theme.plugins.fancybox.js %>"></script> |
||||
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script> |
||||
<script> |
||||
let LAZY_LOAD_IMAGE = "<%- config.lazyload %>"; |
||||
$(".article-entry").find("div.fancybox").find("img").each(function () { |
||||
var element = document.createElement("a"); |
||||
$(element).attr("data-fancybox", "gallery"); |
||||
function pjax_fancybox() { |
||||
$(".article-entry").find("img").not('.inline').not('a img').each(function () { //渲染 fancybox |
||||
var element = document.createElement("a"); // a 标签 |
||||
$(element).attr("pjax-fancybox", ""); // 过滤 pjax |
||||
$(element).attr("href", $(this).attr("src")); |
||||
/* 图片采用懒加载处理时, |
||||
* 一般图片标签内会有个属性名来存放图片的真实地址,比如 data-original, |
||||
* 那么此处将原本的属性名src替换为对应属性名data-original, |
||||
* 修改如下 |
||||
*/ |
||||
if (LAZY_LOAD_IMAGE) { |
||||
$(element).attr("href", $(this).attr("data-original")); |
||||
} |
||||
$(this).wrap(element); |
||||
if ($(this).attr("data-original")) { |
||||
$(element).attr("href", $(this).attr("data-original")); |
||||
} |
||||
$(element).attr("data-fancybox", "images"); |
||||
var caption = ""; // 描述信息 |
||||
if ($(this).attr('alt')) { // 标准 markdown 描述信息 |
||||
$(element).attr('data-caption', $(this).attr('alt')); |
||||
caption = $(this).attr('alt'); |
||||
} |
||||
var div = document.createElement("div"); |
||||
$(div).addClass("fancybox"); |
||||
$(this).wrap(div); // 最外层套 div ,其实主要作用还是 class 样式 |
||||
var span = document.createElement("span"); |
||||
$(span).addClass("image-caption"); |
||||
$(span).text(caption); // 加描述 |
||||
$(this).after(span); // 再套一层描述 |
||||
$(this).wrap(element); // 最后套 a 标签 |
||||
}) |
||||
$(".article-entry").find("img").fancybox({ |
||||
selector: '[data-fancybox="images"]', |
||||
hash: false, |
||||
loop: false, |
||||
closeClick: true, |
||||
helpers: { |
||||
overlay: {closeClick: true} |
||||
}, |
||||
buttons: [ |
||||
"zoom", |
||||
"close" |
||||
] |
||||
}); |
||||
}; |
||||
$(function () { |
||||
pjax_fancybox(); |
||||
}); |
||||
</script> |
||||
|
@ -1,19 +1,52 @@ |
||||
<script async src="<%- theme.plugins.mathjax %>"></script> |
||||
<script async src="https://cdn.jsdelivr.net/npm/mathjax@3.0/es5/tex-mml-chtml.js"></script> |
||||
<!-- MathJax配置,可通过单美元符号书写行内公式等 --> |
||||
|
||||
<script> |
||||
window.MathJax = { |
||||
tex: { |
||||
inlineMath: [ ["$", "$"], ["\\(","\\)"] ], |
||||
displayMath: [ ['$$','$$'], ["\\[","\\]"] ], |
||||
processEscapes: true, |
||||
tags: "ams", |
||||
macros: { |
||||
href: "{}" |
||||
} |
||||
}, |
||||
options: { |
||||
ignoreHtmlClass: "tex2jax_ignore|dno", |
||||
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code'] |
||||
if (typeof MathJax === 'undefined') { |
||||
window.MathJax = { |
||||
loader: { |
||||
source: { |
||||
'[tex]/amsCd': '[tex]/amscd', |
||||
'[tex]/AMScd': '[tex]/amscd' |
||||
} |
||||
}, |
||||
tex: { |
||||
inlineMath: {'[+]': [['$', '$']]}, |
||||
tags: 'ams' |
||||
}, |
||||
options: { |
||||
renderActions: { |
||||
findScript: [10, doc => { |
||||
document.querySelectorAll('script[type^="math/tex"]').forEach(node => { |
||||
const display = !!node.type.match(/; *mode=display/); |
||||
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display); |
||||
const text = document.createTextNode(''); |
||||
node.parentNode.replaceChild(text, node); |
||||
math.start = {node: text, delim: '', n: 0}; |
||||
math.end = {node: text, delim: '', n: 0}; |
||||
doc.math.push(math); |
||||
}); |
||||
}, '', false], |
||||
insertedScript: [200, () => { |
||||
document.querySelectorAll('mjx-container').forEach(node => { |
||||
let target = node.parentNode; |
||||
if (target.nodeName.toLowerCase() === 'li') { |
||||
target.parentNode.classList.add('has-jax'); |
||||
} |
||||
}); |
||||
}, '', false] |
||||
} |
||||
} |
||||
}; |
||||
(function () { |
||||
var script = document.createElement('script'); |
||||
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3.0/es5/tex-mml-chtml.js'; |
||||
script.defer = true; |
||||
document.head.appendChild(script); |
||||
})(); |
||||
} else { |
||||
MathJax.startup.document.state(0); |
||||
MathJax.texReset(); |
||||
MathJax.typeset(); |
||||
} |
||||
}; |
||||
</script> |
||||
|
@ -1,9 +1,9 @@ |
||||
<% (widgets||[]).forEach(function(widget){ %> |
||||
<% if (theme.widget && (widget in theme.widget)){ %> |
||||
<% let w = theme.widget[widget]; %> |
||||
<% let w = theme.widget[widget]; w.id = widget; %> |
||||
<%- partial(w.class, {item: w, where: where}) %> |
||||
<% } else if (site.data.widget && (widget in site.data.widget)){ %> |
||||
<% let w = site.data.widget[widget]; %> |
||||
<% let w = site.data.widget[widget]; w.id = widget; %> |
||||
<%- partial(w.class, {item: w, where: where}) %> |
||||
<% } %> |
||||
<% }) %> |
||||
|
@ -0,0 +1,53 @@ |
||||
'use strict'; |
||||
|
||||
function postCheckbox(args) { |
||||
args = args.join(' ').split(',') |
||||
var cls = '' |
||||
var text = '' |
||||
var checked = false |
||||
if (args.length > 1) { |
||||
cls = (args[0] || '').trim() |
||||
if (cls.length > 0) { |
||||
cls = ' ' + cls |
||||
} |
||||
if (cls.indexOf('checked') > -1) { |
||||
checked = true |
||||
} |
||||
text = (args[1] || '').trim() |
||||
} else if (args.length > 0) { |
||||
text = (args[0] || '').trim() |
||||
} |
||||
if (text.length > 0) { |
||||
return `<div class='checkbox${cls}'><input type="checkbox" ${ checked ? 'checked="checked"' : '' }/>
|
||||
${hexo.render.renderSync({text: text, engine: 'markdown'}).split('\n').join('')} |
||||
</div>` |
||||
} |
||||
} |
||||
function postRadio(args) { |
||||
args = args.join(' ').split(',') |
||||
var cls = '' |
||||
var text = '' |
||||
var checked = false |
||||
if (args.length > 1) { |
||||
cls = (args[0] || '').trim() |
||||
if (cls.length > 0) { |
||||
cls = ' ' + cls |
||||
} |
||||
if (cls.indexOf('checked') > -1) { |
||||
checked = true |
||||
} |
||||
text = (args[1] || '').trim() |
||||
} else if (args.length > 0) { |
||||
text = (args[0] || '').trim() |
||||
} |
||||
if (text.length > 0) { |
||||
return `<div class='checkbox${cls}'><input type="radio" ${ checked ? 'checked="checked"' : '' }/>
|
||||
${hexo.render.renderSync({text: text, engine: 'markdown'}).split('\n').join('')} |
||||
</div>` |
||||
} |
||||
} |
||||
// {% checkbox text %}
|
||||
// {% checkbox checked, text %}
|
||||
// {% checkbox color checked, text %}
|
||||
hexo.extend.tag.register('checkbox', postCheckbox); |
||||
hexo.extend.tag.register('radio', postRadio); |
@ -0,0 +1,44 @@ |
||||
'use strict'; |
||||
|
||||
function postImage(args) { |
||||
args = args.join(' ').split(',') |
||||
let url = (args[0]||'').trim() |
||||
let title = '' |
||||
let width = '' |
||||
let cls = '' |
||||
function getP2(p2) { |
||||
let px = p2.match(/^[0-9]*px$/g) |
||||
if (px) { |
||||
width = px[0] |
||||
} else if (p2 == 'inline') { |
||||
cls = 'class="inline"' |
||||
} else { |
||||
title = p2 |
||||
} |
||||
} |
||||
if (args.length > 2) { |
||||
getP2(args[1].trim()) |
||||
getP2(args[2].trim()) |
||||
} else if (args.length > 1) { |
||||
getP2(args[1].trim()) |
||||
} |
||||
if (width.length > 0) { |
||||
if (title.length > 0) { |
||||
return `<img src='${url}' alt='${title}' style='width:${width}'>`; |
||||
} else { |
||||
return `<img src='${url}' style='width:${width}'>`; |
||||
} |
||||
} else { |
||||
if (title.length > 0) { |
||||
return `<img src='${url}' alt='${title}'>`; |
||||
} else { |
||||
return `<img src='${url}'>`; |
||||
} |
||||
} |
||||
} |
||||
|
||||
// {% image url %}
|
||||
// {% image url, title %}
|
||||
// {% image url, width(px) %}
|
||||
// {% image url, title, width(px) %}
|
||||
hexo.extend.tag.register('image', postImage); |
@ -0,0 +1,191 @@ |
||||
article .checkbox |
||||
display: flex |
||||
align-items: center |
||||
input |
||||
-webkit-appearance: none |
||||
-moz-appearance: none |
||||
-ms-appearance: none |
||||
-o-appearance: none |
||||
appearance: none |
||||
position: relative |
||||
height: 16px |
||||
width: 16px |
||||
transition:all .15s ease-out 0s |
||||
cursor: pointer |
||||
display: inline-block |
||||
outline: none |
||||
border-radius: 2px |
||||
flex-shrink: 0 |
||||
margin-right: 8px |
||||
if hexo-config('style.body.checkbox.enable') != true |
||||
pointer-events: none |
||||
/* Checkbox */ |
||||
input[type=checkbox] |
||||
&:before, &:after |
||||
position: absolute |
||||
content: "" |
||||
background: #fff |
||||
&:before |
||||
left: 1px |
||||
top: 5px |
||||
width: 0px |
||||
height: 2px |
||||
transition: all .2s ease-in |
||||
transform: rotate(45deg) |
||||
-webkit-transform: rotate(45deg) |
||||
-moz-transform: rotate(45deg) |
||||
-ms-transform: rotate(45deg) |
||||
-o-transform: rotate(45deg) |
||||
&:after |
||||
right: 7px |
||||
bottom: 3px |
||||
width: 2px |
||||
height: 0px |
||||
transition: all .2s ease-out |
||||
transform: rotate(40deg) |
||||
-webkit-transform: rotate(40deg) |
||||
-moz-transform: rotate(40deg) |
||||
-ms-transform: rotate(40deg) |
||||
-o-transform: rotate(40deg) |
||||
transition-delay: .25s |
||||
&:checked |
||||
&:before |
||||
left: 0px |
||||
top: 7px |
||||
width: 6px |
||||
height: 2px |
||||
&:after |
||||
right: 3px |
||||
bottom: 1px |
||||
width: 2px |
||||
height: 10px |
||||
&.minus input[type=checkbox] |
||||
&:before |
||||
transform: rotate(0) |
||||
left: 1px |
||||
top: 5px |
||||
width: 0px |
||||
height: 2px |
||||
&:after |
||||
transform: rotate(0) |
||||
left: 1px |
||||
top: 5px |
||||
width: 0px |
||||
height: 2px |
||||
&:checked |
||||
&:before |
||||
left: 1px |
||||
top: 5px |
||||
width: 10px |
||||
height: 2px |
||||
&:after |
||||
left: 1px |
||||
top: 5px |
||||
width: 10px |
||||
height: 2px |
||||
&.plus input[type=checkbox] |
||||
&:before |
||||
transform: rotate(0) |
||||
left: 1px |
||||
top: 5px |
||||
width: 0px |
||||
height: 2px |
||||
&:after |
||||
transform: rotate(0) |
||||
left: 5px |
||||
top: 1px |
||||
width: 2px |
||||
height: 0px |
||||
&:checked |
||||
&:before |
||||
left: 1px |
||||
top: 5px |
||||
width: 10px |
||||
height: 2px |
||||
&:after |
||||
left: 5px |
||||
top: 1px |
||||
width: 2px |
||||
height: 10px |
||||
&.times input[type=checkbox] |
||||
&:before |
||||
transform: rotate(45deg) |
||||
left: 3px |
||||
top: 1px |
||||
width: 0px |
||||
height: 2px |
||||
&:after |
||||
transform: rotate(135deg) |
||||
right: 3px |
||||
top: 1px |
||||
width: 0px |
||||
height: 2px |
||||
&:checked |
||||
&:before |
||||
left: 1px |
||||
top: 5px |
||||
width: 10px |
||||
height: 2px |
||||
&:after |
||||
right: 1px |
||||
top: 5px |
||||
width: 10px |
||||
height: 2px |
||||
/* Radio */ |
||||
input[type=radio] |
||||
border-radius: 50% |
||||
&:before |
||||
content: "" |
||||
display: block |
||||
width: 8px |
||||
height: 8px |
||||
border-radius: 50% |
||||
margin: 2px |
||||
transform: scale(0) |
||||
transition: all .25s ease-out |
||||
&:checked:before |
||||
transform: scale(1) |
||||
/* Colors */ |
||||
input |
||||
$c = convert(hexo-config('style.body.checkbox.color')) || $color-theme |
||||
border: 2px solid $c |
||||
&[type=checkbox]:checked |
||||
background: $c |
||||
&[type=radio]:checked:before |
||||
background: $c |
||||
&.red input |
||||
border-color: $color-mac-red |
||||
&[type=checkbox]:checked |
||||
background: $color-mac-red |
||||
&[type=radio]:checked:before |
||||
background: $color-mac-red |
||||
&.green input |
||||
border-color: $color-mac-green |
||||
&[type=checkbox]:checked |
||||
background: $color-mac-green |
||||
&[type=radio]:checked:before |
||||
background: $color-mac-green |
||||
&.yellow input |
||||
border-color: $color-mac-yellow |
||||
&[type=checkbox]:checked |
||||
background: $color-mac-yellow |
||||
&[type=radio]:checked:before |
||||
background: $color-mac-yellow |
||||
&.cyan input |
||||
border-color: $color-mac-cyan |
||||
&[type=checkbox]:checked |
||||
background: $color-mac-cyan |
||||
&[type=radio]:checked:before |
||||
background: $color-mac-cyan |
||||
&.blue input |
||||
border-color: $color-md-blue |
||||
&[type=checkbox]:checked |
||||
background: $color-md-blue |
||||
&[type=radio]:checked:before |
||||
background: $color-md-blue |
||||
|
||||
article .checkbox |
||||
p |
||||
display: inline-block |
||||
margin-top: 2px !important |
||||
margin-bottom: 0 !important |
@ -0,0 +1,7 @@ |
||||
@media screen and (max-width: $device-mobile) |
||||
.l_header |
||||
.list-v |
||||
.aplayer,.aplayer-pic |
||||
border-radius: $border-card * 0.5 |
||||
width: 64px |
||||
height: 64px |
@ -0,0 +1,11 @@ |
||||
.article |
||||
mjx-container |
||||
font-family: $fontfamily-code |
||||
background: $color-mathjax |
||||
padding: $gap $gap * 0.5 |
||||
border-radius: $border-codeblock |
||||
min-width: 0 !important |
||||
mjx-container[jax="CHTML"][display="true"], .has-jax |
||||
overflow: auto hidden |
||||
mjx-container + br |
||||
display: none |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue