iotcat 4 years ago
parent 7cae351271
commit 04cef00e5d
  1. 2
      .gitignore
  2. 183
      _config.yml
  3. 2
      layout/_layout.swig
  4. 2
      layout/_macro/archive.swig
  5. 4
      layout/_macro/post.swig
  6. 1
      layout/_partial/_head/ushio.swig
  7. 2
      layout/_partial/_post/toc.swig
  8. 2
      layout/_partial/footer.swig
  9. 8
      layout/_partial/header.swig
  10. 4
      layout/_partial/pagination.swig
  11. 6
      layout/_partial/slideout.swig
  12. 19
      layout/_script/_comments/valine.swig
  13. 1
      layout/_script/pjax.swig
  14. 4
      layout/index.swig
  15. 6
      layout/post.swig

2
.gitignore vendored

@ -28,7 +28,7 @@ coverage
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
# config
_config.yml
#_config.yml
.grunt
# Bower dependency directory (https://bower.io/)

@ -0,0 +1,183 @@
# ===========================================
# Site Information Settings
# ===========================================
# Site creation time
since: 2018
# Custom your favicon.ico in `site/source`
favicon: /favicon.ico
# Set feed link (false | default | your feed link)
# false: disable
# default: use `atom.xml`, generator for `hexo-generator-feed`
rss: default
# ===========================================
# Menu Settings
# ===========================================
menu:
Archives: {path: /archives/, zh: '归档'}
Categories: {path: /categories/, zh: '分类'}
Projects: {path: '#', zh: '项目', submenus: {fp: { path: https://fp.yimian.xyz/, zh: 'fp'}, wiot: {path: https://wiot.yimian.xyz/, zh: 'wiot'}}}
Map: {path: '#', zh: '导航', submenus: {APIs: {path: https://api.yimian.xyz/, zh: '接口'}, Imgs: {path: https://img.yimian.xyz/, zh: '图库'}, Imgbed: {https://imgbed.yimian.xyz/, zh: '图床'}, Fileshare: {path: https://share.yimian.xyz/, zh: '文件分享'}, Monitor: {path: https://monitor.yimian.xyz/, zh: '监控'}, ACG.WATCH: {path: https://acg.watch/, zh: '视频'}, Oneindex: {path: https://onedrive.yimian.xyz/, zh: '网盘'}, Proxy: {path: https://proxy.yimian.xyz/, zh: '下载代理'}, ShortenURL: {path: https://shorturl.yimian.xyz/, zh: '短链'}}}
About: {path: '#', zh: '关于', submenus: {links: {path: /links/, pjax: true}, Me: {path: https://iotcat.me/}}}
# ===========================================
# Theme Settings
# ===========================================
# color: default | mint green | cobalt blue | hot pink | dark violet
color: mint green
# default page mode: default | archives
mode: default
toc: true
# jQuery fancybox
fancybox: true
# LaTeX support (via MathJax)
latex: true
# mermaid support
mermaid: true
# Ushio supprot
ushio: true
# Post reading time Tips
readingTime: true
copyright:
enable: true
authorUrl: https://iotcat.me/
# https://creativecommons.org/
license: '<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>'
reward:
enable: false
qrCode:
wechat:
alipay:
# 底部版权心跳
shaky: true
# pjax support
pjax:
enable: true
loadingbar: true
# cdn support
cdnurl: https://cdn.yimian.xyz/kayo
# ===========================================
# Social links Settings
# ===========================================
social:
email: i@iotcat.me
stack-overflow:
twitter:
facebook:
linkedin:
google:
github: https://github.com/iotcat
weibo:
zhihu:
douban:
pocket:
tumblr:
instagram:
# ===========================================
# Third Party Services Settings
# ===========================================
# Baidu Analytics
baidu_analytics:
# Baidu Verification
baidu_verification:
# Google Analytics
google_analytics: UA-169276192-1
# Google Verification
google_verification:
# Disqus
disqus_shortname:
#Changyan
changyan:
appid:
appkey:
#LiveRe
livere_datauid:
# aplayer 网易云歌单播放
aplayer:
enable: false
playlist: 808097971
limit: 14
random: true
api: https://api.yimian.xyz/msc/
autoplay: false
loop: all
color: #00CBFF
# 是否开启dplayer
dplayer:
enable: true
# Valine Comments
# 配置邮件提醒参考https://github.com/IoTcat/Valine-Admin
valine:
enable: true
appId: eVzpK7EyT6OafJvXWIRminWT-gzGzoHsz
appKey: 2qjuEBgVE0BscTQnTmoS9roU
background: https://cdn.jsdelivr.net/gh/drew233/cdn/20200409110727.webp
masterEmailMd5: 9b616ff4cd6c305e5970bee7b1bd9b1f
friendsEmailMd5: '"b6ddef7c7e1c647e7767afeacdfb7b64","46dd4e6fef4f9591736c4723a965ca2e","6132d77f9f0ae060bc733090991acecb","3e00e104b79d7c6e866c6b23c6ba6dfc"'
statistic: true
# Gitalk
# Demo: https://gitalk.github.io
# https://github.com/gitalk/gitalk
gitalk:
enable: false
github_id: iotcat
repo: eee.dog-comments
client_id:
client_secret:
admin_user: iotcat
distraction_free_mode: true # Facebook-like distraction free mode
# Gitalk's display language depends on user's browser or system environment
# If you want everyone visiting your site to see a uniform language, you can set a force language value
# Available values: en, es-ES, fr, ru, zh-CN, zh-TW
language:
# utterances
# Docs: https://utteranc.es/
# Tips: Make sure you have installed [utterances app](https://github.com/apps/utterances) in your repo
utterances:
enable: false
repo: owner/repo # Repository
issueTerm: title # Blog post ↔ issue mapping: pathname | url | title | og:title
theme: github-light # Theme: github-light | github-dark | github-dark-orange | icy-dark | dark-blue | photon-dark
label: utterances # Issue label
# ===========================================
# Version
# ===========================================
version: 1.0.0

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html lang="{{ config.language }}">
<head>
{%- include '_partial/head.swig' %}
<title>{%- block title -%}{%- endblock -%}</title>
{%- include '_partial/head.swig' %}
</head>
<body>

@ -44,7 +44,7 @@
</span>
<span class="archive-post-title">
<a href="{{ url_for(post.path) }}" class="archive-post-link">
{{ post.title }}
<span class=".zh">{{ post.title }}</span><span class=".en">{{ post.titleEN }}</span>
</a>
</span>
</div>

@ -3,9 +3,9 @@
<header class="post-header">
<h1 class="post-title">
{%- if is_home() -%}
<a class="post-link" href="{{ url_for(post.path) }}">{{ post.title }}</a>
<a class="post-link" href="{{ url_for(post.path) }}"><span class=".zh">{{ post.title }}</span><span class=".en" hidden>{{ post.titleEN }}</span></a>
{%- else -%}
{{ post.title }}
<span class=".zh">{{ post.title }}</span><span class=".en" hidden>{{ post.titleEN }}</span>
{%- endif -%}
</h1>

@ -1 +1,2 @@
<script>lang = ['zh', 'en'];</script>
<script type="text/javascript" src="https://cdn.yimian.xyz/ushio-js/ushio-head.min.js"></script>

@ -1,8 +1,10 @@
{%- if not is_home() and toc(page.content) and theme.toc -%}
<style>.toc-level-2 > .toc-child {display: none !important; }</style>
<div class="post-toc" id="post-toc">
<h2 class="post-toc-title">{{ __('posts.toc') }}</h2>
<div class="post-toc-content">
{{ toc(page.content, {list_number: false}) }}
</div>
</div>
<script>var arr = [];var ts = '';if($('.post-toc-content').children().length>1){var el = '.post-toc-content';ts = ($(el).children('ol')[0].outerHTML);}else{var el = '.toc';};for(var i = 0; i < $(el).children('li').length; i++){arr.push($(el).children('li')[i].outerHTML);}; arr.splice(arr.length / 2, 0, '</span><span class=".en">');arr.unshift(ts);arr.unshift('<span class=".zh">');arr.push('</span>');$(el).html(arr.join(''));</script>
{%- endif -%}

@ -15,7 +15,7 @@
{%- endif -%}
<span class="power-by">
{{ __('footer.powered', '<a class="hexo-link" href="https://hexo.io/">Hexo</a>') }}
{{ __('footer.powered', '<a class="hexo-link" href="" onClick="page.showUshio(`iotcat/eee.dog-blog`);">Ushio</a>') }}
</span>
<span class="division">|</span>
<span class="theme-info">

@ -10,16 +10,16 @@
<a id="menu-{{ name }}" class="menu-item-link" href="{{ url_for(theme.menu[name].path) }}">
{%- set itemName = __('menu.' + name.toLowerCase()) -%}
{%- if itemName.startsWith('menu') -%}
{{ name }}
<span class=".en">{{ name }}</span><span class=".zh">{{ theme.menu[name].zh }}</span>
{%- else -%}
{{ itemName }}
<span class=".en">{{ name }}</span><span class=".zh">{{ theme.menu[name].zh }}</span>
{%- endif -%}
</a>
{%- if theme.menu[name].submenus -%}
<script>
$("#menu-{{ name }}").click(function(){
iziToast.question({
tips.question({
timeout: 20000,
close: false,
overlay: true,
@ -31,7 +31,7 @@
position: 'center',
buttons: [
{%- for subname, subobj in theme.menu[name].submenus -%}
['<button><b>{{ subname }}</b></button>', function (instance, toast) {
['<button><b>'+((page.tran.getLang() != 'zh')?'{{ subname }}':'{{ subobj.zh }}')+'</b></button>', function (instance, toast) {
instance.hide({ transitionOut: 'fadeOut' }, toast, 'button');
if("{{ theme.menu[name].submenus[subname].pjax }}" == "true")

@ -18,13 +18,13 @@
{%- if page.prev.path -%}
<a class="prev" href="{{ url_for(page.prev.path) }}">
<i class="iconfont icon-left"></i>
<span class="prev-text nav-default">{{ page.prev.title }}</span>
<span class="prev-text nav-default"><span class=".zh">{{ page.prev.title }}</span><span class=".en">{{ page.prev.titleEN }}</span></span>
<span class="prev-text nav-mobile">{{ __('posts.prev_post') }}</span>
</a>
{%- endif -%}
{%- if page.next.path -%}
<a class="next" href="{{ url_for(page.next.path) }}">
<span class="next-text nav-default">{{ page.next.title }}</span>
<span class="next-text nav-default"><span class=".zh">{{ page.next.title }}</span><span class=".en">{{ page.next.titleEN }}</span></span>
<span class="prev-text nav-mobile">{{ __('posts.next_post') }}</span>
<i class="iconfont icon-right"></i>
</a>

@ -20,9 +20,9 @@
<li class="mobile-menu-item">
{%- set itemName = __('menu.' + name.toLowerCase()) -%}
{%- if itemName.startsWith('menu') -%}
{{ name }}
<span class=".en">{{ name }}</span><span class=".zh">{{ theme.menu[name].zh }}</span>
{%- else -%}
{{ itemName }}
<span class=".en">{{ name }}</span><span class=".zh">{{ theme.menu[name].zh }}</span>
{%- endif -%}
</li>
</a>
@ -31,7 +31,7 @@
{%- for subname, subobj in theme.menu[name].submenus -%}
<li>
<a href="{{ url_for(theme.menu[name].submenus[subname].path) }}">
{{ subname }}
<span class=".en">{{ subname }}</span><span class=".zh">{{ subobj.zh }}</span>
</a>
</li>
{%- endfor -%}

@ -48,15 +48,28 @@ img.vimg:hover {
<script>
pjax_valine = () => {
$.get('https://auth.yimian.xyz/getEmailHash.php', function(res){
if(page.tran.getLang() == 'zh'){
var lan = 'zh-CN';
var metaPlaceholder = {"nick":"昵称/QQ号","mail":"邮箱(完全保密)"};
var tagMeta = ["博主","小伙伴","访客"];
var placeholder = "填写邮箱可以及时收到回复哦(●'◡'●)";
}else{
var lan = 'en';
var metaPlaceholder = {"nick":"Nickname/QQ","mail":"EMail"};
var tagMeta = ["Master","Friend","Visitor"];
var placeholder = "Leave some comments here (●'◡'●)";
}
new Valine({
el: '#vcomments',
appId: '{{ theme.valine.appId }}',
appKey: '{{ theme.valine.appKey }}',
master: '{{ theme.valine.masterEmailMd5 }}', //博主邮箱md5
tagMeta: ["博主","小伙伴","访客"], //标识字段名
tagMeta: tagMeta, //标识字段名
friends: res, //[{{ theme.valine.friendsEmailMd5 }}], //小伙伴邮箱Md5
metaPlaceholder: {"nick":"昵称/QQ号","mail":"邮箱(完全保密)"},
placeholder: "填写邮箱可以及时收到回复哦(●'◡'●)",
metaPlaceholder: metaPlaceholder,
placeholder: placeholder,
lang: lan,
path: window.location.pathname,
enableQQ: true,
visitor: true,

@ -56,6 +56,7 @@
{%- if theme.pjax.loadingbar -%}
loadingbarStop();
{%- endif -%}
page.tran.setLang();
});

@ -9,7 +9,9 @@
<section id="posts" class="posts">
{%- if mode == 'default' -%}
{%- for post in page.posts -%}
{{ post_template.render(post) }}
{%- if post.display -%}
{{ post_template.render(post) }}
{%- endif -%}
{%- endfor -%}
{%- include "_partial/pagination.swig" -%}
{%- else -%}

@ -7,11 +7,11 @@
{{ post_template.render(page) }}
{%- if theme.readingTime -%}
<script>$(()=>{setTimeout(()=>{iziToast.show({
<script>$(()=>{var p = window.location.pathname;setTimeout(()=>{if(window.location.pathname == p)tips.show({
title: 'tips',
position: 'topRight',
message: "此文章预计阅读 {{ readingTime(page.content, '分钟', 150) }}~"
})}, 3000)})</script>
message: ((page.tran.getLang() == 'zh')?"此文章预计阅读 {{ readingTime(page.content, '分钟', 300) }}哦~": "Read this page will spend around {{ readingTime(page.content, ' minutes', 150) }}~")
})}, 6000)})</script>
{%- endif -%}
{%- endblock -%}

Loading…
Cancel
Save