feat(i18n): [#91] 增加主题国际化相关

对于主题国际化,实际上并不是很必须的东西,但目前既然已经做了,就所幸做完了。
本次增加了汉语简体的国际化文本。

close #91
This commit is contained in:
lxy 2020-12-05 13:30:29 +08:00
parent 0073b4dc56
commit 75e40a01c2
50 changed files with 5644 additions and 193 deletions

29
404.ftl
View File

@ -1,15 +1,17 @@
<#--
@package Akina
-->
<#global res_base_url = settings.cdn?then("//cdn.jsdelivr.net/gh/LIlGG/halo-theme-sakura@1.2.1", theme_base)/>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title itemprop="name">Page not found - ${blog_title!}</title>
<title itemprop="name" class="i18n" data-iname="notfound.title" data-ivalue="${blog_title!}"></title>
<@global.head />
<#include "inc/decorate.ftl">
<link rel="stylesheet" href="//at.alicdn.com/t/font_2010950_uq2c7ykeiyk.css" media="noexist" onload="this.media='all'">
<link rel='stylesheet' href='${theme_base!}/styles/style.min.css' type='text/css'/>
</head>
<body class="error404 hfeed">
@ -18,20 +20,16 @@
<div class="anim-icon" id="404" style="height: 66%;"></div>
</div>
<div class="err-button back">
<a id="golast" href=javascript:history.go(-1);>返回上一页</a>
<a id="gohome" href="${blog_url!}">返回主页</a>
<a id="golast" href=javascript:history.go(-1); class="i18n" data-iname="notfound.golast"></a>
<a id="gohome" href="${blog_url!}" class="i18n" data-iname="notfound.gohome"></a>
</div>
<p style="margin-bottom: 1em;margin-top: 1.5em;text-align: center;font-size: 15px;">
别急,试试站内搜索?
</p>
<p style="margin-bottom: 1em;text-align: center;font-size: 15px;">
Don't worry, search in site?
</p>
<p style="margin-bottom: 1em;margin-top: 1.5em;text-align: center;font-size: 15px;" class="i18n" data-iname="notfound.search"></p>
<p style="margin-bottom: 1em;text-align: center;font-size: 15px;" class="i18n" data-iname="notfound.search_2"></p>
<div style="display:block; width:284px;margin: auto;">
<p style="margin-bottom: 1em;margin-top: 1.5em;text-align: center;font-size: 15px;"></p>
<form class="s-search" method="get" action="/search" role="search">
<i class="iconfont js-toggle-search iconsearch icon-search" style="bottom: 8px;left: 12px;"></i>
<input class="text-input" style="padding: 8px 20px 8px 46px;" type="search" name="keyword" placeholder="Search..." required>
<i class="iconfont icon-search" style="bottom: 9px;left: 15px;"></i>
<input class="text-input i18n" style="padding: 8px 20px 8px 46px;" type="search" name="keyword" required data-iname="notfound.searchinput" data-iattr="placeholder">
</form>
</div>
</section>
@ -45,6 +43,15 @@
}
</script>
<script src="${res_base_url!}/source/js/404.js" type="text/javascript"></script>
<script type='text/javascript' src='${theme_base!}/script/i18n.min.js?ver=1.2.1'></script>
<script>
var Poi = {
"themeBase": "${theme_base!}",
}
window.onload = function() {
I18N();
}
</script>
</body>

View File

@ -50,6 +50,7 @@ DEMO[https://lixingyong.com/](https://lixingyong.com/)
- [x] 全局提示&复制提醒功能
- [x] 相册
- [x] 说说
- [x] 国际化
> Tip:
>> 上述功能大部分均可配置。具体操作在 后台 -> 外观 -> 主题 -> 设置 中进行配置

View File

@ -2,7 +2,7 @@
@package Akina
-->
<#include "header.ftl">
<@header title="文章归档 - ${blog_title!}">
<@header title="${options.archives_title?default('文章归档')} - ${blog_title!}">
<#if (settings.patternimg!true) && (settings.archives_patternimg?? && settings.archives_patternimg!='')>
<div class="pattern-center-blank"></div>
<div class="pattern-center">
@ -10,7 +10,11 @@
<img data-src="${settings.archives_patternimg!}" src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="entry-title">文章归档</h1>
<#if options.archives_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.archives_title}</h1>
<#else>
<h1 class="entry-title i18n" data-iname="page.archives.title"></h1>
</#if>
</header>
</div>
<#else>
@ -20,7 +24,11 @@
<article class="post-item page type-page status-publish hentry">
<div id="archives-temp">
<#if !(settings.patternimg!true) || !(settings.archives_patternimg?? && settings.archives_patternimg!='')>
<h2>文章归档</h2>
<#if options.archives_title?default("")?trim?length gt 1>
<h2>${options.archives_title}</h2>
<#else>
<h2 class="i18n" data-iname="page.archives.title"></h2>
</#if>
</#if>
<div id="archives-content">
<@postTag method="archiveMonth">

View File

@ -18,12 +18,10 @@
"dependencies": {
"flv.min": "https://github.com/bilibili/flv.js/releases/download/v1.5.0/flv.min.js",
"isotope.pkgd.min": "https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js",
"jquery.justifiedGallery.min": "https://github.com/miromannino/Justified-Gallery/blob/master/dist/js/jquery.justifiedGallery.min.js",
"imagesloaded": "^4.1.4",
"packery-mode.pkgd.min": "https://github.com/metafizzy/isotope-packery/blob/master/packery-mode.pkgd.min.js",
"APlayer.min": "https://github.com/MoePlayer/APlayer/blob/master/dist/APlayer.min.js",
"tocbot": "^4.12.0",
"jquery-ui": "^1.12.1",
"v1.10": "https://github.com/MoePlayer/APlayer/releases/tag/v1.10.1"
"js-yaml": "^3.14.0"
}
}

View File

@ -14,13 +14,21 @@
<img data-src="${settings.category_patternimg!}" src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="entry-title">${options.categories_title?default('文章分类')}</h1>
<#if options.categories_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.categories_title}</h1>
<#else>
<h1 class="entry-title i18n" data-iname="page.categories.title"></h1>
</#if>
</header>
</div>
<#else>
<div class="blank"></div>
<header class="entry-header">
<h1 class="entry-title">${options.categories_title?default('文章分类')}</h1>
<#if options.categories_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.categories_title}</h1>
<#else>
<h1 class="entry-title i18n" data-iname="page.categories.title"></h1>
</#if>
</header><!-- .entry-header -->
</#if>
</@header>
@ -29,7 +37,7 @@
<div class="card">
<div class="card-content">
<div class="tag-title center-align">
<i class="fa fa-bookmark"></i>&nbsp;&nbsp;文章分类
<i class="fa fa-bookmark"></i>&nbsp;&nbsp;<span class="i18n" data-iname="page.categories.title"></span>
</div>
<div class="tag-chips">
<@categoryTag method="list">

View File

@ -10,7 +10,7 @@
<img data-src='${((category.thumbnail)?length>0)?string((category.thumbnail),"${settings.category_patternimg!}")}' src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="cat-title">分类:${category.name!}</h1>
<h1 class="cat-title i18n" data-iname="page.categories.item_title" data-ivalue="${category.name!}"></h1>
<span class="cat-des">${category.description!}</span>
</header>
</div>
@ -39,24 +39,7 @@
</#if>
</main>
<@paginationTag method="categoryPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${category.slug!}">
<#if (settings.pagenav_style!'ajax') == 'ajax'>
<div id="pagination">
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}" class="">Previous</a>
<#else>
<span>没有更多文章了</span>
</#if>
</div>
<#else>
<nav class="navigator">
<#if pagination.hasPrev>
<a href="${pagination.prevPageFullPath!}"><i class="iconfont icon-previous"></i></a>
</#if>
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}"><i class="iconfont icon-next"></i></a>
</#if>
</nav>
</#if>
<#include "layouts/list-nextprev.ftl">
</@paginationTag>
</div>
<#include "footer.ftl">

View File

@ -12,7 +12,10 @@
<#if !target.disallowComment!false>
<section id="comments" class="comments">
<div class="comments-main">
<h3 id="comments-list-title">Comments | <span class="noticom">${target.commentCount!0} 条评论 </span></h3>
<h3 id="comments-list-title">
<span class="name i18n" data-iname="comment.name"></span>
<span class="noticom i18n" data-iname="comment.number" data-ivalue="${target.commentCount!0}"></span>
</h3>
<halo-comment id="${target.id?c}" type="${type}" :configs="configs"/>
</div>
</section>

View File

@ -173,6 +173,7 @@
"tagRandomColorMax": "${settings.tag_randomColorMax!0.969}",
"nickname": "${user.nickname!}",
"sitename": "${blog_title!}",
"themeBase": "${theme_base!}",
"openToast": "${(settings.open_toast!true)?string('true','')}",
"toastWidth": ${settings.toast_width!},
"toastHeight": ${settings.toast_height!},
@ -254,7 +255,8 @@
</#if>
<script type='text/javascript' src='${res_base_url!}/source/js/qrcode.min.js' defer></script>
<script type='text/javascript' src='${res_base_url!}/source/lib/flv.min/index.js' defer></script>
<script type='text/javascript' src='${theme_base!}/script/app.min.js?ver=1.2.1'></script>
<script type='text/javascript' src='${theme_base!}/script/i18n.min.js?ver=1.2.1'></script>
<script type='text/javascript' src='${theme_base!}/script/app.js?ver=1.2.1'></script>
<#nested />
<#if settings.live2d_switch!true>
<script src="${res_base_url!}/source/lib/jquery-ui/jquery-ui.min.js" async defer></script>

View File

@ -44,15 +44,15 @@
}
#pagination .loading {
background: url(${res_base_url!}/source/images/rotating-ball-o.svg);
background-image: url(${res_base_url!}/source/images/rotating-ball-o.svg);
}
#banner_wave_1 {
background: url(${res_base_url!}/source/images/wave1.png) repeat-x;
background-image: url(${res_base_url!}/source/images/wave1.png) repeat-x;
}
#banner_wave_2 {
background: url(${res_base_url!}/source/images/wave2.png) repeat-x;
background-image: url(${res_base_url!}/source/images/wave2.png) repeat-x;
}
<#if (settings.cursor_skin!'sakura') == 'sakura'>
/** 鼠标样式 */

View File

@ -44,24 +44,7 @@
</main><!-- #main -->
<@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3">
<#if (settings.pagenav_style!'ajax') == 'ajax'>
<div id="pagination">
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}" class="">下一页</a>
<#else>
<span>没有更多文章了</span>
</#if>
</div>
<#else>
<nav class="navigator">
<#if pagination.hasPrev>
<a href="${pagination.prevPageFullPath!}"><i class="iconfont icon-previous"></i></a>
</#if>
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}"><i class="iconfont icon-next"></i></a>
</#if>
</nav>
</#if>
<#include "layouts/list-nextprev.ftl">
</@paginationTag>
</div><!-- #primary -->

View File

@ -10,13 +10,21 @@
<img data-src="${settings.journals_patternimg!}" src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="entry-title">${options.journals_title?default('日志')}</h1>
<#if options.journals_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.journals_title}</h1>
<#else>
<h1 class="entry-title i18n" data-iname="page.journal.title"></h1>
</#if>
</header>
</div>
<#else>
<div class="blank"></div>
<header class="entry-header">
<h1 class="entry-title">${options.journals_title?default('日志')}</h1>
<#if options.journals_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.journals_title}</h1>
<#else>
<h1 class="entry-title i18n" data-iname="page.journal.title"></h1>
</#if>
</header>
<style>
.toc-container {
@ -49,12 +57,13 @@
<@paginationTag method="journals" page="${journals.number}" total="${journals.totalPages}" display="3">
<center id="journals-pagination">
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}" class="at_button" style="margin-bottom: 15px;">加载更多...</a></#if>
<a href="${pagination.nextPageFullPath!}" class="at_button i18n" data-iname="page.journal.loadmore" style="margin-bottom: 15px;">加载更多...</a>
</#if>
</center>
</@paginationTag>
</#if>
<#else>
博主太懒了,这里还什么都没有呢!!!
<span class="i18n" data-iname="page.journal.empty"></span>
</#if>
</div>
<#include "footer.ftl">

97
languages/zh.yml Normal file
View File

@ -0,0 +1,97 @@
home:
feature:
title: 聚焦
one:
title: 聚焦图1
desc: 这是聚焦图1
two:
title: 聚焦图2
desc: 这是聚焦图2
three:
title: 聚焦图3
desc: 这是聚焦图3
postlist:
time: 发布于 %s
heat: '%s 热度'
comments: '%s 条评论'
post:
prev: Previous Post
next: Next Post
visits: '%s 次阅读'
reward:
creative_commons: 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议
page:
next: 下一页
theend: 没有更多文章了
archives:
title: 文章归档
categories:
title: 文章分类
item_title: 分类:%s
photos:
title: 图库
all: 全部
links:
title: 友情链接
journal:
title: 日志
loadmore: 加载更多...
empty: 博主太懒了,这里还什么都没有呢!!!
search:
title: 关于“ %s ”的搜索结果
sresult: '搜索结果: '
tags:
title: 文章标签
item:
title: 标签:%s
none:
title: 没有找到任何东西!
search: 没有找到你想要的,看看其他的吧。
notfound: 我们似乎没有找到你想要的东西. 或许你可以搜索一下试试。
comment:
number: '%s 条评论'
name: Comments |
notfound:
title: 页面不存在 - %s
golast: 返回上一页
gohome: 返回主页
search: 别急,试试站内搜索?
search_2: Don't worry, search in site?
searchinput: Search...
user:
description: 我喜欢做的事就是不写个性签名
icon_alt:
wechat: 微信公众号
sina: 微博
qq: 开始聊天?
qzone: QQ 空间
github: Github
lofter: 乐乎
bili: 哔哩哔哩
cloudmusic: 网易云音乐
twitter: 推特
facebook: 脸书
googleplus: Google+
jianshu: 简书
zhihu: 知乎
csdn: CSDN
share:
weibo: 分享至微博
qq: 分享至 QQ
wechat:
qcode_title: 微信扫一扫:分享
help_1: 微信里点“发现”,扫一下
help_2: 二维码便可将本文分享至朋友圈。
douban: 分享至豆瓣
qzone: 分享至 QQ 空间
linkedin: 分享至领英

View File

@ -13,6 +13,12 @@
</div>
</div>
<hr>
<p><i class="iconfont icon-pencil"></i>${user.description!'我喜欢做的事就是不写个性签名'}</p>
<p><i class="iconfont icon-pencil"></i>
<#if user.description?default("")?trim?length gt 1>
<span>${user.description}</span>
<#else>
<span class="i18n" data-iname="user.description"></span>
</#if>
</p>
</section>
</#if>

View File

@ -1,9 +1,14 @@
<div class="top-feature">
<h1 class="fes-title" style="font-family: 'Ubuntu', sans-serif;">
<#if settings.feature_icon?? && settings.feature_icon!=''>
<i class="${settings.feature_icon}" aria-hidden="true"></i>
</#if>
${settings.feature_title!'聚焦'}</h1>
<i class="${settings.feature_icon}" aria-hidden="true"></i>
</#if>
<#if settings.feature_title?default("")?trim?length gt 1>
<span>${settings.feature_title}</span>
<#else>
<span class="i18n" data-iname="home.feature.title"></span>
</#if>
</h1>
<div class="top-feature-v2">
<div class="the-feature square from_left_and_right">
<a href="${settings.feature1_link!'#'}" target="_blank">
@ -11,8 +16,20 @@
<img src="${settings.feature1_img!'${res_base_url!}/source/images/temp.jpg'}">
</div>
<div class="info">
<h3>${settings.feature1_title!'feature1'}</h3>
<p>${settings.feature1_desc!'feature1'}</p>
<h3>
<#if settings.feature1_title?default("")?trim?length gt 1>
<span>${settings.feature1_title}</span>
<#else>
<span class="i18n" data-iname="home.feature.one.title"></span>
</#if>
</h3>
<p>
<#if settings.feature1_desc?default("")?trim?length gt 1>
<span>${settings.feature1_desc}</span>
<#else>
<span class="i18n" data-iname="home.feature.one.desc"></span>
</#if>
</p>
</div>
</a>
</div>
@ -24,8 +41,20 @@
<img src="${settings.feature2_img!'${res_base_url!}/source/images/temp.jpg'}">
</div>
<div class="info">
<h3>${settings.feature2_title!'feature2'}</h3>
<p>${settings.feature2_desc!'feature2'}</p>
<h3>
<#if settings.feature2_title?default("")?trim?length gt 1>
<span>${settings.feature2_title}</span>
<#else>
<span class="i18n" data-iname="home.feature.two.title"></span>
</#if>
</h3>
<p>
<#if settings.feature2_desc?default("")?trim?length gt 1>
<span>${settings.feature2_desc}</span>
<#else>
<span class="i18n" data-iname="home.feature.two.desc"></span>
</#if>
</p>
</div>
</a>
</div>
@ -37,8 +66,20 @@
<img src="${settings.feature3_img!'${res_base_url!}/source/images/temp.jpg'}">
</div>
<div class="info">
<h3>${settings.feature3_title!'feature3'}</h3>
<p>${settings.feature3_desc!'feature3'}</p>
<h3>
<#if settings.feature3_title?default("")?trim?length gt 1>
<span>${settings.feature3_title}</span>
<#else>
<span class="i18n" data-iname="home.feature.three.title"></span>
</#if>
</h3>
<p>
<#if settings.feature3_desc?default("")?trim?length gt 1>
<span>${settings.feature3_desc}</span>
<#else>
<span class="i18n" data-iname="home.feature.three.desc"></span>
</#if>
</p>
</div>
</a>
</div>

View File

@ -18,57 +18,110 @@
</#if>
<div class="header-info">
<#if user.description?default("")?trim?length gt 1>
<p><i class="fa fa-quote-left"></i>${(user.description)?default('这条说明是默认信息哦!在后台-个人资料-个人说明中进行修改')}<i class="fa fa-quote-right"></i></p>
<p><i class="fa fa-quote-left"></i>${user.description}<i class="fa fa-quote-right"></i></p>
</#if>
<div class="top-social_v2">
<li id="bg-pre">
<img class="flipx" src="${res_base_url!}/source/images/next-b.svg">
</li>
<#if settings.wechat??>
<li class="wechat"><a href="#"><img src="${res_base_url!}/source/images/sns/wechat.png"/></a>
<li class="wechat"><a href="#">
<img src="${res_base_url!}/source/images/sns/wechat.png"/></a>
<div class="wechatInner">
<img src="${settings.wechat!}" alt="微信公众号">
<img src="${settings.wechat!}" class="i18n" data-iname="icon_alt.wechat" data-iattr="alt">
</div>
</li>
</#if>
<#if settings.sina??>
<li><a href="${settings.sina!}" target="_blank" class="social-sina" title="sina"><img src="${res_base_url!}/source/images/sns/sina.png"/></a></li>
<li>
<a href="${settings.sina!}" target="_blank" class="social-sina i18n" data-iname="icon_alt.sina" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/sina.png"/>
</a>
</li>
</#if>
<#if settings.qq??>
<li class="qq"><a href="//wpa.qq.com/msgrd?v=3&uin=${settings.qq!}&site=qq&menu=yes" target="_blank" title="Initiate chat ?"><img src="${res_base_url!}/source/images/sns/qq.png"/></a></li>
<li class="qq">
<a href="//wpa.qq.com/msgrd?v=3&uin=${settings.qq!}&site=qq&menu=yes" target="_blank" class="i18n" data-iname="icon_alt.qq" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/qq.png"/>
</a>
</li>
</#if>
<#if settings.qzone??>
<li><a href="${settings.qzone!}" target="_blank" class="social-qzone" title="qzone"><img src="${res_base_url!}/source/images/sns/qzone.png"/></a></li>
<li>
<a href="${settings.qzone!}" target="_blank" class="social-qzone i18n" data-iname="icon_alt.qzone" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/qzone.png"/>
</a>
</li>
</#if>
<#if settings.github??>
<li><a href="${settings.github!}" target="_blank" class="social-github" title="github"><img src="${res_base_url!}/source/images/sns/github.png"/></a></li>
<li>
<a href="${settings.github!}" target="_blank" class="social-github i18n" data-iname="icon_alt.github" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/github.png"/>
</a>
</li>
</#if>
<#if settings.lofter??>
<li><a href="${settings.lofter!}" target="_blank" class="social-lofter" title="lofter"><img src="${res_base_url!}/source/images/sns/lofter.png"/></a></li>
<li>
<a href="${settings.lofter!}" target="_blank" class="social-lofter i18n" data-iname="icon_alt.lofter" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/lofter.png"/>
</a>
</li>
</#if>
<#if settings.bili??>
<li><a href="${settings.bili!}" target="_blank" class="social-bili" title="bilibili"><img src="${res_base_url!}/source/images/sns/bilibili.png"/></a></li>
<li>
<a href="${settings.bili!}" target="_blank" class="social-bili i18n" data-iname="icon_alt.bili" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/bilibili.png"/>
</a>
</li>
</#if>
<#if settings.wangyiyun??>
<li><a href="${settings.wangyiyun!}" target="_blank" class="social-wangyiyun" title="CloudMusic"><img src="${res_base_url!}/source/images/sns/wangyiyun.png"/></a></li>
<li>
<a href="${settings.wangyiyun!}" target="_blank" class="social-wangyiyun i18n" data-iname="icon_alt.cloudmusic" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/wangyiyun.png"/>
</a>
</li>
</#if>
<#if settings.twitter??>
<li><a href="${settings.twitter!}" target="_blank" class="social-wangyiyun" title="Twitter"><img src="${res_base_url!}/source/images/sns/twitter.png"/></a></li>
<li>
<a href="${settings.twitter!}" target="_blank" class="i18n" data-iname="icon_alt.twitter" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/twitter.png"/>
</a>
</li>
</#if>
<#if settings.facebook??>
<li><a href="${settings.facebook!}" target="_blank" class="social-wangyiyun" title="Facebook"><img src="${res_base_url!}/source/images/sns/facebook.png"/></a></li>
<li>
<a href="${settings.facebook!}" target="_blank" class="i18n" data-iname="icon_alt.facebook" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/facebook.png"/>
</a>
</li>
</#if>
<#if settings.googleplus??>
<li><a href="${settings.googleplus!}" target="_blank" class="social-wangyiyun" title="Google+"><img src="${res_base_url!}/source/images/sns/googleplus.png"/></a></li>
<li>
<a href="${settings.googleplus!}" target="_blank" class="i18n" data-iname="icon_alt.googleplus" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/googleplus.png"/>
</a>
</li>
</#if>
<#if settings.jianshu??>
<li><a href="${settings.jianshu!}" target="_blank" class="social-wangyiyun" title="简书"><img src="${res_base_url!}/source/images/sns/jianshu.png"/></a></li>
<li>
<a href="${settings.jianshu!}" target="_blank" class="i18n" data-iname="icon_alt.jianshu" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/jianshu.png"/>
</a>
</li>
</#if>
<#if settings.zhihu??>
<li><a href="${settings.zhihu!}" target="_blank" class="social-wangyiyun" title="知乎"><img src="${res_base_url!}/source/images/sns/zhihu.png"/></a></li>
<li>
<a href="${settings.zhihu!}" target="_blank" class="i18n" data-iname="icon_alt.zhihu" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/zhihu.png"/>
</a>
</li>
</#if>
<#if settings.csdn??>
<li><a href="${settings.csdn!}" target="_blank" class="social-wangyiyun" title="CSDN"><img src="${res_base_url!}/source/images/sns/csdn.png"/></a></li>
<li>
<a href="${settings.csdn!}" target="_blank" class="i18n" data-iname="icon_alt.csdn" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/csdn.png"/>
</a>
</li>
</#if>
<li id="bg-next">
<img src="${res_base_url!}/source/images/next-b.svg">

21
layouts/list-nextprev.ftl Normal file
View File

@ -0,0 +1,21 @@
<#--
列表所使用的分页
-->
<#if (settings.pagenav_style!'ajax') == 'ajax'>
<div id="pagination">
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}" class="i18n" data-iname="page.next"></a>
<#else>
<span class="i18n" data-iname="page.theend"></span>
</#if>
</div>
<#else>
<nav class="navigator">
<#if pagination.hasPrev>
<a href="${pagination.prevPageFullPath!}"><i class="iconfont icon-previous"></i></a>
</#if>
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}"><i class="iconfont icon-next"></i></a>
</#if>
</nav>
</#if>

View File

@ -6,14 +6,14 @@
<#if prevPost??>
<div class="post-nepre <#if nextPost??>half<#else>full</#if> previous">
<a href="${prevPost.fullPath!}" rel="prev">
<div class="background" style="background-image:url('${prevPost.thumbnail!}');"></div><span class="label">Previous Post</span><div class="info"><h3>${prevPost.title!}</h3><hr></div>
<div class="background" style="background-image:url('${prevPost.thumbnail!}');"></div><span class="label i18n" data-iname="post.prev"></span><div class="info"><h3>${prevPost.title!}</h3><hr></div>
</a>
</div>
</#if>
<#if nextPost??>
<div class="post-nepre <#if prevPost??>half<#else>full</#if> next">
<a href="${nextPost.fullPath!}" rel="next">
<div class="background" style="background-image:url('${nextPost.thumbnail!}');"></div><span class="label">Next Post</span><div class="info"><h3>${nextPost.title!}</h3><hr></div>
<div class="background" style="background-image:url('${nextPost.thumbnail!}');"></div><span class="label i18n" data-iname="post.next"></span><div class="info"><h3>${nextPost.title!}</h3><hr></div>
</a>
</div>
</#if>

View File

@ -85,40 +85,40 @@
<div class="post-share">
<ul class="social-share sharehidden">
<li>
<a href="http://service.weibo.com/share/share.php?url=${post.fullPath!}&appkey=&title=${post.title!}|${user.nickname!}&pic=${post.thumbnail!}" onclick="window.open(this.href, 'weibo-share', 'width=490,height=700');return false;" class="s-weibo">
<img src="${res_base_url!}/source/images/sns/weibo.png"/>
<a href="http://service.weibo.com/share/share.php?url=${post.fullPath!}&appkey=&title=${post.title!}|${user.nickname!}&pic=${post.thumbnail!}" onclick="window.open(this.href, 'weibo-share', 'width=490,height=700');return false;" class="s-weibo i18n" data-iname="share.weibo" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/weibo.png"/>
</a>
</li>
<li>
<a href="http://connect.qq.com/widget/shareqq/index.html?url=${post.fullPath!}&title=${post.title!}|${user.nickname!}&source=${post.title!}|${user.nickname!}&desc=${post.summary!}&pics=${post.thumbnail!}&summary=${post.summary!}" onclick="window.open(this.href, 'qq-share', 'width=730,height=500');return false;" class="s-qq">
<a href="http://connect.qq.com/widget/shareqq/index.html?url=${post.fullPath!}&title=${post.title!}|${user.nickname!}&source=${post.title!}|${user.nickname!}&desc=${post.summary!}&pics=${post.thumbnail!}&summary=${post.summary!}" onclick="window.open(this.href, 'qq-share', 'width=730,height=500');return false;" class="s-qq i18n" data-iname="share.qq" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/qq.png"/>
</a>
</li>
<li>
<a href="javascript:" class="s-wechat">
<div class="wechat-qrcode">
<h4>微信扫一扫:分享</h4>
<h4 class="i18n" data-iname="share.wechat.qcode_title"></h4>
<div id="qrcode" class="qrcode" title="${post.fullPath!}" data-url="${post.fullPath!}"></div>
<div class="help">
<p>微信里点“发现”,扫一下</p>
<p>二维码便可将本文分享至朋友圈。</p>
<p class="i18n" data-iname="share.wechat.help_1"></p>
<p class="i18n" data-iname="share.wechat.help_2"></p>
</div>
</div>
<img src="${res_base_url!}/source/images/sns/wechat.png"/>
</a>
</li>
<li>
<a href="http://shuo.douban.com/!service/share?href=${post.fullPath!}&name=${post.title!}|${user.nickname!}&text=${post.summary!}&image=${post.thumbnail!}&starid=0&aid=0&style=11" onclick="window.open(this.href, 'douban-share', 'width=490,height=600');return false;" class="s-douban">
<a href="http://shuo.douban.com/!service/share?href=${post.fullPath!}&name=${post.title!}|${user.nickname!}&text=${post.summary!}&image=${post.thumbnail!}&starid=0&aid=0&style=11" onclick="window.open(this.href, 'douban-share', 'width=490,height=600');return false;" class="s-douban i18n" data-iname="share.douban" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/douban.png"/>
</a>
</li>
<li>
<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=${post.fullPath!}&title=${post.title!}|${user.nickname!}&desc=${post.summary!}&summary=${post.summary!}&site=${post.summary!}" onclick="window.open(this.href, 'qzone-share', 'width=490,height=600');return false;" class="s-qzone">
<a href="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=${post.fullPath!}&title=${post.title!}|${user.nickname!}&desc=${post.summary!}&summary=${post.summary!}&site=${post.summary!}" onclick="window.open(this.href, 'qzone-share', 'width=490,height=600');return false;" class="s-qzone i18n" data-iname="share.qzone" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/qzone.png"/>
</a>
</li>
<li>
<a href="http://www.linkedin.com/shareArticle?mini=true&ro=true&title=${post.title!}|${user.nickname!}&url=${post.fullPath!}&summary=${post.summary!}&source=${post.thumbnail!}&armin=armin" onclick="window.open(this.href, 'linkedin-share', 'width=490,height=600');return false;" class="s-linkedin">
<a href="http://www.linkedin.com/shareArticle?mini=true&ro=true&title=${post.title!}|${user.nickname!}&url=${post.fullPath!}&summary=${post.summary!}&source=${post.thumbnail!}&armin=armin" onclick="window.open(this.href, 'linkedin-share', 'width=490,height=600');return false;" class="s-linkedin i18n" data-iname="share.linkedin" data-iattr="title">
<img src="${res_base_url!}/source/images/sns/linkedin.png"/>
</a>
</li>

View File

@ -10,7 +10,10 @@
<img data-src="${settings.links_patternimg!}" src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="entry-title">${options.links_title?default('友情链接')}</h1>
<#if options.links_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.links_title}</h1>
<#else>
<h1 class="entry-title i18n" data-iname="page.links.title"></h1>
</header>
</div>
<#else>

View File

@ -1,3 +1,5 @@
<#global res_base_url = settings.cdn?then("//cdn.jsdelivr.net/gh/LIlGG/halo-theme-sakura@1.2.1", theme_base)/>
<div style="background: white;
width: 95%;
max-width: 800px;
@ -20,7 +22,7 @@
margin: -25px auto 0 ;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.30)">Dear ${baseAuthor!}</p>
<br>
<h3>您有一条来自<a style="text-decoration: none;color: orange " target="_blank" href="${blog_url!}" rel="noopener">${blog_title!}</a>的回复</h3>
<h3 class="i18n" data-iname="mail.title">您有一条来自<a style="text-decoration: none;color: orange " target="_blank" href="${blog_url!}" rel="noopener">${blog_title!}</a>的回复</h3>
<br>
<p style="font-size: 14px;">您在文章《${pageTitle!}》上发表的评论:</p>
<p style="border-bottom:#ddd 1px solid;border-left:#ddd 1px solid;padding-bottom:20px;background-color:#eee;margin:15px 0px;padding-left:20px;padding-right:20px;border-top:#ddd 1px solid;border-right:#ddd 1px solid;padding-top:20px">${baseContent!}</p>
@ -43,5 +45,5 @@
<p style="font-size: 12px;text-align: center;color: #999;">本邮件为系统自动发出,请勿直接回复<br>
© ${.now?string("yyyy")} ${(user.nickname)!}
</p>
</div>
</div>
</div>

View File

@ -9,7 +9,8 @@
"build-cleancss": "cleancss -o styles/style.min.css styles/style.css",
"build-clean": "rimraf css",
"build-app-js": "babel script/app.js -o script/app.min.js && uglifyjs script/app.min.js -o script/app.min.js",
"build-js": "npm run build-app-js",
"build-i18n-js": "babel script/i18n.js -o script/i18n.min.js && uglifyjs script/i18n.min.js -o script/i18n.min.js",
"build-js": "npm run build-app-js && npm run build-i18n-js",
"deploy": "npm run build"
},
"browserify": {

View File

@ -10,7 +10,11 @@
<img data-src="${settings.photos_patternimg!}" src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="entry-title">${options.photos_title?default('图库')}</h1>
<#if options.photos_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.photos_title}</h1>
<#else>
<span class="entry-title i18n" data-iname="page.photos.title"></span>
</#if>
</header>
</div>
<#else>

View File

@ -21,7 +21,7 @@
<a href="${blog_url!}">${user.nickname!}</a>
</span>
<span class="bull">·</span>${post.createTime?string('yyyy-MM-dd')}
<span class="bull">·</span>${post.visits!0} 次阅读
<span class="bull">·</span><span class="i18n" data-iname="post.visits" data-ivalue="${post.visits!0}"></span>
</p>
</header>
</div>

View File

@ -31,6 +31,8 @@ var LIlGGAttachContext = {
LIlGGAttachContext.CHS(); // 代码样式
LIlGGAttachContext.PHO(); // 图库功能
LIlGGAttachContext.CMN(); // 评论组件
// i18n
I18N();
},
// 背景视频
BGV: function () {
@ -40,12 +42,11 @@ var LIlGGAttachContext = {
$bg_video_add = $("#video-add"),
dom = $bg_video[0],
diskTime = 20 * 1000,
keyframesIndex,
flvPlayer,
mediaBlob;
var bindBgVideoEvent = function () {
$bg_video_btn.on("click", function (event) {
$bg_video_btn.on("click", function () {
if ($(this).hasClass("loadvideo")) {
$(this).removeClass("loadvideo").hide();
loadSource();
@ -1246,16 +1247,16 @@ $(function () {
Siren.MN(); // 移动端菜单
// 新增功能
if (Poi.themeChange) LIlGGAttachContext.CBG(); // 主题切换
Poi.themeChange && LIlGGAttachContext.CBG(); // 主题切换
LIlGGAttachContext.PLSA(); // 文章列表动画
if (Poi.headFocus && Poi.bgvideo) LIlGGAttachContext.BGV(); // 背景视频
if (Poi.toc) LIlGGAttachContext.TOC(); // 文章目录
(Poi.headFocus && Poi.bgvideo) && LIlGGAttachContext.BGV(); // 背景视频
Poi.toc && LIlGGAttachContext.TOC(); // 文章目录
LIlGGAttachContext.CHS(); // 代码类Mac样式、高亮
LIlGGAttachContext.MGT(); // 移动端回到顶部
if (Poi.photosStyle == "packery") supplement();
(Poi.photosStyle == "packery") && supplement();
LIlGGAttachContext.PHO(); // 图库功能
// 复制提示
if (Poi.copyMonitor) LIlGGAttachContext.CPY();
Poi.copyMonitor && LIlGGAttachContext.CPY();
// 延迟加载图片
lazyload(undefined, {
rootMargin: "150px",
@ -1263,7 +1264,8 @@ $(function () {
// 评论组件
LIlGGAttachContext.CMN();
// PJAX
if (Poi.pjax) pjaxFun();
Poi.pjax && pjaxFun();
I18N();
// 全局提示组件
if (Poi.openToast && window.outerWidth > 860) {
toast = new Toast();
@ -1466,7 +1468,7 @@ var utils = {
}
return idx;
}
},
};
/**

2
script/app.min.js vendored

File diff suppressed because one or more lines are too long

150
script/i18n.js Normal file
View File

@ -0,0 +1,150 @@
/**
* 国际化
*/
var I18N = function () {
var i18nlanguage,
doc;
// 加载资源
function init() {
if(!window.$) {
loadJS(Poi.themeBase + "/source/js/lib.js", init)
} else if(!window.$.i18n) {
loadJS(Poi.themeBase + "/source/lib/jquery-i18n/jquery.i18n.min.js", init)
} else if (!window.jsyaml) {
loadJS(Poi.themeBase + "/source/lib/js-yaml/dist/js-yaml.min.js", init)
} else {
execI18n();
}
}
/**
* 根据文本渲染i18n
*/
function renderI18n() {
if (!$.i18n) {
console.error("未能加载国际化插件,终止国际化操作!")
}
// 使用i18n 渲染页面文本
// 先unload一下
$.i18n.unload();
// 加载doc
$.i18n.load(doc);
// 遍历所有需要i18n的文本
$('.i18n').each(function () {
var args = [];
var name = $(this).data("iname");
var value = $(this).data("ivalue") + '';
var attr = $(this).data('iattr');
args.push(name);
if (value) {
value = value.split(",");
args = args.concat(value);
}
var text = $.i18n._.apply($.i18n, args);
if(attr) {
$(this).attr(attr, text);
} else {
$(this).text(text);
}
})
}
function execI18n() {
if(getCookie(i18nlanguage + ".yml")) {
doc = JSON.parse(getCookie(i18nlanguage + ".yml"));
renderI18n();
} else {
$.ajax({
url: Poi.themeBase + "/languages/" + i18nlanguage + ".yml",
success: function (data) {
doc = jsyaml.safeLoad(data, 'utf8');
if (!doc) {
console.warn("读取读取国际化数据失败");
return;
}
setCookie(i18nlanguage + ".yml", JSON.stringify(doc), 1);
// 执行渲染
renderI18n();
}
})
}
}
/**
* 获取浏览器语言
*/
function getNavLang() {
var currentLang = navigator.language;
// 只获取前两个字符
currentLang = currentLang.substr(0, 2);
//判断IE浏览器使用语言
if (!currentLang) {
currentLang = navigator.browserLanguage;
}
return currentLang;
}
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
expires = "; expires=" + date.toUTCString();
}
document.cookie =
name + "v1.0.0" + "=" + (value || "") + expires + "; path=/";
}
function getCookie(name) {
var nameEQ = name + "v1.0.0" + "=";
var ca = document.cookie.split(";");
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == " ") c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
function loadJS(url, callback) {
var script = document.createElement('script'),
fn = callback || function () { };
script.type = 'text/javascript';
//IE
if (script.readyState) {
script.onreadystatechange = function () {
if (script.readyState == 'loaded' || script.readyState == 'complete') {
script.onreadystatechange = null;
fn();
}
};
} else {
//其他浏览器
script.onload = function () {
fn();
};
}
script.src = url;
document.getElementsByTagName('head')[0].appendChild(script);
}
// 获取用户指定的语言,如果用户未指定或者未自动,则读取缓存,否则读取浏览器语言
if (Poi.i18n && Poi.i18n != "auto") {
i18nlanguage = Poi.i18n;
} else if (getCookie("i18nlanguage")) {
i18nlanguage = getCookie("i18nlanguage");
} else {
// 从浏览器读取
i18nlanguage = getNavLang();
setCookie("i18nlanguage", i18nlanguage);
}
if (!i18nlanguage) {
i18nlanguage = "zh";
console.warn("未能判断语言将使用默认语言zh");
}
// 初始化
init();
}

1
script/i18n.min.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";var I18N=function I18N(){var i18nlanguage,doc;function init(){if(!window.$){loadJS(Poi.themeBase+"/source/js/lib.js",init)}else if(!window.$.i18n){loadJS(Poi.themeBase+"/source/lib/jquery-i18n/jquery.i18n.min.js",init)}else if(!window.jsyaml){loadJS(Poi.themeBase+"/source/lib/js-yaml/dist/js-yaml.min.js",init)}else{execI18n()}}function renderI18n(){if(!$.i18n){console.error("未能加载国际化插件,终止国际化操作!")}$.i18n.unload();$.i18n.load(doc);$(".i18n").each(function(){var args=[];var name=$(this).data("iname");var value=$(this).data("ivalue")+"";var attr=$(this).data("iattr");args.push(name);if(value){value=value.split(",");args=args.concat(value)}var text=$.i18n._.apply($.i18n,args);if(attr){$(this).attr(attr,text)}else{$(this).text(text)}})}function execI18n(){if(getCookie(i18nlanguage+".yml")){doc=JSON.parse(getCookie(i18nlanguage+".yml"));renderI18n()}else{$.ajax({url:Poi.themeBase+"/languages/"+i18nlanguage+".yml",success:function success(data){doc=jsyaml.safeLoad(data,"utf8");if(!doc){console.warn("读取读取国际化数据失败");return}setCookie(i18nlanguage+".yml",JSON.stringify(doc),1);renderI18n()}})}}function getNavLang(){var currentLang=navigator.language;currentLang=currentLang.substr(0,2);if(!currentLang){currentLang=navigator.browserLanguage}return currentLang}function setCookie(name,value,days){var expires="";if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3);expires="; expires="+date.toUTCString()}document.cookie=name+"v1.0.0"+"="+(value||"")+expires+"; path=/"}function getCookie(name){var nameEQ=name+"v1.0.0"+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}function loadJS(url,callback){var script=document.createElement("script"),fn=callback||function(){};script.type="text/javascript";if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;fn()}}}else{script.onload=function(){fn()}}script.src=url;document.getElementsByTagName("head")[0].appendChild(script)}if(Poi.i18n&&Poi.i18n!="auto"){i18nlanguage=Poi.i18n}else if(getCookie("i18nlanguage")){i18nlanguage=getCookie("i18nlanguage")}else{i18nlanguage=getNavLang();setCookie("i18nlanguage",i18nlanguage)}if(!i18nlanguage){i18nlanguage="zh";console.warn("未能判断语言将使用默认语言zh")}init()};

View File

@ -9,7 +9,7 @@
<img data-src="${settings.searh_patternimg!}" src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="entry-title search-title"> 关于“ ${keyword!} ”的搜索结果</h1>
<h1 class="entry-title search-title i18n" data-iname="page.search.title"></h1>
</header>
</div>
<#else>
@ -22,7 +22,7 @@
<main id="main" class="site-main" role="main">
<#if !(settings.patternimg!true) || !(settings.searh_patternimg?? && settings.searh_patternimg!='')>
<header class="page-header">
<h1 class="page-title">搜索结果: <span>${keyword!}</span></h1>
<h1 class="page-title"><span class="i18n" data-iname="page.search.sresult"></span><span>${keyword!}</span></h1>
</header><!-- .page-header -->
</#if>
<#list posts.content as post>
@ -31,24 +31,7 @@
</main><!-- #main -->
<#if posts.totalPages gt 1>
<@paginationTag method="search" page="${posts.number}" total="${posts.totalPages}" display="3" keyword="${keyword!}">
<#if (settings.pagenav_style!'ajax') == 'ajax'>
<div id="pagination">
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}" class="">Previous</a>
<#else>
<span>没有更多文章了</span>
</#if>
</div>
<#else>
<nav class="navigator">
<#if pagination.hasPrev>
<a href="${pagination.prevPageFullPath!}"><i class="iconfont icon-previous"></i></a>
</#if>
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}"><i class="iconfont icon-next"></i></a>
</#if>
</nav>
</#if>
<#include "layouts/list-nextprev.ftl">
</@paginationTag>
</#if>
<#else>

View File

@ -354,7 +354,7 @@ focus:
name: feature_title
label: 聚焦标题
type: text
default: ' START:DASH!!'
default: ''
placeholder: '默认为聚焦,你也可以修改为其他,当然不能当广告用!不允许!!'
feature1_img:
name: feature1_img
@ -365,12 +365,10 @@ focus:
name: feature1_title
label: 聚焦图一标题
type: text
default: 'feature1'
feature1_desc:
name: feature1_desc
label: 聚焦图一描述
type: text
default: 'feature1'
feature1_link:
name: feature1_link
label: 聚焦图一链接
@ -385,12 +383,10 @@ focus:
name: feature2_title
label: 聚焦图二标题
type: text
default: 'feature2'
feature2_desc:
name: feature2_desc
label: 聚焦图二描述
type: text
default: 'feature2'
feature2_link:
name: feature2_link
label: 聚焦图二链接
@ -405,12 +401,10 @@ focus:
name: feature3_title
label: 聚焦图三标题
type: text
default: 'feature3'
feature3_desc:
name: feature3_desc
label: 聚焦图三描述
type: text
default: 'feature3'
feature3_link:
name: feature3_link
label: 聚焦图三链接
@ -547,7 +541,7 @@ tagAndCategory:
description: '标签随机颜色最低值,值越低越偏冷色调取值范围在0-1之间需要小于最大值'
tag_randomColorMax:
name: tag_randomColorMax
label: 标签页及分类页最大值
label: 标签页及分类页颜色最大值
type: text
data-type: double
default: 1
@ -1618,7 +1612,7 @@ toast:
label: 复制内容增加版权声明
type: radio
data-type: bool
default: true
default: false
options:
- value: true
label: 开启
@ -1650,6 +1644,18 @@ others:
- value: false
label: 关闭
description: '开启后静态资源将使用免费的 jsdelivr CDN加载关闭后使用服务器网络加载'
i18n:
name: i18n
label: 主题语言
type: select
default: auto
options:
- value: auto
label: 自动
- value: zh
label: 中文(简体)
- value: en
label: 英文
reply_mail_img:
name: reply_mail_img
label: 邮件回复模块图片

View File

@ -0,0 +1,130 @@
/*!
* jQuery i18n plugin
* @requires jQuery v1.1 or later
*
* See https://github.com/recurser/jquery-i18n
*
* Licensed under the MIT license.
*
* Version: 1.1.2 (Fri, 11 Aug 2017 03:52:21 GMT)
*/
(function($) {
/**
* i18n provides a mechanism for translating strings using a jscript dictionary.
*
*/
var __slice = Array.prototype.slice;
/*
* i18n property list
*/
var i18n = {
dict: null,
missingPattern: null,
/**
* load()
*
* Load translations.
*
* @param property_list i18nDict : The dictionary to use for translation.
*/
load: function(i18nDict, missingPattern) {
if (this.dict !== null) {
$.extend(this.dict, i18nDict);
} else {
this.dict = i18nDict;
}
if (missingPattern) {
this.missingPattern = missingPattern;
}
},
/**
* unload()
*
* Unloads translations and clears the dictionary.
*/
unload: function() {
this.dict = null;
this.missingPattern = null;
},
/**
* _()
*
* Looks the given string up in the dictionary and returns the translation if
* one exists. If a translation is not found, returns the original word.
*
* @param string str : The string to translate.
* @param property_list params.. : params for using printf() on the string.
*
* @return string : Translated word.
*/
_: function (str) {
let strs = str.split(".");
let data = Object.assign({}, this.dict);
for(let i = 0; i < strs.length - 1; ++i) {
if(data.hasOwnProperty(strs[i])) {
data = data[strs[i]];
} else {
break;
}
}
str = strs[strs.length - 1]
if (data && data.hasOwnProperty(str)) {
str = data[str];
} else if (this.missingPattern !== null) {
return this.printf(this.missingPattern, str);
}
let args = __slice.call(arguments);
args[0] = str;
// Substitute any params.
return this.printf.apply(this, args);
},
/*
* printf()
*
* Substitutes %s with parameters given in list. %%s is used to escape %s.
*
* @param string str : String to perform printf on.
* @param string args : Array of arguments for printf.
*
* @return string result : Substituted string
*/
printf: function(str, args) {
if (arguments.length < 2) return str;
args = $.isArray(args) ? args : __slice.call(arguments, 1);
return str.replace(/([^%]|^)%(?:(\d+)\$)?s/g, function(p0, p, position) {
if (position) {
return p + args[parseInt(position)-1];
}
return p + args.shift();
}).replace(/%%s/g, '%s');
}
};
/*
* _t()
*
* Allows you to translate a jQuery selector.
*
* eg $('h1')._t('some text')
*
* @param string str : The string to translate .
* @param property_list params : Params for using printf() on the string.
*
* @return element : Chained and translated element(s).
*/
$.fn._t = function(str, params) {
return $(this).html(i18n._.apply(i18n, arguments));
};
$.i18n = i18n;
})(jQuery);

View File

@ -0,0 +1 @@
"use strict";!function(t){var n=Array.prototype.slice,i={dict:null,missingPattern:null,load:function(n,i){null!==this.dict?t.extend(this.dict,n):this.dict=n,i&&(this.missingPattern=i)},unload:function(){this.dict=null,this.missingPattern=null},_:function(t){for(var i=t.split("."),s=Object.assign({},this.dict),r=0;r<i.length-1&&s.hasOwnProperty(i[r]);++r)s=s[i[r]];if(t=i[i.length-1],s&&s.hasOwnProperty(t))t=s[t];else if(null!==this.missingPattern)return this.printf(this.missingPattern,t);var e=n.call(arguments);return e[0]=t,this.printf.apply(this,e)},printf:function(i,s){return arguments.length<2?i:(s=t.isArray(s)?s:n.call(arguments,1),i.replace(/([^%]|^)%(?:(\d+)\$)?s/g,function(t,n,i){return i?n+s[parseInt(i)-1]:n+s.shift()}).replace(/%%s/g,"%s"))}};t.fn._t=function(n,s){return t(this).html(i._.apply(i,arguments))},t.i18n=i}(jQuery);

View File

@ -0,0 +1,46 @@
{
"name": "js-yaml",
"main": "dist/js-yaml.js",
"homepage": "https://github.com/nodeca/js-yaml",
"authors": [
"Vladimir Zapparov <dervus.grim@gmail.com>",
"Vitaly Puzrin <vitaly@rcdesign.ru>",
"Aleksey V Zapparov <ixti@member.fsf.org>",
"Martin Grenfell <martin.grenfell@gmail.com>"
],
"description": "YAML 1.2 parser and serializer",
"keywords": [
"yaml",
"parser",
"serializer",
"pyyaml"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"benchmark",
"bin",
"bower_components",
"coverage",
"demo",
"examples",
"lib",
"support",
"test",
"Makefile",
"index*",
"package.json"
],
"version": "3.14.0",
"_release": "3.14.0",
"_resolution": {
"type": "version",
"tag": "3.14.0",
"commit": "34e5072f43fd36b08aaaad433da73c10d47c41e5"
},
"_source": "https://github.com/nodeca/js-yaml.git",
"_target": "^3.14.0",
"_originalSource": "js-yaml",
"_direct": true
}

View File

@ -0,0 +1,551 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.14.0] - 2020-05-22
### Changed
- Support `safe/loadAll(input, options)` variant of call.
- CI: drop outdated nodejs versions.
- Dev deps bump.
### Fixed
- Quote `=` in plain scalars #519.
- Check the node type for `!<?>` tag in case user manually specifies it.
- Verify that there are no null-bytes in input.
- Fix wrong quote position when writing condensed flow, #526.
## [3.13.1] - 2019-04-05
### Security
- Fix possible code execution in (already unsafe) `.load()`, #480.
## [3.13.0] - 2019-03-20
### Security
- Security fix: `safeLoad()` can hang when arrays with nested refs
used as key. Now throws exception for nested arrays. #475.
## [3.12.2] - 2019-02-26
### Fixed
- Fix `noArrayIndent` option for root level, #468.
## [3.12.1] - 2019-01-05
### Added
- Added `noArrayIndent` option, #432.
## [3.12.0] - 2018-06-02
### Changed
- Support arrow functions without a block statement, #421.
## [3.11.0] - 2018-03-05
### Added
- Add arrow functions suport for `!!js/function`.
### Fixed
- Fix dump in bin/octal/hex formats for negative integers, #399.
## [3.10.0] - 2017-09-10
### Fixed
- Fix `condenseFlow` output (quote keys for sure, instead of spaces), #371, #370.
- Dump astrals as codepoints instead of surrogate pair, #368.
## [3.9.1] - 2017-07-08
### Fixed
- Ensure stack is present for custom errors in node 7.+, #351.
## [3.9.0] - 2017-07-08
### Added
- Add `condenseFlow` option (to create pretty URL query params), #346.
### Fixed
- Support array return from safeLoadAll/loadAll, #350.
## [3.8.4] - 2017-05-08
### Fixed
- Dumper: prevent space after dash for arrays that wrap, #343.
## [3.8.3] - 2017-04-05
### Fixed
- Should not allow numbers to begin and end with underscore, #335.
## [3.8.2] - 2017-03-02
### Fixed
- Fix `!!float 123` (integers) parse, #333.
- Don't allow leading zeros in floats (except 0, 0.xxx).
- Allow positive exponent without sign in floats.
## [3.8.1] - 2017-02-07
### Changed
- Maintenance: update browserified build.
## [3.8.0] - 2017-02-07
### Fixed
- Fix reported position for `duplicated mapping key` errors.
Now points to block start instead of block end.
(#243, thanks to @shockey).
## [3.7.0] - 2016-11-12
### Added
- Support polymorphism for tags (#300, thanks to @monken).
### Fixed
- Fix parsing of quotes followed by newlines (#304, thanks to @dplepage).
## [3.6.1] - 2016-05-11
### Fixed
- Fix output cut on a pipe, #286.
## [3.6.0] - 2016-04-16
### Fixed
- Dumper rewrite, fix multiple bugs with trailing `\n`.
Big thanks to @aepsilon!
- Loader: fix leading/trailing newlines in block scalars, @aepsilon.
## [3.5.5] - 2016-03-17
### Fixed
- Date parse fix: don't allow dates with on digit in month and day, #268.
## [3.5.4] - 2016-03-09
### Added
- `noCompatMode` for dumper, to disable quoting YAML 1.1 values.
## [3.5.3] - 2016-02-11
### Changed
- Maintenance release.
## [3.5.2] - 2016-01-11
### Changed
- Maintenance: missed comma in bower config.
## [3.5.1] - 2016-01-11
### Changed
- Removed `inherit` dependency, #239.
- Better browserify workaround for esprima load.
- Demo rewrite.
## [3.5.0] - 2016-01-10
### Fixed
- Dumper. Fold strings only, #217.
- Dumper. `norefs` option, to clone linked objects, #229.
- Loader. Throw a warning for duplicate keys, #166.
- Improved browserify support (mark `esprima` & `Buffer` excluded).
## [3.4.6] - 2015-11-26
### Changed
- Use standalone `inherit` to keep browserified files clear.
## [3.4.5] - 2015-11-23
### Added
- Added `lineWidth` option to dumper.
## [3.4.4] - 2015-11-21
### Fixed
- Fixed floats dump (missed dot for scientific format), #220.
- Allow non-printable characters inside quoted scalars, #192.
## [3.4.3] - 2015-10-10
### Changed
- Maintenance release - deps bump (esprima, argparse).
## [3.4.2] - 2015-09-09
### Fixed
- Fixed serialization of duplicated entries in sequences, #205.
Thanks to @vogelsgesang.
## [3.4.1] - 2015-09-05
### Fixed
- Fixed stacktrace handling in generated errors, for browsers (FF/IE).
## [3.4.0] - 2015-08-23
### Changed
- Don't throw on warnings anymore. Use `onWarning` option to catch.
- Throw error on unknown tags (was warning before).
- Reworked internals of error class.
### Fixed
- Fixed multiline keys dump, #197. Thanks to @tcr.
- Fixed heading line breaks in some scalars (regression).
## [3.3.1] - 2015-05-13
### Added
- Added `.sortKeys` dumper option, thanks to @rjmunro.
### Fixed
- Fixed astral characters support, #191.
## [3.3.0] - 2015-04-26
### Changed
- Significantly improved long strings formatting in dumper, thanks to @isaacs.
- Strip BOM if exists.
## [3.2.7] - 2015-02-19
### Changed
- Maintenance release.
- Updated dependencies.
- HISTORY.md -> CHANGELOG.md
## [3.2.6] - 2015-02-07
### Fixed
- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE).
- Fixed demo dates dump (#113, thanks to @Hypercubed).
## [3.2.5] - 2014-12-28
### Fixed
- Fixed resolving of all built-in types on empty nodes.
- Fixed invalid warning on empty lines within quoted scalars and flow collections.
- Fixed bug: Tag on an empty node didn't resolve in some cases.
## [3.2.4] - 2014-12-19
### Fixed
- Fixed resolving of !!null tag on an empty node.
## [3.2.3] - 2014-11-08
### Fixed
- Implemented dumping of objects with circular and cross references.
- Partially fixed aliasing of constructed objects. (see issue #141 for details)
## [3.2.2] - 2014-09-07
### Fixed
- Fixed infinite loop on unindented block scalars.
- Rewritten base64 encode/decode in binary type, to keep code licence clear.
## [3.2.1] - 2014-08-24
### Fixed
- Nothig new. Just fix npm publish error.
## [3.2.0] - 2014-08-24
### Added
- Added input piping support to CLI.
### Fixed
- Fixed typo, that could cause hand on initial indent (#139).
## [3.1.0] - 2014-07-07
### Changed
- 1.5x-2x speed boost.
- Removed deprecated `require('xxx.yml')` support.
- Significant code cleanup and refactoring.
- Internal API changed. If you used custom types - see updated examples.
Others are not affected.
- Even if the input string has no trailing line break character,
it will be parsed as if it has one.
- Added benchmark scripts.
- Moved bower files to /dist folder
- Bugfixes.
## [3.0.2] - 2014-02-27
### Fixed
- Fixed bug: "constructor" string parsed as `null`.
## [3.0.1] - 2013-12-22
### Fixed
- Fixed parsing of literal scalars. (issue #108)
- Prevented adding unnecessary spaces in object dumps. (issue #68)
- Fixed dumping of objects with very long (> 1024 in length) keys.
## [3.0.0] - 2013-12-16
### Changed
- Refactored code. Changed API for custom types.
- Removed output colors in CLI, dump json by default.
- Removed big dependencies from browser version (esprima, buffer). Load `esprima` manually, if `!!js/function` needed. `!!bin` now returns Array in browser
- AMD support.
- Don't quote dumped strings because of `-` & `?` (if not first char).
- __Deprecated__ loading yaml files via `require()`, as not recommended
behaviour for node.
## [2.1.3] - 2013-10-16
### Fixed
- Fix wrong loading of empty block scalars.
## [2.1.2] - 2013-10-07
### Fixed
- Fix unwanted line breaks in folded scalars.
## [2.1.1] - 2013-10-02
### Fixed
- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1
- Fixed reader bug in JSON-like sequences/mappings.
## [2.1.0] - 2013-06-05
### Added
- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`),
JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`).
- Add `skipInvalid` dumper option.
### Changed
- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA`
and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`.
- Use `safeLoad` for `require` extension.
### Fixed
- Bug fix: export `NIL` constant from the public interface.
## [2.0.5] - 2013-04-26
### Security
- Close security issue in !!js/function constructor.
Big thanks to @nealpoole for security audit.
## [2.0.4] - 2013-04-08
### Changed
- Updated .npmignore to reduce package size
## [2.0.3] - 2013-02-26
### Fixed
- Fixed dumping of empty arrays ans objects. ([] and {} instead of null)
## [2.0.2] - 2013-02-15
### Fixed
- Fixed input validation: tabs are printable characters.
## [2.0.1] - 2013-02-09
### Fixed
- Fixed error, when options not passed to function cass
## [2.0.0] - 2013-02-09
### Changed
- Full rewrite. New architecture. Fast one-stage parsing.
- Changed custom types API.
- Added YAML dumper.
## [1.0.3] - 2012-11-05
### Fixed
- Fixed utf-8 files loading.
## [1.0.2] - 2012-08-02
### Fixed
- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44.
- Fix timstamps incorectly parsed in local time when no time part specified.
## [1.0.1] - 2012-07-07
### Fixed
- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong.
- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46.
## [1.0.0] - 2012-07-01
### Changed
- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore.
Fixes #42.
- `require(filename)` now returns a single document and throws an Error if
file contains more than one document.
- CLI was merged back from js-yaml.bin
## [0.3.7] - 2012-02-28
### Fixed
- Fix export of `addConstructor()`. Closes #39.
## [0.3.6] - 2012-02-22
### Changed
- Removed AMD parts - too buggy to use. Need help to rewrite from scratch
### Fixed
- Removed YUI compressor warning (renamed `double` variable). Closes #40.
## [0.3.5] - 2012-01-10
### Fixed
- Workagound for .npmignore fuckup under windows. Thanks to airportyh.
## [0.3.4] - 2011-12-24
### Fixed
- Fixes str[] for oldIEs support.
- Adds better has change support for browserified demo.
- improves compact output of Error. Closes #33.
## [0.3.3] - 2011-12-20
### Added
- adds `compact` stringification of Errors.
### Changed
- jsyaml executable moved to separate module.
## [0.3.2] - 2011-12-16
### Added
- Added jsyaml executable.
- Added !!js/function support. Closes #12.
### Fixed
- Fixes ug with block style scalars. Closes #26.
- All sources are passing JSLint now.
- Fixes bug in Safari. Closes #28.
- Fixes bug in Opers. Closes #29.
- Improves browser support. Closes #20.
## [0.3.1] - 2011-11-18
### Added
- Added AMD support for browserified version.
- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol.
- Added !!js/regexp and !!js/undefined types. Partially solves #12.
### Changed
- Wrapped browserified js-yaml into closure.
### Fixed
- Fixed the resolvement of non-specific tags. Closes #17.
- Fixed !!set mapping.
- Fixed month parse in dates. Closes #19.
## [0.3.0] - 2011-11-09
### Added
- Added browserified version. Closes #13.
- Added live demo of browserified version.
- Ported some of the PyYAML tests. See #14.
### Fixed
- Removed JS.Class dependency. Closes #3.
- Fixed timestamp bug when fraction was given.
## [0.2.2] - 2011-11-06
### Fixed
- Fixed crash on docs without ---. Closes #8.
- Fixed multiline string parse
- Fixed tests/comments for using array as key
## [0.2.1] - 2011-11-02
### Fixed
- Fixed short file read (<4k). Closes #9.
## [0.2.0] - 2011-11-02
### Changed
- First public release
[3.14.0]: https://github.com/nodeca/js-yaml/compare/3.13.1...3.14.0
[3.13.1]: https://github.com/nodeca/js-yaml/compare/3.13.0...3.13.1
[3.13.0]: https://github.com/nodeca/js-yaml/compare/3.12.2...3.13.0
[3.12.2]: https://github.com/nodeca/js-yaml/compare/3.12.1...3.12.2
[3.12.1]: https://github.com/nodeca/js-yaml/compare/3.12.0...3.12.1
[3.12.0]: https://github.com/nodeca/js-yaml/compare/3.11.0...3.12.0
[3.11.0]: https://github.com/nodeca/js-yaml/compare/3.10.0...3.11.0
[3.10.0]: https://github.com/nodeca/js-yaml/compare/3.9.1...3.10.0
[3.9.1]: https://github.com/nodeca/js-yaml/compare/3.9.0...3.9.1
[3.9.0]: https://github.com/nodeca/js-yaml/compare/3.8.4...3.9.0
[3.8.4]: https://github.com/nodeca/js-yaml/compare/3.8.3...3.8.4
[3.8.3]: https://github.com/nodeca/js-yaml/compare/3.8.2...3.8.3
[3.8.2]: https://github.com/nodeca/js-yaml/compare/3.8.1...3.8.2
[3.8.1]: https://github.com/nodeca/js-yaml/compare/3.8.0...3.8.1
[3.8.0]: https://github.com/nodeca/js-yaml/compare/3.7.0...3.8.0
[3.7.0]: https://github.com/nodeca/js-yaml/compare/3.6.1...3.7.0
[3.6.1]: https://github.com/nodeca/js-yaml/compare/3.6.0...3.6.1
[3.6.0]: https://github.com/nodeca/js-yaml/compare/3.5.5...3.6.0
[3.5.5]: https://github.com/nodeca/js-yaml/compare/3.5.4...3.5.5
[3.5.4]: https://github.com/nodeca/js-yaml/compare/3.5.3...3.5.4
[3.5.3]: https://github.com/nodeca/js-yaml/compare/3.5.2...3.5.3
[3.5.2]: https://github.com/nodeca/js-yaml/compare/3.5.1...3.5.2
[3.5.1]: https://github.com/nodeca/js-yaml/compare/3.5.0...3.5.1
[3.5.0]: https://github.com/nodeca/js-yaml/compare/3.4.6...3.5.0
[3.4.6]: https://github.com/nodeca/js-yaml/compare/3.4.5...3.4.6
[3.4.5]: https://github.com/nodeca/js-yaml/compare/3.4.4...3.4.5
[3.4.4]: https://github.com/nodeca/js-yaml/compare/3.4.3...3.4.4
[3.4.3]: https://github.com/nodeca/js-yaml/compare/3.4.2...3.4.3
[3.4.2]: https://github.com/nodeca/js-yaml/compare/3.4.1...3.4.2
[3.4.1]: https://github.com/nodeca/js-yaml/compare/3.4.0...3.4.1
[3.4.0]: https://github.com/nodeca/js-yaml/compare/3.3.1...3.4.0
[3.3.1]: https://github.com/nodeca/js-yaml/compare/3.3.0...3.3.1
[3.3.0]: https://github.com/nodeca/js-yaml/compare/3.2.7...3.3.0
[3.2.7]: https://github.com/nodeca/js-yaml/compare/3.2.6...3.2.7
[3.2.6]: https://github.com/nodeca/js-yaml/compare/3.2.5...3.2.6
[3.2.5]: https://github.com/nodeca/js-yaml/compare/3.2.4...3.2.5
[3.2.4]: https://github.com/nodeca/js-yaml/compare/3.2.3...3.2.4
[3.2.3]: https://github.com/nodeca/js-yaml/compare/3.2.2...3.2.3
[3.2.2]: https://github.com/nodeca/js-yaml/compare/3.2.1...3.2.2
[3.2.1]: https://github.com/nodeca/js-yaml/compare/3.2.0...3.2.1
[3.2.0]: https://github.com/nodeca/js-yaml/compare/3.1.0...3.2.0
[3.1.0]: https://github.com/nodeca/js-yaml/compare/3.0.2...3.1.0
[3.0.2]: https://github.com/nodeca/js-yaml/compare/3.0.1...3.0.2
[3.0.1]: https://github.com/nodeca/js-yaml/compare/3.0.0...3.0.1
[3.0.0]: https://github.com/nodeca/js-yaml/compare/2.1.3...3.0.0
[2.1.3]: https://github.com/nodeca/js-yaml/compare/2.1.2...2.1.3
[2.1.2]: https://github.com/nodeca/js-yaml/compare/2.1.1...2.1.2
[2.1.1]: https://github.com/nodeca/js-yaml/compare/2.1.0...2.1.1
[2.1.0]: https://github.com/nodeca/js-yaml/compare/2.0.5...2.1.0
[2.0.5]: https://github.com/nodeca/js-yaml/compare/2.0.4...2.0.5
[2.0.4]: https://github.com/nodeca/js-yaml/compare/2.0.3...2.0.4
[2.0.3]: https://github.com/nodeca/js-yaml/compare/2.0.2...2.0.3
[2.0.2]: https://github.com/nodeca/js-yaml/compare/2.0.1...2.0.2
[2.0.1]: https://github.com/nodeca/js-yaml/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/nodeca/js-yaml/compare/1.0.3...2.0.0
[1.0.3]: https://github.com/nodeca/js-yaml/compare/1.0.2...1.0.3
[1.0.2]: https://github.com/nodeca/js-yaml/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/nodeca/js-yaml/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/nodeca/js-yaml/compare/0.3.7...1.0.0
[0.3.7]: https://github.com/nodeca/js-yaml/compare/0.3.6...0.3.7
[0.3.6]: https://github.com/nodeca/js-yaml/compare/0.3.5...0.3.6
[0.3.5]: https://github.com/nodeca/js-yaml/compare/0.3.4...0.3.5
[0.3.4]: https://github.com/nodeca/js-yaml/compare/0.3.3...0.3.4
[0.3.3]: https://github.com/nodeca/js-yaml/compare/0.3.2...0.3.3
[0.3.2]: https://github.com/nodeca/js-yaml/compare/0.3.1...0.3.2
[0.3.1]: https://github.com/nodeca/js-yaml/compare/0.3.0...0.3.1
[0.3.0]: https://github.com/nodeca/js-yaml/compare/0.2.2...0.3.0
[0.2.2]: https://github.com/nodeca/js-yaml/compare/0.2.1...0.2.2
[0.2.1]: https://github.com/nodeca/js-yaml/compare/0.2.0...0.2.1
[0.2.0]: https://github.com/nodeca/js-yaml/releases/tag/0.2.0

View File

@ -0,0 +1,21 @@
(The MIT License)
Copyright (C) 2011-2015 by Vitaly Puzrin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,299 @@
JS-YAML - YAML 1.2 parser / writer for JavaScript
=================================================
[![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml)
[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml)
__[Online Demo](http://nodeca.github.com/js-yaml/)__
This is an implementation of [YAML](http://yaml.org/), a human-friendly data
serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was
completely rewritten from scratch. Now it's very fast, and supports 1.2 spec.
Installation
------------
### YAML module for node.js
```
npm install js-yaml
```
### CLI executable
If you want to inspect your YAML files from CLI, install js-yaml globally:
```
npm install -g js-yaml
```
#### Usage
```
usage: js-yaml [-h] [-v] [-c] [-t] file
Positional arguments:
file File with YAML document(s)
Optional arguments:
-h, --help Show this help message and exit.
-v, --version Show program's version number and exit.
-c, --compact Display errors in compact mode
-t, --trace Show stack trace on error
```
### Bundled YAML library for browsers
``` html
<!-- esprima required only for !!js/function -->
<script src="esprima.js"></script>
<script src="js-yaml.min.js"></script>
<script type="text/javascript">
var doc = jsyaml.load('greeting: hello\nname: world');
</script>
```
Browser support was done mostly for the online demo. If you find any errors - feel
free to send pull requests with fixes. Also note, that IE and other old browsers
needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate.
Notes:
1. We have no resources to support browserified version. Don't expect it to be
well tested. Don't expect fast fixes if something goes wrong there.
2. `!!js/function` in browser bundle will not work by default. If you really need
it - load `esprima` parser first (via amd or directly).
3. `!!bin` in browser will return `Array`, because browsers do not support
node.js `Buffer` and adding Buffer shims is completely useless on practice.
API
---
Here we cover the most 'useful' methods. If you need advanced details (creating
your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and
[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more
info.
``` javascript
const yaml = require('js-yaml');
const fs = require('fs');
// Get document, or throw exception on error
try {
const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8'));
console.log(doc);
} catch (e) {
console.log(e);
}
```
### safeLoad (string [ , options ])
**Recommended loading way.** Parses `string` as single YAML document. Returns either a
plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does
not support regexps, functions and undefined. This method is safe for untrusted data.
options:
- `filename` _(default: null)_ - string to be used as a file path in
error/warning messages.
- `onWarning` _(default: null)_ - function to call on warning messages.
Loader will call this function with an instance of `YAMLException` for each warning.
- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use.
- `FAILSAFE_SCHEMA` - only strings, arrays and plain objects:
http://www.yaml.org/spec/1.2/spec.html#id2802346
- `JSON_SCHEMA` - all JSON-supported types:
http://www.yaml.org/spec/1.2/spec.html#id2803231
- `CORE_SCHEMA` - same as `JSON_SCHEMA`:
http://www.yaml.org/spec/1.2/spec.html#id2804923
- `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones
(`!!js/undefined`, `!!js/regexp` and `!!js/function`):
http://yaml.org/type/
- `DEFAULT_FULL_SCHEMA` - all supported YAML types.
- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error.
NOTE: This function **does not** understand multi-document sources, it throws
exception on those.
NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.
So, the JSON schema is not as strictly defined in the YAML specification.
It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
The core schema also has no such restrictions. It allows binary notation for integers.
### load (string [ , options ])
**Use with care with untrusted sources**. The same as `safeLoad()` but uses
`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types:
`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you
must additionally validate object structure to avoid injections:
``` javascript
const untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
// I'm just converting that string, what could possibly go wrong?
require('js-yaml').load(untrusted_code) + ''
```
### safeLoadAll (string [, iterator] [, options ])
Same as `safeLoad()`, but understands multi-document sources. Applies
`iterator` to each document if specified, or returns array of documents.
``` javascript
const yaml = require('js-yaml');
yaml.safeLoadAll(data, function (doc) {
console.log(doc);
});
```
### loadAll (string [, iterator] [ , options ])
Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default.
### safeDump (object [ , options ])
Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will
throw an exception if you try to dump regexps or functions. However, you can
disable exceptions by setting the `skipInvalid` option to `true`.
options:
- `indent` _(default: 2)_ - indentation width to use (in spaces).
- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements
- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function
in the safe schema) and skip pairs and single values with such types.
- `flowLevel` (default: -1) - specifies level of nesting, when to switch from
block to flow style for collections. -1 means block style everwhere
- `styles` - "tag" => "style" map. Each tag may have own set of styles.
- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use.
- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a
function, use the function to sort the keys.
- `lineWidth` _(default: `80`)_ - set max line width.
- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references
- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older
yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1
- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded.
The following table show availlable styles (e.g. "canonical",
"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml
output is shown on the right side after `=>` (default setting) or `->`:
``` none
!!null
"canonical" -> "~"
"lowercase" => "null"
"uppercase" -> "NULL"
"camelcase" -> "Null"
!!int
"binary" -> "0b1", "0b101010", "0b1110001111010"
"octal" -> "01", "052", "016172"
"decimal" => "1", "42", "7290"
"hexadecimal" -> "0x1", "0x2A", "0x1C7A"
!!bool
"lowercase" => "true", "false"
"uppercase" -> "TRUE", "FALSE"
"camelcase" -> "True", "False"
!!float
"lowercase" => ".nan", '.inf'
"uppercase" -> ".NAN", '.INF'
"camelcase" -> ".NaN", '.Inf'
```
Example:
``` javascript
safeDump (object, {
'styles': {
'!!null': 'canonical' // dump null as ~
},
'sortKeys': true // sort object keys
});
```
### dump (object [ , options ])
Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default).
Supported YAML types
--------------------
The list of standard YAML tags and corresponding JavaScipt types. See also
[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and
[YAML types repository](http://yaml.org/type/).
```
!!null '' # null
!!bool 'yes' # bool
!!int '3...' # number
!!float '3.14...' # number
!!binary '...base64...' # buffer
!!timestamp 'YYYY-...' # date
!!omap [ ... ] # array of key-value pairs
!!pairs [ ... ] # array or array pairs
!!set { ... } # array of objects with given keys and null values
!!str '...' # string
!!seq [ ... ] # array
!!map { ... } # object
```
**JavaScript-specific tags**
```
!!js/regexp /pattern/gim # RegExp
!!js/undefined '' # Undefined
!!js/function 'function () {...}' # Function
```
Caveats
-------
Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects
or arrays as keys, and stringifies (by calling `toString()` method) them at the
moment of adding them.
``` yaml
---
? [ foo, bar ]
: - baz
? { foo: bar }
: - baz
- baz
```
``` javascript
{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] }
```
Also, reading of properties on implicit block mapping keys is not supported yet.
So, the following YAML document cannot be loaded.
``` yaml
&anchor foo:
foo: bar
*anchor: duplicate key
baz: bat
*anchor: duplicate key
```
js-yaml for enterprise
----------------------
Available as part of the Tidelift Subscription
The maintainers of js-yaml and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

View File

@ -0,0 +1,29 @@
{
"name": "js-yaml",
"main": "dist/js-yaml.js",
"homepage": "https://github.com/nodeca/js-yaml",
"authors": [ "Vladimir Zapparov <dervus.grim@gmail.com>",
"Vitaly Puzrin <vitaly@rcdesign.ru>",
"Aleksey V Zapparov <ixti@member.fsf.org>",
"Martin Grenfell <martin.grenfell@gmail.com>" ],
"description": "YAML 1.2 parser and serializer",
"keywords": ["yaml", "parser", "serializer", "pyyaml"],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"benchmark",
"bin",
"bower_components",
"coverage",
"demo",
"examples",
"lib",
"support",
"test",
"Makefile",
"index*",
"package.json"
]
}

3989
source/lib/js-yaml/dist/js-yaml.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -766,7 +766,10 @@ a:active {
min-width: 99.999%;
min-height: 550px;
z-index: 0;
height: 100vh
/** 使视频全屏。并保证填满屏幕 */
height: 100vh;
-o-object-fit: fill;
object-fit: fill;
}
#video-btn,
@ -2831,7 +2834,7 @@ h1.page-title.mb- {
background-size: auto 100%
}
h3#comments-list-title {
h3#comments-list-title .name {
max-width: 860px;
width: 100%;
margin: 0 auto;
@ -2840,7 +2843,7 @@ h3#comments-list-title {
font-weight: 400
}
#comments-list-title span {
#comments-list-title .noticom {
font-size: 13px;
font-weight: 400;
color: #909090

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

21
tag.ftl
View File

@ -12,7 +12,7 @@
<img data-src='${((tag.thumbnail)?length>0)?string((tag.thumbnail),"${settings.tag_patternimg!}")}' src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="cat-title">标签:${tag.name!}</h1>
<h1 class="cat-title i18n" data-iname="page.tags.item.title" data-ivalue="${tag.name!}"></h1>
</header>
</div>
<#else>
@ -46,24 +46,7 @@
</#if>
</main><!-- #main -->
<@paginationTag method="tagPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${tag.slug!}">
<#if (settings.pagenav_style!'ajax') == 'ajax'>
<div id="pagination">
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}" class="">Previous</a>
<#else>
<span>没有更多文章了</span>
</#if>
</div>
<#else>
<nav class="navigator">
<#if pagination.hasPrev>
<a href="${pagination.prevPageFullPath!}"><i class="iconfont icon-previous"></i></a>
</#if>
<#if pagination.hasNext>
<a href="${pagination.nextPageFullPath!}"><i class="iconfont icon-next"></i></a>
</#if>
</nav>
</#if>
<#include "layouts/list-nextprev.ftl">
</@paginationTag>
</div><!-- #primary -->
<#include "footer.ftl">

View File

@ -14,13 +14,21 @@
<img data-src="${settings.tag_patternimg!}" src="${res_base_url!}/source/images/svg/loader/orange.progress-bar-stripe-loader.svg" class="lazyload" onerror="imgError(this, IMG_Type.DEFAULT)">
</div>
<header class="pattern-header">
<h1 class="entry-title">${options.tags_title?default('文章标签')}</h1>
<#if options.tags_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.tags_title}</h1>
<#else>
<h1 class="entry-title i18n" data-iname="page.tags.title"></h1>
</#if>
</header>
</div>
<#else>
<div class="blank"></div>
<header class="entry-header">
<h1 class="entry-title">${options.tags_title?default('文章标签')}</h1>
<#if options.tags_title?default("")?trim?length gt 1>
<h1 class="entry-title">${options.tags_title}</h1>
<#else>
<h1 class="entry-title i18n" data-iname="page.tags.title"></h1>
</#if>
</header>
</#if>
</@header>
@ -49,7 +57,7 @@
<div class="card">
<div class="card-content">
<div class="tag-title center-align">
<i class="fa fa-tags"></i>&nbsp;&nbsp;文章标签
<i class="fa fa-tags"></i>&nbsp;&nbsp;<span class="i18n" data-iname="page.tags.title"></span>
</div>
<div class="tag-chips">
<@tagTag method="list">

View File

@ -1,14 +1,20 @@
<section>
<#if !(settings.patternimg!true) || !(settings.photos_patternimg?? && settings.photos_patternimg!='')>
<header class="entry-header">
<h1 class="entry-title">${options.photos_title?default('图库')}</h1>
<h1 class="entry-title">
<#if options.photos_title?default("")?trim?length gt 1>
<span>${options.photos_title}</span>
<#else>
<span class="i18n" data-iname="page.photos.title"></span>
</#if>
</h1>
</header><!-- .entry-header -->
</#if>
<div class="wrapper justify-wrapper">
<nav id="gallery-filter">
<ul>
<li>
<a href="javascript:void(0);" data-filter="*" class="active">全部</a>
<a href="javascript:void(0);" data-filter="*" class="active i18n" data-iname="page.photos.all"></a>
</li>
<@photoTag method="listTeams">
<#list teams as item>

View File

@ -1,7 +1,13 @@
<article>
<#if !(settings.patternimg!true) || (!(settings.links_patternimg?? && settings.links_patternimg!='') && !(is_sheet?? && sheet.thumbnail?? && sheet.thumbnail!=''))>
<header class="entry-header">
<h1 class="entry-title">${options.links_title?default('友情链接')}</h1>
<h1 class="entry-title">
<#if options.links_title?default("")?trim?length gt 1>
<span>${options.links_title}</span>
<#else>
<span class="i18n" data-iname="page.links.title"></span>
</#if>
</h1>
</header><!-- .entry-header -->
</#if>
<#if is_sheet??>

View File

@ -1,14 +1,20 @@
<section>
<#if !(settings.patternimg!true) || !(settings.photos_patternimg?? && settings.photos_patternimg!='')>
<header class="entry-header">
<h1 class="entry-title">${options.photos_title?default('图库')}</h1>
<h1 class="entry-title">
<#if options.photos_title?default("")?trim?length gt 1>
<span>${options.photos_title}</span>
<#else>
<span class="i18n" data-iname="page.photos.title"></span>
</#if>
</h1>
</header><!-- .entry-header -->
</#if>
<div class="wrapper">
<nav id="gallery-filter">
<ul>
<li>
<a href="javascript:void(0);" data-filter="*" class="active">全部</a>
<a href="javascript:void(0);" data-filter="*" class="active i18n" data-iname="page.photos.all"></a>
</li>
<@photoTag method="listTeams">
<#list teams as item>

View File

@ -3,13 +3,13 @@
-->
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title">没有找到任何东西!</h1>
<h1 class="page-title i18n" data-iname="page.none.title"></h1>
</header><!-- .page-header -->
<div class="page-content">
<#if is_search??>
<div class="sorry">
<p>没有找到你想要的,看看其他的吧。</p>
<p class="i18n" data-iname="page.none.search"></p>
<div class="sorry-inner">
<ul class="search-no-reasults">
<@postTag method="latest" top="10">
@ -21,7 +21,7 @@
</div>
</div>
<#else>
<p>我们似乎没有找到你想要的东西. 或许你可以搜索一下试试.</p>
<p class="i18n" data-iname="page.none.notfound"></p>
</#if>
</div><!-- .page-content -->
</section><!-- .no-results -->

View File

@ -6,7 +6,7 @@
<header class="entry-header">
<h1 class="entry-title">${post.title!}</h1>
<p class="entry-census">${post.createTime?string('yyyy-MM-dd')}
&nbsp;&nbsp;${post.visits!0} 次阅读</p>
&nbsp;&nbsp;<span class="i18n" data-iname="post.visits" data-ivalue="${post.visits!0}"></span></p>
<hr>
</header><!-- .entry-header -->
</#if>
@ -21,7 +21,7 @@
</div><!-- .entry-content -->
<#if settings.alipay_code?? || settings.wechat_code??>
<div class="single-reward">
<div class="reward-open">
<div class="reward-open"><span class="i18n" data-iname="post.reward"></span>
<div class="reward-main">
<ul class="reward-row">
<#if settings.alipay_code?? && settings.alipay_code!=''>
@ -39,7 +39,7 @@
<div class="post-lincenses">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank" rel="nofollow">
<i class="fa fa-creative-commons" aria-hidden="true"></i>
知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议
<span class="i18n" data-iname="post.creative_commons"></span>
</a>
</div>
<div class="post-tags">

View File

@ -18,13 +18,13 @@
<div class="post-content-wrap">
<div class="post-content">
<div class="post-date">
<i class="iconfont icon-time"></i>发布于 ${post.createTime?string("yyyy-MM-dd")}
<i class="iconfont icon-time"></i><span class="i18n" data-iname="postlist.time" data-ivalue="${post.createTime?string('yyyy-MM-dd')}"></span>
<#if post.topPriority?? && post.topPriority!=0>&nbsp;<i class="iconfont icon-hot hotpost"></i></#if>
</div>
<a href="${post.fullPath!}" class="post-title"><h3>${post.title!}</h3></a>
<div class="post-meta">
<span><i class="iconfont icon-attention"></i>${post.visits?c} 热度</span>
<span class="comments-number"><i class="iconfont icon-mark"></i>${post.commentCount!0} 条评论</span>
<span><i class="iconfont icon-attention"></i><span class="i18n" data-iname="postlist.heat" data-ivalue="${post.visits?c}"></span></span>
<span class="comments-number"><i class="iconfont icon-mark"></i><span class="i18n" data-iname="postlist.comments" data-ivalue="${post.commentCount!0}"></span></span>
<#if post.categories?? && post.categories?size gt 0>
<span><i class="iconfont icon-file"></i><a href="${post.categories[0].fullPath!}">${post.categories[0].name!}</a></span>
</#if>

View File

@ -7,7 +7,7 @@
<#if post.thumbnail?? && post.thumbnail!=''>
<a href="${post.fullPath!}">
<div class="overlay"><i class="iconfont icon-text"></i></div>
<img width="150" height="150" src="${post.thumbnail!}" class="attachment-post-thumbnail size-post-thumbnail" alt="" />
<img width="150" height="150" src="${post.thumbnail!}" class="attachment-post-thumbnail size-post-thumbnail" />
</a>
<#else>
<a href="${post.fullPath!}">
@ -21,7 +21,7 @@
<#if post.topPriority?? && post.topPriority!=0>
<i class="iconfont icon-hot hotpost"></i>
</#if>
<i class="iconfont icon-time"></i>发布于 ${post.createTime?string("yyyy-MM-dd")}
<i class="iconfont icon-time"></i><span class="i18n" data-iname="postlist.time" data-ivalue="${post.createTime?string('yyyy-MM-dd')}"></span>
</div>
<p>${post.summary!}</p>
<footer class="entry-footer">
@ -30,10 +30,10 @@
</div>
<div class="info-meta">
<div class="comnum">
<span><i class="iconfont icon-mark"></i>${post.commentCount!0} 条评论</span>
<span><i class="iconfont icon-mark"></i><span class="i18n" data-iname="postlist.heat" data-ivalue="${post.visits?c}"></span></span>
</div>
<div class="views">
<span><i class="iconfont icon-attention"></i>${post.visits!0} 热度</span>
<span><i class="iconfont icon-attention"></i><span class="i18n" data-iname="postlist.comments" data-ivalue="${post.commentCount!0}"></span></span>
</div>
</div>
</footer><!-- .entry-footer -->