init...
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: npm
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 20
|
||||
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
node_modules/*
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/qr-hexo.iml" filepath="$PROJECT_DIR$/.idea/qr-hexo.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/themes/anzhiyu" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/themes/butterfly" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+123
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="de9fa6e3-30cd-4bd9-9de2-e5d7f0390fc8" name="更改" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="HTML File" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/themes/butterfly" />
|
||||
</component>
|
||||
<component name="GitHubPullRequestSearchHistory">{
|
||||
"lastFilter": {
|
||||
"state": "OPEN",
|
||||
"assignee": "shenjianZ"
|
||||
}
|
||||
}</component>
|
||||
<component name="GithubPullRequestsUISettings">{
|
||||
"selectedUrlAndAccountId": {
|
||||
"url": "https://github.com/jerryc127/hexo-theme-butterfly.git",
|
||||
"accountId": "53499177-02a2-4229-a523-2b51bfe7d230"
|
||||
}
|
||||
}</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"customColor": "",
|
||||
"associatedIndex": 8
|
||||
}</component>
|
||||
<component name="ProjectId" id="2jxaBMaq32ZWf7XyMTBhC0qvzci" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"DefaultHtmlFileTemplate": "HTML File",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": ".invalid",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "D:/JetBrainsToolProject/InteliJIDEA/qr-hexo",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"npm.clean.executor": "Run",
|
||||
"npm.server.executor": "Run",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes\butterfly\source\img" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\static" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager" selected="npm.server">
|
||||
<configuration name="clean" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
|
||||
<package-json value="$PROJECT_DIR$/package.json" />
|
||||
<command value="run" />
|
||||
<scripts>
|
||||
<script value="clean" />
|
||||
</scripts>
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="server" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
|
||||
<package-json value="$PROJECT_DIR$/package.json" />
|
||||
<command value="run" />
|
||||
<scripts>
|
||||
<script value="server" />
|
||||
</scripts>
|
||||
<node-interpreter value="project" />
|
||||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="npm.server" />
|
||||
<item itemvalue="npm.clean" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-jdk-9f38398b9061-39b83d9b5494-intellij.indexing.shared.core-IU-241.18034.62" />
|
||||
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-IU-241.18034.62" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="默认任务">
|
||||
<changelist id="de9fa6e3-30cd-4bd9-9de2-e5d7f0390fc8" name="更改" comment="" />
|
||||
<created>1722331046875</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1722331046875</updated>
|
||||
<workItem from="1722331047325" duration="8230000" />
|
||||
<workItem from="1722339532652" duration="1879000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
</project>
|
||||
+1314
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,993 @@
|
||||
# Navigation bar settings (導航欄設置)
|
||||
# see https://butterfly.js.org/posts/4aa8abbe/##導航欄設置-Navigation-bar-settings
|
||||
# --------------------------------------
|
||||
|
||||
nav:
|
||||
logo: # image
|
||||
display_title: true
|
||||
fixed: true # fixed navigation bar
|
||||
|
||||
# Menu 目錄
|
||||
menu:
|
||||
Home: / || fas fa-home
|
||||
Archives: /archives/ || fas fa-archive
|
||||
Tags: /tags/ || fas fa-tags
|
||||
Categories: /categories/ || fas fa-folder-open
|
||||
List||fas fa-list:
|
||||
Music: /music/ || fas fa-music
|
||||
Movie: /movies/ || fas fa-video
|
||||
Link: /link/ || fas fa-link
|
||||
About: /about/ || fas fa-heart
|
||||
|
||||
# Code Blocks (代碼相關)
|
||||
# --------------------------------------
|
||||
|
||||
highlight_theme: mac # darker / pale night / light / ocean / mac / mac light / false
|
||||
highlight_copy: true # copy button
|
||||
highlight_lang: true # show the code language
|
||||
highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
|
||||
highlight_height_limit: false # unit: px
|
||||
code_word_wrap: false
|
||||
|
||||
# Social Settings (社交圖標設置)
|
||||
# formal:
|
||||
# icon: link || the description || color
|
||||
social:
|
||||
fab fa-github: https://github.com/shenjianZ || Github || '#24292e'
|
||||
fas fa-envelope: mailto:15202078626@163.com || Email || '#4a7dbe'
|
||||
|
||||
# Image (圖片設置)
|
||||
# --------------------------------------
|
||||
|
||||
# Favicon(網站圖標)
|
||||
favicon: /img/favicon.png
|
||||
|
||||
# Avatar (頭像)
|
||||
avatar:
|
||||
img: /img/avatar.jpg
|
||||
effect: false
|
||||
|
||||
# Disable all banner image
|
||||
disable_top_img: false
|
||||
|
||||
# The banner image of home page
|
||||
index_img:
|
||||
|
||||
# If the banner of page not setting, it will show the top_img
|
||||
default_top_img:
|
||||
|
||||
# The banner image of archive page
|
||||
archive_img:
|
||||
|
||||
# If the banner of tag page not setting, it will show the top_img
|
||||
# note: tag page, not tags page (子標籤頁面的 top_img)
|
||||
tag_img:
|
||||
|
||||
# The banner image of tag page
|
||||
# format:
|
||||
# - tag name: xxxxx
|
||||
tag_per_img:
|
||||
|
||||
# If the banner of category page not setting, it will show the top_img
|
||||
# note: category page, not categories page (子分類頁面的 top_img)
|
||||
category_img:
|
||||
|
||||
# The banner image of category page
|
||||
# format:
|
||||
# - category name: xxxxx
|
||||
category_per_img:
|
||||
|
||||
cover:
|
||||
# display the cover or not (是否顯示文章封面)
|
||||
index_enable: true
|
||||
aside_enable: true
|
||||
archives_enable: true
|
||||
# the position of cover in home page (封面顯示的位置)
|
||||
# left/right/both
|
||||
position: both
|
||||
# When cover is not set, the default cover is displayed (當沒有設置cover時,默認的封面顯示)
|
||||
default_cover:
|
||||
- https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg
|
||||
|
||||
# Replace Broken Images (替換無法顯示的圖片)
|
||||
error_img:
|
||||
flink: /img/friend_404.gif
|
||||
post_page: /img/404.jpg
|
||||
|
||||
# A simple 404 page
|
||||
error_404:
|
||||
enable: true
|
||||
subtitle: 'Page Not Found'
|
||||
background: https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png
|
||||
|
||||
post_meta:
|
||||
page: # Home Page
|
||||
date_type: created # created or updated or both 主頁文章日期是創建日或者更新日或都顯示
|
||||
date_format: date # date/relative 顯示日期還是相對日期
|
||||
categories: true # true or false 主頁是否顯示分類
|
||||
tags: false # true or false 主頁是否顯示標籤
|
||||
label: true # true or false 顯示描述性文字
|
||||
post:
|
||||
date_type: both # created or updated or both 文章頁日期是創建日或者更新日或都顯示
|
||||
date_format: date # date/relative 顯示日期還是相對日期
|
||||
categories: true # true or false 文章頁是否顯示分類
|
||||
tags: true # true or false 文章頁是否顯示標籤
|
||||
label: true # true or false 顯示描述性文字
|
||||
|
||||
# Display the article introduction on homepage
|
||||
# 1: description
|
||||
# 2: both (if the description exists, it will show description, or show the auto_excerpt)
|
||||
# 3: auto_excerpt (default)
|
||||
# false: do not show the article introduction
|
||||
index_post_content:
|
||||
method: 3
|
||||
length: 500 # if you set method to 2 or 3, the length need to config
|
||||
|
||||
# anchor
|
||||
anchor:
|
||||
# when you scroll, the URL will update according to header id.
|
||||
auto_update: false
|
||||
# Click the headline to scroll and update the anchor
|
||||
click_to_scroll: false
|
||||
|
||||
# figcaption (圖片描述文字)
|
||||
photofigcaption: false
|
||||
|
||||
# copy settings
|
||||
# copyright: Add the copyright information after copied content (複製的內容後面加上版權信息)
|
||||
copy:
|
||||
enable: true
|
||||
copyright:
|
||||
enable: false
|
||||
limit_count: 50
|
||||
|
||||
# Post
|
||||
# --------------------------------------
|
||||
|
||||
# toc (目錄)
|
||||
toc:
|
||||
post: true
|
||||
page: false
|
||||
number: true
|
||||
expand: true
|
||||
style_simple: false # for post
|
||||
scroll_percent: true
|
||||
|
||||
post_copyright:
|
||||
enable: true
|
||||
decode: false
|
||||
author_href:
|
||||
license: CC BY-NC-SA 4.0
|
||||
license_url: https://qr.shenjianl.cn/licenses/by-nc-sa/4.0/
|
||||
|
||||
# Sponsor/reward
|
||||
reward:
|
||||
enable: false
|
||||
text:
|
||||
QR_code:
|
||||
# - img: /img/wechat.jpg
|
||||
# link:
|
||||
# text: wechat
|
||||
# - img: /img/alipay.jpg
|
||||
# link:
|
||||
# text: alipay
|
||||
|
||||
# Post edit
|
||||
# Easily browse and edit blog source code online.
|
||||
post_edit:
|
||||
enable: false
|
||||
# url: https://github.com/user-name/repo-name/edit/branch-name/subdirectory-name/
|
||||
# For example: https://github.com/jerryc127/butterfly.js.org/edit/main/source/
|
||||
url:
|
||||
|
||||
# Related Articles
|
||||
related_post:
|
||||
enable: true
|
||||
limit: 6 # Number of posts displayed
|
||||
date_type: created # or created or updated 文章日期顯示創建日或者更新日
|
||||
|
||||
# post_pagination (分頁)
|
||||
# value: 1 || 2 || false
|
||||
# 1: The 'next post' will link to old post
|
||||
# 2: The 'next post' will link to new post
|
||||
# false: disable pagination
|
||||
post_pagination: 1
|
||||
|
||||
# Displays outdated notice for a post (文章過期提醒)
|
||||
noticeOutdate:
|
||||
enable: false
|
||||
style: flat # style: simple/flat
|
||||
limit_day: 500 # When will it be shown
|
||||
position: top # position: top/bottom
|
||||
message_prev: It has been
|
||||
message_next: days since the last update, the content of the article may be outdated.
|
||||
|
||||
# Footer Settings
|
||||
# --------------------------------------
|
||||
footer:
|
||||
owner:
|
||||
enable: true
|
||||
since: 2020
|
||||
custom_text: <a href="icp链接"><img class="icp-icon" src="icp图片"><span>备案号:xxxxxx</span></a>
|
||||
|
||||
# aside (側邊欄)
|
||||
# --------------------------------------
|
||||
|
||||
aside:
|
||||
enable: true
|
||||
hide: false
|
||||
button: true
|
||||
mobile: true # display on mobile
|
||||
position: left # left or right
|
||||
display:
|
||||
archive: false
|
||||
tag: false
|
||||
category: false
|
||||
card_author:
|
||||
enable: false
|
||||
description:
|
||||
button:
|
||||
enable: true
|
||||
icon: fab fa-github
|
||||
text: Follow Me
|
||||
link: https://github.com/shenjianz
|
||||
card_announcement:
|
||||
enable: false
|
||||
content: '一个简单快捷的文档知识点查阅网站'
|
||||
card_recent_post:
|
||||
enable: true
|
||||
limit: 5 # if set 0 will show all
|
||||
sort: date # date or updated
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_categories:
|
||||
enable: true
|
||||
limit: 8 # if set 0 will show all
|
||||
expand: none # none/true/false
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_tags:
|
||||
enable: true
|
||||
limit: 40 # if set 0 will show all
|
||||
color: false
|
||||
orderby: random # Order of tags, random/name/length
|
||||
order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_archives:
|
||||
enable: true
|
||||
type: monthly # yearly or monthly
|
||||
format: MMMM YYYY # eg: YYYY年MM月
|
||||
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
limit: 8 # if set 0 will show all
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_webinfo:
|
||||
enable: true
|
||||
post_count: true
|
||||
last_push_date: true
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
card_post_series:
|
||||
enable: true
|
||||
series_title: false # The title shows the series name
|
||||
orderBy: 'date' # Order by title or date
|
||||
order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
|
||||
# busuanzi count for PV / UV in site
|
||||
# 訪問人數
|
||||
busuanzi:
|
||||
site_uv: true
|
||||
site_pv: true
|
||||
page_pv: true
|
||||
|
||||
# Time difference between publish date and now (網頁運行時間)
|
||||
# Formal: Month/Day/Year Time or Year/Month/Day Time
|
||||
runtimeshow:
|
||||
enable: true
|
||||
publish_date: 7/31/2024 00:00:00
|
||||
|
||||
# Aside widget - Newest Comments
|
||||
newest_comments:
|
||||
enable: false
|
||||
sort_order: # Don't modify the setting unless you know how it works
|
||||
limit: 6
|
||||
storage: 10 # unit: mins, save data to localStorage
|
||||
avatar: true
|
||||
|
||||
# Bottom right button (右下角按鈕)
|
||||
# --------------------------------------
|
||||
|
||||
# Conversion between Traditional and Simplified Chinese (簡繁轉換)
|
||||
translate:
|
||||
enable: false
|
||||
# The text of a button
|
||||
default: 簡
|
||||
# the language of website (1 - Traditional Chinese/ 2 - Simplified Chinese)
|
||||
defaultEncoding: 2
|
||||
# Time delay
|
||||
translateDelay: 0
|
||||
# The text of the button when the language is Simplified Chinese
|
||||
msgToTraditionalChinese: '繁'
|
||||
# The text of the button when the language is Traditional Chinese
|
||||
msgToSimplifiedChinese: '簡'
|
||||
|
||||
# Read Mode (閲讀模式)
|
||||
readmode: true
|
||||
|
||||
# dark mode
|
||||
darkmode:
|
||||
enable: true
|
||||
# Toggle Button to switch dark/light mode
|
||||
button: true
|
||||
# Switch dark/light mode automatically (自動切換 dark mode和 light mode)
|
||||
# autoChangeMode: 1 Following System Settings, if the system doesn't support dark mode, it will switch dark mode between 6 pm to 6 am
|
||||
# autoChangeMode: 2 Switch dark mode between 6 pm to 6 am
|
||||
# autoChangeMode: false
|
||||
autoChangeMode: true
|
||||
# Set the light mode time. The value is between 0 and 24. If not set, the default value is 6 and 18
|
||||
start: # 8
|
||||
end: # 22
|
||||
|
||||
# show scroll percent in scroll-to-top button
|
||||
rightside_scroll_percent: false
|
||||
|
||||
# Don't modify the following settings unless you know how they work (非必要請不要修改 )
|
||||
# Choose: readmode,translate,darkmode,hideAside,toc,chat,comment
|
||||
# Don't repeat 不要重複
|
||||
rightside_item_order:
|
||||
enable: false
|
||||
hide: # readmode,translate,darkmode,hideAside
|
||||
show: # toc,chat,comment
|
||||
|
||||
# Math (數學)
|
||||
# --------------------------------------
|
||||
# About the per_page
|
||||
# if you set it to true, it will load mathjax/katex script in each page (true 表示每一頁都加載js)
|
||||
# if you set it to false, it will load mathjax/katex script according to your setting (add the 'mathjax: true' in page's front-matter)
|
||||
# (false 需要時加載,須在使用的 Markdown Front-matter 加上 mathjax: true)
|
||||
|
||||
# MathJax
|
||||
mathjax:
|
||||
enable: false
|
||||
per_page: false
|
||||
|
||||
# KaTeX
|
||||
katex:
|
||||
enable: false
|
||||
per_page: false
|
||||
hide_scrollbar: true
|
||||
|
||||
# search (搜索)
|
||||
# see https://butterfly.js.org/posts/ceeb73f/#搜索系統
|
||||
# --------------------------------------
|
||||
|
||||
# Algolia search
|
||||
algolia_search:
|
||||
enable: false
|
||||
hits:
|
||||
per_page: 6
|
||||
|
||||
# Local search
|
||||
local_search:
|
||||
enable: false
|
||||
# Preload the search data when the page loads.
|
||||
preload: false
|
||||
# Show top n results per article, show all results by setting to -1
|
||||
top_n_per_article: 1
|
||||
# Unescape html strings to the readable one.
|
||||
unescape: false
|
||||
CDN:
|
||||
|
||||
# Docsearch
|
||||
docsearch:
|
||||
enable: false
|
||||
appId:
|
||||
apiKey:
|
||||
indexName:
|
||||
option:
|
||||
|
||||
# Share System (分享)
|
||||
# --------------------------------------
|
||||
|
||||
# Share.js
|
||||
# https://github.com/overtrue/share.js
|
||||
sharejs:
|
||||
enable: true
|
||||
sites: facebook,twitter,wechat,weibo,qq
|
||||
|
||||
# AddToAny
|
||||
# https://www.addtoany.com/
|
||||
addtoany:
|
||||
enable: false
|
||||
item: facebook,twitter,wechat,sina_weibo,facebook_messenger,email,copy_link
|
||||
|
||||
# Comments System
|
||||
# --------------------------------------
|
||||
|
||||
comments:
|
||||
# Up to two comments system, the first will be shown as default
|
||||
# Choose: Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/Artalk
|
||||
use: # Valine,Disqus
|
||||
text: true # Display the comment name next to the button
|
||||
# lazyload: The comment system will be load when comment element enters the browser's viewport.
|
||||
# If you set it to true, the comment count will be invalid
|
||||
lazyload: false
|
||||
count: false # Display comment count in post's top_img
|
||||
card_post_count: false # Display comment count in Home Page
|
||||
|
||||
# disqus
|
||||
# https://disqus.com/
|
||||
disqus:
|
||||
shortname:
|
||||
apikey: # For newest comments widget
|
||||
|
||||
# Alternative Disqus - Render comments with Disqus API
|
||||
# DisqusJS 評論系統,可以實現在網路審查地區載入 Disqus 評論列表,兼容原版
|
||||
# https://github.com/SukkaW/DisqusJS
|
||||
disqusjs:
|
||||
shortname:
|
||||
apikey:
|
||||
option:
|
||||
|
||||
# livere (來必力)
|
||||
# https://www.livere.com/
|
||||
livere:
|
||||
uid:
|
||||
|
||||
# gitalk
|
||||
# https://github.com/gitalk/gitalk
|
||||
gitalk:
|
||||
client_id:
|
||||
client_secret:
|
||||
repo:
|
||||
owner:
|
||||
admin:
|
||||
option:
|
||||
|
||||
# valine
|
||||
# https://valine.js.org
|
||||
valine:
|
||||
appId: # leancloud application app id
|
||||
appKey: # leancloud application app key
|
||||
avatar: monsterid # gravatar style https://valine.js.org/#/avatar
|
||||
serverURLs: # This configuration is suitable for domestic custom domain name users, overseas version will be automatically detected (no need to manually fill in)
|
||||
bg: # valine background
|
||||
visitor: false
|
||||
option:
|
||||
|
||||
# waline - A simple comment system with backend support fork from Valine
|
||||
# https://waline.js.org/
|
||||
waline:
|
||||
serverURL: # Waline server address url
|
||||
bg: # waline background
|
||||
pageview: false
|
||||
option:
|
||||
|
||||
# utterances
|
||||
# https://utteranc.es/
|
||||
utterances:
|
||||
repo:
|
||||
# Issue Mapping: pathname/url/title/og:title
|
||||
issue_term: pathname
|
||||
# Theme: github-light/github-dark/github-dark-orange/icy-dark/dark-blue/photon-dark
|
||||
light_theme: github-light
|
||||
dark_theme: photon-dark
|
||||
|
||||
# Facebook Comments Plugin
|
||||
# https://developers.facebook.com/docs/plugins/comments/
|
||||
facebook_comments:
|
||||
app_id:
|
||||
user_id: # optional
|
||||
pageSize: 10 # The number of comments to show
|
||||
order_by: social # social/time/reverse_time
|
||||
lang: zh_CN # Language en_US/zh_CN/zh_TW and so on
|
||||
|
||||
# Twikoo
|
||||
# https://github.com/imaegoo/twikoo
|
||||
twikoo:
|
||||
envId:
|
||||
region:
|
||||
visitor: false
|
||||
option:
|
||||
|
||||
# Giscus
|
||||
# https://giscus.app/
|
||||
giscus:
|
||||
repo:
|
||||
repo_id:
|
||||
category_id:
|
||||
theme:
|
||||
light: light
|
||||
dark: dark
|
||||
option:
|
||||
|
||||
# Remark42
|
||||
# https://remark42.com/docs/configuration/frontend/
|
||||
remark42:
|
||||
host: # Your Host URL
|
||||
siteId: # Your Site ID
|
||||
option:
|
||||
|
||||
# Artalk
|
||||
# https://artalk.js.org/guide/frontend/config.html
|
||||
artalk:
|
||||
server:
|
||||
site:
|
||||
visitor: false
|
||||
option:
|
||||
|
||||
# Chat Services
|
||||
# --------------------------------------
|
||||
|
||||
# Chat Button [recommend]
|
||||
# It will create a button in the bottom right corner of website, and hide the origin button
|
||||
chat_btn: false
|
||||
|
||||
# The origin chat button is displayed when scrolling up, and the button is hidden when scrolling down
|
||||
chat_hide_show: false
|
||||
|
||||
# chatra
|
||||
# https://chatra.io/
|
||||
chatra:
|
||||
enable: false
|
||||
id:
|
||||
|
||||
# tidio
|
||||
# https://www.tidio.com/
|
||||
tidio:
|
||||
enable: false
|
||||
public_key:
|
||||
|
||||
# daovoice
|
||||
# http://dashboard.daovoice.io/app
|
||||
daovoice:
|
||||
enable: false
|
||||
app_id:
|
||||
|
||||
# crisp
|
||||
# https://crisp.chat/en/
|
||||
crisp:
|
||||
enable: false
|
||||
website_id:
|
||||
|
||||
# messenger
|
||||
# https://developers.facebook.com/docs/messenger-platform/discovery/facebook-chat-plugin/
|
||||
messenger:
|
||||
enable: false
|
||||
pageID:
|
||||
lang: zh_CN # Language en_US/zh_CN/zh_TW and so on
|
||||
|
||||
# Analysis
|
||||
# --------------------------------------
|
||||
|
||||
# Baidu Analytics
|
||||
# https://tongji.baidu.com/web/welcome/login
|
||||
baidu_analytics:
|
||||
|
||||
# Google Analytics
|
||||
# https://analytics.google.com/analytics/web/
|
||||
google_analytics:
|
||||
|
||||
# Cloudflare Analytics
|
||||
# https://www.cloudflare.com/zh-tw/web-analytics/
|
||||
cloudflare_analytics:
|
||||
|
||||
# Microsoft Clarity
|
||||
# https://clarity.microsoft.com/
|
||||
microsoft_clarity:
|
||||
|
||||
# Advertisement
|
||||
# --------------------------------------
|
||||
|
||||
# Google Adsense (谷歌廣告)
|
||||
google_adsense:
|
||||
enable: false
|
||||
auto_ads: true
|
||||
js: https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
|
||||
client:
|
||||
enable_page_level_ads: true
|
||||
|
||||
# Insert ads manually (手動插入廣告)
|
||||
# ad:
|
||||
# index:
|
||||
# aside:
|
||||
# post:
|
||||
|
||||
# Verification (站長驗證)
|
||||
# --------------------------------------
|
||||
|
||||
site_verification:
|
||||
# - name: google-site-verification
|
||||
# content: xxxxxx
|
||||
# - name: baidu-site-verification
|
||||
# content: xxxxxxx
|
||||
|
||||
# Beautify/Effect (美化/效果)
|
||||
# --------------------------------------
|
||||
|
||||
# Theme color for customize
|
||||
# Notice: color value must in double quotes like "#000" or may cause error!
|
||||
|
||||
theme_color:
|
||||
enable: true
|
||||
main: "#1E90FF" # 主颜色,亮蓝色
|
||||
paginator: "#C9A0DC" # 分页器颜色,淡紫色
|
||||
button_hover: "#FF7242" # 按钮悬停颜色,橙色
|
||||
text_selection: "rgba(173, 216, 230, 0.6)" # 文本选择颜色,蓝色
|
||||
link_color: "#8A2BE2" # 链接颜色,紫罗兰色
|
||||
meta_color: "#858585" # 元数据颜色,中灰色
|
||||
hr_color: "#E6E6FA" # 水平线颜色,薰衣草紫
|
||||
code_foreground: "#BA55D3" # 代码前景色,中兰花紫
|
||||
code_background: "rgba(27, 31, 35, .05)" # 代码背景色,保持不变
|
||||
toc_color: "#9370DB" # 目录颜色,浅紫色
|
||||
blockquote_padding_color: "#DDA0DD" # 引用块的填充颜色,梅花紫
|
||||
blockquote_background_color: "#E6E6FA" # 引用块的背景颜色,薰衣草紫
|
||||
scrollbar_color: "#B19CD9" # 滚动条颜色,浅紫色
|
||||
meta_theme_color_light: "#ffffff" # 元主题颜色(浅色模式),白色
|
||||
meta_theme_color_dark: "#0d0d0d" # 元主题颜色(深色模式),近黑色
|
||||
|
||||
# The top_img settings of home page
|
||||
# default: top img - full screen, site info - middle (默認top_img全屏,site_info在中間)
|
||||
# The position of site info, eg: 300px/300em/300rem/10% (主頁標題距離頂部距離)
|
||||
index_site_info_top:
|
||||
# The height of top_img, eg: 300px/300em/300rem (主頁top_img高度)
|
||||
index_top_img_height:
|
||||
|
||||
# The user interface setting of category and tag page (category和tag頁的UI設置)
|
||||
# index - same as Homepage UI (index 值代表 UI將與首頁的UI一樣)
|
||||
# default - same as archives UI 默認跟archives頁面UI一樣
|
||||
category_ui: # 留空或 index
|
||||
tag_ui: # 留空或 index
|
||||
|
||||
# Stretches the lines so that each line has equal width(文字向兩側對齊,對最後一行無效)
|
||||
text_align_justify: false
|
||||
|
||||
# Website Background (設置網站背景)
|
||||
# can set it to color or image (可設置圖片 或者 顔色)
|
||||
# The formal of image: url(http://xxxxxx.com/xxx.jpg)
|
||||
background:
|
||||
|
||||
# Footer Background
|
||||
footer_bg: false
|
||||
|
||||
# Add mask to header or footer (为 header 或 footer 添加黑色半透遮罩)
|
||||
mask:
|
||||
header: true
|
||||
footer: true
|
||||
|
||||
# the position of bottom right button/default unit: px (右下角按鈕距離底部的距離/默認單位為px)
|
||||
rightside_bottom:
|
||||
|
||||
# Enter transitions (開啓網頁進入效果)
|
||||
enter_transitions: true
|
||||
|
||||
# Typewriter Effect (打字效果)
|
||||
# https://github.com/disjukr/activate-power-mode
|
||||
activate_power_mode:
|
||||
enable: false
|
||||
colorful: true # open particle animation (冒光特效)
|
||||
shake: true # open shake (抖動特效)
|
||||
mobile: false
|
||||
|
||||
# Background effects (背景特效)
|
||||
# --------------------------------------
|
||||
|
||||
# canvas_ribbon (靜止彩帶背景)
|
||||
# See: https://github.com/hustcc/ribbon.js
|
||||
canvas_ribbon:
|
||||
enable: false
|
||||
size: 150
|
||||
alpha: 0.6
|
||||
zIndex: -1
|
||||
click_to_change: false
|
||||
mobile: false
|
||||
|
||||
# Fluttering Ribbon (動態彩帶)
|
||||
canvas_fluttering_ribbon:
|
||||
enable: false
|
||||
mobile: false
|
||||
|
||||
# canvas_nest
|
||||
# https://github.com/hustcc/canvas-nest.js
|
||||
canvas_nest:
|
||||
enable: false
|
||||
color: '0,0,255' #color of lines, default: '0,0,0'; RGB values: (R,G,B).(note: use ',' to separate.)
|
||||
opacity: 0.7 # the opacity of line (0~1), default: 0.5.
|
||||
zIndex: -1 # z-index property of the background, default: -1.
|
||||
count: 99 # the number of lines, default: 99.
|
||||
mobile: false
|
||||
|
||||
# Mouse click effects: fireworks (鼠標點擊效果: 煙火特效)
|
||||
fireworks:
|
||||
enable: false
|
||||
zIndex: 9999 # -1 or 9999
|
||||
mobile: false
|
||||
|
||||
# Mouse click effects: Heart symbol (鼠標點擊效果: 愛心)
|
||||
click_heart:
|
||||
enable: false
|
||||
mobile: false
|
||||
|
||||
# Mouse click effects: words (鼠標點擊效果: 文字)
|
||||
clickShowText:
|
||||
enable: false
|
||||
text:
|
||||
# - I
|
||||
# - LOVE
|
||||
# - YOU
|
||||
fontSize: 15px
|
||||
random: false
|
||||
mobile: false
|
||||
|
||||
# Default display mode (網站默認的顯示模式)
|
||||
# light (default) / dark
|
||||
display_mode: light
|
||||
|
||||
# Beautify (美化頁面顯示)
|
||||
beautify:
|
||||
enable: false
|
||||
field: post # site/post
|
||||
title-prefix-icon: # '\f0c1'
|
||||
title-prefix-icon-color: # '#F47466'
|
||||
|
||||
# Global font settings
|
||||
# Don't modify the following settings unless you know how they work (非必要不要修改)
|
||||
font:
|
||||
global-font-size:
|
||||
code-font-size:
|
||||
font-family:
|
||||
code-font-family:
|
||||
|
||||
# Font settings for the site title and site subtitle
|
||||
# 左上角網站名字 主頁居中網站名字
|
||||
blog_title_font:
|
||||
font_link:
|
||||
font-family:
|
||||
|
||||
# The setting of divider icon (水平分隔線圖標設置)
|
||||
hr_icon:
|
||||
enable: true
|
||||
icon: # the unicode value of Font Awesome icon, such as '\3423'
|
||||
icon-top:
|
||||
|
||||
# the subtitle on homepage (主頁subtitle)
|
||||
subtitle:
|
||||
enable: false
|
||||
# Typewriter Effect (打字效果)
|
||||
effect: true
|
||||
# Customize typed.js (配置typed.js)
|
||||
# https://github.com/mattboldt/typed.js/#customization
|
||||
typed_option:
|
||||
# source 調用第三方服務
|
||||
# source: false 關閉調用
|
||||
# source: 1 調用一言網的一句話(簡體) https://hitokoto.cn/
|
||||
# source: 2 調用一句網(簡體) https://yijuzhan.com/
|
||||
# source: 3 調用今日詩詞(簡體) https://www.jinrishici.com/
|
||||
# subtitle 會先顯示 source , 再顯示 sub 的內容
|
||||
source: false
|
||||
# 如果關閉打字效果,subtitle 只會顯示 sub 的第一行文字
|
||||
sub:
|
||||
|
||||
# Loading Animation (加載動畫)
|
||||
preloader:
|
||||
enable: false
|
||||
# source
|
||||
# 1. fullpage-loading
|
||||
# 2. pace (progress bar)
|
||||
source: 1
|
||||
# pace theme (see https://codebyzach.github.io/pace/)
|
||||
pace_css_url:
|
||||
|
||||
# wordcount (字數統計)
|
||||
# see https://butterfly.js.org/posts/ceeb73f/#字數統計
|
||||
wordcount:
|
||||
enable: false
|
||||
post_wordcount: true
|
||||
min2read: true
|
||||
total_wordcount: true
|
||||
|
||||
# Lightbox (圖片大圖查看模式)
|
||||
# --------------------------------------
|
||||
# You can only choose one, or neither (只能選擇一個 或者 兩個都不選)
|
||||
|
||||
# medium-zoom
|
||||
# https://github.com/francoischalifour/medium-zoom
|
||||
medium_zoom: false
|
||||
|
||||
# fancybox
|
||||
# https://fancyapps.com/fancybox/
|
||||
fancybox: true
|
||||
|
||||
# Tag Plugins settings (標籤外掛)
|
||||
# --------------------------------------
|
||||
|
||||
# series (系列文章)
|
||||
series:
|
||||
enable: true
|
||||
orderBy: 'title' # Order by title or date
|
||||
order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending
|
||||
number: true
|
||||
|
||||
# abcjs (樂譜渲染)
|
||||
# See https://github.com/paulrosen/abcjs
|
||||
abcjs:
|
||||
enable: false
|
||||
per_page: true
|
||||
|
||||
# mermaid
|
||||
# see https://github.com/mermaid-js/mermaid
|
||||
mermaid:
|
||||
enable: false
|
||||
# built-in themes: default/forest/dark/neutral
|
||||
theme:
|
||||
light: default
|
||||
dark: dark
|
||||
|
||||
# Note (Bootstrap Callout)
|
||||
note:
|
||||
# Note tag style values:
|
||||
# - simple bs-callout old alert style. Default.
|
||||
# - modern bs-callout new (v2-v3) alert style.
|
||||
# - flat flat callout style with background, like on Mozilla or StackOverflow.
|
||||
# - disabled disable all CSS styles import of note tag.
|
||||
style: flat
|
||||
icons: true
|
||||
border_radius: 3
|
||||
# Offset lighter of background in % for modern and flat styles (modern: -12 | 12; flat: -18 | 6).
|
||||
# Offset also applied to label tag variables. This option can work with disabled note tag.
|
||||
light_bg_offset: 0
|
||||
|
||||
# other
|
||||
# --------------------------------------
|
||||
|
||||
# Pjax
|
||||
# It may contain bugs and unstable, give feedback when you find the bugs.
|
||||
# https://github.com/MoOx/pjax
|
||||
pjax:
|
||||
enable: false
|
||||
exclude:
|
||||
# - xxxx
|
||||
# - xxxx
|
||||
|
||||
# Inject the css and script (aplayer/meting)
|
||||
aplayerInject:
|
||||
enable: false
|
||||
per_page: true
|
||||
|
||||
# Snackbar (Toast Notification 彈窗)
|
||||
# https://github.com/polonel/SnackBar
|
||||
# position 彈窗位置
|
||||
# 可選 top-left / top-center / top-right / bottom-left / bottom-center / bottom-right
|
||||
snackbar:
|
||||
enable: false
|
||||
position: bottom-left
|
||||
bg_light: '#49b1f5' # The background color of Toast Notification in light mode
|
||||
bg_dark: '#1f1f1f' # The background color of Toast Notification in dark mode
|
||||
|
||||
# https://instant.page/
|
||||
# prefetch (預加載)
|
||||
instantpage: false
|
||||
|
||||
# https://github.com/vinta/pangu.js
|
||||
# Insert a space between Chinese character and English character (中英文之間添加空格)
|
||||
pangu:
|
||||
enable: false
|
||||
field: site # site/post
|
||||
|
||||
# Lazyload (圖片懶加載)
|
||||
# https://github.com/verlok/vanilla-lazyload
|
||||
lazyload:
|
||||
enable: false
|
||||
field: site # site/post
|
||||
placeholder:
|
||||
blur: false
|
||||
|
||||
# PWA
|
||||
# See https://github.com/JLHwung/hexo-offline
|
||||
# ---------------
|
||||
# pwa:
|
||||
# enable: false
|
||||
# manifest: /pwa/manifest.json
|
||||
# apple_touch_icon: /pwa/apple-touch-icon.png
|
||||
# favicon_32_32: /pwa/32.png
|
||||
# favicon_16_16: /pwa/16.png
|
||||
# mask_icon: /pwa/safari-pinned-tab.svg
|
||||
|
||||
# Open graph meta tags
|
||||
# https://developers.facebook.com/docs/sharing/webmasters/
|
||||
Open_Graph_meta:
|
||||
enable: true
|
||||
option:
|
||||
# twitter_card:
|
||||
# twitter_image:
|
||||
# twitter_id:
|
||||
# twitter_site:
|
||||
# google_plus:
|
||||
# fb_admins:
|
||||
# fb_app_id:
|
||||
|
||||
# Add the vendor prefixes to ensure compatibility
|
||||
css_prefix: true
|
||||
|
||||
# Inject
|
||||
# Insert the code to head (before '</head>' tag) and the bottom (before '</body>' tag)
|
||||
# 插入代码到头部 </head> 之前 和 底部 </body> 之前
|
||||
inject:
|
||||
head:
|
||||
# - <link rel="stylesheet" href="/xxx.css">
|
||||
bottom:
|
||||
# - <script src="xxxx"></script>
|
||||
|
||||
# CDN
|
||||
# Don't modify the following settings unless you know how they work
|
||||
# 非必要請不要修改
|
||||
CDN:
|
||||
# The CDN provider of internal scripts (主題內部 js 的 cdn 配置)
|
||||
# option: local/jsdelivr/unpkg/cdnjs/custom
|
||||
# Dev version can only choose. ( dev版的主題只能設置為 local )
|
||||
internal_provider: local
|
||||
|
||||
# The CDN provider of third party scripts (第三方 js 的 cdn 配置)
|
||||
# option: local/jsdelivr/unpkg/cdnjs/custom
|
||||
# when set it to local, you need to install hexo-butterfly-extjs
|
||||
third_party_provider: jsdelivr
|
||||
|
||||
# Add version number to url, true or false
|
||||
version: true
|
||||
|
||||
# Custom format
|
||||
# For example: https://cdn.staticfile.org/${cdnjs_name}/${version}/${min_cdnjs_file}
|
||||
custom_format:
|
||||
|
||||
option:
|
||||
# abcjs_basic_js:
|
||||
# activate_power_mode:
|
||||
# algolia_js:
|
||||
# algolia_search:
|
||||
# aplayer_css:
|
||||
# aplayer_js:
|
||||
# artalk_css:
|
||||
# artalk_js:
|
||||
# blueimp_md5:
|
||||
# busuanzi:
|
||||
# canvas_fluttering_ribbon:
|
||||
# canvas_nest:
|
||||
# canvas_ribbon:
|
||||
# click_heart:
|
||||
# clickShowText:
|
||||
# disqusjs:
|
||||
# disqusjs_css:
|
||||
# docsearch_css:
|
||||
# docsearch_js:
|
||||
# egjs_infinitegrid:
|
||||
# fancybox:
|
||||
# fancybox_css:
|
||||
# fireworks:
|
||||
# fontawesome:
|
||||
# gitalk:
|
||||
# gitalk_css:
|
||||
# giscus:
|
||||
# instantpage:
|
||||
# instantsearch:
|
||||
# katex:
|
||||
# katex_copytex:
|
||||
# lazyload:
|
||||
# local_search:
|
||||
# main:
|
||||
# main_css:
|
||||
# mathjax:
|
||||
# medium_zoom:
|
||||
# mermaid:
|
||||
# meting_js:
|
||||
# pangu:
|
||||
# prismjs_autoloader:
|
||||
# prismjs_js:
|
||||
# prismjs_lineNumber_js:
|
||||
# pjax:
|
||||
# sharejs:
|
||||
# sharejs_css:
|
||||
# snackbar:
|
||||
# snackbar_css:
|
||||
# translate:
|
||||
# twikoo:
|
||||
# typed:
|
||||
# utils:
|
||||
# valine:
|
||||
# waline_css:
|
||||
# waline_js:
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
# Hexo Configuration
|
||||
## Docs: https://hexo.io/docs/configuration.html
|
||||
## Source: https://github.com/hexojs/hexo/
|
||||
|
||||
# Site
|
||||
title: QuickReference
|
||||
subtitle: '实用知识文档'
|
||||
description: '一份快捷简便的文档,便于查阅编程的细节'
|
||||
keywords: doucment
|
||||
author: shenjianZ
|
||||
language: zh-Hans
|
||||
timezone: 'Asia/Shanghai'
|
||||
|
||||
# URL
|
||||
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
|
||||
url: http://rq.shenjianl.cn
|
||||
permalink: :year/:month/:day/:title/
|
||||
permalink_defaults:
|
||||
pretty_urls:
|
||||
trailing_index: true # Set to false to remove trailing 'index.md' from permalinks
|
||||
trailing_html: true # Set to false to remove trailing '.html' from permalinks
|
||||
|
||||
# Directory
|
||||
source_dir: source
|
||||
public_dir: public
|
||||
tag_dir: tags
|
||||
archive_dir: archives
|
||||
category_dir: categories
|
||||
code_dir: downloads/code
|
||||
i18n_dir: :lang
|
||||
skip_render:
|
||||
|
||||
# Writing
|
||||
new_post_name: :title.md # File name of new posts
|
||||
default_layout: post
|
||||
titlecase: false # Transform title into titlecase
|
||||
external_link:
|
||||
enable: true # Open external links in new tab
|
||||
field: site # Apply to the whole site
|
||||
exclude: ''
|
||||
filename_case: 0
|
||||
render_drafts: false
|
||||
post_asset_folder: false
|
||||
relative_link: false
|
||||
future: true
|
||||
syntax_highlighter: highlight.js
|
||||
highlight:
|
||||
line_number: true
|
||||
auto_detect: false
|
||||
tab_replace: ''
|
||||
wrap: true
|
||||
hljs: false
|
||||
prismjs:
|
||||
preprocess: true
|
||||
line_number: true
|
||||
tab_replace: ''
|
||||
|
||||
# Home page setting
|
||||
# path: Root path for your blogs index page. (default = '')
|
||||
# per_page: Posts displayed per page. (0 = disable pagination)
|
||||
# order_by: Posts order. (Order by date descending by default)
|
||||
index_generator:
|
||||
path: ''
|
||||
per_page: 10
|
||||
order_by: -date
|
||||
|
||||
# Category & Tag
|
||||
default_category: uncategorized
|
||||
category_map:
|
||||
tag_map:
|
||||
|
||||
# Metadata elements
|
||||
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
||||
meta_generator: true
|
||||
|
||||
# Date / Time format
|
||||
## Hexo uses Moment.js to parse and display date
|
||||
## You can customize the date format as defined in
|
||||
## http://momentjs.com/docs/#/displaying/format/
|
||||
date_format: YYYY-MM-DD
|
||||
time_format: HH:mm:ss
|
||||
## updated_option supports 'mtime', 'date', 'empty'
|
||||
updated_option: 'mtime'
|
||||
|
||||
# Pagination
|
||||
## Set per_page to 0 to disable pagination
|
||||
per_page: 10
|
||||
pagination_dir: page
|
||||
|
||||
# Include / Exclude file(s)
|
||||
## include:/exclude: options only apply to the 'source/' folder
|
||||
include:
|
||||
exclude:
|
||||
ignore:
|
||||
|
||||
# Extensions
|
||||
## Plugins: https://hexo.io/plugins/
|
||||
## Themes: https://hexo.io/themes/
|
||||
theme: butterfly
|
||||
|
||||
# Deployment
|
||||
## Docs: https://hexo.io/docs/one-command-deployment
|
||||
deploy:
|
||||
type: ''
|
||||
Generated
+4827
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "hexo-site",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "hexo generate",
|
||||
"clean": "hexo clean",
|
||||
"deploy": "hexo deploy",
|
||||
"server": "hexo server"
|
||||
},
|
||||
"hexo": {
|
||||
"version": "7.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"hexo": "^7.0.0",
|
||||
"hexo-generator-archive": "^2.0.0",
|
||||
"hexo-generator-category": "^2.0.0",
|
||||
"hexo-generator-index": "^3.0.0",
|
||||
"hexo-generator-tag": "^2.0.0",
|
||||
"hexo-renderer-ejs": "^2.0.0",
|
||||
"hexo-renderer-marked": "^6.0.0",
|
||||
"hexo-renderer-pug": "^3.0.0",
|
||||
"hexo-renderer-stylus": "^3.0.1",
|
||||
"hexo-server": "^3.0.0",
|
||||
"hexo-theme-anzhiyu": "^1.6.12",
|
||||
"hexo-theme-landscape": "^1.0.0"
|
||||
}
|
||||
}
|
||||
Generated
+1554
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+154
@@ -0,0 +1,154 @@
|
||||
<!DOCTYPE html><html lang="zh-Hans" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Page Not Found | QuickReference</title><meta name="author" content="shenjianZ"><meta name="copyright" content="shenjianZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一份快捷简便的文档,便于查阅编程的细节">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="QuickReference">
|
||||
<meta property="og:url" content="http://rq.shenjianl.cn/404.html">
|
||||
<meta property="og:site_name" content="QuickReference">
|
||||
<meta property="og:description" content="一份快捷简便的文档,便于查阅编程的细节">
|
||||
<meta property="og:locale">
|
||||
<meta property="og:image" content="http://rq.shenjianl.cn/img/avatar.jpg">
|
||||
<meta property="article:author" content="shenjianZ">
|
||||
<meta property="article:tag" content="doucment">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:image" content="http://rq.shenjianl.cn/img/avatar.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://rq.shenjianl.cn/404.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css?v=4.13.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
|
||||
root: '/',
|
||||
algolia: undefined,
|
||||
localSearch: undefined,
|
||||
translate: undefined,
|
||||
noticeOutdate: undefined,
|
||||
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
|
||||
copy: {
|
||||
success: 'Copy Successful',
|
||||
error: 'Copy Error',
|
||||
noSupport: 'Browser Not Supported'
|
||||
},
|
||||
relativeDate: {
|
||||
homepage: false,
|
||||
post: false
|
||||
},
|
||||
runtime: 'days',
|
||||
dateSuffix: {
|
||||
just: 'Just now',
|
||||
min: 'minutes ago',
|
||||
hour: 'hours ago',
|
||||
day: 'days ago',
|
||||
month: 'months ago'
|
||||
},
|
||||
copyright: undefined,
|
||||
lightbox: 'fancybox',
|
||||
Snackbar: undefined,
|
||||
infinitegrid: {
|
||||
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid@4.11.1/dist/infinitegrid.min.js',
|
||||
buttonText: 'Load More'
|
||||
},
|
||||
isPhotoFigcaption: false,
|
||||
islazyload: false,
|
||||
isAnchor: false,
|
||||
percent: {
|
||||
toc: true,
|
||||
rightside: false,
|
||||
},
|
||||
autoDarkmode: false
|
||||
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||
title: 'Page Not Found',
|
||||
isPost: false,
|
||||
isHome: false,
|
||||
isHighlightShrink: false,
|
||||
isToc: false,
|
||||
postUpdate: '2024-07-30 21:38:06'
|
||||
}</script><script>(win=>{
|
||||
win.saveToLocal = {
|
||||
set: (key, value, ttl) => {
|
||||
if (ttl === 0) return
|
||||
const now = Date.now()
|
||||
const expiry = now + ttl * 86400000
|
||||
const item = {
|
||||
value,
|
||||
expiry
|
||||
}
|
||||
localStorage.setItem(key, JSON.stringify(item))
|
||||
},
|
||||
|
||||
get: key => {
|
||||
const itemStr = localStorage.getItem(key)
|
||||
|
||||
if (!itemStr) {
|
||||
return undefined
|
||||
}
|
||||
const item = JSON.parse(itemStr)
|
||||
const now = Date.now()
|
||||
|
||||
if (now > item.expiry) {
|
||||
localStorage.removeItem(key)
|
||||
return undefined
|
||||
}
|
||||
return item.value
|
||||
}
|
||||
}
|
||||
|
||||
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script')
|
||||
script.src = url
|
||||
script.async = true
|
||||
script.onerror = reject
|
||||
script.onload = script.onreadystatechange = function() {
|
||||
const loadState = this.readyState
|
||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||
script.onload = script.onreadystatechange = null
|
||||
resolve()
|
||||
}
|
||||
|
||||
Object.keys(attr).forEach(key => {
|
||||
script.setAttribute(key, attr[key])
|
||||
})
|
||||
|
||||
document.head.appendChild(script)
|
||||
})
|
||||
|
||||
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
|
||||
const link = document.createElement('link')
|
||||
link.rel = 'stylesheet'
|
||||
link.href = url
|
||||
if (id) link.id = id
|
||||
link.onerror = reject
|
||||
link.onload = link.onreadystatechange = function() {
|
||||
const loadState = this.readyState
|
||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||
link.onload = link.onreadystatechange = null
|
||||
resolve()
|
||||
}
|
||||
document.head.appendChild(link)
|
||||
})
|
||||
|
||||
win.activateDarkMode = () => {
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
|
||||
}
|
||||
}
|
||||
win.activateLightMode = () => {
|
||||
document.documentElement.setAttribute('data-theme', 'light')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
|
||||
}
|
||||
}
|
||||
const t = saveToLocal.get('theme')
|
||||
|
||||
if (t === 'dark') activateDarkMode()
|
||||
else if (t === 'light') activateLightMode()
|
||||
|
||||
const asideStatus = saveToLocal.get('aside-status')
|
||||
if (asideStatus !== undefined) {
|
||||
if (asideStatus === 'hide') {
|
||||
document.documentElement.classList.add('hide-aside')
|
||||
} else {
|
||||
document.documentElement.classList.remove('hide-aside')
|
||||
}
|
||||
}
|
||||
|
||||
const detectApple = () => {
|
||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||
document.documentElement.classList.add('apple')
|
||||
}
|
||||
}
|
||||
detectApple()
|
||||
})(window)</script><meta name="generator" content="Hexo 7.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">2</div></a><a href="/tags/"><div class="headline">Tags</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">Categories</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="error404" id="body-wrap"><header class="not-top-img fixed" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="QuickReference"><span class="site-name">QuickReference</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><div id="error-wrap"><div class="error-content"><div class="error-img"><img src="https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png" alt="Page not found"></div><div class="error-info"><h1 class="error_title">404</h1><div class="error_subtitle">Page Not Found</div></div></div></div></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="Toggle Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between Single-column and Double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="Back To Top"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=4.13.0"></script><script src="/js/main.js?v=4.13.0"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 323 B |
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
File diff suppressed because one or more lines are too long
@@ -0,0 +1,878 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
let headerContentWidth, $nav
|
||||
let mobileSidebarOpen = false
|
||||
|
||||
const adjustMenu = init => {
|
||||
const getAllWidth = ele => {
|
||||
return Array.from(ele).reduce((width, i) => width + i.offsetWidth, 0)
|
||||
}
|
||||
|
||||
if (init) {
|
||||
const blogInfoWidth = getAllWidth(document.querySelector('#blog-info > a').children)
|
||||
const menusWidth = getAllWidth(document.getElementById('menus').children)
|
||||
headerContentWidth = blogInfoWidth + menusWidth
|
||||
$nav = document.getElementById('nav')
|
||||
}
|
||||
|
||||
const hideMenuIndex = window.innerWidth <= 768 || headerContentWidth > $nav.offsetWidth - 120
|
||||
$nav.classList.toggle('hide-menu', hideMenuIndex)
|
||||
}
|
||||
|
||||
// 初始化header
|
||||
const initAdjust = () => {
|
||||
adjustMenu(true)
|
||||
$nav.classList.add('show')
|
||||
}
|
||||
|
||||
// sidebar menus
|
||||
const sidebarFn = {
|
||||
open: () => {
|
||||
btf.sidebarPaddingR()
|
||||
document.body.style.overflow = 'hidden'
|
||||
btf.animateIn(document.getElementById('menu-mask'), 'to_show 0.5s')
|
||||
document.getElementById('sidebar-menus').classList.add('open')
|
||||
mobileSidebarOpen = true
|
||||
},
|
||||
close: () => {
|
||||
const $body = document.body
|
||||
$body.style.overflow = ''
|
||||
$body.style.paddingRight = ''
|
||||
btf.animateOut(document.getElementById('menu-mask'), 'to_hide 0.5s')
|
||||
document.getElementById('sidebar-menus').classList.remove('open')
|
||||
mobileSidebarOpen = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 首頁top_img底下的箭頭
|
||||
*/
|
||||
const scrollDownInIndex = () => {
|
||||
const handleScrollToDest = () => {
|
||||
btf.scrollToDest(document.getElementById('content-inner').offsetTop, 300)
|
||||
}
|
||||
|
||||
const $scrollDownEle = document.getElementById('scroll-down')
|
||||
$scrollDownEle && btf.addEventListenerPjax($scrollDownEle, 'click', handleScrollToDest)
|
||||
}
|
||||
|
||||
/**
|
||||
* 代碼
|
||||
* 只適用於Hexo默認的代碼渲染
|
||||
*/
|
||||
const addHighlightTool = () => {
|
||||
const highLight = GLOBAL_CONFIG.highlight
|
||||
if (!highLight) return
|
||||
|
||||
const { highlightCopy, highlightLang, highlightHeightLimit, plugin } = highLight
|
||||
const isHighlightShrink = GLOBAL_CONFIG_SITE.isHighlightShrink
|
||||
const isShowTool = highlightCopy || highlightLang || isHighlightShrink !== undefined
|
||||
const $figureHighlight = plugin === 'highlight.js' ? document.querySelectorAll('figure.highlight') : document.querySelectorAll('pre[class*="language-"]')
|
||||
|
||||
if (!((isShowTool || highlightHeightLimit) && $figureHighlight.length)) return
|
||||
|
||||
const isPrismjs = plugin === 'prismjs'
|
||||
const highlightShrinkClass = isHighlightShrink === true ? 'closed' : ''
|
||||
const highlightShrinkEle = isHighlightShrink !== undefined ? '<i class="fas fa-angle-down expand"></i>' : ''
|
||||
const highlightCopyEle = highlightCopy ? '<div class="copy-notice"></div><i class="fas fa-paste copy-button"></i>' : ''
|
||||
|
||||
const alertInfo = (ele, text) => {
|
||||
if (GLOBAL_CONFIG.Snackbar !== undefined) {
|
||||
btf.snackbarShow(text)
|
||||
} else {
|
||||
const prevEle = ele.previousElementSibling
|
||||
prevEle.textContent = text
|
||||
prevEle.style.opacity = 1
|
||||
setTimeout(() => { prevEle.style.opacity = 0 }, 800)
|
||||
}
|
||||
}
|
||||
|
||||
const copy = ctx => {
|
||||
if (document.queryCommandSupported && document.queryCommandSupported('copy')) {
|
||||
document.execCommand('copy')
|
||||
alertInfo(ctx, GLOBAL_CONFIG.copy.success)
|
||||
} else {
|
||||
alertInfo(ctx, GLOBAL_CONFIG.copy.noSupport)
|
||||
}
|
||||
}
|
||||
|
||||
// click events
|
||||
const highlightCopyFn = ele => {
|
||||
const $buttonParent = ele.parentNode
|
||||
$buttonParent.classList.add('copy-true')
|
||||
const selection = window.getSelection()
|
||||
const range = document.createRange()
|
||||
const preCodeSelector = isPrismjs ? 'pre code' : 'table .code pre'
|
||||
range.selectNodeContents($buttonParent.querySelectorAll(`${preCodeSelector}`)[0])
|
||||
selection.removeAllRanges()
|
||||
selection.addRange(range)
|
||||
copy(ele.lastChild)
|
||||
selection.removeAllRanges()
|
||||
$buttonParent.classList.remove('copy-true')
|
||||
}
|
||||
|
||||
const highlightShrinkFn = ele => {
|
||||
ele.classList.toggle('closed')
|
||||
}
|
||||
|
||||
const highlightToolsFn = function (e) {
|
||||
const $target = e.target.classList
|
||||
if ($target.contains('expand')) highlightShrinkFn(this)
|
||||
else if ($target.contains('copy-button')) highlightCopyFn(this)
|
||||
}
|
||||
|
||||
const expandCode = function () {
|
||||
this.classList.toggle('expand-done')
|
||||
}
|
||||
|
||||
const createEle = (lang, item, service) => {
|
||||
const fragment = document.createDocumentFragment()
|
||||
|
||||
if (isShowTool) {
|
||||
const hlTools = document.createElement('div')
|
||||
hlTools.className = `highlight-tools ${highlightShrinkClass}`
|
||||
hlTools.innerHTML = highlightShrinkEle + lang + highlightCopyEle
|
||||
btf.addEventListenerPjax(hlTools, 'click', highlightToolsFn)
|
||||
fragment.appendChild(hlTools)
|
||||
}
|
||||
|
||||
if (highlightHeightLimit && item.offsetHeight > highlightHeightLimit + 30) {
|
||||
const ele = document.createElement('div')
|
||||
ele.className = 'code-expand-btn'
|
||||
ele.innerHTML = '<i class="fas fa-angle-double-down"></i>'
|
||||
btf.addEventListenerPjax(ele, 'click', expandCode)
|
||||
fragment.appendChild(ele)
|
||||
}
|
||||
|
||||
if (service === 'hl') {
|
||||
item.insertBefore(fragment, item.firstChild)
|
||||
} else {
|
||||
item.parentNode.insertBefore(fragment, item)
|
||||
}
|
||||
}
|
||||
|
||||
if (isPrismjs) {
|
||||
$figureHighlight.forEach(item => {
|
||||
if (highlightLang) {
|
||||
const langName = item.getAttribute('data-language') || 'Code'
|
||||
const highlightLangEle = `<div class="code-lang">${langName}</div>`
|
||||
btf.wrap(item, 'figure', { class: 'highlight' })
|
||||
createEle(highlightLangEle, item)
|
||||
} else {
|
||||
btf.wrap(item, 'figure', { class: 'highlight' })
|
||||
createEle('', item)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
$figureHighlight.forEach(item => {
|
||||
if (highlightLang) {
|
||||
let langName = item.getAttribute('class').split(' ')[1]
|
||||
if (langName === 'plain' || langName === undefined) langName = 'Code'
|
||||
const highlightLangEle = `<div class="code-lang">${langName}</div>`
|
||||
createEle(highlightLangEle, item, 'hl')
|
||||
} else {
|
||||
createEle('', item, 'hl')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PhotoFigcaption
|
||||
*/
|
||||
const addPhotoFigcaption = () => {
|
||||
document.querySelectorAll('#article-container img').forEach(item => {
|
||||
const altValue = item.title || item.alt
|
||||
if (!altValue) return
|
||||
const ele = document.createElement('div')
|
||||
ele.className = 'img-alt is-center'
|
||||
ele.textContent = altValue
|
||||
item.insertAdjacentElement('afterend', ele)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Lightbox
|
||||
*/
|
||||
const runLightbox = () => {
|
||||
btf.loadLightbox(document.querySelectorAll('#article-container img:not(.no-lightbox)'))
|
||||
}
|
||||
|
||||
/**
|
||||
* justified-gallery 圖庫排版
|
||||
*/
|
||||
|
||||
const fetchUrl = async (url) => {
|
||||
const response = await fetch(url)
|
||||
return await response.json()
|
||||
}
|
||||
|
||||
const runJustifiedGallery = (item, data, isButton = false, tabs) => {
|
||||
const dataLength = data.length
|
||||
|
||||
const ig = new InfiniteGrid.JustifiedInfiniteGrid(item, {
|
||||
gap: 5,
|
||||
isConstantSize: true,
|
||||
sizeRange: [150, 600],
|
||||
useResizeObserver: true,
|
||||
observeChildren: true,
|
||||
useTransform: true
|
||||
// useRecycle: false
|
||||
})
|
||||
|
||||
if (tabs) {
|
||||
btf.addGlobalFn('igOfTabs', () => { ig.destroy() }, false, tabs)
|
||||
}
|
||||
|
||||
const replaceDq = str => str.replace(/"/g, '"') // replace double quotes to "
|
||||
|
||||
const getItems = (nextGroupKey, count) => {
|
||||
const nextItems = []
|
||||
const startCount = (nextGroupKey - 1) * count
|
||||
|
||||
for (let i = 0; i < count; ++i) {
|
||||
const num = startCount + i
|
||||
if (num >= dataLength) {
|
||||
break
|
||||
}
|
||||
|
||||
const item = data[num]
|
||||
const alt = item.alt ? `alt="${replaceDq(item.alt)}"` : ''
|
||||
const title = item.title ? `title="${replaceDq(item.title)}"` : ''
|
||||
|
||||
nextItems.push(`<div class="item ">
|
||||
<img src="${item.url}" data-grid-maintained-target="true" ${alt + title} />
|
||||
</div>`)
|
||||
}
|
||||
return nextItems
|
||||
}
|
||||
|
||||
const buttonText = GLOBAL_CONFIG.infinitegrid.buttonText
|
||||
const addButton = item => {
|
||||
const button = document.createElement('button')
|
||||
button.textContent = buttonText
|
||||
|
||||
const buttonFn = e => {
|
||||
e.target.removeEventListener('click', buttonFn)
|
||||
e.target.remove()
|
||||
btf.setLoading.add(item)
|
||||
appendItem(ig.getGroups().length + 1, 10)
|
||||
}
|
||||
|
||||
button.addEventListener('click', buttonFn)
|
||||
item.insertAdjacentElement('afterend', button)
|
||||
}
|
||||
|
||||
const appendItem = (nextGroupKey, count) => {
|
||||
ig.append(getItems(nextGroupKey, count), nextGroupKey)
|
||||
}
|
||||
|
||||
const maxGroupKey = Math.ceil(dataLength / 10)
|
||||
|
||||
const completeFn = e => {
|
||||
const { updated, isResize, mounted } = e
|
||||
if (!updated.length || !mounted.length || isResize) {
|
||||
return
|
||||
}
|
||||
|
||||
btf.loadLightbox(item.querySelectorAll('img:not(.medium-zoom-image)'))
|
||||
|
||||
if (ig.getGroups().length === maxGroupKey) {
|
||||
btf.setLoading.remove(item)
|
||||
ig.off('renderComplete', completeFn)
|
||||
return
|
||||
}
|
||||
|
||||
if (isButton) {
|
||||
btf.setLoading.remove(item)
|
||||
addButton(item)
|
||||
}
|
||||
}
|
||||
|
||||
const requestAppendFn = btf.debounce(e => {
|
||||
const nextGroupKey = (+e.groupKey || 0) + 1
|
||||
appendItem(nextGroupKey, 10)
|
||||
|
||||
if (nextGroupKey === maxGroupKey) {
|
||||
ig.off('requestAppend', requestAppendFn)
|
||||
}
|
||||
}, 300)
|
||||
|
||||
btf.setLoading.add(item)
|
||||
ig.on('renderComplete', completeFn)
|
||||
|
||||
if (isButton) {
|
||||
appendItem(1, 10)
|
||||
} else {
|
||||
ig.on('requestAppend', requestAppendFn)
|
||||
ig.renderItems()
|
||||
}
|
||||
|
||||
btf.addGlobalFn('justifiedGallery', () => { ig.destroy() })
|
||||
}
|
||||
|
||||
const addJustifiedGallery = async (ele, tabs = false) => {
|
||||
const init = async () => {
|
||||
for (const item of ele) {
|
||||
if (btf.isHidden(item)) continue
|
||||
if (tabs && item.classList.contains('loaded')) {
|
||||
item.querySelector('.gallery-items').innerHTML = ''
|
||||
const button = item.querySelector(':scope > button')
|
||||
const loadingContainer = item.querySelector(':scope > .loading-container')
|
||||
button && button.remove()
|
||||
loadingContainer && loadingContainer.remove()
|
||||
}
|
||||
|
||||
const isButton = item.getAttribute('data-button') === 'true'
|
||||
const text = item.firstElementChild.textContent
|
||||
item.classList.add('loaded')
|
||||
const content = item.getAttribute('data-type') === 'url' ? await fetchUrl(text) : JSON.parse(text)
|
||||
runJustifiedGallery(item.lastElementChild, content, isButton, tabs)
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof InfiniteGrid === 'function') {
|
||||
init()
|
||||
} else {
|
||||
await getScript(`${GLOBAL_CONFIG.infinitegrid.js}`)
|
||||
init()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rightside scroll percent
|
||||
*/
|
||||
const rightsideScrollPercent = currentTop => {
|
||||
const scrollPercent = btf.getScrollPercent(currentTop, document.body)
|
||||
const goUpElement = document.getElementById('go-up')
|
||||
|
||||
if (scrollPercent < 95) {
|
||||
goUpElement.classList.add('show-percent')
|
||||
goUpElement.querySelector('.scroll-percent').textContent = scrollPercent
|
||||
} else {
|
||||
goUpElement.classList.remove('show-percent')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 滾動處理
|
||||
*/
|
||||
const scrollFn = () => {
|
||||
const $rightside = document.getElementById('rightside')
|
||||
const innerHeight = window.innerHeight + 56
|
||||
let initTop = 0
|
||||
const $header = document.getElementById('page-header')
|
||||
const isChatBtn = typeof chatBtn !== 'undefined'
|
||||
const isShowPercent = GLOBAL_CONFIG.percent.rightside
|
||||
|
||||
// 當滾動條小于 56 的時候
|
||||
if (document.body.scrollHeight <= innerHeight) {
|
||||
$rightside.classList.add('rightside-show')
|
||||
return
|
||||
}
|
||||
|
||||
// find the scroll direction
|
||||
const scrollDirection = currentTop => {
|
||||
const result = currentTop > initTop // true is down & false is up
|
||||
initTop = currentTop
|
||||
return result
|
||||
}
|
||||
|
||||
let flag = ''
|
||||
const scrollTask = btf.throttle(() => {
|
||||
const currentTop = window.scrollY || document.documentElement.scrollTop
|
||||
const isDown = scrollDirection(currentTop)
|
||||
if (currentTop > 56) {
|
||||
if (flag === '') {
|
||||
$header.classList.add('nav-fixed')
|
||||
$rightside.classList.add('rightside-show')
|
||||
}
|
||||
|
||||
if (isDown) {
|
||||
if (flag !== 'down') {
|
||||
$header.classList.remove('nav-visible')
|
||||
isChatBtn && window.chatBtn.hide()
|
||||
flag = 'down'
|
||||
}
|
||||
} else {
|
||||
if (flag !== 'up') {
|
||||
$header.classList.add('nav-visible')
|
||||
isChatBtn && window.chatBtn.show()
|
||||
flag = 'up'
|
||||
}
|
||||
}
|
||||
} else {
|
||||
flag = ''
|
||||
if (currentTop === 0) {
|
||||
$header.classList.remove('nav-fixed', 'nav-visible')
|
||||
}
|
||||
$rightside.classList.remove('rightside-show')
|
||||
}
|
||||
|
||||
isShowPercent && rightsideScrollPercent(currentTop)
|
||||
|
||||
if (document.body.scrollHeight <= innerHeight) {
|
||||
$rightside.classList.add('rightside-show')
|
||||
}
|
||||
}, 300)
|
||||
|
||||
btf.addEventListenerPjax(window, 'scroll', scrollTask, { passive: true })
|
||||
}
|
||||
|
||||
/**
|
||||
* toc,anchor
|
||||
*/
|
||||
const scrollFnToDo = () => {
|
||||
const isToc = GLOBAL_CONFIG_SITE.isToc
|
||||
const isAnchor = GLOBAL_CONFIG.isAnchor
|
||||
const $article = document.getElementById('article-container')
|
||||
|
||||
if (!($article && (isToc || isAnchor))) return
|
||||
|
||||
let $tocLink, $cardToc, autoScrollToc, $tocPercentage, isExpand
|
||||
|
||||
if (isToc) {
|
||||
const $cardTocLayout = document.getElementById('card-toc')
|
||||
$cardToc = $cardTocLayout.querySelector('.toc-content')
|
||||
$tocLink = $cardToc.querySelectorAll('.toc-link')
|
||||
$tocPercentage = $cardTocLayout.querySelector('.toc-percentage')
|
||||
isExpand = $cardToc.classList.contains('is-expand')
|
||||
|
||||
// toc元素點擊
|
||||
const tocItemClickFn = e => {
|
||||
const target = e.target.closest('.toc-link')
|
||||
if (!target) return
|
||||
|
||||
e.preventDefault()
|
||||
btf.scrollToDest(btf.getEleTop(document.getElementById(decodeURI(target.getAttribute('href')).replace('#', ''))), 300)
|
||||
if (window.innerWidth < 900) {
|
||||
$cardTocLayout.classList.remove('open')
|
||||
}
|
||||
}
|
||||
|
||||
btf.addEventListenerPjax($cardToc, 'click', tocItemClickFn)
|
||||
|
||||
autoScrollToc = item => {
|
||||
const activePosition = item.getBoundingClientRect().top
|
||||
const sidebarScrollTop = $cardToc.scrollTop
|
||||
if (activePosition > (document.documentElement.clientHeight - 100)) {
|
||||
$cardToc.scrollTop = sidebarScrollTop + 150
|
||||
}
|
||||
if (activePosition < 100) {
|
||||
$cardToc.scrollTop = sidebarScrollTop - 150
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// find head position & add active class
|
||||
const $articleList = $article.querySelectorAll('h1,h2,h3,h4,h5,h6')
|
||||
let detectItem = ''
|
||||
const findHeadPosition = top => {
|
||||
if (top === 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
let currentId = ''
|
||||
let currentIndex = ''
|
||||
|
||||
$articleList.forEach((ele, index) => {
|
||||
if (top > btf.getEleTop(ele) - 80) {
|
||||
const id = ele.id
|
||||
currentId = id ? '#' + encodeURI(id) : ''
|
||||
currentIndex = index
|
||||
}
|
||||
})
|
||||
|
||||
if (detectItem === currentIndex) return
|
||||
|
||||
if (isAnchor) btf.updateAnchor(currentId)
|
||||
|
||||
detectItem = currentIndex
|
||||
|
||||
if (isToc) {
|
||||
$cardToc.querySelectorAll('.active').forEach(i => { i.classList.remove('active') })
|
||||
|
||||
if (currentId === '') {
|
||||
return
|
||||
}
|
||||
|
||||
const currentActive = $tocLink[currentIndex]
|
||||
currentActive.classList.add('active')
|
||||
|
||||
setTimeout(() => {
|
||||
autoScrollToc(currentActive)
|
||||
}, 0)
|
||||
|
||||
if (isExpand) return
|
||||
let parent = currentActive.parentNode
|
||||
|
||||
for (; !parent.matches('.toc'); parent = parent.parentNode) {
|
||||
if (parent.matches('li')) parent.classList.add('active')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// main of scroll
|
||||
const tocScrollFn = btf.throttle(() => {
|
||||
const currentTop = window.scrollY || document.documentElement.scrollTop
|
||||
if (isToc && GLOBAL_CONFIG.percent.toc) {
|
||||
$tocPercentage.textContent = btf.getScrollPercent(currentTop, $article)
|
||||
}
|
||||
findHeadPosition(currentTop)
|
||||
}, 100)
|
||||
|
||||
btf.addEventListenerPjax(window, 'scroll', tocScrollFn, { passive: true })
|
||||
}
|
||||
|
||||
const handleThemeChange = mode => {
|
||||
const globalFn = window.globalFn || {}
|
||||
const themeChange = globalFn.themeChange || {}
|
||||
if (!themeChange) {
|
||||
return
|
||||
}
|
||||
|
||||
Object.keys(themeChange).forEach(key => {
|
||||
const themeChangeFn = themeChange[key]
|
||||
if (['disqus', 'disqusjs'].includes(key)) {
|
||||
setTimeout(() => themeChangeFn(mode), 300)
|
||||
} else {
|
||||
themeChangeFn(mode)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Rightside
|
||||
*/
|
||||
const rightSideFn = {
|
||||
readmode: () => { // read mode
|
||||
const $body = document.body
|
||||
$body.classList.add('read-mode')
|
||||
const newEle = document.createElement('button')
|
||||
newEle.type = 'button'
|
||||
newEle.className = 'fas fa-sign-out-alt exit-readmode'
|
||||
$body.appendChild(newEle)
|
||||
|
||||
const clickFn = () => {
|
||||
$body.classList.remove('read-mode')
|
||||
newEle.remove()
|
||||
newEle.removeEventListener('click', clickFn)
|
||||
}
|
||||
|
||||
newEle.addEventListener('click', clickFn)
|
||||
},
|
||||
darkmode: () => { // switch between light and dark mode
|
||||
const willChangeMode = document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'
|
||||
if (willChangeMode === 'dark') {
|
||||
activateDarkMode()
|
||||
GLOBAL_CONFIG.Snackbar !== undefined && btf.snackbarShow(GLOBAL_CONFIG.Snackbar.day_to_night)
|
||||
} else {
|
||||
activateLightMode()
|
||||
GLOBAL_CONFIG.Snackbar !== undefined && btf.snackbarShow(GLOBAL_CONFIG.Snackbar.night_to_day)
|
||||
}
|
||||
saveToLocal.set('theme', willChangeMode, 2)
|
||||
handleThemeChange(willChangeMode)
|
||||
},
|
||||
'rightside-config': item => { // Show or hide rightside-hide-btn
|
||||
const hideLayout = item.firstElementChild
|
||||
if (hideLayout.classList.contains('show')) {
|
||||
hideLayout.classList.add('status')
|
||||
setTimeout(() => {
|
||||
hideLayout.classList.remove('status')
|
||||
}, 300)
|
||||
}
|
||||
|
||||
hideLayout.classList.toggle('show')
|
||||
},
|
||||
'go-up': () => { // Back to top
|
||||
btf.scrollToDest(0, 500)
|
||||
},
|
||||
'hide-aside-btn': () => { // Hide aside
|
||||
const $htmlDom = document.documentElement.classList
|
||||
const saveStatus = $htmlDom.contains('hide-aside') ? 'show' : 'hide'
|
||||
saveToLocal.set('aside-status', saveStatus, 2)
|
||||
$htmlDom.toggle('hide-aside')
|
||||
},
|
||||
'mobile-toc-button': item => { // Show mobile toc
|
||||
const tocEle = document.getElementById('card-toc')
|
||||
tocEle.style.transition = 'transform 0.3s ease-in-out'
|
||||
tocEle.classList.toggle('open')
|
||||
tocEle.addEventListener('transitionend', () => {
|
||||
tocEle.style.transition = ''
|
||||
}, { once: true })
|
||||
},
|
||||
'chat-btn': () => { // Show chat
|
||||
window.chatBtnFn()
|
||||
},
|
||||
translateLink: () => { // switch between traditional and simplified chinese
|
||||
window.translateFn.translatePage()
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('rightside').addEventListener('click', function (e) {
|
||||
const $target = e.target.closest('[id]')
|
||||
if ($target && rightSideFn[$target.id]) {
|
||||
rightSideFn[$target.id](this)
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* menu
|
||||
* 側邊欄sub-menu 展開/收縮
|
||||
*/
|
||||
const clickFnOfSubMenu = () => {
|
||||
const handleClickOfSubMenu = e => {
|
||||
const target = e.target.closest('.site-page.group')
|
||||
if (!target) return
|
||||
target.classList.toggle('hide')
|
||||
}
|
||||
|
||||
document.querySelector('#sidebar-menus .menus_items').addEventListener('click', handleClickOfSubMenu)
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机端目录点击
|
||||
*/
|
||||
const openMobileMenu = () => {
|
||||
const handleClick = () => { sidebarFn.open() }
|
||||
btf.addEventListenerPjax(document.getElementById('toggle-menu'), 'click', handleClick)
|
||||
}
|
||||
|
||||
/**
|
||||
* 複製時加上版權信息
|
||||
*/
|
||||
const addCopyright = () => {
|
||||
const { limitCount, languages } = GLOBAL_CONFIG.copyright
|
||||
|
||||
const handleCopy = (e) => {
|
||||
e.preventDefault()
|
||||
const copyFont = window.getSelection(0).toString()
|
||||
let textFont = copyFont
|
||||
if (copyFont.length > limitCount) {
|
||||
textFont = `${copyFont}\n\n\n${languages.author}\n${languages.link}${window.location.href}\n${languages.source}\n${languages.info}`
|
||||
}
|
||||
if (e.clipboardData) {
|
||||
return e.clipboardData.setData('text', textFont)
|
||||
} else {
|
||||
return window.clipboardData.setData('text', textFont)
|
||||
}
|
||||
}
|
||||
|
||||
document.body.addEventListener('copy', handleCopy)
|
||||
}
|
||||
|
||||
/**
|
||||
* 網頁運行時間
|
||||
*/
|
||||
const addRuntime = () => {
|
||||
const $runtimeCount = document.getElementById('runtimeshow')
|
||||
if ($runtimeCount) {
|
||||
const publishDate = $runtimeCount.getAttribute('data-publishDate')
|
||||
$runtimeCount.textContent = `${btf.diffDate(publishDate)} ${GLOBAL_CONFIG.runtime}`
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 最後一次更新時間
|
||||
*/
|
||||
const addLastPushDate = () => {
|
||||
const $lastPushDateItem = document.getElementById('last-push-date')
|
||||
if ($lastPushDateItem) {
|
||||
const lastPushDate = $lastPushDateItem.getAttribute('data-lastPushDate')
|
||||
$lastPushDateItem.textContent = btf.diffDate(lastPushDate, true)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* table overflow
|
||||
*/
|
||||
const addTableWrap = () => {
|
||||
const $table = document.querySelectorAll('#article-container table')
|
||||
if (!$table.length) return
|
||||
|
||||
$table.forEach(item => {
|
||||
if (!item.closest('.highlight')) {
|
||||
btf.wrap(item, 'div', { class: 'table-wrap' })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* tag-hide
|
||||
*/
|
||||
const clickFnOfTagHide = () => {
|
||||
const hideButtons = document.querySelectorAll('#article-container .hide-button')
|
||||
if (!hideButtons.length) return
|
||||
const handleClick = function (e) {
|
||||
const $this = this
|
||||
$this.classList.add('open')
|
||||
const $fjGallery = $this.nextElementSibling.querySelectorAll('.gallery-container')
|
||||
$fjGallery.length && addJustifiedGallery($fjGallery)
|
||||
}
|
||||
|
||||
hideButtons.forEach(item => {
|
||||
item.addEventListener('click', handleClick, { once: true })
|
||||
})
|
||||
}
|
||||
|
||||
const tabsFn = () => {
|
||||
const navTabsElement = document.querySelectorAll('#article-container .tabs')
|
||||
if (!navTabsElement.length) return
|
||||
|
||||
const removeAndAddActiveClass = (elements, detect) => {
|
||||
Array.from(elements).forEach(element => {
|
||||
element.classList.remove('active')
|
||||
if (element === detect || element.id === detect) {
|
||||
element.classList.add('active')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const addTabNavEventListener = (item, isJustifiedGallery) => {
|
||||
const navClickHandler = function (e) {
|
||||
const target = e.target.closest('button')
|
||||
if (target.classList.contains('active')) return
|
||||
removeAndAddActiveClass(this.children, target)
|
||||
this.classList.remove('no-default')
|
||||
const tabId = target.getAttribute('data-href')
|
||||
const tabContent = this.nextElementSibling
|
||||
removeAndAddActiveClass(tabContent.children, tabId)
|
||||
if (isJustifiedGallery) {
|
||||
btf.removeGlobalFnEvent('igOfTabs', this)
|
||||
const justifiedGalleryItems = tabContent.querySelectorAll(`:scope > #${tabId} .gallery-container`)
|
||||
justifiedGalleryItems.length && addJustifiedGallery(justifiedGalleryItems, this)
|
||||
}
|
||||
}
|
||||
btf.addEventListenerPjax(item.firstElementChild, 'click', navClickHandler)
|
||||
}
|
||||
|
||||
const addTabToTopEventListener = item => {
|
||||
const btnClickHandler = (e) => {
|
||||
const target = e.target.closest('button')
|
||||
if (!target) return
|
||||
btf.scrollToDest(btf.getEleTop(item), 300)
|
||||
}
|
||||
btf.addEventListenerPjax(item.lastElementChild, 'click', btnClickHandler)
|
||||
}
|
||||
|
||||
navTabsElement.forEach(item => {
|
||||
const isJustifiedGallery = !!item.querySelectorAll('.gallery-container')
|
||||
addTabNavEventListener(item, isJustifiedGallery)
|
||||
addTabToTopEventListener(item)
|
||||
})
|
||||
}
|
||||
|
||||
const toggleCardCategory = () => {
|
||||
const cardCategory = document.querySelector('#aside-cat-list.expandBtn')
|
||||
if (!cardCategory) return
|
||||
|
||||
const handleToggleBtn = (e) => {
|
||||
const target = e.target
|
||||
if (target.nodeName === 'I') {
|
||||
e.preventDefault()
|
||||
target.parentNode.classList.toggle('expand')
|
||||
}
|
||||
}
|
||||
btf.addEventListenerPjax(cardCategory, 'click', handleToggleBtn, true)
|
||||
}
|
||||
|
||||
const switchComments = () => {
|
||||
const switchBtn = document.getElementById('switch-btn')
|
||||
if (!switchBtn) return
|
||||
let switchDone = false
|
||||
const commentContainer = document.getElementById('post-comment')
|
||||
const handleSwitchBtn = () => {
|
||||
commentContainer.classList.toggle('move')
|
||||
if (!switchDone && typeof loadOtherComment === 'function') {
|
||||
switchDone = true
|
||||
loadOtherComment()
|
||||
}
|
||||
}
|
||||
btf.addEventListenerPjax(switchBtn, 'click', handleSwitchBtn)
|
||||
}
|
||||
|
||||
const addPostOutdateNotice = () => {
|
||||
const { limitDay, messagePrev, messageNext, position } = GLOBAL_CONFIG.noticeOutdate
|
||||
const diffDay = btf.diffDate(GLOBAL_CONFIG_SITE.postUpdate)
|
||||
if (diffDay >= limitDay) {
|
||||
const ele = document.createElement('div')
|
||||
ele.className = 'post-outdate-notice'
|
||||
ele.textContent = `${messagePrev} ${diffDay} ${messageNext}`
|
||||
const $targetEle = document.getElementById('article-container')
|
||||
if (position === 'top') {
|
||||
$targetEle.insertBefore(ele, $targetEle.firstChild)
|
||||
} else {
|
||||
$targetEle.appendChild(ele)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const lazyloadImg = () => {
|
||||
window.lazyLoadInstance = new LazyLoad({
|
||||
elements_selector: 'img',
|
||||
threshold: 0,
|
||||
data_src: 'lazy-src'
|
||||
})
|
||||
}
|
||||
|
||||
const relativeDate = function (selector) {
|
||||
selector.forEach(item => {
|
||||
const timeVal = item.getAttribute('datetime')
|
||||
item.textContent = btf.diffDate(timeVal, true)
|
||||
item.style.display = 'inline'
|
||||
})
|
||||
}
|
||||
|
||||
const unRefreshFn = function () {
|
||||
window.addEventListener('resize', () => {
|
||||
adjustMenu(false)
|
||||
mobileSidebarOpen && btf.isHidden(document.getElementById('toggle-menu')) && sidebarFn.close()
|
||||
})
|
||||
|
||||
document.getElementById('menu-mask').addEventListener('click', e => { sidebarFn.close() })
|
||||
|
||||
clickFnOfSubMenu()
|
||||
GLOBAL_CONFIG.islazyload && lazyloadImg()
|
||||
GLOBAL_CONFIG.copyright !== undefined && addCopyright()
|
||||
|
||||
if (GLOBAL_CONFIG.autoDarkmode) {
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
|
||||
if (saveToLocal.get('theme') !== undefined) return
|
||||
e.matches ? handleThemeChange('dark') : handleThemeChange('light')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
window.refreshFn = function () {
|
||||
initAdjust()
|
||||
|
||||
if (GLOBAL_CONFIG_SITE.isPost) {
|
||||
GLOBAL_CONFIG.noticeOutdate !== undefined && addPostOutdateNotice()
|
||||
GLOBAL_CONFIG.relativeDate.post && relativeDate(document.querySelectorAll('#post-meta time'))
|
||||
} else {
|
||||
GLOBAL_CONFIG.relativeDate.homepage && relativeDate(document.querySelectorAll('#recent-posts time'))
|
||||
GLOBAL_CONFIG.runtime && addRuntime()
|
||||
addLastPushDate()
|
||||
toggleCardCategory()
|
||||
}
|
||||
|
||||
scrollFnToDo()
|
||||
GLOBAL_CONFIG_SITE.isHome && scrollDownInIndex()
|
||||
addHighlightTool()
|
||||
GLOBAL_CONFIG.isPhotoFigcaption && addPhotoFigcaption()
|
||||
scrollFn()
|
||||
|
||||
btf.removeGlobalFnEvent('justifiedGallery')
|
||||
const galleryContainer = document.querySelectorAll('#article-container .gallery-container')
|
||||
galleryContainer.length && addJustifiedGallery(galleryContainer)
|
||||
|
||||
runLightbox()
|
||||
addTableWrap()
|
||||
clickFnOfTagHide()
|
||||
tabsFn()
|
||||
switchComments()
|
||||
openMobileMenu()
|
||||
}
|
||||
|
||||
refreshFn()
|
||||
unRefreshFn()
|
||||
})
|
||||
@@ -0,0 +1,177 @@
|
||||
window.addEventListener('load', () => {
|
||||
const $searchMask = document.getElementById('search-mask')
|
||||
const $searchDialog = document.querySelector('#algolia-search .search-dialog')
|
||||
|
||||
const openSearch = () => {
|
||||
const bodyStyle = document.body.style
|
||||
bodyStyle.width = '100%'
|
||||
bodyStyle.overflow = 'hidden'
|
||||
btf.animateIn($searchMask, 'to_show 0.5s')
|
||||
btf.animateIn($searchDialog, 'titleScale 0.5s')
|
||||
setTimeout(() => { document.querySelector('#algolia-search .ais-SearchBox-input').focus() }, 100)
|
||||
|
||||
// shortcut: ESC
|
||||
document.addEventListener('keydown', function f (event) {
|
||||
if (event.code === 'Escape') {
|
||||
closeSearch()
|
||||
document.removeEventListener('keydown', f)
|
||||
}
|
||||
})
|
||||
|
||||
fixSafariHeight()
|
||||
window.addEventListener('resize', fixSafariHeight)
|
||||
}
|
||||
|
||||
const closeSearch = () => {
|
||||
const bodyStyle = document.body.style
|
||||
bodyStyle.width = ''
|
||||
bodyStyle.overflow = ''
|
||||
btf.animateOut($searchDialog, 'search_close .5s')
|
||||
btf.animateOut($searchMask, 'to_hide 0.5s')
|
||||
window.removeEventListener('resize', fixSafariHeight)
|
||||
}
|
||||
|
||||
// fix safari
|
||||
const fixSafariHeight = () => {
|
||||
if (window.innerWidth < 768) {
|
||||
$searchDialog.style.setProperty('--search-height', window.innerHeight + 'px')
|
||||
}
|
||||
}
|
||||
|
||||
const searchClickFn = () => {
|
||||
btf.addEventListenerPjax(document.querySelector('#search-button > .search'), 'click', openSearch)
|
||||
}
|
||||
|
||||
const searchFnOnce = () => {
|
||||
$searchMask.addEventListener('click', closeSearch)
|
||||
document.querySelector('#algolia-search .search-close-button').addEventListener('click', closeSearch)
|
||||
}
|
||||
|
||||
const cutContent = content => {
|
||||
if (content === '') return ''
|
||||
|
||||
const firstOccur = content.indexOf('<mark>')
|
||||
|
||||
let start = firstOccur - 30
|
||||
let end = firstOccur + 120
|
||||
let pre = ''
|
||||
let post = ''
|
||||
|
||||
if (start <= 0) {
|
||||
start = 0
|
||||
end = 140
|
||||
} else {
|
||||
pre = '...'
|
||||
}
|
||||
|
||||
if (end > content.length) {
|
||||
end = content.length
|
||||
} else {
|
||||
post = '...'
|
||||
}
|
||||
|
||||
const matchContent = pre + content.substring(start, end) + post
|
||||
return matchContent
|
||||
}
|
||||
|
||||
const algolia = GLOBAL_CONFIG.algolia
|
||||
const isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName
|
||||
if (!isAlgoliaValid) {
|
||||
return console.error('Algolia setting is invalid!')
|
||||
}
|
||||
|
||||
const search = instantsearch({
|
||||
indexName: algolia.indexName,
|
||||
/* global algoliasearch */
|
||||
searchClient: algoliasearch(algolia.appId, algolia.apiKey),
|
||||
searchFunction (helper) {
|
||||
helper.state.query && helper.search()
|
||||
}
|
||||
})
|
||||
|
||||
const configure = instantsearch.widgets.configure({
|
||||
hitsPerPage: 5
|
||||
})
|
||||
|
||||
const searchBox = instantsearch.widgets.searchBox({
|
||||
container: '#algolia-search-input',
|
||||
showReset: false,
|
||||
showSubmit: false,
|
||||
placeholder: GLOBAL_CONFIG.algolia.languages.input_placeholder,
|
||||
showLoadingIndicator: true
|
||||
})
|
||||
|
||||
const hits = instantsearch.widgets.hits({
|
||||
container: '#algolia-hits',
|
||||
templates: {
|
||||
item (data) {
|
||||
const link = data.permalink ? data.permalink : (GLOBAL_CONFIG.root + data.path)
|
||||
const result = data._highlightResult
|
||||
const content = result.contentStripTruncate
|
||||
? cutContent(result.contentStripTruncate.value)
|
||||
: result.contentStrip
|
||||
? cutContent(result.contentStrip.value)
|
||||
: result.content
|
||||
? cutContent(result.content.value)
|
||||
: ''
|
||||
return `
|
||||
<a href="${link}" class="algolia-hit-item-link">
|
||||
<span class="algolia-hits-item-title">${result.title.value || 'no-title'}</span>
|
||||
<p class="algolia-hit-item-content">${content}</p>
|
||||
</a>`
|
||||
},
|
||||
empty: function (data) {
|
||||
return (
|
||||
'<div id="algolia-hits-empty">' +
|
||||
GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) +
|
||||
'</div>'
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const stats = instantsearch.widgets.stats({
|
||||
container: '#algolia-info > .algolia-stats',
|
||||
templates: {
|
||||
text: function (data) {
|
||||
const stats = GLOBAL_CONFIG.algolia.languages.hits_stats
|
||||
.replace(/\$\{hits}/, data.nbHits)
|
||||
.replace(/\$\{time}/, data.processingTimeMS)
|
||||
return (
|
||||
`<hr>${stats}`
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const powerBy = instantsearch.widgets.poweredBy({
|
||||
container: '#algolia-info > .algolia-poweredBy'
|
||||
})
|
||||
|
||||
const pagination = instantsearch.widgets.pagination({
|
||||
container: '#algolia-pagination',
|
||||
totalPages: 5,
|
||||
templates: {
|
||||
first: '<i class="fas fa-angle-double-left"></i>',
|
||||
last: '<i class="fas fa-angle-double-right"></i>',
|
||||
previous: '<i class="fas fa-angle-left"></i>',
|
||||
next: '<i class="fas fa-angle-right"></i>'
|
||||
}
|
||||
})
|
||||
|
||||
search.addWidgets([configure, searchBox, hits, stats, powerBy, pagination]) // add the widgets to the instantsearch instance
|
||||
|
||||
search.start()
|
||||
|
||||
searchClickFn()
|
||||
searchFnOnce()
|
||||
|
||||
window.addEventListener('pjax:complete', () => {
|
||||
!btf.isHidden($searchMask) && closeSearch()
|
||||
searchClickFn()
|
||||
})
|
||||
|
||||
window.pjax && search.on('render', () => {
|
||||
window.pjax.refresh(document.getElementById('algolia-hits'))
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,364 @@
|
||||
/**
|
||||
* Refer to hexo-generator-searchdb
|
||||
* https://github.com/next-theme/hexo-generator-searchdb/blob/main/dist/search.js
|
||||
* Modified by hexo-theme-butterfly
|
||||
*/
|
||||
|
||||
class LocalSearch {
|
||||
constructor ({
|
||||
path = '',
|
||||
unescape = false,
|
||||
top_n_per_article = 1
|
||||
}) {
|
||||
this.path = path
|
||||
this.unescape = unescape
|
||||
this.top_n_per_article = top_n_per_article
|
||||
this.isfetched = false
|
||||
this.datas = null
|
||||
}
|
||||
|
||||
getIndexByWord (words, text, caseSensitive = false) {
|
||||
const index = []
|
||||
const included = new Set()
|
||||
|
||||
if (!caseSensitive) {
|
||||
text = text.toLowerCase()
|
||||
}
|
||||
words.forEach(word => {
|
||||
if (this.unescape) {
|
||||
const div = document.createElement('div')
|
||||
div.innerText = word
|
||||
word = div.innerHTML
|
||||
}
|
||||
const wordLen = word.length
|
||||
if (wordLen === 0) return
|
||||
let startPosition = 0
|
||||
let position = -1
|
||||
if (!caseSensitive) {
|
||||
word = word.toLowerCase()
|
||||
}
|
||||
while ((position = text.indexOf(word, startPosition)) > -1) {
|
||||
index.push({ position, word })
|
||||
included.add(word)
|
||||
startPosition = position + wordLen
|
||||
}
|
||||
})
|
||||
// Sort index by position of keyword
|
||||
index.sort((left, right) => {
|
||||
if (left.position !== right.position) {
|
||||
return left.position - right.position
|
||||
}
|
||||
return right.word.length - left.word.length
|
||||
})
|
||||
return [index, included]
|
||||
}
|
||||
|
||||
// Merge hits into slices
|
||||
mergeIntoSlice (start, end, index) {
|
||||
let item = index[0]
|
||||
let { position, word } = item
|
||||
const hits = []
|
||||
const count = new Set()
|
||||
while (position + word.length <= end && index.length !== 0) {
|
||||
count.add(word)
|
||||
hits.push({
|
||||
position,
|
||||
length: word.length
|
||||
})
|
||||
const wordEnd = position + word.length
|
||||
|
||||
// Move to next position of hit
|
||||
index.shift()
|
||||
while (index.length !== 0) {
|
||||
item = index[0]
|
||||
position = item.position
|
||||
word = item.word
|
||||
if (wordEnd > position) {
|
||||
index.shift()
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
hits,
|
||||
start,
|
||||
end,
|
||||
count: count.size
|
||||
}
|
||||
}
|
||||
|
||||
// Highlight title and content
|
||||
highlightKeyword (val, slice) {
|
||||
let result = ''
|
||||
let index = slice.start
|
||||
for (const { position, length } of slice.hits) {
|
||||
result += val.substring(index, position)
|
||||
index = position + length
|
||||
result += `<mark class="search-keyword">${val.substr(position, length)}</mark>`
|
||||
}
|
||||
result += val.substring(index, slice.end)
|
||||
return result
|
||||
}
|
||||
|
||||
getResultItems (keywords) {
|
||||
const resultItems = []
|
||||
this.datas.forEach(({ title, content, url }) => {
|
||||
// The number of different keywords included in the article.
|
||||
const [indexOfTitle, keysOfTitle] = this.getIndexByWord(keywords, title)
|
||||
const [indexOfContent, keysOfContent] = this.getIndexByWord(keywords, content)
|
||||
const includedCount = new Set([...keysOfTitle, ...keysOfContent]).size
|
||||
|
||||
// Show search results
|
||||
const hitCount = indexOfTitle.length + indexOfContent.length
|
||||
if (hitCount === 0) return
|
||||
|
||||
const slicesOfTitle = []
|
||||
if (indexOfTitle.length !== 0) {
|
||||
slicesOfTitle.push(this.mergeIntoSlice(0, title.length, indexOfTitle))
|
||||
}
|
||||
|
||||
let slicesOfContent = []
|
||||
while (indexOfContent.length !== 0) {
|
||||
const item = indexOfContent[0]
|
||||
const { position } = item
|
||||
// Cut out 120 characters. The maxlength of .search-input is 80.
|
||||
const start = Math.max(0, position - 20)
|
||||
const end = Math.min(content.length, position + 100)
|
||||
slicesOfContent.push(this.mergeIntoSlice(start, end, indexOfContent))
|
||||
}
|
||||
|
||||
// Sort slices in content by included keywords' count and hits' count
|
||||
slicesOfContent.sort((left, right) => {
|
||||
if (left.count !== right.count) {
|
||||
return right.count - left.count
|
||||
} else if (left.hits.length !== right.hits.length) {
|
||||
return right.hits.length - left.hits.length
|
||||
}
|
||||
return left.start - right.start
|
||||
})
|
||||
|
||||
// Select top N slices in content
|
||||
const upperBound = parseInt(this.top_n_per_article, 10)
|
||||
if (upperBound >= 0) {
|
||||
slicesOfContent = slicesOfContent.slice(0, upperBound)
|
||||
}
|
||||
|
||||
let resultItem = ''
|
||||
|
||||
url = new URL(url, location.origin)
|
||||
url.searchParams.append('highlight', keywords.join(' '))
|
||||
|
||||
if (slicesOfTitle.length !== 0) {
|
||||
resultItem += `<div class="local-search-hit-item"><a href="${url.href}"><span class="search-result-title">${this.highlightKeyword(title, slicesOfTitle[0])}</span>`
|
||||
} else {
|
||||
resultItem += `<div class="local-search-hit-item"><a href="${url.href}"><span class="search-result-title">${title}</span>`
|
||||
}
|
||||
|
||||
slicesOfContent.forEach(slice => {
|
||||
resultItem += `<p class="search-result">${this.highlightKeyword(content, slice)}...</p></a>`
|
||||
})
|
||||
|
||||
resultItem += '</div>'
|
||||
resultItems.push({
|
||||
item: resultItem,
|
||||
id: resultItems.length,
|
||||
hitCount,
|
||||
includedCount
|
||||
})
|
||||
})
|
||||
return resultItems
|
||||
}
|
||||
|
||||
fetchData () {
|
||||
const isXml = !this.path.endsWith('json')
|
||||
fetch(this.path)
|
||||
.then(response => response.text())
|
||||
.then(res => {
|
||||
// Get the contents from search data
|
||||
this.isfetched = true
|
||||
this.datas = isXml
|
||||
? [...new DOMParser().parseFromString(res, 'text/xml').querySelectorAll('entry')].map(element => ({
|
||||
title: element.querySelector('title').textContent,
|
||||
content: element.querySelector('content').textContent,
|
||||
url: element.querySelector('url').textContent
|
||||
}))
|
||||
: JSON.parse(res)
|
||||
// Only match articles with non-empty titles
|
||||
this.datas = this.datas.filter(data => data.title).map(data => {
|
||||
data.title = data.title.trim()
|
||||
data.content = data.content ? data.content.trim().replace(/<[^>]+>/g, '') : ''
|
||||
data.url = decodeURIComponent(data.url).replace(/\/{2,}/g, '/')
|
||||
return data
|
||||
})
|
||||
// Remove loading animation
|
||||
window.dispatchEvent(new Event('search:loaded'))
|
||||
})
|
||||
}
|
||||
|
||||
// Highlight by wrapping node in mark elements with the given class name
|
||||
highlightText (node, slice, className) {
|
||||
const val = node.nodeValue
|
||||
let index = slice.start
|
||||
const children = []
|
||||
for (const { position, length } of slice.hits) {
|
||||
const text = document.createTextNode(val.substring(index, position))
|
||||
index = position + length
|
||||
const mark = document.createElement('mark')
|
||||
mark.className = className
|
||||
mark.appendChild(document.createTextNode(val.substr(position, length)))
|
||||
children.push(text, mark)
|
||||
}
|
||||
node.nodeValue = val.substring(index, slice.end)
|
||||
children.forEach(element => {
|
||||
node.parentNode.insertBefore(element, node)
|
||||
})
|
||||
}
|
||||
|
||||
// Highlight the search words provided in the url in the text
|
||||
highlightSearchWords (body) {
|
||||
const params = new URL(location.href).searchParams.get('highlight')
|
||||
const keywords = params ? params.split(' ') : []
|
||||
if (!keywords.length || !body) return
|
||||
const walk = document.createTreeWalker(body, NodeFilter.SHOW_TEXT, null)
|
||||
const allNodes = []
|
||||
while (walk.nextNode()) {
|
||||
if (!walk.currentNode.parentNode.matches('button, select, textarea, .mermaid')) allNodes.push(walk.currentNode)
|
||||
}
|
||||
allNodes.forEach(node => {
|
||||
const [indexOfNode] = this.getIndexByWord(keywords, node.nodeValue)
|
||||
if (!indexOfNode.length) return
|
||||
const slice = this.mergeIntoSlice(0, node.nodeValue.length, indexOfNode)
|
||||
this.highlightText(node, slice, 'search-keyword')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
// Search
|
||||
const { path, top_n_per_article, unescape, languages } = GLOBAL_CONFIG.localSearch
|
||||
const localSearch = new LocalSearch({
|
||||
path,
|
||||
top_n_per_article,
|
||||
unescape
|
||||
})
|
||||
|
||||
const input = document.querySelector('#local-search-input input')
|
||||
const statsItem = document.getElementById('local-search-stats-wrap')
|
||||
const $loadingStatus = document.getElementById('loading-status')
|
||||
const isXml = !path.endsWith('json')
|
||||
|
||||
const inputEventFunction = () => {
|
||||
if (!localSearch.isfetched) return
|
||||
let searchText = input.value.trim().toLowerCase()
|
||||
isXml && (searchText = searchText.replace(/</g, '<').replace(/>/g, '>'))
|
||||
if (searchText !== '') $loadingStatus.innerHTML = '<i class="fas fa-spinner fa-pulse"></i>'
|
||||
const keywords = searchText.split(/[-\s]+/)
|
||||
const container = document.getElementById('local-search-results')
|
||||
let resultItems = []
|
||||
if (searchText.length > 0) {
|
||||
// Perform local searching
|
||||
resultItems = localSearch.getResultItems(keywords)
|
||||
}
|
||||
if (keywords.length === 1 && keywords[0] === '') {
|
||||
container.textContent = ''
|
||||
statsItem.textContent = ''
|
||||
} else if (resultItems.length === 0) {
|
||||
container.textContent = ''
|
||||
const statsDiv = document.createElement('div')
|
||||
statsDiv.className = 'search-result-stats'
|
||||
statsDiv.textContent = languages.hits_empty.replace(/\$\{query}/, searchText)
|
||||
statsItem.innerHTML = statsDiv.outerHTML
|
||||
} else {
|
||||
resultItems.sort((left, right) => {
|
||||
if (left.includedCount !== right.includedCount) {
|
||||
return right.includedCount - left.includedCount
|
||||
} else if (left.hitCount !== right.hitCount) {
|
||||
return right.hitCount - left.hitCount
|
||||
}
|
||||
return right.id - left.id
|
||||
})
|
||||
|
||||
const stats = languages.hits_stats.replace(/\$\{hits}/, resultItems.length)
|
||||
|
||||
container.innerHTML = `<div class="search-result-list">${resultItems.map(result => result.item).join('')}</div>`
|
||||
statsItem.innerHTML = `<hr><div class="search-result-stats">${stats}</div>`
|
||||
window.pjax && window.pjax.refresh(container)
|
||||
}
|
||||
|
||||
$loadingStatus.textContent = ''
|
||||
}
|
||||
|
||||
let loadFlag = false
|
||||
const $searchMask = document.getElementById('search-mask')
|
||||
const $searchDialog = document.querySelector('#local-search .search-dialog')
|
||||
|
||||
// fix safari
|
||||
const fixSafariHeight = () => {
|
||||
if (window.innerWidth < 768) {
|
||||
$searchDialog.style.setProperty('--search-height', window.innerHeight + 'px')
|
||||
}
|
||||
}
|
||||
|
||||
const openSearch = () => {
|
||||
const bodyStyle = document.body.style
|
||||
bodyStyle.width = '100%'
|
||||
bodyStyle.overflow = 'hidden'
|
||||
btf.animateIn($searchMask, 'to_show 0.5s')
|
||||
btf.animateIn($searchDialog, 'titleScale 0.5s')
|
||||
setTimeout(() => { input.focus() }, 300)
|
||||
if (!loadFlag) {
|
||||
!localSearch.isfetched && localSearch.fetchData()
|
||||
input.addEventListener('input', inputEventFunction)
|
||||
loadFlag = true
|
||||
}
|
||||
// shortcut: ESC
|
||||
document.addEventListener('keydown', function f (event) {
|
||||
if (event.code === 'Escape') {
|
||||
closeSearch()
|
||||
document.removeEventListener('keydown', f)
|
||||
}
|
||||
})
|
||||
|
||||
fixSafariHeight()
|
||||
window.addEventListener('resize', fixSafariHeight)
|
||||
}
|
||||
|
||||
const closeSearch = () => {
|
||||
const bodyStyle = document.body.style
|
||||
bodyStyle.width = ''
|
||||
bodyStyle.overflow = ''
|
||||
btf.animateOut($searchDialog, 'search_close .5s')
|
||||
btf.animateOut($searchMask, 'to_hide 0.5s')
|
||||
window.removeEventListener('resize', fixSafariHeight)
|
||||
}
|
||||
|
||||
const searchClickFn = () => {
|
||||
btf.addEventListenerPjax(document.querySelector('#search-button > .search'), 'click', openSearch)
|
||||
}
|
||||
|
||||
const searchFnOnce = () => {
|
||||
document.querySelector('#local-search .search-close-button').addEventListener('click', closeSearch)
|
||||
$searchMask.addEventListener('click', closeSearch)
|
||||
if (GLOBAL_CONFIG.localSearch.preload) {
|
||||
localSearch.fetchData()
|
||||
}
|
||||
localSearch.highlightSearchWords(document.getElementById('article-container'))
|
||||
}
|
||||
|
||||
window.addEventListener('search:loaded', () => {
|
||||
const $loadDataItem = document.getElementById('loading-database')
|
||||
$loadDataItem.nextElementSibling.style.display = 'block'
|
||||
$loadDataItem.remove()
|
||||
})
|
||||
|
||||
searchClickFn()
|
||||
searchFnOnce()
|
||||
|
||||
// pjax
|
||||
window.addEventListener('pjax:complete', () => {
|
||||
!btf.isHidden($searchMask) && closeSearch()
|
||||
localSearch.highlightSearchWords(document.getElementById('article-container'))
|
||||
searchClickFn()
|
||||
})
|
||||
})
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,296 @@
|
||||
const btf = {
|
||||
debounce: (func, wait = 0, immediate = false) => {
|
||||
let timeout
|
||||
return (...args) => {
|
||||
const later = () => {
|
||||
timeout = null
|
||||
if (!immediate) func(...args)
|
||||
}
|
||||
const callNow = immediate && !timeout
|
||||
clearTimeout(timeout)
|
||||
timeout = setTimeout(later, wait)
|
||||
if (callNow) func(...args)
|
||||
}
|
||||
},
|
||||
|
||||
throttle: function (func, wait, options = {}) {
|
||||
let timeout, context, args
|
||||
let previous = 0
|
||||
|
||||
const later = () => {
|
||||
previous = options.leading === false ? 0 : new Date().getTime()
|
||||
timeout = null
|
||||
func.apply(context, args)
|
||||
if (!timeout) context = args = null
|
||||
}
|
||||
|
||||
const throttled = (...params) => {
|
||||
const now = new Date().getTime()
|
||||
if (!previous && options.leading === false) previous = now
|
||||
const remaining = wait - (now - previous)
|
||||
context = this
|
||||
args = params
|
||||
if (remaining <= 0 || remaining > wait) {
|
||||
if (timeout) {
|
||||
clearTimeout(timeout)
|
||||
timeout = null
|
||||
}
|
||||
previous = now
|
||||
func.apply(context, args)
|
||||
if (!timeout) context = args = null
|
||||
} else if (!timeout && options.trailing !== false) {
|
||||
timeout = setTimeout(later, remaining)
|
||||
}
|
||||
}
|
||||
|
||||
return throttled
|
||||
},
|
||||
|
||||
sidebarPaddingR: () => {
|
||||
const innerWidth = window.innerWidth
|
||||
const clientWidth = document.body.clientWidth
|
||||
const paddingRight = innerWidth - clientWidth
|
||||
if (innerWidth !== clientWidth) {
|
||||
document.body.style.paddingRight = paddingRight + 'px'
|
||||
}
|
||||
},
|
||||
|
||||
snackbarShow: (text, showAction = false, duration = 2000) => {
|
||||
const { position, bgLight, bgDark } = GLOBAL_CONFIG.Snackbar
|
||||
const bg = document.documentElement.getAttribute('data-theme') === 'light' ? bgLight : bgDark
|
||||
Snackbar.show({
|
||||
text,
|
||||
backgroundColor: bg,
|
||||
showAction,
|
||||
duration,
|
||||
pos: position,
|
||||
customClass: 'snackbar-css'
|
||||
})
|
||||
},
|
||||
|
||||
diffDate: (d, more = false) => {
|
||||
const dateNow = new Date()
|
||||
const datePost = new Date(d)
|
||||
const dateDiff = dateNow.getTime() - datePost.getTime()
|
||||
const minute = 1000 * 60
|
||||
const hour = minute * 60
|
||||
const day = hour * 24
|
||||
const month = day * 30
|
||||
const { dateSuffix } = GLOBAL_CONFIG
|
||||
|
||||
if (!more) return parseInt(dateDiff / day)
|
||||
|
||||
const monthCount = dateDiff / month
|
||||
const dayCount = dateDiff / day
|
||||
const hourCount = dateDiff / hour
|
||||
const minuteCount = dateDiff / minute
|
||||
|
||||
if (monthCount > 12) return datePost.toISOString().slice(0, 10)
|
||||
if (monthCount >= 1) return `${parseInt(monthCount)} ${dateSuffix.month}`
|
||||
if (dayCount >= 1) return `${parseInt(dayCount)} ${dateSuffix.day}`
|
||||
if (hourCount >= 1) return `${parseInt(hourCount)} ${dateSuffix.hour}`
|
||||
if (minuteCount >= 1) return `${parseInt(minuteCount)} ${dateSuffix.min}`
|
||||
return dateSuffix.just
|
||||
},
|
||||
|
||||
loadComment: (dom, callback) => {
|
||||
if ('IntersectionObserver' in window) {
|
||||
const observerItem = new IntersectionObserver((entries) => {
|
||||
if (entries[0].isIntersecting) {
|
||||
callback()
|
||||
observerItem.disconnect()
|
||||
}
|
||||
}, { threshold: [0] })
|
||||
observerItem.observe(dom)
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
|
||||
scrollToDest: (pos, time = 500) => {
|
||||
const currentPos = window.pageYOffset
|
||||
const isNavFixed = document.getElementById('page-header').classList.contains('fixed')
|
||||
if (currentPos > pos || isNavFixed) pos = pos - 70
|
||||
|
||||
if ('scrollBehavior' in document.documentElement.style) {
|
||||
window.scrollTo({
|
||||
top: pos,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
let start = null
|
||||
pos = +pos
|
||||
window.requestAnimationFrame(function step (currentTime) {
|
||||
start = !start ? currentTime : start
|
||||
const progress = currentTime - start
|
||||
if (currentPos < pos) {
|
||||
window.scrollTo(0, ((pos - currentPos) * progress / time) + currentPos)
|
||||
} else {
|
||||
window.scrollTo(0, currentPos - ((currentPos - pos) * progress / time))
|
||||
}
|
||||
if (progress < time) {
|
||||
window.requestAnimationFrame(step)
|
||||
} else {
|
||||
window.scrollTo(0, pos)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
animateIn: (ele, text) => {
|
||||
ele.style.display = 'block'
|
||||
ele.style.animation = text
|
||||
},
|
||||
|
||||
animateOut: (ele, text) => {
|
||||
ele.addEventListener('animationend', function f () {
|
||||
ele.style.display = ''
|
||||
ele.style.animation = ''
|
||||
ele.removeEventListener('animationend', f)
|
||||
})
|
||||
ele.style.animation = text
|
||||
},
|
||||
|
||||
wrap: (selector, eleType, options) => {
|
||||
const createEle = document.createElement(eleType)
|
||||
for (const [key, value] of Object.entries(options)) {
|
||||
createEle.setAttribute(key, value)
|
||||
}
|
||||
selector.parentNode.insertBefore(createEle, selector)
|
||||
createEle.appendChild(selector)
|
||||
},
|
||||
|
||||
isHidden: ele => ele.offsetHeight === 0 && ele.offsetWidth === 0,
|
||||
|
||||
getEleTop: ele => {
|
||||
let actualTop = ele.offsetTop
|
||||
let current = ele.offsetParent
|
||||
|
||||
while (current !== null) {
|
||||
actualTop += current.offsetTop
|
||||
current = current.offsetParent
|
||||
}
|
||||
|
||||
return actualTop
|
||||
},
|
||||
|
||||
loadLightbox: ele => {
|
||||
const service = GLOBAL_CONFIG.lightbox
|
||||
|
||||
if (service === 'mediumZoom') {
|
||||
mediumZoom(ele, { background: 'var(--zoom-bg)' })
|
||||
}
|
||||
|
||||
if (service === 'fancybox') {
|
||||
Array.from(ele).forEach(i => {
|
||||
if (i.parentNode.tagName !== 'A') {
|
||||
const dataSrc = i.dataset.lazySrc || i.src
|
||||
const dataCaption = i.title || i.alt || ''
|
||||
btf.wrap(i, 'a', { href: dataSrc, 'data-fancybox': 'gallery', 'data-caption': dataCaption, 'data-thumb': dataSrc })
|
||||
}
|
||||
})
|
||||
|
||||
if (!window.fancyboxRun) {
|
||||
Fancybox.bind('[data-fancybox]', {
|
||||
Hash: false,
|
||||
Thumbs: {
|
||||
showOnStart: false
|
||||
},
|
||||
Images: {
|
||||
Panzoom: {
|
||||
maxScale: 4
|
||||
}
|
||||
},
|
||||
Carousel: {
|
||||
transition: 'slide'
|
||||
},
|
||||
Toolbar: {
|
||||
display: {
|
||||
left: ['infobar'],
|
||||
middle: [
|
||||
'zoomIn',
|
||||
'zoomOut',
|
||||
'toggle1to1',
|
||||
'rotateCCW',
|
||||
'rotateCW',
|
||||
'flipX',
|
||||
'flipY'
|
||||
],
|
||||
right: ['slideshow', 'thumbs', 'close']
|
||||
}
|
||||
}
|
||||
})
|
||||
window.fancyboxRun = true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setLoading: {
|
||||
add: ele => {
|
||||
const html = `
|
||||
<div class="loading-container">
|
||||
<div class="loading-item">
|
||||
<div></div><div></div><div></div><div></div><div></div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
ele.insertAdjacentHTML('afterend', html)
|
||||
},
|
||||
remove: ele => {
|
||||
ele.nextElementSibling.remove()
|
||||
}
|
||||
},
|
||||
|
||||
updateAnchor: (anchor) => {
|
||||
if (anchor !== window.location.hash) {
|
||||
if (!anchor) anchor = location.pathname
|
||||
const title = GLOBAL_CONFIG_SITE.title
|
||||
window.history.replaceState({
|
||||
url: location.href,
|
||||
title
|
||||
}, title, anchor)
|
||||
}
|
||||
},
|
||||
|
||||
getScrollPercent: (currentTop, ele) => {
|
||||
const docHeight = ele.clientHeight
|
||||
const winHeight = document.documentElement.clientHeight
|
||||
const headerHeight = ele.offsetTop
|
||||
const contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : (document.documentElement.scrollHeight - winHeight)
|
||||
const scrollPercent = (currentTop - headerHeight) / (contentMath)
|
||||
const scrollPercentRounded = Math.round(scrollPercent * 100)
|
||||
const percentage = (scrollPercentRounded > 100) ? 100 : (scrollPercentRounded <= 0) ? 0 : scrollPercentRounded
|
||||
return percentage
|
||||
},
|
||||
|
||||
addGlobalFn: (key, fn, name = false, parent = window) => {
|
||||
const globalFn = parent.globalFn || {}
|
||||
const keyObj = globalFn[key] || {}
|
||||
|
||||
if (name && keyObj[name]) return
|
||||
|
||||
name = name || Object.keys(keyObj).length
|
||||
keyObj[name] = fn
|
||||
globalFn[key] = keyObj
|
||||
parent.globalFn = globalFn
|
||||
},
|
||||
|
||||
addEventListenerPjax: (ele, event, fn, option = false) => {
|
||||
ele.addEventListener(event, fn, option)
|
||||
btf.addGlobalFn('pjax', () => {
|
||||
ele.removeEventListener(event, fn, option)
|
||||
})
|
||||
},
|
||||
|
||||
removeGlobalFnEvent: (key, parent = window) => {
|
||||
const { globalFn = {} } = parent
|
||||
const keyObj = globalFn[key] || {}
|
||||
const keyArr = Object.keys(keyObj)
|
||||
if (!keyArr.length) return
|
||||
keyArr.forEach(i => {
|
||||
keyObj[i]()
|
||||
})
|
||||
delete parent.globalFn[key]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
tags:
|
||||
---
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
date: {{ date }}
|
||||
---
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
date: {{ date }}
|
||||
tags:
|
||||
---
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: About me
|
||||
date: 2024-07-30 17:25:52
|
||||
tags:
|
||||
categories:
|
||||
---
|
||||
|
||||
## about
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
title: Hello World
|
||||
---
|
||||
Welcome to [Hexo](https://hexo.io/)! This is your very first post. Check [documentation](https://hexo.io/docs/) for more info. If you get any problems when using Hexo, you can find the answer in [troubleshooting](https://hexo.io/docs/troubleshooting.html) or you can ask me on [GitHub](https://github.com/hexojs/hexo/issues).
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Create a new post
|
||||
|
||||
``` bash
|
||||
$ hexo new "My New Post"
|
||||
```
|
||||
|
||||
More info: [Writing](https://hexo.io/docs/writing.html)
|
||||
|
||||
### Run server
|
||||
|
||||
``` bash
|
||||
$ hexo server
|
||||
```
|
||||
|
||||
More info: [Server](https://hexo.io/docs/server.html)
|
||||
|
||||
### Generate static files
|
||||
|
||||
``` bash
|
||||
$ hexo generate
|
||||
```
|
||||
|
||||
More info: [Generating](https://hexo.io/docs/generating.html)
|
||||
|
||||
### Deploy to remote sites
|
||||
|
||||
``` bash
|
||||
$ hexo deploy
|
||||
```
|
||||
|
||||
More info: [Deployment](https://hexo.io/docs/one-command-deployment.html)
|
||||
@@ -0,0 +1,73 @@
|
||||
name: Bug report
|
||||
description: Create a report to help us improve
|
||||
title: "[Bug]: "
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
重要:请依照该模板来提交
|
||||
Please follow the template to create a new issue
|
||||
- type: input
|
||||
id: anzhiyu-ver
|
||||
attributes:
|
||||
label: 使用的 AnZhiYu 版本? | What version of AnZhiYu are you use?
|
||||
description: 检视主题的 package.json | Check the theme's package.json
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: browser
|
||||
attributes:
|
||||
label: 使用的浏览器? || What browse are you using?
|
||||
options:
|
||||
- Chrome
|
||||
- Edge
|
||||
- Safari
|
||||
- Opera
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: modify
|
||||
attributes:
|
||||
label: 是否修改过主题文件? || Has the theme files been modified?
|
||||
options:
|
||||
- 是 (Yes)
|
||||
- 不是 (No)
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: platform
|
||||
attributes:
|
||||
label: 使用的系统? || What operating system are you using?
|
||||
options:
|
||||
- Windows
|
||||
- macOS
|
||||
- Linux
|
||||
- Android
|
||||
- iOS
|
||||
- Other
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: 问题描述 | Describe the bug
|
||||
description: 请描述你的问题现象 | A clear and concise description of what the bug is.
|
||||
placeholder: 请尽量提供截图来定位你的问题 | If applicable, add screenshots to help explain your problem
|
||||
value:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: website
|
||||
attributes:
|
||||
label: 出现问题的网站 | Website
|
||||
description: 请提供下可复现的网站地址 | Please supply a website url which can reproduce problem.
|
||||
placeholder:
|
||||
validations:
|
||||
required: true
|
||||
@@ -0,0 +1,13 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Questions about AnZhiYu
|
||||
url: https://github.com/anzhiyu-c/hexo-theme-anzhiyu/discussions
|
||||
about: 一些使用问题请到 Discussion 询问。 Please ask questions in Discussion.
|
||||
|
||||
- name: AnZhiYu Q&A
|
||||
url: https://blog.anheyu.com/comments/
|
||||
about: AnZhiYu Q&A
|
||||
|
||||
- name: QQ群
|
||||
url: https://jq.qq.com/?_wv=1027&k=v7NK7ELr
|
||||
about: "群号 464636182"
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
name: Feature request
|
||||
description: Suggest an idea for this project
|
||||
title: "[Feature]: "
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
id: feature-request
|
||||
attributes:
|
||||
label: 想要的功能 | What feature do you want?
|
||||
description: 请描述你需要的新功能 | A clear and concise description of what the feature is.
|
||||
placeholder:
|
||||
value:
|
||||
validations:
|
||||
require: true
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
name: Close need info
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 */1 * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
close-need-info:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: close-issues
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "close-issues"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
labels: "question"
|
||||
inactive-day: 60
|
||||
close-reason: "not_planned"
|
||||
body: |
|
||||
Hello @${{ github.event.issue.user.login }}, this issue was closed due to no activities in 60 days.
|
||||
你好 @${{ github.event.issue.user.login }},此issue因超过60天未回复被关闭。
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
name: Close inactive
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 */7 * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
close-inactive:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: close-issues
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "close-issues"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
labels: "stale"
|
||||
inactive-day: 60
|
||||
close-reason: "not_planned"
|
||||
body: |
|
||||
Hello @${{ github.event.issue.user.login }}, this issue was closed due to inactive more than 60 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again.
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Issue Duplicate
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
create-comment:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.label.name == 'duplicate'
|
||||
steps:
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: "create-comment"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
body: |
|
||||
Hello @${{ github.event.issue.user.login }}, your issue is duplicated and will be closed.
|
||||
你好 @${{ github.event.issue.user.login }},你的issue是重复的,将被关闭。
|
||||
- name: Close issue
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: "close-issue"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,18 @@
|
||||
name: Issue Invalid
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
lock-issue:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.label.name == 'invalid'
|
||||
steps:
|
||||
- name: Lock issue
|
||||
uses: actions-cool/issues-helper@v2
|
||||
with:
|
||||
actions: "lock-issue"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
lock-reason: "off-topic"
|
||||
@@ -0,0 +1,20 @@
|
||||
name: Issue Question
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
create-comment:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.label.name == 'question'
|
||||
steps:
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@v2.0.0
|
||||
with:
|
||||
actions: "create-comment"
|
||||
token: ${{ secrets.ISSUSE_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
body: |
|
||||
Hello @${{ github.event.issue.user.login }}, please input issue by template and add detail. Issues labeled by Need More Info will be closed if no activities in 7 days.
|
||||
你好 @${{ github.event.issue.user.login }},请按照issue模板填写, 并详细说明问题和复现步骤等, 60天内未回复issue自动关闭。
|
||||
@@ -0,0 +1,25 @@
|
||||
name: Issue Wontfix
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
lock-issue:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.label.name == 'wontfix'
|
||||
steps:
|
||||
- name: Create comment
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "create-comment"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-number: ${{ github.event.issue.number }}
|
||||
body: |
|
||||
Hello @${{ github.event.issue.user.login }}, this issue will not be worked on and will be closed.
|
||||
你好 @${{ github.event.issue.user.login }},这不会被处理,将被关闭。
|
||||
- name: Close issue
|
||||
uses: actions-cool/issues-helper@v3
|
||||
with:
|
||||
actions: "close-issue"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,19 @@
|
||||
name: npm publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
# Setup .npmrc file to publish to npm
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- run: npm install
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
@@ -0,0 +1,19 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
days-before-issue-stale: 30
|
||||
days-before-pr-stale: -1
|
||||
days-before-close: 7
|
||||
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
|
||||
close-pr-message: 'This issue has not seen any activity since it was marked stale. Closing.'
|
||||
stale-issue-label: 'Stale'
|
||||
exempt-issue-labels: 'pinned,bug,enhancement,documentation,Plan'
|
||||
operations-per-run: 1000
|
||||
@@ -0,0 +1,9 @@
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
db.json
|
||||
*.log
|
||||
node_modules/
|
||||
public/
|
||||
.deploy*/
|
||||
.deploy_git*/
|
||||
.idea
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,137 @@
|
||||
<p align="center">
|
||||
<a title="Hexo Version" target="_blank" href="https://hexo.io/zh-cn/"><img alt="Hexo Version" src="https://img.shields.io/badge/Hexo-%3E%3D%205.3.0-orange?style=flat"></a>
|
||||
<a title="Node Version" target="_blank" href="https://nodejs.org/zh-cn/"><img alt="Node Version" src="https://img.shields.io/badge/Node-%3E%3D%2010.13.0-yellowgreen?style=flat"></a>
|
||||
<a title="License" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/anzhiyu-c/hexo-theme-anzhiyu.svg?style=flat"></a>
|
||||
<br>
|
||||
<a title="GitHub Release" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/releases"><img alt="GitHub Release" src="https://img.shields.io/github/v/release/anzhiyu-c/hexo-theme-anzhiyu?style=flat"></a>
|
||||
<a title="Npm Downloads" target="_blank" href="https://www.npmjs.com/package/hexo-theme-anzhiyu"><img alt="Npm Downloads" src="https://img.shields.io/npm/dt/hexo-theme-anzhiyu?color=red&label=npm"></a>
|
||||
<a title="GitHub Commits" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/commits/master"><img alt="GitHub Commits" src="https://img.shields.io/github/commit-activity/m/anzhiyu-c/hexo-theme-anzhiyu.svg?style=flat&color=brightgreen&label=commits"></a>
|
||||
<br><br>
|
||||
<a title="GitHub Watchers" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/watchers"><img alt="GitHub Watchers" src="https://img.shields.io/github/watchers/anzhiyu-c/hexo-theme-anzhiyu.svg?label=Watchers&style=social"></a>
|
||||
<a title="GitHub Stars" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/stargazers"><img alt="GitHub Stars" src="https://img.shields.io/github/stars/anzhiyu-c/hexo-theme-anzhiyu.svg?label=Stars&style=social"></a>
|
||||
<a title="GitHub Forks" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/network/members"><img alt="GitHub Forks" src="https://img.shields.io/github/forks/anzhiyu-c/hexo-theme-anzhiyu.svg?label=Forks&style=social"></a>
|
||||
</p>
|
||||
|
||||
<p align="center">🇨🇳 中文简体 | <a title="English" href="README_EN.md">🇬🇧 English</a></p>
|
||||
|
||||
预览: 👍 [AnZhiYu](https://blog.anheyu.com/) || 🤞 [AnZhiYu](https://index.anheyu.com/)
|
||||
|
||||
文档: 📖 [anzhiyu Docs](https://docs.anheyu.com/)
|
||||
|
||||
一款基于[hexo-theme-butterfly](https://github.com/jerryc127/hexo-theme-butterfly)修改的主題
|
||||
|
||||
# hexo-theme-anzhiyu
|
||||
|
||||

|
||||
|
||||
## 💻 安裝
|
||||
|
||||
### Git 安裝
|
||||
|
||||
在博客根目录里安装最新版【推荐】
|
||||
|
||||
```powershell
|
||||
git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
|
||||
```
|
||||
|
||||
## ⚙ 应用主题
|
||||
|
||||
修改 hexo 配置文件`_config.yml`,把主题改为`anzhiyu`
|
||||
|
||||
```
|
||||
theme: anzhiyu
|
||||
```
|
||||
|
||||
> 如果你没有 pug 以及 stylus 的渲染器,请下载安装: `npm install hexo-renderer-pug hexo-renderer-stylus --save`
|
||||
|
||||
## 覆盖配置
|
||||
|
||||
覆盖配置可以使`主题配置`放置在 anzhiyu 目录之外,避免在更新主题时丢失自定义的配置。
|
||||
|
||||
通过 Npm 安装主题的用户可忽略,其他用户建议学习使用。
|
||||
|
||||
- macos/linux
|
||||
在博客根目录运行
|
||||
|
||||
```bash
|
||||
cp -rf ./themes/anzhiyu/_config.yml ./_config.anzhiyu.yml
|
||||
```
|
||||
|
||||
- windows
|
||||
复制`/themes/anzhiyu/_config.yml`此文件到 hexo 根目录,并重命名为`_config.anzhiyu.yml`
|
||||
|
||||
以后如果修改任何主题配置,都只需修改 _config.anzhiyu.yml 的配置即可。
|
||||
|
||||
注意:
|
||||
- 只要存在于 `_config.anzhiyu.yml` 的配置都是高优先级,修改原 `_config.yml` 是无效的。
|
||||
- 每次更新主题可能存在配置变更,请注意更新说明,可能需要手动对 `_config.anzhiyu.yml` 同步修改。
|
||||
- 想查看覆盖配置有没有生效,可以通过 `hexo g --debug` 查看命令行输出。
|
||||
- 如果想将某些配置覆盖为空,注意不要把主键删掉,不然是无法覆盖的
|
||||
|
||||
## 功能特性
|
||||
|
||||
- ✅ 无比详实的[用户文档](https://docs.anheyu.com/)
|
||||
- ✅ 页面组件懒加载(pjax方案)
|
||||
- ✅ 图片懒加载
|
||||
- ✅ 多种代码高亮方案
|
||||
- ✅ 多语言配置
|
||||
- ✅ 内置多款评论插件
|
||||
- ✅ 内置网页访问统计
|
||||
- ✅ 支持暗色模式
|
||||
- ✅ 支持脚注语法
|
||||
- ✅ 支持自定义CDN静态资源
|
||||
- ✅ 丰富多样化的标签选项快速构建你想要的功能
|
||||
- ✅ 支持定制化的右键菜单
|
||||
- ✅ 支持定制化的主色调随封面图片颜色变化
|
||||
- ✅ 支持沉浸式状态栏
|
||||
- ✅ 支持文章字数统计
|
||||
- ✅ 支持聊天系统
|
||||
- ✅ 支持谷歌分析、百度分析、微软分析、cloudflare分析、cnzz分析
|
||||
- ✅ 支持广告挂载
|
||||
- ✅ 支持图片大图查看
|
||||
- ✅ 支持瀑布流即刻说说
|
||||
- ✅ 支持瀑布流相册集
|
||||
- ✅ 支持阿里图标与fontawesome
|
||||
- ✅ 支持高速缓存的swpp,pwa特性
|
||||
- ✅ 优秀的隐私协议支持
|
||||
- ✅ 文章AI摘要支持
|
||||
- ✅ 支持音乐球
|
||||
- ✅ 支持全局中控台
|
||||
- ✅ 支持快捷键选项
|
||||
- ✅ 支持本地搜索/algolia搜索🔍/Docsearch
|
||||
- ✅ 支持 LaTeX 数学公式
|
||||
- ✅ 支持 mermaid 流程图
|
||||
|
||||
## 部分功能展示
|
||||
|
||||
**沉浸式状态栏**
|
||||
沉浸阅读。
|
||||

|
||||
|
||||
**高低自定义的右键菜单**
|
||||
高度定制。
|
||||

|
||||
|
||||
**AI摘要**
|
||||
迅速读取文章内容。
|
||||

|
||||
|
||||
**让人眼前一亮的清爽界面**
|
||||
|
||||

|
||||
|
||||
**评论弹幕**
|
||||
|
||||

|
||||
|
||||
## 贡献者
|
||||
|
||||
[](https://github.com/anzhiyu-c/hexo-theme-anzhiyu/)
|
||||
|
||||
主题设计:[@张洪 Heo](https://github.com/zhheo)
|
||||
|
||||
文档编写:[@xiaoran](https://github.com/xiaoran)
|
||||
|
||||
## 仓库统计
|
||||
|
||||

|
||||
@@ -0,0 +1,140 @@
|
||||
<p align="center">
|
||||
<a title="Hexo Version" target="_blank" href="https://hexo.io/zh-cn/"><img alt="Hexo Version" src="https://img.shields.io/badge/Hexo-%3E%3D%205.3.0-orange?style=flat"></a>
|
||||
<a title="Node Version" target="_blank" href="https://nodejs.org/zh-cn/"><img alt="Node Version" src="https://img.shields.io/badge/Node-%3E%3D%2010.13.0-yellowgreen?style=flat"></a>
|
||||
<a title="License" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/anzhiyu-c/hexo-theme-anzhiyu.svg?style=flat"></a>
|
||||
<br>
|
||||
<a title="GitHub Release" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/releases"><img alt="GitHub Release" src="https://img.shields.io/github/v/release/anzhiyu-c/hexo-theme-anzhiyu?style=flat"></a>
|
||||
<a title="Npm Downloads" target="_blank" href="https://www.npmjs.com/package/hexo-theme-anzhiyu"><img alt="Npm Downloads" src="https://img.shields.io/npm/dt/hexo-theme-anzhiyu?color=red&label=npm"></a>
|
||||
<a title="GitHub Commits" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/commits/master"><img alt="GitHub Commits" src="https://img.shields.io/github/commit-activity/m/anzhiyu-c/hexo-theme-anzhiyu.svg?style=flat&color=brightgreen&label=commits"></a>
|
||||
<br><br>
|
||||
<a title="GitHub Watchers" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/watchers"><img alt="GitHub Watchers" src="https://img.shields.io/github/watchers/anzhiyu-c/hexo-theme-anzhiyu.svg?label=Watchers&style=social"></a>
|
||||
<a title="GitHub Stars" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/stargazers"><img alt="GitHub Stars" src="https://img.shields.io/github/stars/anzhiyu-c/hexo-theme-anzhiyu.svg?label=Stars&style=social"></a>
|
||||
<a title="GitHub Forks" target="_blank" href="https://github.com/anzhiyu-c/hexo-theme-anzhiyu/network/members"><img alt="GitHub Forks" src="https://img.shields.io/github/forks/anzhiyu-c/hexo-theme-anzhiyu.svg?label=Forks&style=social"></a>
|
||||
</p>
|
||||
|
||||
<p align="center"><a title="中文" href="/README.md">🇨🇳 中文简体</a> | 🇬🇧 English</p>
|
||||
|
||||
Preview: 👍 [AnZhiYu](https://blog.anheyu.com/) || 🤞 [AnZhiYu](https://index.anheyu.com/)
|
||||
|
||||
Document: 📖 [anzhiyu Docs](https://docs.anheyu.com/)
|
||||
|
||||
A theme based on [hexo-theme-butterfly](https://github.com/jerryc127/hexo-theme-butterfly) modification
|
||||
|
||||
# hexo-theme-anzhiyu
|
||||
|
||||

|
||||
|
||||
## 💻 安裝
|
||||
|
||||
### Git 安裝
|
||||
|
||||
Install the latest version in the root directory of the blog [recommended]
|
||||
|
||||
```powershell
|
||||
git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
|
||||
```
|
||||
|
||||
## ⚙ 应用主题
|
||||
|
||||
Modify the hexo configuration file `_ config.yml` and change the theme to `anzhiyu`
|
||||
|
||||
```
|
||||
theme: anzhiyu
|
||||
```
|
||||
|
||||
> If you do not have a renderer for pug and stylus, please download and install: `npm install hexo-renderer-pug hexo-renderer-stylus --save`
|
||||
|
||||
## Override configuration
|
||||
|
||||
Override configuration allows the `theme configuration `to be placed outside the anzhiyu directory to avoid losing custom configurations when updating the theme.
|
||||
|
||||
Users who install the theme through Npm can ignore it, and other users are recommended to learn to use it.
|
||||
|
||||
- macos/linux
|
||||
Run in the blog root directory
|
||||
```bash
|
||||
cp -rf ./themes/anzhiyu/_config.yml ./_config.anzhiyu.yml
|
||||
```
|
||||
|
||||
- windows
|
||||
Copy the file `/ themes/anzhiyu/_ config.yml` to the hexo root directory and rename it to` _ config.anzhiyu.yml`
|
||||
|
||||
If you modify any theme configuration in the future, you only need to modify the configuration of_config.anzhiyu.yml.
|
||||
|
||||
Note:
|
||||
- as long as the configurations that exist in `_ config.anzhiyu.yml` are of high priority, it is invalid to modify the original` _ config.yml`.
|
||||
- there may be configuration changes each time the topic is updated. Please pay attention to the update instructions. You may need to manually modify `_ config.anzhiyu.yml`.
|
||||
- to check whether the override configuration has taken effect, you can check the command line output via `override g-- debug`.
|
||||
- if you want to overwrite some configurations to empty, be careful not to delete the primary key, otherwise it cannot be overwritten
|
||||
|
||||
## Functional characteristics
|
||||
|
||||
-✅ extremely detailed [user documentation] (https://docs.anheyu.com/)
|
||||
-✅ Page components load lazily (pjax scheme)
|
||||
-✅ the picture is loaded lazily
|
||||
-✅ multiple code highlighting schemes
|
||||
-✅ multilingual configuration
|
||||
-✅ built-in multiple comment plug-ins
|
||||
-✅ built-in web page access statistics
|
||||
-✅ supports dark mode
|
||||
-✅ supports footnote syntax
|
||||
-✅ support custom CDN static resources
|
||||
-✅ A rich variety of tag options to quickly build the features you want
|
||||
-✅ supports customized right-click menus
|
||||
-✅ support customized dominant tone to vary with the color of the cover image
|
||||
-✅ support for immersive status bar
|
||||
-✅ support article word statistics
|
||||
-✅ support chat system
|
||||
-✅ support Google Analytics, Baidu Analytics, Microsoft Analytics, cloudflare Analytics, cnzz Analytics
|
||||
-✅ Advertising is supported
|
||||
-✅ large picture view is supported
|
||||
-✅ support waterfall flow and talk about it right away
|
||||
-✅ supports waterfall stream album
|
||||
-✅ supports Ali icon and fontawesome
|
||||
-✅ supports cached swpp,pwa features
|
||||
-✅ excellent privacy protocol support
|
||||
-✅ AI abstract support for articles
|
||||
-✅ support music ball
|
||||
-✅ supports the global center console
|
||||
-✅ supports shortcut key options
|
||||
-✅ support local search / algolia search 🔍 / Docsearch
|
||||
-✅ supports LaTeX mathematical formula
|
||||
-✅ support mermaid flow chart
|
||||
|
||||
## Partial function display
|
||||
|
||||
**Immersive status bar**
|
||||
|
||||
Immerse yourself in reading.
|
||||
|
||||

|
||||
|
||||
**Customized right-click menu**
|
||||
|
||||
Highly customized.
|
||||
|
||||

|
||||
|
||||
**AI Summary**
|
||||
Read articles quickly.
|
||||

|
||||
|
||||
**A refreshing interface that makes people shine at the moment**
|
||||
|
||||

|
||||
|
||||
**Comment Barrage**
|
||||
|
||||

|
||||
|
||||
## Contributors
|
||||
|
||||
[](https://github.com/anzhiyu-c/hexo-theme-anzhiyu/)
|
||||
|
||||
Theme Design:[@张洪 Heo](https://github.com/zhheo)
|
||||
|
||||
Document writing:[@xiaoran](https://github.com/xiaoran)
|
||||
|
||||
## Warehouse Statistics
|
||||
|
||||

|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,128 @@
|
||||
footer:
|
||||
framework: 框架
|
||||
theme: 主题
|
||||
|
||||
copy:
|
||||
success: 复制成功
|
||||
error: 复制错误
|
||||
noSupport: 浏览器不支持
|
||||
|
||||
page:
|
||||
articles: 文章总览
|
||||
tag: 标签
|
||||
category: 分类
|
||||
archives: 归档
|
||||
|
||||
card_post_count: 条评论
|
||||
|
||||
sticky: 置顶
|
||||
no_title: 无题
|
||||
|
||||
post:
|
||||
created: 发表于
|
||||
updated: 更新于
|
||||
wordcount: 字数总计
|
||||
min2read: 阅读时长
|
||||
min2read_unit: 分钟
|
||||
page_pv: 阅读量
|
||||
comments: 评论数
|
||||
copyright:
|
||||
author: 文章作者
|
||||
link: 文章链接
|
||||
copyright_notice: 版权声明
|
||||
copyright_content: '本博客所有文章除特别声明外,均采用
|
||||
<a href="%s" target="_blank">%s</a> 许可协议。转载请注明来自 <a href="%s" target="_blank">%s</a>!'
|
||||
recommend: 喜欢这篇文章的人也看了
|
||||
edit: 编辑
|
||||
|
||||
search:
|
||||
title: "搜索"
|
||||
load_data: 数据库加载中
|
||||
algolia_search:
|
||||
input_placeholder: 输入关键词后按下回车查找
|
||||
hits_empty: "找不到您查询的内容:${query}"
|
||||
hits_stats: "找到 ${hits} 条结果,用时 ${time} 毫秒"
|
||||
|
||||
local_search:
|
||||
input_placeholder: 搜索文章
|
||||
hits_empty: "找不到您查询的内容:${query}"
|
||||
|
||||
pagination:
|
||||
prev: 上一篇
|
||||
next: 下一篇
|
||||
|
||||
comment: 评论
|
||||
|
||||
aside:
|
||||
articles: 文章
|
||||
tags: 标签
|
||||
categories: 分类
|
||||
card_announcement: 公告
|
||||
card_categories: 分类
|
||||
card_tags: 标签
|
||||
card_archives: 归档
|
||||
card_recent_post: 最近发布
|
||||
card_webinfo:
|
||||
headline: 网站资讯
|
||||
article_name: 文章总数
|
||||
runtime:
|
||||
name: 建站天数
|
||||
unit: 天
|
||||
last_push_date:
|
||||
name: 最后更新时间
|
||||
site_wordcount: 全站字数
|
||||
site_uv_name: 全站访客数
|
||||
site_pv_name: 全站总访问量
|
||||
more_button: 查看更多
|
||||
card_newest_comments:
|
||||
headline: 最新评论
|
||||
loading_text: 正在加载中...
|
||||
error: 无法获取评论,请确认相关配置是否正确
|
||||
zero: 没有评论
|
||||
image: 图片
|
||||
link: 链接
|
||||
code: 代码
|
||||
card_toc: 文章目录
|
||||
display_mode: 显示模式
|
||||
function: 功能
|
||||
|
||||
date_suffix:
|
||||
just: 刚刚
|
||||
min: 分钟前
|
||||
hour: 小时前
|
||||
day: 天前
|
||||
month: 个月前
|
||||
|
||||
donate: 不给糖果就捣蛋
|
||||
share: 分享
|
||||
|
||||
rightside:
|
||||
readmode_title: 阅读模式
|
||||
translate_title: 简繁转换
|
||||
night_mode_title: 浅色和深色模式转换
|
||||
back_to_top: 回到顶部
|
||||
toc: 目录
|
||||
scroll_to_comment: 直达评论
|
||||
setting: 设置
|
||||
aside: 单栏和双栏切换
|
||||
chat: 聊天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
link: 链接
|
||||
source: 来源
|
||||
info: 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
|
||||
copySuccess: 复制成功,复制和转载请标注本文地址
|
||||
|
||||
Snackbar:
|
||||
chs_to_cht: 你已切换为繁体
|
||||
cht_to_chs: 你已切换为简体
|
||||
day_to_night: 你已切换为深色模式
|
||||
night_to_day: 你已切换为浅色模式
|
||||
copy_equipment_name: 已复制装备名称
|
||||
|
||||
loading: 加载中...
|
||||
|
||||
load_more: 加载更多
|
||||
|
||||
error404: 页面没有找到
|
||||
@@ -0,0 +1,129 @@
|
||||
footer:
|
||||
framework: Framework
|
||||
theme: Theme
|
||||
|
||||
copy:
|
||||
success: Copy successfully
|
||||
error: Copy error
|
||||
noSupport: The browser does not support
|
||||
|
||||
page:
|
||||
articles: Articles
|
||||
tag: Tag
|
||||
category: Category
|
||||
archives: Archives
|
||||
|
||||
card_post_count: comments
|
||||
|
||||
sticky: Sticky
|
||||
no_title: No title
|
||||
|
||||
post:
|
||||
created: Created
|
||||
updated: Updated
|
||||
wordcount: Word count
|
||||
min2read: Reading time
|
||||
min2read_unit: min
|
||||
page_pv: Post View
|
||||
comments: Comments
|
||||
copyright:
|
||||
author: Author
|
||||
link: Link
|
||||
copyright_notice: Copyright Notice
|
||||
copyright_content: 'All articles in this blog are licensed under <a href="%s">%s</a> unless stating additionally.'
|
||||
recommend: Related Articles
|
||||
edit:
|
||||
github: Edited on GitHub
|
||||
yuque: Edited on Yuque
|
||||
|
||||
search:
|
||||
title: Search
|
||||
load_data: Loading the Database
|
||||
algolia_search:
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}."
|
||||
hits_stats: "${hits} results found in ${time} ms"
|
||||
|
||||
local_search:
|
||||
input_placeholder: Search for Posts
|
||||
hits_empty: "We didn't find any results for the search: ${query}"
|
||||
|
||||
pagination:
|
||||
prev: Previous Post
|
||||
next: Next Post
|
||||
|
||||
comment: Comment
|
||||
|
||||
aside:
|
||||
articles: Articles
|
||||
tags: Tags
|
||||
categories: Categories
|
||||
card_announcement: Announcement
|
||||
card_categories: Categories
|
||||
card_tags: Tags
|
||||
card_archives: Archives
|
||||
card_recent_post: Recent Post
|
||||
card_webinfo:
|
||||
headline: Info
|
||||
article_name: Article
|
||||
runtime:
|
||||
name: Run time
|
||||
unit: days
|
||||
last_push_date:
|
||||
name: Last Push
|
||||
site_wordcount: Total Count
|
||||
site_uv_name: UV
|
||||
site_pv_name: PV
|
||||
more_button: More
|
||||
card_newest_comments:
|
||||
headline: Newest Comments
|
||||
loading_text: loading...
|
||||
error: Unable to get the data, please make sure the settings are correct.
|
||||
zero: No Comment
|
||||
image: image
|
||||
link: link
|
||||
code: code
|
||||
card_toc: Catalog
|
||||
display_mode: Display Mode
|
||||
function: Function
|
||||
|
||||
date_suffix:
|
||||
just: Just
|
||||
min: minutes ago
|
||||
hour: hours ago
|
||||
day: days ago
|
||||
month: months ago
|
||||
|
||||
donate: Donate
|
||||
share: Share
|
||||
|
||||
rightside:
|
||||
readmode_title: Read Mode
|
||||
translate_title: Switch Between Traditional Chinese And Simplified Chinese
|
||||
night_mode_title: Switch Between Light And Dark Mode
|
||||
back_to_top: Back To Top
|
||||
toc: Table Of Contents
|
||||
scroll_to_comment: Scroll To Comments
|
||||
setting: Setting
|
||||
aside: Toggle between single-column and double-column
|
||||
chat: Chat
|
||||
|
||||
copy_copyright:
|
||||
author: Author
|
||||
link: Link
|
||||
source: Source
|
||||
info: Copyright is owned by the author. For commercial reprints, please contact the author for authorization. For non-commercial reprints, please indicate the source.
|
||||
copySuccess: Copy success, copy and reprint please mark the address of this article
|
||||
|
||||
Snackbar:
|
||||
chs_to_cht: Traditional Chinese Activated Manually
|
||||
cht_to_chs: Simplified Chinese Activated Manually
|
||||
day_to_night: Dark Mode Activated Manually
|
||||
night_to_day: Light Mode Activated Manually
|
||||
copy_equipment_name: Installed device name has been loaded
|
||||
|
||||
loading: Loading...
|
||||
|
||||
load_more: Load More
|
||||
|
||||
error404: Page not found
|
||||
@@ -0,0 +1,132 @@
|
||||
footer:
|
||||
framework: 框架
|
||||
theme: 主题
|
||||
|
||||
copy:
|
||||
success: 复制成功
|
||||
error: 复制错误
|
||||
noSupport: 浏览器不支持
|
||||
|
||||
page:
|
||||
articles: 文章总览
|
||||
tag: 标签
|
||||
category: 分类
|
||||
archives: 归档
|
||||
|
||||
card_post_count: 条评论
|
||||
|
||||
sticky: 置顶
|
||||
no_title: 无题
|
||||
|
||||
post:
|
||||
created: 发表于
|
||||
updated: 更新于
|
||||
wordcount: 字数总计
|
||||
min2read: 阅读时长
|
||||
min2read_unit: 分钟
|
||||
page_pv: 阅读量
|
||||
comments: 评论数
|
||||
copyright:
|
||||
author: 文章作者
|
||||
link: 文章链接
|
||||
copyright_notice: 版权声明
|
||||
copyright_content: '本博客所有文章除特别声明外,均采用
|
||||
<a href="%s" target="_blank">%s</a> 许可协议。转载请注明来自 <a href="%s" target="_blank">%s</a>!'
|
||||
recommend: 喜欢这篇文章的人也看了
|
||||
edit:
|
||||
github: 在 GitHub 上编辑
|
||||
yuque: 在 语雀 上编辑
|
||||
# notion: 在 Notion 上编辑
|
||||
# flowus: 在 Flowus 上编辑
|
||||
|
||||
search:
|
||||
title: "搜索"
|
||||
load_data: 数据库加载中
|
||||
algolia_search:
|
||||
input_placeholder: 输入关键词后按下回车查找
|
||||
hits_empty: "找不到您查询的内容:${query}"
|
||||
hits_stats: "找到 ${hits} 条结果,用时 ${time} 毫秒"
|
||||
|
||||
local_search:
|
||||
input_placeholder: 搜索文章
|
||||
hits_empty: "找不到您查询的内容:${query}"
|
||||
|
||||
pagination:
|
||||
prev: 上一篇
|
||||
next: 下一篇
|
||||
|
||||
comment: 评论
|
||||
|
||||
aside:
|
||||
articles: 文章
|
||||
tags: 标签
|
||||
categories: 分类
|
||||
card_announcement: 公告
|
||||
card_categories: 分类
|
||||
card_tags: 标签
|
||||
card_archives: 归档
|
||||
card_recent_post: 最近发布
|
||||
card_webinfo:
|
||||
headline: 网站资讯
|
||||
article_name: 文章总数
|
||||
runtime:
|
||||
name: 建站天数
|
||||
unit: 天
|
||||
last_push_date:
|
||||
name: 最后更新
|
||||
site_wordcount: 全站字数
|
||||
site_uv_name: 总访客数
|
||||
site_pv_name: 总访问量
|
||||
more_button: 查看更多
|
||||
card_newest_comments:
|
||||
headline: 最新评论
|
||||
loading_text: 正在加载中...
|
||||
error: 无法获取评论,请确认相关配置是否正确
|
||||
zero: 没有评论
|
||||
image: 图片
|
||||
link: 链接
|
||||
code: 代码
|
||||
card_toc: 文章目录
|
||||
display_mode: 显示模式
|
||||
function: 功能
|
||||
|
||||
date_suffix:
|
||||
just: 刚刚
|
||||
min: 分钟前
|
||||
hour: 小时前
|
||||
day: 天前
|
||||
month: 个月前
|
||||
|
||||
donate: 不给糖果就捣蛋
|
||||
share: 分享
|
||||
|
||||
rightside:
|
||||
readmode_title: 阅读模式
|
||||
translate_title: 简繁转换
|
||||
night_mode_title: 浅色和深色模式转换
|
||||
back_to_top: 回到顶部
|
||||
toc: 目录
|
||||
scroll_to_comment: 直达评论
|
||||
setting: 设置
|
||||
aside: 单栏和双栏切换
|
||||
chat: 聊天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
link: 链接
|
||||
source: 来源
|
||||
info: 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
|
||||
copySuccess: 复制成功,复制和转载请标注本文地址
|
||||
|
||||
Snackbar:
|
||||
chs_to_cht: 你已切换为繁体
|
||||
cht_to_chs: 你已切换为简体
|
||||
day_to_night: 你已切换为深色模式
|
||||
night_to_day: 你已切换为浅色模式
|
||||
copy_equipment_name: 已复制装备名称
|
||||
|
||||
loading: 加载中...
|
||||
|
||||
load_more: 加载更多
|
||||
|
||||
error404: 页面没有找到
|
||||
@@ -0,0 +1,130 @@
|
||||
footer:
|
||||
framework: 框架
|
||||
theme: 主題
|
||||
|
||||
copy:
|
||||
success: 複製成功
|
||||
error: 複製錯誤
|
||||
noSupport: 瀏覽器不支援
|
||||
|
||||
page:
|
||||
articles: 文章總覽
|
||||
tag: 標籤
|
||||
category: 分類
|
||||
archives: 歸檔
|
||||
|
||||
card_post_count: 條評論
|
||||
|
||||
sticky: 置頂
|
||||
no_title: 無題
|
||||
|
||||
post:
|
||||
created: 發表於
|
||||
updated: 更新於
|
||||
wordcount: 字數總計
|
||||
min2read: 閱讀時長
|
||||
min2read_unit: 分鐘
|
||||
page_pv: 閱讀量
|
||||
comments: 評論數
|
||||
copyright:
|
||||
author: 文章作者
|
||||
link: 文章連結
|
||||
copyright_notice: 版權聲明
|
||||
copyright_content: '本部落格所有文章除特別聲明外,均採用
|
||||
<a href="%s" target="_blank">%s</a> 許可協議。轉載請註明來自 <a href="%s" target="_blank">%s</a>!'
|
||||
recommend: 相關推薦
|
||||
edit:
|
||||
github: 在 GitHub 上編輯
|
||||
yuque: 在 語雀 上編輯
|
||||
|
||||
search:
|
||||
title: 搜尋
|
||||
load_data: 資料庫載入中
|
||||
algolia_search:
|
||||
input_placeholder: 輸入關鍵字後按下回車查找
|
||||
hits_empty: "找不到您查詢的內容:${query}"
|
||||
hits_stats: "找到 ${hits} 條結果,用時 ${time} 毫秒"
|
||||
|
||||
local_search:
|
||||
input_placeholder: 搜尋文章
|
||||
hits_empty: "找不到您查詢的內容:${query}"
|
||||
|
||||
pagination:
|
||||
prev: 上一篇
|
||||
next: 下一篇
|
||||
|
||||
comment: 評論
|
||||
|
||||
aside:
|
||||
articles: 文章
|
||||
tags: 標籤
|
||||
categories: 分類
|
||||
card_announcement: 公告
|
||||
card_categories: 分類
|
||||
card_tags: 標籤
|
||||
card_archives: 歸檔
|
||||
card_recent_post: 最近发布
|
||||
card_webinfo:
|
||||
headline: 網站資訊
|
||||
article_name: 文章數目
|
||||
runtime:
|
||||
name: 已執行時間
|
||||
unit: 天
|
||||
last_push_date:
|
||||
name: 最後更新時間
|
||||
site_wordcount: 本站總字數
|
||||
site_uv_name: 本站訪客數
|
||||
site_pv_name: 本站總訪問量
|
||||
more_button: 檢視更多
|
||||
card_newest_comments:
|
||||
headline: 最新評論
|
||||
loading_text: 正在載入中...
|
||||
error: 無法獲取評論,請確認相關配置是否正確
|
||||
zero: 沒有評論
|
||||
image: 圖片
|
||||
link: 連結
|
||||
code: 程式碼
|
||||
card_toc: 文章目錄
|
||||
display_mode: 顯示模式
|
||||
function: 功能
|
||||
|
||||
date_suffix:
|
||||
just: 剛剛
|
||||
min: 分鐘前
|
||||
hour: 小時前
|
||||
day: 天前
|
||||
month: 個月前
|
||||
|
||||
donate: 打賞
|
||||
share: 分享
|
||||
|
||||
rightside:
|
||||
readmode_title: 閱讀模式
|
||||
translate_title: 簡繁轉換
|
||||
night_mode_title: 淺色和深色模式轉換
|
||||
back_to_top: 回到頂部
|
||||
toc: 目錄
|
||||
scroll_to_comment: 直達評論
|
||||
setting: 設定
|
||||
aside: 單欄和雙欄切換
|
||||
chat: 聊天
|
||||
|
||||
copy_copyright:
|
||||
author: 作者
|
||||
link: 連結
|
||||
source: 來源
|
||||
info: 著作權歸作者所有。商業轉載請聯絡作者獲得授權,非商業轉載請註明出處。
|
||||
copySuccess: 複製成功,複製和轉載請標注本文地址
|
||||
|
||||
Snackbar:
|
||||
chs_to_cht: 你已切換為繁體
|
||||
cht_to_chs: 你已切換為簡體
|
||||
day_to_night: 你已切換為深色模式
|
||||
night_to_day: 你已切換為淺色模式
|
||||
copy_equipment_name: 已複製裝備名稱
|
||||
|
||||
loading: 載入中...
|
||||
|
||||
load_more: 載入更多
|
||||
|
||||
error404: 頁面沒有找到
|
||||
@@ -0,0 +1,8 @@
|
||||
extends includes/layout.pug
|
||||
|
||||
block content
|
||||
include ./includes/mixins/article-sort.pug
|
||||
#archive
|
||||
.article-sort-title= `${_p('page.articles')} - ${getArchiveLength()}`
|
||||
+articleSort(page.posts, page.current)
|
||||
include includes/pagination.pug
|
||||
@@ -0,0 +1,23 @@
|
||||
extends includes/layout.pug
|
||||
|
||||
block content
|
||||
if theme.category_ui == 'index'
|
||||
include ./includes/mixins/post-ui.pug
|
||||
#recent-posts.recent-posts.category_ui
|
||||
+postUI
|
||||
include includes/pagination.pug
|
||||
else
|
||||
include ./includes/mixins/article-sort.pug
|
||||
#category
|
||||
#catalog-bar
|
||||
i.anzhiyufont.anzhiyu-icon-shapes
|
||||
#catalog-list
|
||||
.catalog-list-item
|
||||
a(href="/") 首页
|
||||
!=catalog_list("categories")
|
||||
.category-bar-next#category-bar-next(onclick="anzhiyu.scrollCategoryBarToRight()")
|
||||
i.anzhiyufont.anzhiyu-icon-angle-double-right
|
||||
a.catalog-more(href="/categories/")!= '更多'
|
||||
.article-sort-title= _p('page.category') + ' - ' + page.category
|
||||
+articleSort(page.posts, page.current)
|
||||
include includes/pagination.pug
|
||||
@@ -0,0 +1,36 @@
|
||||
- let error_404_top_img = theme.error_404.background || theme.default_top_img
|
||||
- let error_404_bg_img = `background-image: url('${url_for(error_404_top_img)}')`
|
||||
|
||||
#body-wrap.error
|
||||
include ./header/index.pug
|
||||
.error-box
|
||||
#error-wrap
|
||||
.error-content
|
||||
.error-img(style=error_404_bg_img)
|
||||
.error-info
|
||||
h1.error_title= '404'
|
||||
.error_subtitle= theme.error_404.subtitle
|
||||
a.button--animated(href=config.root)
|
||||
i.anzhiyufont.anzhiyu-icon-rocket
|
||||
= _p('回到主页')
|
||||
|
||||
.aside-list
|
||||
.aside-list-group
|
||||
- let postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.related_post.limit || 6
|
||||
- let sort = theme.aside.card_recent_post.sort === 'updated' ? 'updated' : 'date'
|
||||
- site.posts.sort(sort, -1).limit(postLimit).each(function(article){
|
||||
- let link = article.link || article.path
|
||||
- let title = article.title || _p('no_title')
|
||||
- let no_cover = article.cover === false || !theme.cover.aside_enable ? 'no-cover' : ''
|
||||
- let post_cover = article.cover
|
||||
.aside-list-item(class=no_cover)
|
||||
if post_cover && theme.cover.aside_enable
|
||||
a.thumbnail(href=url_for(link) title=title)
|
||||
img(src=url_for(post_cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title)
|
||||
.content
|
||||
a.title(href=url_for(link) title=title)= title
|
||||
if theme.aside.card_recent_post.sort === 'updated'
|
||||
time(datetime=date_xml(article.updated) title=_p('post.updated') + ' ' + full_date(article.updated)) #[=date(article.updated, config.date_format)]
|
||||
else
|
||||
time(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]
|
||||
- })
|
||||
@@ -0,0 +1,131 @@
|
||||
div
|
||||
script(src=url_for(theme.asset.utils))
|
||||
script(src=url_for(theme.asset.main))
|
||||
|
||||
if theme.translate.enable
|
||||
script(src=url_for(theme.asset.translate))
|
||||
|
||||
if theme.medium_zoom
|
||||
script(src=url_for(theme.asset.medium_zoom))
|
||||
else if theme.fancybox
|
||||
script(src=url_for(theme.asset.fancybox))
|
||||
|
||||
if theme.instantpage
|
||||
script(src=url_for(theme.asset.instantpage), type='module')
|
||||
|
||||
if theme.lazyload.enable
|
||||
script(src=url_for(theme.asset.lazyload))
|
||||
|
||||
if theme.snackbar.enable
|
||||
script(src=url_for(theme.asset.snackbar))
|
||||
|
||||
if theme.pangu.enable
|
||||
!= partial("includes/third-party/pangu.pug", {}, { cache: true })
|
||||
if theme.asset.meting_api
|
||||
script.
|
||||
var meting_api = "!{theme.asset.meting_api}";
|
||||
|
||||
//- 深色模式粒子效果canvas
|
||||
if theme.universe.enable
|
||||
canvas(id="universe")
|
||||
script(async src="https://npm.elemecdn.com/anzhiyu-theme-static@1.0.0/dark/dark.js")
|
||||
|
||||
//- 控制台打印信息
|
||||
if theme.console.enable
|
||||
!= partial("includes/anzhiyu/log-js.pug", {}, { cache: true })
|
||||
|
||||
//- 随机文章
|
||||
script(async src="/anzhiyu/random.js")
|
||||
|
||||
//- 页脚计时器
|
||||
if theme.footer.runtime.enable
|
||||
!= partial("includes/third-party/runtime/runtime-js.pug", {}, { cache: true })
|
||||
|
||||
//- search
|
||||
if theme.algolia_search.enable
|
||||
script(src=url_for(theme.asset.algolia_search))
|
||||
script(src=url_for(theme.asset.instantsearch))
|
||||
script(src=url_for(theme.asset.algolia_js))
|
||||
else if theme.local_search.enable
|
||||
script(src=url_for(theme.asset.local_search))
|
||||
|
||||
|
||||
|
||||
|
||||
.js-pjax
|
||||
if theme.peoplecanvas.enable && is_home()
|
||||
script.
|
||||
if (typeof gsap === "object") {
|
||||
getScript("!{url_for(theme.asset.people_js)}", {defer:true})
|
||||
} else {
|
||||
getScript("!{url_for(theme.asset.gsap_js)}").then(()=>{
|
||||
getScript("!{url_for(theme.asset.people_js)}", {defer:true})
|
||||
});
|
||||
}
|
||||
if needLoadCountJs
|
||||
!= partial("includes/third-party/card-post-count/index", {}, { cache: true })
|
||||
|
||||
if loadSubJs
|
||||
include ./third-party/subtitle.pug
|
||||
|
||||
include ./third-party/math/index.pug
|
||||
|
||||
if commentsJsLoad
|
||||
include ./third-party/comments/js.pug
|
||||
|
||||
input(type="hidden" name="page-type" id="page-type" value=(page.type ? page.type : (is_post() ? "post" : (is_category() ? "categories" : "anzhiyu"))))
|
||||
|
||||
//- 评论弹幕
|
||||
if theme.comment_barrage_config.enable && theme.comments.use == 'Twikoo' && page.comments
|
||||
script(async src=url_for(theme.asset.comment_barrage_js))
|
||||
|
||||
!= partial("includes/third-party/prismjs", {}, { cache: true })
|
||||
|
||||
if theme.aside.enable && theme.newest_comments.enable
|
||||
if theme.pjax.enable
|
||||
!= partial("includes/third-party/newest-comments/index", {}, { cache: true })
|
||||
else if (!is_post() && page.aside !== false)
|
||||
!= partial("includes/third-party/newest-comments/index", {}, { cache: true })
|
||||
//- 气泡效果
|
||||
if theme.bubble.enable
|
||||
script(async data-pjax src="https://npm.elemecdn.com/anzhiyu-theme-static@1.0.1/bubble/bubble.js")
|
||||
if theme.visitorMail.enable
|
||||
- const mail = theme.visitorMail.mail
|
||||
script.
|
||||
var visitorMail = "#{mail}";
|
||||
|
||||
//- 即刻依赖waterfall
|
||||
script(async data-pjax src=url_for(theme.asset.waterfall))
|
||||
//- 文章二维码
|
||||
script(src='https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/qrcodejs/1.0.0/qrcode.min.js')
|
||||
//- 右键菜单
|
||||
if (theme.rightClickMenu && theme.rightClickMenu.enable)
|
||||
script(src=url_for(theme.asset.right_click_menu_js))
|
||||
|
||||
//- iconfont依赖
|
||||
link(rel="stylesheet" href=url_for(theme.asset.ali_iconfont_css))
|
||||
if (theme.icons && theme.icons.ali_iconfont_js)
|
||||
script(async src=url_for(theme.icons.ali_iconfont_js))
|
||||
|
||||
!= fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||
|
||||
!= partial("includes/third-party/effect", {}, { cache: true })
|
||||
|
||||
!= partial("includes/third-party/chat/index", {}, { cache: true })
|
||||
|
||||
if theme.aplayerInject && theme.aplayerInject.enable
|
||||
if theme.pjax.enable || theme.aplayerInject.per_page
|
||||
include ./third-party/aplayer.pug
|
||||
else if page.aplayer
|
||||
include ./third-party/aplayer.pug
|
||||
|
||||
if theme.pjax.enable
|
||||
!= partial("includes/third-party/pjax", {}, { cache: true })
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async data-pjax src= theme.asset.busuanzi || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
||||
if theme.accesskey.enable
|
||||
script(charset="UTF-8" src=url_for(theme.asset.accesskey_js))
|
||||
|
||||
if is_current("/") && theme.greetingBox.enable
|
||||
#greetingBox
|
||||
@@ -0,0 +1,26 @@
|
||||
- let pageFillDescription = get_page_fill_description()
|
||||
- let gptName = theme.post_head_ai_description.gptName
|
||||
- let mode = theme.post_head_ai_description.mode
|
||||
- let switchBtn = theme.post_head_ai_description.switchBtn
|
||||
if (pageFillDescription && page.ai)
|
||||
.post-ai-description
|
||||
.ai-title
|
||||
i.anzhiyufont.anzhiyu-icon-bilibili
|
||||
.ai-title-text AI-摘要
|
||||
if (switchBtn)
|
||||
#ai-Toggle 切换
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right
|
||||
i.anzhiyufont.anzhiyu-icon-circle-dot(title="朗读摘要")
|
||||
#ai-tag
|
||||
if mode == "tianli"
|
||||
= "Tianli GPT"
|
||||
else
|
||||
= gptName + " GPT"
|
||||
.ai-explanation AI初始化中...
|
||||
.ai-btn-box
|
||||
.ai-btn-item 介绍自己 🙈
|
||||
.ai-btn-item 生成本文简介 👋
|
||||
.ai-btn-item 推荐相关文章 📖
|
||||
.ai-btn-item 前往主页 🏠
|
||||
.ai-btn-item#go-tianli-blog 前往爱发电购买
|
||||
script(data-pjax src=url_for(theme.asset.ai_abstract_js))
|
||||
@@ -0,0 +1,29 @@
|
||||
#he-plugin-simple
|
||||
script.
|
||||
var WIDGET = {
|
||||
"CONFIG": {
|
||||
"modules": "0124",
|
||||
"background": "2",
|
||||
"tmpColor": "FFFFFF",
|
||||
"tmpSize": "16",
|
||||
"cityColor": "FFFFFF",
|
||||
"citySize": "16",
|
||||
"aqiColor": "E8D87B",
|
||||
"aqiSize": "16",
|
||||
"weatherIconSize": "24",
|
||||
"alertIconSize": "18",
|
||||
"padding": "10px 10px 10px 10px",
|
||||
"shadow": "0",
|
||||
"language": "auto",
|
||||
"borderRadius": "20",
|
||||
"fixed": "true",
|
||||
"vertical": "top",
|
||||
"horizontal": "left",
|
||||
"left": "20",
|
||||
"top": "7.1",
|
||||
"key": "df245676fb434a0691ead1c63341cd94"
|
||||
}
|
||||
}
|
||||
|
||||
link(rel="stylesheet", href="https://widget.qweather.net/simple/static/css/he-simple.css?v=1.4.0")
|
||||
script(src="https://widget.qweather.net/simple/static/js/he-simple.js?v=1.4.0")
|
||||
@@ -0,0 +1,47 @@
|
||||
#console
|
||||
.console-card-group-reward
|
||||
ul.reward-all.console-card
|
||||
each item in theme.reward.QR_code
|
||||
li.reward-item
|
||||
a(href=url_for(item.link || item.img), target='_blank')
|
||||
img.post-qr-code-img(alt=item.text, src=url_for(item.img))
|
||||
.post-qr-code-desc=item.text
|
||||
.console-card-group
|
||||
.console-card-group-left
|
||||
!=partial('includes/widget/card_newest_comment', {}, {cache: true})
|
||||
.console-card-group-right
|
||||
.console-card.tags
|
||||
.card-content
|
||||
if theme.nav_music.enable && theme.nav_music.console_widescreen_music
|
||||
.author-content-item-tips 音乐
|
||||
span.author-content-item-title 灵魂的碰撞💥
|
||||
else
|
||||
.author-content-item-tips 兴趣点
|
||||
span.author-content-item-title 寻找你感兴趣的领域
|
||||
!=partial('includes/widget/card_console_tags', {}, {cache: true})
|
||||
.console-card.history
|
||||
.item-headline
|
||||
i.anzhiyufont.anzhiyu-icon-box-archiv
|
||||
span 文章
|
||||
!=partial('includes/widget/card_console_archives', {}, {cache: true})
|
||||
.button-group
|
||||
if theme.darkmode.enable
|
||||
.console-btn-item
|
||||
a.darkmode_switchbutton(title='显示模式切换', href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-moon
|
||||
.console-btn-item#consoleHideAside(onclick='anzhiyu.hideAsideBtn()', title='边栏显示控制')
|
||||
a.asideSwitch
|
||||
i.anzhiyufont.anzhiyu-icon-arrows-left-right
|
||||
if theme.comment_barrage_config.enable
|
||||
.console-btn-item.on#consoleCommentBarrage(onclick='anzhiyu.switchCommentBarrage()', title='热评开关')
|
||||
a.commentBarrage
|
||||
i.anzhiyufont.anzhiyu-icon-message
|
||||
if theme.nav_music.enable
|
||||
.console-btn-item#consoleMusic(onclick='anzhiyu.musicToggle()', title='音乐开关')
|
||||
a.music-switch
|
||||
i.anzhiyufont.anzhiyu-icon-music
|
||||
if theme.shortcutKey.enable
|
||||
.console-btn-item#consoleKeyboard(onclick='anzhiyu.keyboardToggle()', title='快捷键开关')
|
||||
a.keyboard-switch
|
||||
i.anzhiyufont.anzhiyu-icon-keyboard
|
||||
.console-mask(onclick='anzhiyu.hideConsole()', href='javascript:void(0);')
|
||||
@@ -0,0 +1,78 @@
|
||||
- let author = config.author
|
||||
- let launch_time = theme.footer.runtime.launch_time
|
||||
- let since = theme.footer.owner.since
|
||||
- let version = get_version("tags")
|
||||
script.
|
||||
// 消除控制台打印
|
||||
var HoldLog = console.log;
|
||||
console.log = function () {};
|
||||
let now1 = new Date();
|
||||
queueMicrotask(() => {
|
||||
const Log = function () {
|
||||
HoldLog.apply(console, arguments);
|
||||
}; //在恢复前输出日志
|
||||
const grt = new Date("#{launch_time}"); //此处修改你的建站时间或者网站上线时间
|
||||
now1.setTime(now1.getTime() + 250);
|
||||
const days = (now1 - grt) / 1000 / 60 / 60 / 24;
|
||||
const dnum = Math.floor(days);
|
||||
const ascll = [
|
||||
`欢迎使用安知鱼!`,
|
||||
`生活明朗, 万物可爱`,
|
||||
`
|
||||
|
||||
█████╗ ███╗ ██╗███████╗██╗ ██╗██╗██╗ ██╗██╗ ██╗
|
||||
██╔══██╗████╗ ██║╚══███╔╝██║ ██║██║╚██╗ ██╔╝██║ ██║
|
||||
███████║██╔██╗ ██║ ███╔╝ ███████║██║ ╚████╔╝ ██║ ██║
|
||||
██╔══██║██║╚██╗██║ ███╔╝ ██╔══██║██║ ╚██╔╝ ██║ ██║
|
||||
██║ ██║██║ ╚████║███████╗██║ ██║██║ ██║ ╚██████╔╝
|
||||
╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝
|
||||
|
||||
`,
|
||||
"已上线",
|
||||
dnum,
|
||||
"天",
|
||||
"©#{since} By 安知鱼 V#{version}",
|
||||
];
|
||||
const ascll2 = [`NCC2-036`, `调用前置摄像头拍照成功,识别为【小笨蛋】.`, `Photo captured: `, `🤪`];
|
||||
|
||||
setTimeout(
|
||||
Log.bind(
|
||||
console,
|
||||
`\n%c${ascll[0]} %c ${ascll[1]} %c ${ascll[2]} %c${ascll[3]}%c ${ascll[4]}%c ${ascll[5]}\n\n%c ${ascll[6]}\n`,
|
||||
"color:#425AEF",
|
||||
"",
|
||||
"color:#425AEF",
|
||||
"color:#425AEF",
|
||||
"",
|
||||
"color:#425AEF",
|
||||
""
|
||||
)
|
||||
);
|
||||
setTimeout(
|
||||
Log.bind(
|
||||
console,
|
||||
`%c ${ascll2[0]} %c ${ascll2[1]} %c \n${ascll2[2]} %c\n${ascll2[3]}\n`,
|
||||
"color:white; background-color:#4fd953",
|
||||
"",
|
||||
"",
|
||||
'background:url("https://npm.elemecdn.com/anzhiyu-blog@1.1.6/img/post/common/tinggge.gif") no-repeat;font-size:450%'
|
||||
)
|
||||
);
|
||||
|
||||
setTimeout(Log.bind(console, "%c WELCOME %c 你好,小笨蛋.", "color:white; background-color:#4f90d9", ""));
|
||||
|
||||
setTimeout(
|
||||
console.warn.bind(
|
||||
console,
|
||||
"%c ⚡ Powered by 安知鱼 %c 你正在访问 #{author} 的博客.",
|
||||
"color:white; background-color:#f0ad4e",
|
||||
""
|
||||
)
|
||||
);
|
||||
|
||||
setTimeout(Log.bind(console, "%c W23-12 %c 你已打开控制台.", "color:white; background-color:#4f90d9", ""));
|
||||
|
||||
setTimeout(
|
||||
console.warn.bind(console, "%c S013-782 %c 你现在正处于监控中.", "color:white; background-color:#d9534f", "")
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,82 @@
|
||||
- const { translate } = theme
|
||||
#rightMenu
|
||||
.rightMenu-group.rightMenu-small
|
||||
.rightMenu-item#menu-backward
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-left
|
||||
.rightMenu-item#menu-forward
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-right
|
||||
.rightMenu-item#menu-refresh
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right(style="font-size: 1rem;")
|
||||
.rightMenu-item#menu-top
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-up
|
||||
.rightMenu-group.rightMenu-line.rightMenuPlugin
|
||||
.rightMenu-item#menu-copytext
|
||||
i.anzhiyufont.anzhiyu-icon-copy
|
||||
span 复制选中文本
|
||||
.rightMenu-item#menu-pastetext
|
||||
i.anzhiyufont.anzhiyu-icon-paste
|
||||
span 粘贴文本
|
||||
a.rightMenu-item#menu-commenttext
|
||||
i.anzhiyufont.anzhiyu-icon-comment-medical
|
||||
span 引用到评论
|
||||
.rightMenu-item#menu-newwindow
|
||||
i.anzhiyufont.anzhiyu-icon-window-restore
|
||||
span 新窗口打开
|
||||
.rightMenu-item#menu-copylink
|
||||
i.anzhiyufont.anzhiyu-icon-link
|
||||
span 复制链接地址
|
||||
.rightMenu-item#menu-copyimg
|
||||
i.anzhiyufont.anzhiyu-icon-images
|
||||
span 复制此图片
|
||||
.rightMenu-item#menu-downloadimg
|
||||
i.anzhiyufont.anzhiyu-icon-download
|
||||
span 下载此图片
|
||||
.rightMenu-item#menu-newwindowimg
|
||||
i.anzhiyufont.anzhiyu-icon-window-restore
|
||||
span 新窗口打开图片
|
||||
.rightMenu-item#menu-search
|
||||
i.anzhiyufont.anzhiyu-icon-magnifying-glass
|
||||
span 站内搜索
|
||||
.rightMenu-item#menu-searchBaidu
|
||||
i.anzhiyufont.anzhiyu-icon-magnifying-glass
|
||||
span 百度搜索
|
||||
.rightMenu-item#menu-music-toggle
|
||||
i.anzhiyufont.anzhiyu-icon-play
|
||||
span 播放音乐
|
||||
.rightMenu-item#menu-music-back
|
||||
i.anzhiyufont.anzhiyu-icon-backward
|
||||
span 切换到上一首
|
||||
.rightMenu-item#menu-music-forward
|
||||
i.anzhiyufont.anzhiyu-icon-forward
|
||||
span 切换到下一首
|
||||
- const nav_music_all_playlist = theme.nav_music.all_playlist
|
||||
.rightMenu-item#menu-music-playlist(onclick=`window.open("${nav_music_all_playlist}", "_blank");`, style='display: none;')
|
||||
i.anzhiyufont.anzhiyu-icon-radio
|
||||
span 查看所有歌曲
|
||||
.rightMenu-item#menu-music-copyMusicName
|
||||
i.anzhiyufont.anzhiyu-icon-copy
|
||||
span 复制歌名
|
||||
.rightMenu-group.rightMenu-line.rightMenuOther
|
||||
a.rightMenu-item.menu-link#menu-randomPost
|
||||
i.anzhiyufont.anzhiyu-icon-shuffle
|
||||
span 随便逛逛
|
||||
a.rightMenu-item.menu-link(href='/categories/')
|
||||
i.anzhiyufont.anzhiyu-icon-cube
|
||||
span 博客分类
|
||||
a.rightMenu-item.menu-link(href='/tags/')
|
||||
i.anzhiyufont.anzhiyu-icon-tags
|
||||
span 文章标签
|
||||
.rightMenu-group.rightMenu-line.rightMenuOther
|
||||
a.rightMenu-item#menu-copy(href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-copy
|
||||
span 复制地址
|
||||
a.rightMenu-item#menu-commentBarrage(href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-message
|
||||
span.menu-commentBarrage-text 关闭热评
|
||||
a.rightMenu-item#menu-darkmode(href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-circle-half-stroke
|
||||
span.menu-darkmode-text 深色模式
|
||||
a.rightMenu-item#menu-translate(href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-language
|
||||
span=translate.rightMenuMsgDefault
|
||||
#rightmenu-mask
|
||||
@@ -0,0 +1,20 @@
|
||||
if site.data.creativity
|
||||
#skills-tags-group-all
|
||||
.tags-group-wrapper
|
||||
each i in site.data.creativity
|
||||
- const evenNum = i.creativity_list.filter((x, index) => index % 2 === 0);
|
||||
- const oddNum = i.creativity_list.filter((x, index) => index % 2 === 1);
|
||||
each item, index in i.creativity_list
|
||||
if ((index+1 <= evenNum.length) && (index+1 <= oddNum.length))
|
||||
.tags-group-icon-pair
|
||||
.tags-group-icon(style=`background: ${evenNum[index].color}`)
|
||||
img.no-lightbox(title=evenNum[index].name, src=evenNum[index].icon, size="60px" alt=evenNum[index].name)
|
||||
.tags-group-icon(style=`background: ${oddNum[index].color}`)
|
||||
img.no-lightbox(title=oddNum[index].name, src=oddNum[index].icon, size="60px" alt=oddNum[index].name)
|
||||
each item, index in i.creativity_list
|
||||
if ((index+1 <= evenNum.length) && (index+1 <= oddNum.length))
|
||||
.tags-group-icon-pair
|
||||
.tags-group-icon(style=`background: ${evenNum[index].color}`)
|
||||
img.no-lightbox(title=evenNum[index].name, src=evenNum[index].icon, size="60px" alt=evenNum[index].name)
|
||||
.tags-group-icon(style=`background: ${oddNum[index].color}`)
|
||||
img.no-lightbox(title=oddNum[index].name, src=oddNum[index].icon, size="60px" alt=oddNum[index].name)
|
||||
@@ -0,0 +1,17 @@
|
||||
if site.data.essay
|
||||
each i in site.data.essay
|
||||
if i.home_essay
|
||||
- let onclick_value = theme.pjax.enable ? `pjax.loadUrl("/essay/");` : '';
|
||||
- let href_value = theme.pjax.enable ? 'javascript:void(0);' : `/essay/`;
|
||||
#bbTimeList.bbTimeList.container
|
||||
i.anzhiyufont.anzhiyu-icon-jike.bber-logo.fontbold(onclick=onclick_value, title="即刻短文", href=href_value, aria-hidden="true")
|
||||
#bbtalk.swiper-container.swiper-no-swiping.essay_bar_swiper_container(tabindex="-1")
|
||||
#bber-talk.swiper-wrapper(onclick=onclick_value)
|
||||
each i in site.data.essay
|
||||
each item, index in i.essay_list
|
||||
if index < 10
|
||||
- var contentText = item.image ? item.content + ' [图片]' : (item.video ? item.content + ' [视频]' : item.content)
|
||||
a.li-style.swiper-slide(href=href_value)= contentText
|
||||
a.bber-gotobb.anzhiyufont.anzhiyu-icon-circle-arrow-right( onclick=onclick_value, href=href_value, title="查看全文")
|
||||
|
||||
script(src=url_for(theme.home_top.swiper.swiper_js))
|
||||
@@ -0,0 +1,2 @@
|
||||
//- 随机背景
|
||||
script(src=url_for("https://npm.elemecdn.com/anzhiyu-theme-static@1.0.0/biliBg/biliBg.js"), data-pjax)
|
||||
@@ -0,0 +1,10 @@
|
||||
#categoryBar
|
||||
#category-bar.category-bar
|
||||
#catalog-bar
|
||||
#catalog-list
|
||||
.catalog-list-item(id='首页')
|
||||
a(href="/") 首页
|
||||
!=catalog_list("categories")
|
||||
.category-bar-next#category-bar-next(onclick="anzhiyu.scrollCategoryBarToRight()")
|
||||
i.anzhiyufont.anzhiyu-icon-angle-double-right
|
||||
a.catalog-more(href="/categories/")!= '更多'
|
||||
@@ -0,0 +1,93 @@
|
||||
#footer-wrap
|
||||
if theme.footer.socialBar.enable
|
||||
- let centerImg = theme.footer.socialBar.centerImg ? theme.footer.socialBar.centerImg : theme.avatar.img
|
||||
- let leftInfo = theme.footer.socialBar.left
|
||||
- let rightInfo = theme.footer.socialBar.right
|
||||
#footer_deal
|
||||
each item, index in leftInfo
|
||||
a.deal_link(href=url_for(item.link) title=item.title)
|
||||
if (item.icon.startsWith("fa"))
|
||||
i(class=`${item.icon}`)
|
||||
else if (item.icon.startsWith("icon"))
|
||||
svg.icon(aria-hidden="true")
|
||||
use(xlink:href=`#`+ item.icon)
|
||||
else if (item.icon.startsWith("anzhiyu"))
|
||||
i.anzhiyufont(class=`${item.icon}`)
|
||||
img.footer_mini_logo(title="返回顶部", alt="返回顶部" onclick="anzhiyu.scrollToDest(0, 500)", src=centerImg, size="50px")
|
||||
each item, index in rightInfo
|
||||
a.deal_link(href=url_for(item.link) title=item.title)
|
||||
if (item.icon.startsWith("fa"))
|
||||
i(class=`${item.icon}`)
|
||||
else if (item.icon.startsWith("icon"))
|
||||
svg.icon(aria-hidden="true")
|
||||
use(xlink:href=`#`+ item.icon)
|
||||
else if (item.icon.startsWith("anzhiyu"))
|
||||
i.anzhiyufont(class=`${item.icon}`)
|
||||
|
||||
if theme.footer.owner.enable && !theme.footer.footerBar.enable
|
||||
- var nowYear = new Date().getFullYear()
|
||||
if theme.footer.owner.since && theme.footer.owner.since != nowYear
|
||||
.copyright!= `©${theme.footer.owner.since} - ${nowYear} By ${config.author}`
|
||||
else
|
||||
.copyright!= `©${nowYear} By ${config.author}`
|
||||
|
||||
- let work_img = theme.footer.runtime.work_img
|
||||
- let work_description = theme.footer.runtime.work_description
|
||||
if theme.footer.runtime.enable
|
||||
#workboard
|
||||
if work_img != null
|
||||
img(src=`${work_img}`, alt=`${work_description}`, title=`${work_description}`, class="workSituationImg boardsign")
|
||||
#runtimeTextTip
|
||||
if theme.footer.custom_text
|
||||
.footer_custom_text!=`${theme.footer.custom_text}`
|
||||
|
||||
if theme.footer.list.enable
|
||||
- let projectList = theme.footer.list.project
|
||||
#anzhiyu-footer
|
||||
each item, index in projectList
|
||||
.footer-group
|
||||
.footer-title=item.title
|
||||
.footer-links
|
||||
each iten, indey in item.links
|
||||
a.footer-item(title=iten.title href=url_for(iten.link))=iten.title
|
||||
if theme.footer.list.randomFriends > 0
|
||||
.footer-group
|
||||
.footer-title-group
|
||||
.footer-title 友链
|
||||
a.random-friends-btn#footer-random-friends-btn(href="javascript:addFriendLinksInFooter();" title="换一批友情链接")
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-rotate-right
|
||||
.footer-links#friend-links-in-footer
|
||||
|
||||
if theme.footer.bdageitem.enable
|
||||
p#ghbdages
|
||||
each item in theme.footer.bdageitem.list
|
||||
a.github-badge(target='_blank' href=item.link style='margin-inline:5px' data-title=item.message title=item.message)
|
||||
img(src=item.shields alt=item.message)
|
||||
|
||||
if theme.footer.footerBar && theme.footer.footerBar.enable
|
||||
#footer-bar
|
||||
.footer-bar-links
|
||||
.footer-bar-left
|
||||
#footer-bar-tips
|
||||
if theme.footer.owner.enable
|
||||
- var nowYear = new Date().getFullYear()
|
||||
- let authorLink = theme.footer.footerBar.authorLink ? theme.footer.footerBar.authorLink : config.url
|
||||
if theme.footer.owner.since && theme.footer.owner.since != nowYear
|
||||
.copyright!= `©${theme.footer.owner.since} - ${nowYear} By `
|
||||
a.footer-bar-link(href=url_for(authorLink) title=config.author target="_blank")=config.author
|
||||
else
|
||||
.copyright!= `©${nowYear} By `
|
||||
a.footer-bar-link(href=url_for(authorLink) title=config.author target="_blank")=config.author
|
||||
#footer-type-tips
|
||||
if theme.footer.footerBar && theme.footer.footerBar.subTitle && theme.footer.footerBar.subTitle.enable
|
||||
.js-pjax
|
||||
include ./third-party/footerBarSubtitle.pug
|
||||
.footer-bar-right
|
||||
each item in theme.footer.footerBar.linkList
|
||||
a.footer-bar-link(href=url_for(item.link) title=item.text)=item.text
|
||||
if theme.footer.footerBar.cc.enable
|
||||
a.footer-bar-link.cc(href=url_for(theme.footer.footerBar.cc.link) title="cc协议")
|
||||
i.anzhiyufont.anzhiyu-icon-copyright-line
|
||||
i.anzhiyufont.anzhiyu-icon-creative-commons-by-line
|
||||
i.anzhiyufont.anzhiyu-icon-creative-commons-nc-line
|
||||
i.anzhiyufont.anzhiyu-icon-creative-commons-nd-line
|
||||
@@ -0,0 +1,92 @@
|
||||
- var pageTitle
|
||||
- is_archive() ? page.title = findArchivesTitle(page, theme.menu, date) : ''
|
||||
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||||
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||||
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404')
|
||||
- else pageTitle = page.title || config.title || ''
|
||||
|
||||
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
||||
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
||||
|
||||
- var pageKeywords
|
||||
- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords
|
||||
- else if (page.tags && page.tags.length) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||||
- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||||
- var pageCopyright = config.copyright || config.author
|
||||
- var themeColorLight = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_light || '#ffffff'
|
||||
- var themeColorDark = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_dark || '#0d0d0d'
|
||||
- var themeColor = theme.display_mode === 'dark' ? themeColorDark : themeColorLight
|
||||
|
||||
meta(charset='UTF-8')
|
||||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||||
meta(name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no")
|
||||
title= tabTitle
|
||||
if pageKeywords
|
||||
meta(name="keywords" content=pageKeywords)
|
||||
meta(name="author" content=pageAuthor)
|
||||
meta(name="copyright" content=pageCopyright)
|
||||
meta(name ="format-detection" content="telephone=no")
|
||||
meta(name="theme-color" content=themeColor)
|
||||
meta(name="mobile-web-app-capable", content="yes")
|
||||
meta(name="apple-touch-fullscreen", content="yes")
|
||||
meta(name="apple-mobile-web-app-title", content=pageTitle)
|
||||
meta(name="application-name", content=pageTitle)
|
||||
meta(name="apple-mobile-web-app-capable", content="yes")
|
||||
meta(name="apple-mobile-web-app-status-bar-style", content=themeColor)
|
||||
|
||||
|
||||
//- Open_Graph
|
||||
include ./head/Open_Graph.pug
|
||||
|
||||
!=favicon_tag(theme.favicon || config.favicon)
|
||||
link(rel="canonical" href=urlNoIndex())
|
||||
|
||||
//- 預解析
|
||||
!=partial('includes/head/preconnect', {}, {cache: true})
|
||||
|
||||
//- 網站驗證
|
||||
!=partial('includes/head/site_verification', {}, {cache: true})
|
||||
|
||||
//- PWA
|
||||
if (theme.pwa && theme.pwa.enable)
|
||||
!=partial('includes/head/pwa', {}, {cache: true})
|
||||
|
||||
|
||||
//- animation依赖
|
||||
if (theme.icons && theme.icons.fontawesome_animation_css)
|
||||
link(rel="stylesheet", href=url_for(theme.icons.fontawesome_animation_css))
|
||||
|
||||
//- main css
|
||||
link(rel='stylesheet', href=url_for(theme.asset.main_css))
|
||||
if (theme.icons && theme.icons.fontawesome)
|
||||
link(rel='stylesheet', href=url_for(theme.asset.fontawesome) media="print" onload="this.media='all'")
|
||||
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
link(rel='stylesheet', href=url_for(theme.asset.snackbar_css) media="print" onload="this.media='all'")
|
||||
|
||||
if theme.fancybox
|
||||
link(rel='stylesheet' href=url_for(theme.asset.fancybox_css) media="print" onload="this.media='all'")
|
||||
|
||||
if site.data.essay || theme.home_top.swiper.enable
|
||||
link(rel='stylesheet' href=url_for(theme.home_top.swiper.swiper_css) media="print" onload="this.media='all'")
|
||||
|
||||
//- google_adsense
|
||||
!=partial('includes/head/google_adsense', {}, {cache: true})
|
||||
|
||||
//- analytics
|
||||
!=partial('includes/head/analytics', {}, {cache: true})
|
||||
|
||||
//- font
|
||||
if theme.blog_title_font && theme.blog_title_font.font_link
|
||||
link(rel='stylesheet' href=url_for(theme.blog_title_font.font_link) media="print" onload="this.media='all'")
|
||||
|
||||
//- global config
|
||||
!=partial('includes/head/config', {}, {cache: true})
|
||||
|
||||
include ./head/config_site.pug
|
||||
include ./head/noscript.pug
|
||||
|
||||
!=fragment_cache('injectHeadJs', function(){return inject_head_js()})
|
||||
|
||||
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||
@@ -0,0 +1,18 @@
|
||||
if theme.Open_Graph_meta
|
||||
- let contentType = is_post() ? 'article' : 'website'
|
||||
- let metaImage = (page.cover || theme.avatar.img) ? full_url_for(page.cover || theme.avatar.img) : ''
|
||||
|
||||
meta(property="og:type", content=contentType)
|
||||
meta(property="og:title", content=pageTitle)
|
||||
meta(property="og:url", content=theme.post_copyright.decode ? decodeURI(url) : url)
|
||||
meta(property="og:site_name", content=config.title)
|
||||
meta(property="og:description", content=page_description())
|
||||
meta(property="og:locale", content=config.language)
|
||||
meta(property="og:image", content=metaImage)
|
||||
meta(property="article:author" content=config.author)
|
||||
meta(property="article:tag" content=config.keywords)
|
||||
meta(name="twitter:card", content="summary")
|
||||
meta(name="twitter:image", content=metaImage)
|
||||
|
||||
meta(name="description" content=page_description())
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
if theme.baidu_analytics
|
||||
script.
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?!{theme.baidu_analytics}";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
|
||||
if theme.google_analytics
|
||||
script(async src=`https://www.googletagmanager.com/gtag/js?id=${theme.google_analytics}`)
|
||||
script.
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '!{theme.google_analytics}');
|
||||
|
||||
if theme.cnzz_analytics
|
||||
script(async data-pjax src=`https://s4.cnzz.com/z_stat.php?id=${theme.cnzz_analytics}&web_id=${theme.cnzz_analytics}`)
|
||||
|
||||
if theme.cloudflare_analytics
|
||||
script(defer data-pjax src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon=`{"token": "${theme.cloudflare_analytics}"}`)
|
||||
|
||||
if theme.microsoft_clarity
|
||||
script.
|
||||
(function(c,l,a,r,i,t,y){
|
||||
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
||||
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
||||
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
||||
})(window, document, "clarity", "script", "!{theme.microsoft_clarity}");
|
||||
@@ -0,0 +1,217 @@
|
||||
-
|
||||
let algolia = 'undefined';
|
||||
let env = process.env;
|
||||
if (theme.algolia_search.enable) {
|
||||
algolia = JSON.stringify({
|
||||
appId: env.ALGOLIA_APP_ID || config.algolia.appId || config.algolia.applicationID,
|
||||
apiKey: env.ALGOLIA_API_KEY || config.algolia.apiKey,
|
||||
indexName: env.ALGOLIA_INDEX_NAME || config.algolia.indexName,
|
||||
hits: theme.algolia_search.hits,
|
||||
// search languages
|
||||
languages: {
|
||||
input_placeholder: _p("search.algolia_search.input_placeholder"),
|
||||
hits_empty: _p("search.algolia_search.hits_empty"),
|
||||
hits_stats: _p("search.algolia_search.hits_stats"),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let localSearch = 'undefined';
|
||||
if (theme.local_search && theme.local_search.enable) {
|
||||
localSearch = JSON.stringify({
|
||||
path: theme.local_search.CDN ? theme.local_search.CDN : config.root + config.search.path,
|
||||
preload: theme.local_search.preload,
|
||||
languages: {
|
||||
// search languages
|
||||
hits_empty: _p("search.local_search.hits_empty"),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let translate = 'undefined';
|
||||
if (theme.translate && theme.translate.enable){
|
||||
translate = JSON.stringify({
|
||||
defaultEncoding: theme.translate.defaultEncoding,
|
||||
translateDelay: theme.translate.translateDelay,
|
||||
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
|
||||
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese,
|
||||
rightMenuMsgToTraditionalChinese: theme.translate.rightMenuMsgToTraditionalChinese,
|
||||
rightMenuMsgToSimplifiedChinese: theme.translate.rightMenuMsgToSimplifiedChinese
|
||||
})
|
||||
}
|
||||
|
||||
let copyright = 'undefined';
|
||||
if (theme.copy.enable){
|
||||
copyright = JSON.stringify({
|
||||
copy: theme.copy.enable,
|
||||
copyrightEbable: theme.copy.copyright.enable,
|
||||
limitCount: theme.copy.copyright.limit_count,
|
||||
languages: {
|
||||
author: _p("copy_copyright.author") + ': ' + config.author,
|
||||
link: _p("copy_copyright.link") + ': ',
|
||||
source: _p("copy_copyright.source") + ': ' + config.title,
|
||||
info: _p("copy_copyright.info"),
|
||||
copySuccess: _p("copy_copyright.copySuccess")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
let Snackbar = 'undefined';
|
||||
if (theme.snackbar && theme.snackbar.enable) {
|
||||
Snackbar = JSON.stringify({
|
||||
chs_to_cht: _p("Snackbar.chs_to_cht"),
|
||||
cht_to_chs: _p("Snackbar.cht_to_chs"),
|
||||
day_to_night: _p("Snackbar.day_to_night"),
|
||||
night_to_day: _p("Snackbar.night_to_day"),
|
||||
bgLight: theme.snackbar.bg_light,
|
||||
bgDark: theme.snackbar.bg_dark,
|
||||
position: theme.snackbar.position,
|
||||
})
|
||||
}
|
||||
|
||||
let noticeOutdate = 'undefined';
|
||||
if (theme.noticeOutdate && theme.noticeOutdate.enable) {
|
||||
noticeOutdate = JSON.stringify({
|
||||
limitDay: theme.noticeOutdate.limit_day,
|
||||
position: theme.noticeOutdate.position,
|
||||
messagePrev: theme.noticeOutdate.message_prev,
|
||||
messageNext: theme.noticeOutdate.message_next,
|
||||
})
|
||||
}
|
||||
|
||||
let highlight = 'undefined';
|
||||
let syntaxHighlighter = config.syntax_highlighter;
|
||||
let highlightEnable = syntaxHighlighter ? ['highlight.js', 'prismjs'].includes(syntaxHighlighter) : (config.highlight.enable || config.prismjs.enable);
|
||||
if (highlightEnable) {
|
||||
highlight = JSON.stringify({
|
||||
plugin: syntaxHighlighter ? syntaxHighlighter : config.highlight.enable ? 'highlight.js' : 'prismjs',
|
||||
highlightCopy: theme.highlight_copy,
|
||||
highlightLang: theme.highlight_lang,
|
||||
highlightHeightLimit: theme.highlight_height_limit
|
||||
})
|
||||
}
|
||||
|
||||
let friends_vue_info = 'undefined'
|
||||
if (theme.friends_vue && theme.friends_vue.enable) {
|
||||
friends_vue_info = JSON.stringify({
|
||||
apiurl: theme.friends_vue.apiurl
|
||||
})
|
||||
}
|
||||
|
||||
let mainTone = 'undefined'
|
||||
if (theme.mainTone && theme.mainTone.enable) {
|
||||
mainTone = JSON.stringify({
|
||||
mode: theme.mainTone.mode,
|
||||
api: theme.mainTone.api,
|
||||
cover_change: theme.mainTone.cover_change,
|
||||
})
|
||||
}
|
||||
|
||||
let authorStatus = 'undefined'
|
||||
if (theme.author_status && theme.author_status.enable) {
|
||||
authorStatus = JSON.stringify({
|
||||
skills: theme.author_status.skills
|
||||
})
|
||||
}
|
||||
|
||||
let preloader = 'undefined'
|
||||
if (theme.preloader && theme.preloader.enable) {
|
||||
preloader = JSON.stringify({
|
||||
source: theme.preloader.source
|
||||
})
|
||||
}
|
||||
|
||||
let commentBarrageConfig = 'undefined'
|
||||
if (theme.comment_barrage_config && theme.comment_barrage_config.enable) {
|
||||
commentBarrageConfig = JSON.stringify(theme.comment_barrage_config)
|
||||
}
|
||||
|
||||
let greetingBox = 'undefined'
|
||||
if (theme.greetingBox && theme.greetingBox.enable) {
|
||||
greetingBox = JSON.stringify(theme.greetingBox)
|
||||
}
|
||||
|
||||
let LA51 = 'undefined'
|
||||
if (theme.LA && theme.LA.enable) {
|
||||
LA51 = JSON.stringify(theme.LA)
|
||||
}
|
||||
|
||||
let shortcutKey = 'undefined'
|
||||
if (theme.shortcutKey && theme.shortcutKey.enable) {
|
||||
shortcutKey = JSON.stringify(theme.shortcutKey)
|
||||
}
|
||||
|
||||
let diytitle = 'undefined'
|
||||
if (theme.diytitle && theme.diytitle.enable) {
|
||||
diytitle = JSON.stringify(theme.diytitle)
|
||||
}
|
||||
|
||||
let postHeadAiDescription = 'undefined'
|
||||
if (theme.post_head_ai_description && theme.post_head_ai_description.enable) {
|
||||
postHeadAiDescription = JSON.stringify(theme.post_head_ai_description)
|
||||
}
|
||||
|
||||
let linkPageTop = 'undefined'
|
||||
if (theme.linkPageTop && theme.linkPageTop.enable) {
|
||||
linkPageTop = JSON.stringify(theme.linkPageTop)
|
||||
}
|
||||
|
||||
let peoplecanvas = 'undefined'
|
||||
if (theme.peoplecanvas && theme.peoplecanvas.enable) {
|
||||
peoplecanvas = JSON.stringify(theme.peoplecanvas)
|
||||
}
|
||||
|
||||
script.
|
||||
const GLOBAL_CONFIG = {
|
||||
linkPageTop: !{linkPageTop},
|
||||
peoplecanvas: !{peoplecanvas},
|
||||
postHeadAiDescription: !{postHeadAiDescription},
|
||||
diytitle: !{diytitle},
|
||||
LA51: !{LA51},
|
||||
greetingBox: !{greetingBox},
|
||||
twikooEnvId: '!{theme.twikoo.envId}',
|
||||
commentBarrageConfig:!{commentBarrageConfig},
|
||||
root: '!{config.root}',
|
||||
preloader: !{preloader},
|
||||
friends_vue_info: !{friends_vue_info},
|
||||
navMusic: !{theme.nav_music.enable},
|
||||
mainTone: !{mainTone},
|
||||
authorStatus: !{authorStatus},
|
||||
algolia: !{algolia},
|
||||
localSearch: !{localSearch},
|
||||
translate: !{translate},
|
||||
noticeOutdate: !{noticeOutdate},
|
||||
highlight: !{highlight},
|
||||
copy: {
|
||||
success: '!{_p("copy.success")}',
|
||||
error: '!{_p("copy.error")}',
|
||||
noSupport: '!{_p("copy.noSupport")}'
|
||||
},
|
||||
relativeDate: {
|
||||
homepage: !{theme.post_meta.page.date_format === 'relative'},
|
||||
simplehomepage: !{theme.post_meta.page.date_format === 'simple'},
|
||||
post: !{theme.post_meta.post.date_format === 'relative'}
|
||||
},
|
||||
runtime: '!{theme.runtimeshow.enable ? _p("aside.card_webinfo.runtime.unit") : ""}',
|
||||
date_suffix: {
|
||||
just: '!{_p("date_suffix.just")}',
|
||||
min: '!{_p("date_suffix.min")}',
|
||||
hour: '!{_p("date_suffix.hour")}',
|
||||
day: '!{_p("date_suffix.day")}',
|
||||
month: '!{_p("date_suffix.month")}'
|
||||
},
|
||||
copyright: !{copyright},
|
||||
lightbox: '!{ theme.medium_zoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null" )}',
|
||||
Snackbar: !{Snackbar},
|
||||
source: {
|
||||
justifiedGallery: {
|
||||
js: '!{url_for(theme.asset.flickr_justified_gallery_js)}',
|
||||
css: '!{url_for(theme.asset.flickr_justified_gallery_css)}'
|
||||
}
|
||||
},
|
||||
isPhotoFigcaption: !{theme.photofigcaption},
|
||||
islazyload: !{theme.lazyload.enable},
|
||||
isAnchor: !{theme.anchor},
|
||||
shortcutKey: !{shortcutKey},
|
||||
autoDarkmode: !{theme.darkmode.enable && theme.darkmode.autoChangeMode === 1}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
-
|
||||
const titleVal = pageTitle.replace(/'/ig,"\\'")
|
||||
|
||||
let isHighlightShrink
|
||||
if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined'
|
||||
else if (page.highlight_shrink === true || page.highlight_shrink === false) isHighlightShrink = page.highlight_shrink
|
||||
else isHighlightShrink = theme.highlight_shrink
|
||||
|
||||
var showToc = false
|
||||
if (theme.aside.enable && page.aside !== false) {
|
||||
let tocEnable = false
|
||||
if (is_post()) {
|
||||
if (theme.toc.post) tocEnable = true
|
||||
} else if (is_page()) {
|
||||
if (theme.toc.page) tocEnable = true
|
||||
}
|
||||
const pageToc = page.toc === true || page.toc === false ? page.toc : tocEnable
|
||||
showToc = pageToc && (toc(page.content) !== '' || page.encrypt == true )
|
||||
}
|
||||
-
|
||||
|
||||
script#config-diff.
|
||||
var GLOBAL_CONFIG_SITE = {
|
||||
configTitle: '!{config.title}',
|
||||
title: '!{titleVal}',
|
||||
postAI: '!{page.ai}',
|
||||
pageFillDescription: '!{get_page_fill_description()}',
|
||||
isPost: !{is_post()},
|
||||
isHome: !{is_home()},
|
||||
isHighlightShrink: !{isHighlightShrink},
|
||||
isToc: !{showToc},
|
||||
postUpdate: '!{full_date(page.updated)}',
|
||||
postMainColor: '!{page.main_color}',
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
if (theme.google_adsense && theme.google_adsense.enable)
|
||||
script(async src=theme.google_adsense.js)
|
||||
|
||||
if theme.google_adsense.auto_ads
|
||||
script.
|
||||
(adsbygoogle = window.adsbygoogle || []).push({
|
||||
google_ad_client: '!{theme.google_adsense.client}',
|
||||
enable_page_level_ads: '!{theme.google_adsense.enable_page_level_ads}'
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
noscript.
|
||||
<style type="text/css">
|
||||
#nav {
|
||||
opacity: 1
|
||||
}
|
||||
.justified-gallery img {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
#recent-posts time,
|
||||
#post-meta time {
|
||||
display: inline !important
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,39 @@
|
||||
-
|
||||
const { internal_provider, third_party_provider, custom_format } = theme.CDN
|
||||
const providers = {
|
||||
'jsdelivr': '//cdn.jsdelivr.net',
|
||||
'cdnjs': '//cdnjs.cloudflare.com',
|
||||
'unpkg': '//unpkg.com',
|
||||
'elemecdn': '//npm.elemecdn.com',
|
||||
'onmicrosoft': '//npm.onmicrosoft.cn',
|
||||
'cbd': '//cdn.cbd.int',
|
||||
'anheyu': '//cdn.anheyu.com',
|
||||
'custom': custom_format && custom_format.match(/^((https?:)?(\/\/[^/]+)|([^/]+))(\/|$)/)[1]
|
||||
}
|
||||
-
|
||||
|
||||
if internal_provider === third_party_provider && internal_provider !== 'local'
|
||||
link(rel="preconnect" href=providers[internal_provider])
|
||||
else
|
||||
if internal_provider !== 'local'
|
||||
link(rel="preconnect" href=providers[internal_provider])
|
||||
if third_party_provider !== 'local'
|
||||
link(rel="preconnect" href=providers[third_party_provider])
|
||||
|
||||
if theme.google_analytics
|
||||
link(rel="preconnect" href="//www.google-analytics.com" crossorigin='')
|
||||
|
||||
if theme.baidu_analytics
|
||||
link(rel="preconnect" href="//hm.baidu.com")
|
||||
|
||||
if theme.cloudflare_analytics
|
||||
link(rel="preconnect" href="//static.cloudflareinsights.com")
|
||||
|
||||
if theme.microsoft_clarity
|
||||
link(rel="preconnect" href="//www.clarity.ms")
|
||||
|
||||
if theme.blog_title_font && theme.blog_title_font.font_link && theme.blog_title_font.font_link.indexOf('//fonts.googleapis.com') != -1
|
||||
link(rel="preconnect" href="//fonts.googleapis.com" crossorigin='')
|
||||
|
||||
if !theme.asset.busuanzi && (theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv)
|
||||
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
||||
@@ -0,0 +1,59 @@
|
||||
link(rel="manifest" href=url_for(theme.pwa.manifest))
|
||||
if(theme.pwa.theme_color)
|
||||
meta(name="msapplication-TileColor" content=theme.pwa.theme_color)
|
||||
if(theme.pwa.mask_icon)
|
||||
link(rel="mask-icon" href=url_for(theme.pwa.mask_icon) color="#5bbad5")
|
||||
|
||||
if(theme.pwa.apple_touch_icon)
|
||||
link(rel="apple-touch-icon" sizes="180x180" href=url_for(theme.pwa.apple_touch_icon))
|
||||
link(rel="apple-touch-icon-precomposed", sizes="180x180", href=url_for(theme.pwa.apple_touch_icon))
|
||||
if(theme.pwa.favicon_32_32)
|
||||
link(rel="icon" type="image/png" sizes="32x32" href=url_for(theme.pwa.favicon_32_32))
|
||||
if(theme.pwa.favicon_16_16)
|
||||
link(rel="icon" type="image/png" sizes="16x16" href=url_for(theme.pwa.favicon_16_16))
|
||||
if(theme.pwa.bookmark_icon)
|
||||
link(rel="bookmark", href=url_for(theme.pwa.bookmark_icon))
|
||||
|
||||
if(theme.pwa.startup_image_enable)
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2048-2732.jpg", media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2732-2048.jpg", media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1668-2388.jpg", media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2388-1668.jpg", media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1536-2048.jpg", media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2048-1536.jpg", media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1668-2224.jpg", media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2224-1668.jpg", media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1620-2160.jpg", media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2160-1620.jpg", media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1290-2796.jpg", media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2796-1290.jpg", media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1179-2556.jpg", media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2556-1179.jpg", media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1284-2778.jpg", media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2778-1284.jpg", media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1170-2532.jpg", media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2532-1170.jpg", media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1125-2436.jpg", media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2436-1125.jpg", media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1242-2688.jpg", media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2688-1242.jpg", media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-828-1792.jpg", media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1792-828.jpg", media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1242-2208.jpg", media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-2208-1242.jpg", media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-750-1334.jpg", media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1334-750.jpg", media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-640-1136.jpg", media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)")
|
||||
link(rel="apple-touch-startup-image", href="/img/siteicon/apple-splash-1136-640.jpg", media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)")
|
||||
|
||||
//- script.
|
||||
//- if ('serviceWorker' in navigator) {
|
||||
//- if (navigator.serviceWorker.controller) {
|
||||
//- navigator.serviceWorker.addEventListener('controllerchange', function() {
|
||||
//- location.reload()
|
||||
//- })
|
||||
//- }
|
||||
//- window.addEventListener('load', function() {
|
||||
//- navigator.serviceWorker.register('/service-worker.js')
|
||||
//- })
|
||||
//- }
|
||||
@@ -0,0 +1,3 @@
|
||||
if theme.site_verification
|
||||
each item in theme.site_verification
|
||||
meta(name=item.name content=item.content)
|
||||
@@ -0,0 +1,59 @@
|
||||
if !theme.disable_top_img && page.top_img !== false
|
||||
if is_post()
|
||||
- var top_img = page.top_img || page.cover || page.randomcover
|
||||
else if is_page()
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
else if is_home()
|
||||
- var top_img = theme.index_img !== false ? theme.index_img || theme.default_top_img : false
|
||||
- var home_index_img = theme.index_img !== false ? theme.index_img || theme.default_top_img : false
|
||||
else
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
|
||||
if top_img !== false
|
||||
- var imgSource = top_img && top_img.indexOf('/') !== -1 ? url_for(top_img) : top_img
|
||||
- var bg_img = top_img ? imgSource : ''
|
||||
- var home_index_img_bg = home_index_img ? home_index_img : ''
|
||||
- var site_title = page.title || page.tag || page.category || config.title
|
||||
- var isHomeClass = is_home() ? 'full_page' : 'not-home-page'
|
||||
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||
else
|
||||
- var isHomeClass = 'not-top-img'
|
||||
else
|
||||
- var top_img = false
|
||||
- var isHomeClass = 'not-top-img'
|
||||
header#page-header(class=`${isHomeClass}` style=home_index_img_bg)
|
||||
!=partial('includes/header/nav', {}, {cache: true})
|
||||
if top_img !== false
|
||||
if is_post()
|
||||
if page.bilibili_bg
|
||||
!=partial('includes/bili-banner/index')
|
||||
else
|
||||
include ./post-info.pug
|
||||
if theme.dynamicEffect && theme.dynamicEffect.postTopWave
|
||||
section.main-hero-waves-area.waves-area
|
||||
svg.waves-svg(xmlns='http://www.w3.org/2000/svg', xlink='http://www.w3.org/1999/xlink', viewBox='0 24 150 28', preserveAspectRatio='none', shape-rendering='auto')
|
||||
defs
|
||||
path#gentle-wave(d='M -160 44 c 30 0 58 -18 88 -18 s 58 18 88 18 s 58 -18 88 -18 s 58 18 88 18 v 44 h -352 Z')
|
||||
g.parallax
|
||||
use(href='#gentle-wave', x='48', y='0')
|
||||
use(href='#gentle-wave', x='48', y='3')
|
||||
use(href='#gentle-wave', x='48', y='5')
|
||||
use(href='#gentle-wave', x='48', y='7')
|
||||
#post-top-cover
|
||||
img#post-top-bg(class='nolazyload' src=bg_img)
|
||||
|
||||
else if is_home()
|
||||
#site-info
|
||||
h1#site-title=site_title
|
||||
if theme.subtitle.enable
|
||||
- var loadSubJs = true
|
||||
#site-subtitle
|
||||
span#subtitle
|
||||
if(theme.social)
|
||||
#site_social_icons
|
||||
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||
#scroll-down
|
||||
i.anzhiyufont.anzhiyu-icon-angle-down.scroll-down-effects
|
||||
else
|
||||
#page-site-info
|
||||
h1#site-title=site_title
|
||||
@@ -0,0 +1,49 @@
|
||||
if theme.menu
|
||||
//- for mobile sidebar
|
||||
- let sidebarChildHide = theme.hide_sidebar_menu_child ? 'hide' : ''
|
||||
|
||||
.menus_items
|
||||
each value, label in theme.menu
|
||||
if typeof value !== 'object'
|
||||
.menus_item
|
||||
a.site-page.faa-parent.animated-hover(href=url_for(trim(value.split('||')[0])))
|
||||
if value.split('||')[1]
|
||||
- var icon_value = trim(value.split('||')[1])
|
||||
- var anima_value = value.split('||')[2] ? trim(value.split('||')[2]) : 'faa-tada'
|
||||
if icon_value.substring(0,2)=="fa"
|
||||
i(class=icon_value + ' ' + anima_value)
|
||||
else if icon_value.substring(0,4)=="icon"
|
||||
svg.icon(aria-hidden="true" class=anima_value)
|
||||
use(xlink:href=`#`+ icon_value)
|
||||
else if icon_value.substring(0,4)=="anzhiyu"
|
||||
i.anzhiyufont(style="font-size: 0.9em;" class=icon_value + ' ' + anima_value)
|
||||
span=' '+label
|
||||
else
|
||||
.menus_item
|
||||
a.site-page(href='javascript:void(0);')
|
||||
if label.split('||')[1]
|
||||
- var icon_label = trim(label.split('||')[1])
|
||||
- var anima_label = label.split('||')[2] ? trim(label.split('||')[2]) : 'faa-tada'
|
||||
if icon_label.substring(0,2)=="fa"
|
||||
i(class=icon_label + ' ' + anima_label)
|
||||
else if (icon_label.startsWith("icon"))
|
||||
svg.icon(aria-hidden="true" class=anima_label)
|
||||
use(xlink:href=`#`+ icon_label)
|
||||
else if (icon_label.startsWith("anzhiyu"))
|
||||
i.anzhiyufont(style="font-size: 0.9em;" class=icon_label + ' ' + anima_label)
|
||||
span=' '+ trim(label.split('||')[0])
|
||||
ul.menus_item_child
|
||||
each val,lab in value
|
||||
li
|
||||
a.site-page.child.faa-parent.animated-hover(href=url_for(trim(val.split('||')[0])))
|
||||
if val.split('||')[1]
|
||||
- var icon_val = trim(val.split('||')[1])
|
||||
- var anima_val = val.split('||')[2] ? trim(val.split('||')[2]) : 'faa-tada'
|
||||
if icon_val.substring(0,2)=="fa"
|
||||
i(class=icon_val + ' ' + anima_val)
|
||||
else if (icon_val.startsWith("icon"))
|
||||
svg.icon(aria-hidden="true" class=anima_val)
|
||||
use(xlink:href=`#`+ icon_val)
|
||||
else if (icon_val.startsWith("anzhiyu"))
|
||||
i.anzhiyufont(style="font-size: 0.9em;" class=icon_val + ' ' + anima_val)
|
||||
span=' '+ lab
|
||||
@@ -0,0 +1,61 @@
|
||||
- const { darkmode } = theme
|
||||
nav#nav
|
||||
#nav-group
|
||||
span#blog_name
|
||||
if theme.nav.enable
|
||||
.back-home-button
|
||||
i.anzhiyufont.anzhiyu-icon-grip-vertical
|
||||
.back-menu-list-groups
|
||||
each group in theme.nav.menu
|
||||
.back-menu-list-group
|
||||
.back-menu-list-title= group.title
|
||||
.back-menu-list
|
||||
each item in group.item
|
||||
a.back-menu-item(href=url_for(item.link), title=item.name)
|
||||
img.back-menu-item-icon(src=item.icon alt=item.name)
|
||||
span.back-menu-item-text= item.name
|
||||
a#site-name(href=url_for('/') accesskey="h")
|
||||
.title #[=config.title]
|
||||
i.anzhiyufont.anzhiyu-icon-house-chimney
|
||||
if (theme.nav.clock)
|
||||
!=partial('includes/anzhiyu/clock', {}, {cache: true})
|
||||
|
||||
div.mask-name-container
|
||||
#name-container
|
||||
a#page-name(href="javascript:anzhiyu.scrollToDest(0, 500)") PAGE_NAME
|
||||
|
||||
#menus
|
||||
!=partial('includes/header/menu_item', {}, {cache: true})
|
||||
#nav-right
|
||||
if theme.nav.travelling
|
||||
.nav-button.only-home#travellings_button(title='随机前往一个开往项目网站')
|
||||
a.site-page(onclick='anzhiyu.totraveling()', title='随机前往一个开往项目网站', href='javascript:void(0);', rel='external nofollow', data-pjax-state='external')
|
||||
i.anzhiyufont.anzhiyu-icon-train
|
||||
.nav-button#randomPost_button
|
||||
a.site-page(onclick='toRandomPost()', title='随机前往一个文章', href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-dice
|
||||
if (theme.algolia_search.enable || theme.local_search.enable || theme.docsearch.enable)
|
||||
div.nav-button#search-button
|
||||
a.site-page.social-icon.search(href='javascript:void(0);', title='搜索🔍' accesskey="s")
|
||||
i.anzhiyufont.anzhiyu-icon-magnifying-glass
|
||||
span=' '+_p('search.title')
|
||||
|
||||
if theme.centerConsole.enable
|
||||
input#center-console(type="checkbox")
|
||||
label.widget(for="center-console" title=_p("中控台") onclick="anzhiyu.switchConsole();")
|
||||
i.left
|
||||
i.widget.center
|
||||
i.widget.right
|
||||
|
||||
!=partial('includes/anzhiyu/console', {}, {cache:true})
|
||||
|
||||
div.nav-button#nav-totop
|
||||
a.totopbtn(href='javascript:void(0);')
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-up
|
||||
span#percent(onclick="anzhiyu.scrollToDest(0,500)") 0
|
||||
|
||||
#toggle-menu
|
||||
a.site-page(href='javascript:void(0);' title="切换")
|
||||
i.anzhiyufont.anzhiyu-icon-bars
|
||||
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
- let comments = theme.comments
|
||||
#post-info
|
||||
#post-firstinfo
|
||||
.meta-firstline
|
||||
if (page.copyright_author && page.copyright_author !== config.author)
|
||||
a.post-meta-original 转载
|
||||
else
|
||||
a.post-meta-original 原创
|
||||
if (theme.post_meta.post.categories && page.categories && page.categories.data.length > 0)
|
||||
span.post-meta-categories
|
||||
if (theme.post_meta.post.date_type)
|
||||
span.post-meta-separator
|
||||
|
||||
each item, index in page.categories.data
|
||||
i.anzhiyufont.anzhiyu-icon-inbox.post-meta-icon
|
||||
a(href=url_for(item.path) itemprop="url").post-meta-categories #[=item.name]
|
||||
if (index < page.categories.data.length - 1)
|
||||
i.anzhiyufont.anzhiyu-icon-angle-right.post-meta-separator
|
||||
if (theme.post_meta.page.tags)
|
||||
span.article-meta.tags
|
||||
each item, index in page.tags.data
|
||||
a(href=url_for(item.path) tabindex="-1" itemprop="url").article-meta__tags
|
||||
span
|
||||
i.anzhiyufont.anzhiyu-icon-hashtag
|
||||
=item.name
|
||||
|
||||
h1.post-title(itemprop="name headline")= page.title || _p('no_title')
|
||||
if (theme.post_edit.enable && (theme.post_edit.github !== false))
|
||||
a.post-edit-link(href=theme.post_edit.url + page.source title=_p('post.edit.github') + ' - ' + page.title target="_blank")
|
||||
i.anzhiyufont.anzhiyu-icon-pencil
|
||||
if (theme.post_edit.enable && (theme.post_edit.yuque !== false))
|
||||
a.post-edit-link(href=theme.post_edit.yuque + page.id + '/edit/' title=_p('post.edit.yuque') + ' - ' + page.title target="_blank")
|
||||
i.anzhiyufont.anzhiyu-icon-pencil
|
||||
|
||||
#post-meta
|
||||
.meta-firstline
|
||||
if (theme.post_meta.post.date_type)
|
||||
span.post-meta-date
|
||||
if (theme.post_meta.post.date_type === 'both')
|
||||
i.anzhiyufont.anzhiyu-icon-calendar-days.post-meta-icon
|
||||
span.post-meta-label= _p('post.created')
|
||||
time.post-meta-date-created(itemprop="dateCreated datePublished" datetime=date_xml(page.date) title=_p('post.created') + ' ' + full_date(page.date))=date(page.date, config.date_format)
|
||||
span.post-meta-separator
|
||||
i.anzhiyufont.anzhiyu-icon-history.post-meta-icon
|
||||
span.post-meta-label= _p('post.updated')
|
||||
time.post-meta-date-updated(itemprop="dateCreated datePublished" datetime=date_xml(page.updated) title=_p('post.updated') + ' ' + full_date(page.updated))=date(page.updated, config.date_format)
|
||||
else
|
||||
- let data_type_update = theme.post_meta.post.date_type === 'updated'
|
||||
- let date_type = data_type_update ? 'updated' : 'date'
|
||||
- let date_icon = data_type_update ? 'anzhiyu-icon-history' :'anzhiyu-icon-calendar-days'
|
||||
- let date_title = data_type_update ? _p('post.updated') : _p('post.created')
|
||||
i.post-meta-icon.anzhiyufont(class=date_icon)
|
||||
span.post-meta-label= date_title
|
||||
time(itemprop="dateCreated datePublished" datetime=date_xml(page[date_type]) title=date_title + ' ' + full_date(page[date_type]))=date(page[date_type], config.date_format)
|
||||
|
||||
.meta-secondline
|
||||
- let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read)
|
||||
if (postWordcount)
|
||||
span.post-meta-separator
|
||||
span.post-meta-wordcount
|
||||
if theme.wordcount.post_wordcount
|
||||
i.anzhiyufont.anzhiyu-icon-file-word.post-meta-icon(title="文章字数")
|
||||
span.post-meta-label(title="文章字数")= _p('post.wordcount') + ':'
|
||||
span.word-count(title="文章字数")= wordcount(page.content)
|
||||
if theme.wordcount.min2read
|
||||
span.post-meta-separator
|
||||
if theme.wordcount.min2read
|
||||
i.anzhiyufont.anzhiyu-icon-clock.post-meta-icon(title="阅读时长")
|
||||
span.post-meta-label(title="阅读时长")= _p('post.min2read') + ':'
|
||||
span= min2read(page.content, {cn: 350, en: 160}) + _p('post.min2read_unit')
|
||||
|
||||
//- for pv and count
|
||||
mixin pvBlock(parent_id,parent_class,parent_title)
|
||||
span.post-meta-separator
|
||||
span(class=parent_class id=parent_id data-flag-title=page.title)
|
||||
i.anzhiyufont.anzhiyu-icon-fw-eye.post-meta-icon
|
||||
span.post-meta-label(title="阅读量")=_p('post.page_pv') + ':'
|
||||
if block
|
||||
block
|
||||
|
||||
- const commentUse = comments.use
|
||||
if page.comments !== false && commentUse && !comments.lazyload
|
||||
if commentUse[0] === 'Valine' && theme.valine.visitor
|
||||
+pvBlock(url_for(page.path),'leancloud_visitors',page.title)
|
||||
span.leancloud-visitors-count(title="访问量")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if commentUse[0] === 'Waline' && theme.waline.pageview
|
||||
+pvBlock('','','')
|
||||
span.waline-pageview-count(data-path=url_for(page.path) title="访问量")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if commentUse[0] === 'Twikoo' && theme.twikoo.visitor
|
||||
+pvBlock('','','')
|
||||
span#twikoo_visitors(title="访问量")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if commentUse[0] === 'Artalk' && theme.artalk.visitor
|
||||
+pvBlock('','','')
|
||||
span#ArtalkPV
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if theme.busuanzi.page_pv
|
||||
+pvBlock('','post-meta-pv-cv','')
|
||||
span#busuanzi_value_page_pv
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
else if theme.busuanzi.page_pv
|
||||
+pvBlock('','post-meta-pv-cv','')
|
||||
span#busuanzi_value_page_pv
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
- let location = page.location ? page.location : theme.post_copyright.location
|
||||
if theme.post_copyright.enable && location
|
||||
span.post-meta-separator
|
||||
span.post-meta-position(title="作者IP属地为" + location)
|
||||
i.anzhiyufont.anzhiyu-icon-location-dot
|
||||
=location
|
||||
|
||||
if comments.count && !comments.lazyload && page.comments !== false && comments.use
|
||||
- var whichCount = comments.use[0]
|
||||
|
||||
mixin countBlock
|
||||
span.post-meta-separator
|
||||
span.post-meta-commentcount
|
||||
i.anzhiyufont.anzhiyu-icon-comments.post-meta-icon
|
||||
span.post-meta-label= _p('post.comments') + ':'
|
||||
if block
|
||||
block
|
||||
|
||||
case whichCount
|
||||
when 'Valine'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
||||
span.valine-comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Waline'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.waline-comment-count(data-path=url_for(page.path))
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Twikoo'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment' tabindex="-1")
|
||||
span#twikoo-count
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Artalk'
|
||||
+countBlock
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.artalk-count
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
@@ -0,0 +1,12 @@
|
||||
each value, title in theme.social
|
||||
a.social-icon.faa-parent.animated-hover(href=url_for(trim(value.split('||')[0])) target="_blank" title=title === undefined ? '' : trim(title))
|
||||
if value.split('||')[1]
|
||||
- var icon_value = trim(value.split('||')[1])
|
||||
- var anima_value = value.split('||')[2] ? trim(value.split('||')[2]) : 'faa-tada'
|
||||
if (icon_value.startsWith("fa"))
|
||||
i(class=icon_value + ' ' + anima_value)
|
||||
else if (icon_value.startsWith("icon"))
|
||||
svg.icon(aria-hidden="true" class=anima_value)
|
||||
use(xlink:href=`#`+ icon_value)
|
||||
else if (icon_value.startsWith("anzhiyu"))
|
||||
i.anzhiyufont(class=icon_value)
|
||||
@@ -0,0 +1,91 @@
|
||||
- var htmlClassHideAside = theme.aside.enable && theme.aside.hide ? 'hide-aside' : ''
|
||||
- page.aside = is_archive() ? theme.aside.display.archive: is_category() ? theme.aside.display.category : is_tag() ? theme.aside.display.tag : page.aside
|
||||
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
|
||||
- var pageType = is_post() ? 'post' : 'page'
|
||||
|
||||
doctype html
|
||||
html(lang=config.language data-theme=theme.display_mode class=htmlClassHideAside)
|
||||
head
|
||||
include ./head.pug
|
||||
body(data-type="anzhiyu")
|
||||
#web_bg
|
||||
#an_music_bg
|
||||
if theme.preloader.enable
|
||||
!=partial('includes/loading/index', {}, {cache: true})
|
||||
if (theme.mourn.enable && is_home_first_page())
|
||||
include ./mourn.pug
|
||||
if page.type !== '404'
|
||||
#body-wrap(class=pageType)
|
||||
include ./header/index.pug
|
||||
main#blog-container
|
||||
if (is_home())
|
||||
include ./bbTimeList.pug
|
||||
if is_current("/")
|
||||
include ./top/top.pug
|
||||
if page.top_single
|
||||
- let background = page.top_single_background
|
||||
- let tip = page.top_single_tip
|
||||
- let subTitle = page.top_single_subtitle
|
||||
- let btn_link = page.top_single_btn_link
|
||||
- let btn_text = page.top_single_btn_text
|
||||
#single_top
|
||||
.author-content.author-content-item.single(style=`${background ? `background: url(${background}) top / cover no-repeat;` : ""}`)
|
||||
.card-content
|
||||
.author-content-item-tips=subTitle
|
||||
span.author-content-item-title=page.title
|
||||
.content-bottom
|
||||
.tips=tip
|
||||
.banner-button-group
|
||||
a.banner-button(onclick=`pjax.loadUrl("${url_for(btn_link ? btn_link : '/about')}")`)
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
|
||||
span.banner-button-text=btn_text ? btn_text : "关于我"
|
||||
|
||||
#content-inner.layout(class=hideAside)
|
||||
if body
|
||||
div!= body
|
||||
else
|
||||
block content
|
||||
if theme.aside.enable && page.aside !== false
|
||||
include widget/index.pug
|
||||
|
||||
- var footerBg = theme.footer_bg
|
||||
if (footerBg)
|
||||
if (footerBg === true)
|
||||
- var footer_bg = bg_img
|
||||
else
|
||||
- var footer_bg = theme.footer_bg.indexOf('/') !== -1 ? `background-image: url('${url_for(footerBg)}')` : `background: ${footerBg}`
|
||||
else
|
||||
- var footer_bg = ''
|
||||
|
||||
footer#footer(style=footer_bg)
|
||||
!=partial('includes/footer', {}, {cache: true})
|
||||
|
||||
if (theme.agreementPopup && theme.agreementPopup.enable && is_home_first_page())
|
||||
- let agreementPopupUrl = theme.agreementPopup.url
|
||||
script(defer).
|
||||
var hasShownPopup = sessionStorage.getItem('sessionNegotiatePopupShown');
|
||||
|
||||
if (!hasShownPopup) {
|
||||
setTimeout(() => {
|
||||
anzhiyuPopupManager && anzhiyuPopupManager.enqueuePopup('协议提醒助手', '查看本站为你的个人隐私做出的努力', '#{agreementPopupUrl}', 4000);
|
||||
sessionStorage.setItem('sessionNegotiatePopupShown', 'true');
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
else
|
||||
include ./404.pug
|
||||
|
||||
!=partial('includes/sidebar', {}, {cache: true})
|
||||
|
||||
if theme.shortcutKey.enable
|
||||
!=partial('includes/shortcutKey', {}, {cache: true})
|
||||
include ./rightside.pug
|
||||
|
||||
if (theme.nav_music.enable || theme.nav_music.console_widescreen_music)
|
||||
include ./music.pug
|
||||
!=partial('includes/third-party/search/index', {}, {cache: true})
|
||||
!=partial('includes/anzhiyu/rightmenu', {}, {cache:true})
|
||||
include ./additional-js.pug
|
||||
|
||||
//- 弹窗通知
|
||||
!=partial('includes/popup/index', {}, {cache: true})
|
||||
@@ -0,0 +1,21 @@
|
||||
- loading_img = theme.preloader.avatar ? theme.preloader.avatar : theme.avatar.img
|
||||
#loading-box(onclick='document.getElementById("loading-box").classList.add("loaded")')
|
||||
.loading-bg
|
||||
img.loading-img(alt="加载头像" class='nolazyload' src=url_for(loading_img))
|
||||
.loading-image-dot
|
||||
script.
|
||||
const preloader = {
|
||||
endLoading: () => {
|
||||
document.getElementById('loading-box').classList.add("loaded");
|
||||
},
|
||||
initLoading: () => {
|
||||
document.getElementById('loading-box').classList.remove("loaded")
|
||||
}
|
||||
}
|
||||
window.addEventListener('load',()=> { preloader.endLoading() })
|
||||
setTimeout(function(){preloader.endLoading();},10000)
|
||||
|
||||
if (!{theme.pjax && theme.pjax.enable}) {
|
||||
document.addEventListener('pjax:send', () => { preloader.initLoading() })
|
||||
document.addEventListener('pjax:complete', () => { preloader.endLoading() })
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
if theme.preloader.source === 1
|
||||
include ./fullpage-loading.pug
|
||||
else if theme.preloader.source === 2
|
||||
include ./pace.pug
|
||||
else
|
||||
include ./fullpage-loading.pug
|
||||
include ./pace.pug
|
||||
@@ -0,0 +1,2 @@
|
||||
link(rel="stylesheet", href=url_for(theme.preloader.pace_css_url || theme.asset.pace_default_css))
|
||||
script(async src=url_for(theme.asset.pace_js), data-pace-options='{ "restartOnRequestAfter":false,"eventLag":false}')
|
||||
@@ -0,0 +1,37 @@
|
||||
mixin articleSort(posts, current)
|
||||
.article-sort
|
||||
- var year
|
||||
- let modifiedUrl
|
||||
- posts.each(function (article, post_index) {
|
||||
- let tempYear = date(article.date, 'YYYY')
|
||||
- let no_cover = article.cover === false || !theme.cover.archives_enable ? 'no-article-cover' : ''
|
||||
- let title = article.title || _p('no_title')
|
||||
- let pageThumbnailSuffix = theme.pageThumbnailSuffix
|
||||
if (pageThumbnailSuffix && theme.pageThumbnailSuffix.startsWith("!") && article.cover && article.cover.includes("!"))
|
||||
- let imageUrl = article.cover.substring(0, article.cover.indexOf("!"))
|
||||
- modifiedUrl = imageUrl + pageThumbnailSuffix
|
||||
else
|
||||
- modifiedUrl = article.cover
|
||||
if tempYear !== year
|
||||
- year = tempYear
|
||||
.article-sort-item.year
|
||||
span= year
|
||||
.article-sort-item(class=no_cover)
|
||||
if article.cover && theme.cover.archives_enable
|
||||
a.article-sort-item-img(href=url_for(article.path) title=title)
|
||||
img(src=url_for(modifiedUrl) alt=title onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'`)
|
||||
.article-sort-item-info
|
||||
a.article-sort-item-title(href=url_for(article.path) title=title)= title
|
||||
span.article-sort-item-index= (current - 1) * config.per_page + post_index + 1
|
||||
.article-meta-wrap
|
||||
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||
span.article-sort-item-tags
|
||||
each item, index in article.tags.data
|
||||
a(href=url_for(item.path) tabindex="-1").article-meta__tags
|
||||
span
|
||||
i.anzhiyufont.anzhiyu-icon-hashtag
|
||||
=item.name
|
||||
.article-sort-item-time
|
||||
i.anzhiyufont.anzhiyu-icon-calendar-alt
|
||||
time.post-meta-date-created(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format)
|
||||
- })
|
||||
@@ -0,0 +1,122 @@
|
||||
- let maxDate = 0
|
||||
each item in site.posts.data
|
||||
if item.date > maxDate
|
||||
- maxDate = item.date
|
||||
mixin postUI(posts)
|
||||
each article , index in page.posts.data
|
||||
- let link = article.link || article.path
|
||||
div(class = (index === 0 ? 'recent-post-item lastestpost-item' : 'recent-post-item') onclick=`pjax.loadUrl('${url_for(link)}')`)
|
||||
-
|
||||
let title = article.title || _p('no_title')
|
||||
const position = theme.cover.position
|
||||
let leftOrRight = position === 'both'
|
||||
? index%2 == 0 ? 'left' : 'right'
|
||||
: position === 'left' ? 'left' : 'right'
|
||||
let post_cover = article.cover
|
||||
let no_cover = article.cover === false || !theme.cover.index_enable ? 'no-cover' : ''
|
||||
-
|
||||
- const new_post = is_current('/') && (maxDate === article.date)
|
||||
|
||||
if post_cover && theme.cover.index_enable
|
||||
.post_cover(class=leftOrRight)
|
||||
a(href=url_for(link) title=title style='display: flex;height: 100%;')
|
||||
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title style='pointer-events: none')
|
||||
|
||||
.recent-post-info(class=no_cover)
|
||||
.recent-post-info-top
|
||||
.recent-post-info-top-tips
|
||||
if (is_home() && (article.top || article.sticky > 0))
|
||||
span.article-meta.sticky-warp
|
||||
i.anzhiyufont.anzhiyu-icon-thumbtack.sticky
|
||||
span.sticky= _p('sticky')
|
||||
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||
each item, index in article.categories.data
|
||||
.article-categories-original=item.name
|
||||
if new_post
|
||||
span.newPost 最新
|
||||
a.unvisited-post(href=url_for(link) title=title) 未读
|
||||
a.article-title(href=url_for(link) title=title)= title
|
||||
.article-meta-wrap
|
||||
if (theme.post_meta.page.date_type)
|
||||
span.post-meta-date
|
||||
if (theme.post_meta.page.date_type === 'both')
|
||||
i.anzhiyufont.anzhiyu-icon-calendar-alt(style=`${theme.post_meta.page.date_format==="simple" ? "display:none":""}`)
|
||||
span.article-meta-label=_p('post.created')
|
||||
time.post-meta-date-created(datetime=date_xml(article.date) title=_p('post.created') + ' ' + full_date(article.date) time=full_date(article.date))=date(article.date, config.date_format)
|
||||
span.article-meta-separator
|
||||
i.anzhiyufont.anzhiyu-icon-history(style=`font-size: 15px; ${theme.post_meta.page.date_format==="simple" ? "display:none":""}`)
|
||||
span.article-meta-label=_p('post.updated')
|
||||
time.post-meta-date-updated(datetime=date_xml(article.updated) title=_p('post.updated') + ' ' + full_date(article.updated) time=full_date(article.updated))=date(article.updated, config.date_format)
|
||||
else
|
||||
- let data_type_updated = theme.post_meta.page.date_type === 'updated'
|
||||
- let date_type = data_type_updated ? 'updated' : 'date'
|
||||
- let date_type_other = data_type_updated ? 'date' : 'updated'
|
||||
- let date_icon = data_type_updated ? 'anzhiyu-icon-history' :'anzhiyu-icon-calendar-days'
|
||||
- let date_title = data_type_updated ? _p('post.updated') : _p('post.created')
|
||||
- let date_title_other = data_type_updated ? _p('post.created') : _p('post.updated')
|
||||
i.anzhiyufont(class=date_icon style=`font-size: 15px; ${theme.post_meta.page.date_format==="simple" ? "display:none":""}`)
|
||||
span.article-meta-label=date_title
|
||||
time(datetime=date_xml(article[date_type]) title=date_title + ' ' + full_date(article[date_type]) time=full_date(article[date_type]))=date(article[date_type], config.date_format)
|
||||
time(datetime=date_xml(article[date_type_other]), class="time_hidden", title=date_title_other + ' ' + full_date(article[date_type_other]) time=full_date(article[date_type_other]))=date(article[date_type_other], config.date_format)
|
||||
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||
span.article-meta.tags
|
||||
each item, index in article.tags.data
|
||||
a(href=url_for(item.path) event.cancelbubble onclick="window.event.cancelBubble=true;").article-meta__tags
|
||||
span
|
||||
i.anzhiyufont.anzhiyu-icon-hashtag
|
||||
=item.name
|
||||
|
||||
mixin countBlockInIndex
|
||||
- needLoadCountJs = true
|
||||
span.article-meta
|
||||
span.article-meta-separator
|
||||
i.anzhiyufont.anzhiyu-icon-comments
|
||||
if block
|
||||
block
|
||||
span.article-meta-label= ' ' + _p('card_post_count')
|
||||
|
||||
if theme.comments.card_post_count
|
||||
case theme.comments.use[0]
|
||||
when 'Valine'
|
||||
+countBlockInIndex
|
||||
a(href=url_for(link) + '#post-comment')
|
||||
span.valine-comment-count(data-xid=url_for(link))
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Waline'
|
||||
+countBlockInIndex
|
||||
a(href=url_for(link) + '#post-comment')
|
||||
span.waline-comment-count(id=url_for(link))
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Twikoo'
|
||||
+countBlockInIndex
|
||||
a.twikoo-count(href=url_for(link) + '#post-comment' tabindex="-1")
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
when 'Artalk'
|
||||
+countBlockInIndex
|
||||
a(href=url_for(link) + '#post-comment')
|
||||
span.artalk-count(data-page-key=url_for(link))
|
||||
i.anzhiyufont.anzhiyu-icon-spinner.anzhiyu-spin
|
||||
|
||||
//- Display the article introduction on homepage
|
||||
case theme.index_post_content.method
|
||||
when false
|
||||
- break
|
||||
when 1
|
||||
.content!= article.description
|
||||
when 2
|
||||
if article.description
|
||||
.content!= article.description
|
||||
else
|
||||
- const content = strip_html(article.content)
|
||||
- let expert = content.substring(0, theme.index_post_content.length)
|
||||
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
|
||||
.content!= expert
|
||||
default
|
||||
- const content = strip_html(article.content)
|
||||
- let expert = content.substring(0, theme.index_post_content.length)
|
||||
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
|
||||
.content!= expert
|
||||
|
||||
if theme.ad && theme.ad.index
|
||||
if (index + 1) % 3 == 0
|
||||
.recent-post-item.ads-wrap!=theme.ad.index
|
||||
@@ -0,0 +1,9 @@
|
||||
script.
|
||||
function initMourn() {
|
||||
const date = new Date();
|
||||
const today = (date.getMonth() + 1) + "-" + date.getDate()
|
||||
const mourn_days = !{JSON.stringify(theme.mourn.days)}
|
||||
if (mourn_days.includes(today)) {
|
||||
document.documentElement.style.filter = "grayscale(1)";
|
||||
}}
|
||||
initMourn();
|
||||
@@ -0,0 +1,7 @@
|
||||
- const nav_music_id = theme.nav_music.id
|
||||
- const nav_music_server = theme.nav_music.server
|
||||
- const nav_music_volume = theme.nav_music.volume
|
||||
#nav-music
|
||||
a#nav-music-hoverTips(onclick='anzhiyu.musicToggle()' accesskey="m") 播放音乐
|
||||
#console-music-bg
|
||||
meting-js(id=nav_music_id server=nav_music_server type="playlist" mutex="true" preload="none" theme="var(--anzhiyu-main)" data-lrctype="0" order="random" volume=nav_music_volume)
|
||||
@@ -0,0 +1,430 @@
|
||||
if site.data.about
|
||||
- let aboutData = site.data.about
|
||||
each item in aboutData
|
||||
- let subtitle = item.subtitle || config.subtitle
|
||||
- let avatarImg = item.avatarImg || theme.avatar.img
|
||||
- let aboutName = item.name || theme.author
|
||||
- let aboutDescription = item.description || config.description
|
||||
- let helloAbout = item.helloAbout
|
||||
- let skillsTips = item.skillsTips
|
||||
- let careers = item.careers
|
||||
- let crrList = careers.list
|
||||
- let crrItem = careers.item
|
||||
- let avatarSkills = item.avatarSkills
|
||||
#about-page
|
||||
.author-box
|
||||
if avatarSkills
|
||||
.author-tag-left
|
||||
each item in avatarSkills.left
|
||||
span.author-tag=item
|
||||
.author-img
|
||||
img.no-lightbox(src=url_for(avatarImg) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar")
|
||||
if avatarSkills
|
||||
.author-tag-right
|
||||
each item in avatarSkills.right
|
||||
span.author-tag=item
|
||||
p.p.center.logo.large 关于我
|
||||
p.p.center.small=subtitle
|
||||
.author-content
|
||||
.author-content-item.myInfoAndSayHello
|
||||
.title1 你好,很高兴认识你👋
|
||||
.title2
|
||||
| 我叫
|
||||
span.inline-word=aboutName
|
||||
.title1=aboutDescription
|
||||
.aboutsiteTips.author-content-item
|
||||
- let { tips, title1, title2, word } = item.aboutsiteTips
|
||||
.author-content-item-tips= tips
|
||||
h2
|
||||
= title1
|
||||
br
|
||||
= title2
|
||||
.mask
|
||||
each wordItem, index in word
|
||||
if index < word.length - 2
|
||||
span(class=(index === 0 ? 'first-tips' : ''))= wordItem
|
||||
span(data-up)= word[word.length - 2]
|
||||
|
|
||||
span(data-show)= word[word.length - 1]
|
||||
|
||||
.hello-about
|
||||
.cursor(style='translate:none;rotate:none;scale:none;transform:translate(721px,180px)')
|
||||
.shapes
|
||||
.shape.shape-1(style='translate:none;rotate:none;scale:none;transform:translate(721px,180px)')
|
||||
.shape.shape-2(style='translate:none;rotate:none;scale:none;transform:translate(721px,180px)')
|
||||
.shape.shape-3(style='translate:none;rotate:none;scale:none;transform:translate(721px,180px)')
|
||||
.content
|
||||
h1=helloAbout
|
||||
|
||||
.author-content
|
||||
.author-content-item.skills
|
||||
.card-content
|
||||
.author-content-item-tips=skillsTips.tips
|
||||
span.author-content-item-title=skillsTips.title
|
||||
.skills-style-group
|
||||
include ../anzhiyu/tags-group-all.pug
|
||||
if site.data.creativity
|
||||
.skills-list
|
||||
each i in site.data.creativity
|
||||
each item, index in i.creativity_list
|
||||
.skill-info
|
||||
.skill-icon(style=`background: ${item.color}`)
|
||||
img.no-lightbox(title=item.name, src=item.icon, alt=item.name)
|
||||
.skill-name
|
||||
span=item.name
|
||||
.etc ...
|
||||
.author-content-item.careers
|
||||
.card-content
|
||||
.author-content-item-tips=careers.tips
|
||||
span.author-content-item-title=careers.title
|
||||
.careers-group
|
||||
if crrList
|
||||
each career in crrList
|
||||
.career-item
|
||||
.circle(style=`background:${career.color ? career.color : "#357ef5"}`)
|
||||
.name=career.desc
|
||||
else
|
||||
.careers-none
|
||||
if careers.img
|
||||
img.author-content-img.no-lightbox(alt=careers.tips, src=url_for(careers.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'`)
|
||||
|
||||
.author-content
|
||||
if theme.LA.enable
|
||||
- let cover = item.statistic.cover
|
||||
.about-statistic.author-content-item(style=`background: url(${cover}) top / cover no-repeat;`)
|
||||
.card-content
|
||||
.author-content-item-tips 数据
|
||||
span.author-content-item-title 访问统计
|
||||
#statistic
|
||||
.post-tips
|
||||
| 统计信息来自
|
||||
a(href='https://invite.51.la/1NzKqTeb?target=V6', target='_blank', rel='noopener nofollow') 51la网站统计
|
||||
.banner-button-group
|
||||
- let link = item.statistic.link
|
||||
- let text = item.statistic.text
|
||||
a.banner-button(onclick=`pjax.loadUrl("${link}")`)
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-circle-right
|
||||
|
|
||||
span.banner-button-text=text
|
||||
.author-content-item-group.column.mapAndInfo
|
||||
- let mapBackground = item.map.background
|
||||
- let mapBackgroundDark = item.map.backgroundDark
|
||||
style.
|
||||
.author-content-item.map {
|
||||
background-image: url(#{mapBackground});
|
||||
}
|
||||
[data-theme='dark'] .author-content-item.map {
|
||||
background-image: url(#{mapBackgroundDark});
|
||||
}
|
||||
.author-content-item.map.single
|
||||
- let mapTitle = item.map.title
|
||||
- let mapStrengthenTitle = item.map.StrengthenTitle
|
||||
span.map-title=mapTitle
|
||||
b=mapStrengthenTitle
|
||||
.author-content-item.selfInfo.single
|
||||
- let { selfInfoTips1, selfInfoContentYear, selfInfoTips2, selfInfoContent2, selfInfoTips3, selfInfoContent3 } = item.selfInfo
|
||||
div
|
||||
span.selfInfo-title=selfInfoTips1
|
||||
|
|
||||
span.selfInfo-content#selfInfo-content-year(style='color:#43a6c6')=selfInfoContentYear
|
||||
div
|
||||
span.selfInfo-title=selfInfoTips2
|
||||
|
|
||||
span.selfInfo-content(style='color:#c69043')=selfInfoContent2
|
||||
div
|
||||
span.selfInfo-title=selfInfoTips3
|
||||
|
|
||||
span.selfInfo-content(style='color:#b04fe6')=selfInfoContent3
|
||||
|
||||
.author-content
|
||||
.author-content-item.personalities
|
||||
- let {author_name, personality_type, photo_url, personality_img, name_url, personality_type_color} = item.personalities
|
||||
.author-content-item-tips 性格
|
||||
span.author-content-item-title= author_name
|
||||
.title2(style=`color:${personality_type_color ? personality_type_color : "#ac899c"}`)= personality_type
|
||||
.post-tips
|
||||
| 在
|
||||
a(href='https://www.16personalities.com/', target='_blank', rel='noopener nofollow') 16personalities
|
||||
| 了解更多关于
|
||||
a(target='_blank', rel='noopener external nofollow', href= name_url)= author_name
|
||||
.image
|
||||
img.no-lightbox(src=url_for(personality_img), alt='人格')
|
||||
.author-content-item.myphoto
|
||||
img.author-content-img.no-lightbox(alt='自拍', src=url_for(photo_url))
|
||||
|
||||
.author-content
|
||||
.author-content-item.maxim
|
||||
- let {maxim_tips, maxim_top, maxim_bottom} = item.maxim
|
||||
.author-content-item-tips=maxim_tips
|
||||
span.maxim-title
|
||||
span(style='opacity:.6;margin-bottom:8px')=maxim_top
|
||||
|
|
||||
span=maxim_bottom
|
||||
.author-content-item.buff
|
||||
.card-content
|
||||
- let {buff_tips, buff_top, buff_bottom} = item.buff
|
||||
.author-content-item-tips=buff_tips
|
||||
span.buff-title
|
||||
span(style='opacity:.6;margin-bottom:8px')=buff_top
|
||||
|
|
||||
span=buff_bottom
|
||||
.card-background-icon
|
||||
i.anzhiyufont.anzhiyu-icon-dice-d20
|
||||
|
||||
.author-content
|
||||
- let {game_tips, game_title, game_uid, game_bg} = item.game
|
||||
.author-content-item.game-yuanshen(style=`background: url(${game_bg}) top / cover no-repeat;`)
|
||||
.card-content
|
||||
.author-content-item-tips=game_tips
|
||||
span.author-content-item-title=game_title
|
||||
.content-bottom
|
||||
.icon-group
|
||||
.loading-bar(role='presentation', aria-hidden='true' style=`${game_title != "原神" ? "display: none": ""}`)
|
||||
.tips.game-yuanshen-uid=game_uid
|
||||
.author-content-item.comic-content
|
||||
.card-content
|
||||
- let {comic_tips, comic_title, comic_list} = item.comic
|
||||
.author-content-item-tips=comic_tips
|
||||
.author-content-item-title=comic_title
|
||||
.comic-box
|
||||
if comic_list
|
||||
each i in comic_list
|
||||
a.comic-item(href=i.href, target="_blank", title=i.name)
|
||||
.comic-item-cover
|
||||
img(src=i.cover, alt=i.name)
|
||||
|
||||
.author-content
|
||||
- let {music_tips, music_title, music_link, music_bg} = item.music
|
||||
- let {like_tips, like_title, like_bottom, like_bg} = item.like
|
||||
.author-content-item.like-technology(style=`background: url(${like_bg}) top / cover no-repeat;`)
|
||||
.card-content
|
||||
.author-content-item-tips=like_tips
|
||||
span.author-content-item-title=like_title
|
||||
.content-bottom
|
||||
.tips=like_bottom
|
||||
.author-content-item.like-music(style=`background: url(${music_bg}) top / cover no-repeat;`)
|
||||
.card-content
|
||||
.author-content-item-tips=music_tips
|
||||
span.author-content-item-title=music_title
|
||||
.content-bottom
|
||||
.tips=`跟 ${aboutName} 一起欣赏更多音乐`
|
||||
.banner-button-group
|
||||
a.banner-button(onclick=`pjax.loadUrl("${music_link}")`)
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-circle-right
|
||||
|
|
||||
span.banner-button-text 更多推荐
|
||||
|
||||
if page.content
|
||||
.author-content
|
||||
.create-site-post.author-content-item.single
|
||||
!= page.content
|
||||
|
||||
- let rawData = item.reward_list
|
||||
if rawData
|
||||
- let sortedByDate = rawData.slice().sort((a, b) => new Date(b.datatime) - new Date(a.datatime));
|
||||
.author-content
|
||||
.author-content-item.single.reward#about-reward
|
||||
.author-content-item-tips 致谢
|
||||
span.author-content-item-title 赞赏名单
|
||||
.author-content-item-description 感谢因为有你们,让我更加有创作的动力。
|
||||
.reward-list-all
|
||||
- let reward_list_amount = item.reward_list.sort((a,b)=>b.amount - a.amount)
|
||||
each item, index in reward_list_amount
|
||||
.reward-list-item
|
||||
.reward-list-item-name=item.name
|
||||
.reward-list-bottom-group
|
||||
if item.amount >= 50
|
||||
.reward-list-item-money(style='background:var(--anzhiyu-yellow)')=`¥${item.amount}`
|
||||
else
|
||||
.reward-list-item-money=`¥${item.amount + (item.suffix ? item.suffix : "")}`
|
||||
.datatime.reward-list-item-time(datatime=item.datatime)=new Date(item.datatime).toISOString().slice(0, -14)
|
||||
.reward-list-updateDate
|
||||
| 最新更新时间:
|
||||
time.datatime.reward-list-updateDate-time(datatime=sortedByDate[0].datatime)=new Date(sortedByDate[0].datatime).toISOString().slice(0, -14)
|
||||
.about-reward
|
||||
#con
|
||||
#TA-con(onclick="anzhiyu.rewardShowConsole()")
|
||||
#text-con
|
||||
#linght
|
||||
#TA 为TA充电
|
||||
#tube-con
|
||||
svg(viewBox='0 0 1028 385', fill='none', xmlns='http://www.w3.org/2000/svg')
|
||||
path(d='M1 77H234.226L307.006 24H790', stroke='#e5e9ef', stroke-width='20')
|
||||
path(d='M0 140H233.035L329.72 71H1028', stroke='#e5e9ef', stroke-width='20')
|
||||
path(d='M1 255H234.226L307.006 307H790', stroke='#e5e9ef', stroke-width='20')
|
||||
path(d='M0 305H233.035L329.72 375H1028', stroke='#e5e9ef', stroke-width='20')
|
||||
rect(y='186', width='236', height='24', fill='#e5e9ef')
|
||||
ellipse(cx='790', cy='25.5', rx='25', ry='25.5', fill='#e5e9ef')
|
||||
circle(r='14', transform='matrix(1 0 0 -1 790 25)', fill='white')
|
||||
ellipse(cx='790', cy='307.5', rx='25', ry='25.5', fill='#e5e9ef')
|
||||
circle(r='14', transform='matrix(1 0 0 -1 790 308)', fill='white')
|
||||
#mask
|
||||
svg(viewBox='0 0 1028 385', fill='none', xmlns='http://www.w3.org/2000/svg')
|
||||
path(d='M1 77H234.226L307.006 24H790', stroke='#f25d8e', stroke-width='20')
|
||||
path(d='M0 140H233.035L329.72 71H1028', stroke='#f25d8e', stroke-width='20')
|
||||
path(d='M1 255H234.226L307.006 307H790', stroke='#f25d8e', stroke-width='20')
|
||||
path(d='M0 305H233.035L329.72 375H1028', stroke='#f25d8e', stroke-width='20')
|
||||
rect(y='186', width='236', height='24', fill='#f25d8e')
|
||||
ellipse(cx='790', cy='25.5', rx='25', ry='25.5', fill='#f25d8e')
|
||||
circle(r='14', transform='matrix(1 0 0 -1 790 25)', fill='white')
|
||||
ellipse(cx='790', cy='307.5', rx='25', ry='25.5', fill='#f25d8e')
|
||||
circle(r='14', transform='matrix(1 0 0 -1 790 308)', fill='white')
|
||||
#orange-mask
|
||||
svg(viewBox='0 0 1028 385', fill='none', xmlns='http://www.w3.org/2000/svg')
|
||||
path(d='M1 77H234.226L307.006 24H790', stroke='#ffd52b', stroke-width='20')
|
||||
path(d='M0 140H233.035L329.72 71H1028', stroke='#ffd52b', stroke-width='20')
|
||||
path(d='M1 255H234.226L307.006 307H790', stroke='#ffd52b', stroke-width='20')
|
||||
path(d='M0 305H233.035L329.72 375H1028', stroke='#ffd52b', stroke-width='20')
|
||||
rect(y='186', width='236', height='24', fill='#ffd52b')
|
||||
ellipse(cx='790', cy='25.5', rx='25', ry='25.5', fill='#ffd52b')
|
||||
circle(r='14', transform='matrix(1 0 0 -1 790 25)', fill='white')
|
||||
ellipse(cx='790', cy='307.5', rx='25', ry='25.5', fill='#ffd52b')
|
||||
circle(r='14', transform='matrix(1 0 0 -1 790 308)', fill='white')
|
||||
p#people
|
||||
| 共
|
||||
b=item.reward_list.length
|
||||
| 人
|
||||
|
||||
|
||||
script(src=url_for(theme.asset.countup_js))
|
||||
- const ck = theme.LA.ck
|
||||
script(defer).
|
||||
function initAboutPage() {
|
||||
fetch("https://v6-widget.51.la/v6/#{ck}/quote.js")
|
||||
.then(res => res.text())
|
||||
.then(data => {
|
||||
let title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
|
||||
let num = data.match(/(<\/span><span>).*?(\/span><\/p>)/g);
|
||||
|
||||
num = num.map(el => {
|
||||
let val = el.replace(/(<\/span><span>)/g, "");
|
||||
let str = val.replace(/(<\/span><\/p>)/g, "");
|
||||
return str;
|
||||
});
|
||||
|
||||
let statisticEl = document.getElementById("statistic");
|
||||
|
||||
// 自定义不显示哪个或者显示哪个,如下为不显示 最近活跃访客 和 总访问量
|
||||
let statistic = [];
|
||||
for (let i = 0; i < num.length; i++) {
|
||||
if (!statisticEl) return;
|
||||
if (i == 0) continue;
|
||||
statisticEl.innerHTML +=
|
||||
"<div><span>" + title[i] + "</span><span id=" + title[i] + ">" + num[i] + "</span></div>";
|
||||
queueMicrotask(() => {
|
||||
statistic.push(
|
||||
new CountUp(title[i], 0, num[i], 0, 2, {
|
||||
useEasing: true,
|
||||
useGrouping: true,
|
||||
separator: ",",
|
||||
decimal: ".",
|
||||
prefix: "",
|
||||
suffix: "",
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
let statisticElement = document.querySelector(".about-statistic.author-content-item");
|
||||
function statisticUP() {
|
||||
if (!statisticElement) return;
|
||||
|
||||
const callback = (entries, observer) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
for (let i = 0; i < num.length; i++) {
|
||||
if (i == 0) continue;
|
||||
queueMicrotask(() => {
|
||||
statistic[i - 1].start();
|
||||
});
|
||||
}
|
||||
observer.disconnect(); // 停止观察元素,因为不再需要触发此回调
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const options = {
|
||||
root: null,
|
||||
rootMargin: "0px",
|
||||
threshold: 0
|
||||
};
|
||||
const observer = new IntersectionObserver(callback, options);
|
||||
observer.observe(statisticElement);
|
||||
}
|
||||
|
||||
const selfInfoContentYear = new CountUp("selfInfo-content-year", 0, #{selfInfoContentYear}, 0, 2, {
|
||||
useEasing: true,
|
||||
useGrouping: false,
|
||||
separator: ",",
|
||||
decimal: ".",
|
||||
prefix: "",
|
||||
suffix: "",
|
||||
});
|
||||
|
||||
let selfInfoContentYearElement = document.querySelector(".author-content-item.selfInfo.single");
|
||||
function selfInfoContentYearUp() {
|
||||
if (!selfInfoContentYearElement) return;
|
||||
|
||||
const callback = (entries, observer) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
selfInfoContentYear.start();
|
||||
observer.disconnect(); // 停止观察元素,因为不再需要触发此回调
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const options = {
|
||||
root: null,
|
||||
rootMargin: "0px",
|
||||
threshold: 0
|
||||
};
|
||||
const observer = new IntersectionObserver(callback, options);
|
||||
observer.observe(selfInfoContentYearElement);
|
||||
}
|
||||
|
||||
selfInfoContentYearUp();
|
||||
statisticUP()
|
||||
});
|
||||
|
||||
var pursuitInterval = null;
|
||||
pursuitInterval = setInterval(function () {
|
||||
const show = document.querySelector("span[data-show]");
|
||||
const next = show.nextElementSibling || document.querySelector(".first-tips");
|
||||
const up = document.querySelector("span[data-up]");
|
||||
|
||||
if (up) {
|
||||
up.removeAttribute("data-up");
|
||||
}
|
||||
|
||||
show.removeAttribute("data-show");
|
||||
show.setAttribute("data-up", "");
|
||||
|
||||
next.setAttribute("data-show", "");
|
||||
}, 2000);
|
||||
|
||||
document.addEventListener("pjax:send", function () {
|
||||
pursuitInterval && clearInterval(pursuitInterval);
|
||||
});
|
||||
|
||||
var helloAboutEl = document.querySelector(".hello-about");
|
||||
helloAboutEl.addEventListener("mousemove", evt => {
|
||||
const mouseX = evt.offsetX;
|
||||
const mouseY = evt.offsetY;
|
||||
gsap.set(".cursor", {
|
||||
x: mouseX,
|
||||
y: mouseY,
|
||||
});
|
||||
|
||||
gsap.to(".shape", {
|
||||
x: mouseX,
|
||||
y: mouseY,
|
||||
stagger: -0.1,
|
||||
});
|
||||
});
|
||||
}
|
||||
if (typeof gsap === "object") {
|
||||
initAboutPage()
|
||||
} else {
|
||||
getScript("!{url_for(theme.asset.gsap_js)}").then(initAboutPage);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#album
|
||||
- let album_background = page.top_background
|
||||
.author-content.author-content-item.album.single(style=`${album_background ? `background: url(${album_background}) top / cover no-repeat;` : ""}`)
|
||||
.card-content
|
||||
.author-content-item-tips 相册集
|
||||
span.author-content-item-title 这里是我的相册集哦😯
|
||||
.content-bottom
|
||||
.tips 每一张照片都是一次美好的记忆。
|
||||
.banner-button-group
|
||||
a.banner-button(onclick='pjax.loadUrl("/about/")')
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
|
||||
span.banner-button-text 关于本人
|
||||
.card-album
|
||||
each i in site.data.album
|
||||
.card(onclick=`pjax.loadUrl("${i.path_name}")`)
|
||||
img.card_cover(src=i.cover)
|
||||
.card__content
|
||||
p.card__category=i.class_name
|
||||
h3.card__heading=i.description
|
||||
.album-content-nocover
|
||||
.album-content-nocover
|
||||
.album-content-nocover
|
||||
@@ -0,0 +1,89 @@
|
||||
#album_detail
|
||||
each i in site.data.album
|
||||
- let path_name = (is_current(i.path_name)) ? true : false
|
||||
- type = i.type
|
||||
- let album_detail_background = i.top_background
|
||||
- let album_detail_top_link = i.top_link
|
||||
- let album_detail_top_btn_text = i.top_btn_text
|
||||
if (path_name && i.album_list)
|
||||
.author-content.author-content-item.album.single(style=`${album_detail_background ? `background: url(${album_detail_background}) top / cover no-repeat;` : ""}`)
|
||||
.card-content
|
||||
.author-content-item-tips 相册集
|
||||
span.author-content-item-title=i.class_name
|
||||
.content-bottom
|
||||
.tips=i.description
|
||||
.banner-button-group
|
||||
a.banner-button(onclick=`pjax.loadUrl("${url_for(album_detail_top_link ? album_detail_top_link : '/about')}")`, data-pjax-state)
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-circle-right(style='font-size: 1.5rem')
|
||||
span.banner-button-text=album_detail_top_btn_text ? album_detail_top_btn_text : "关于我"
|
||||
section.timeline.page-1
|
||||
if type == 1
|
||||
ul#waterfall.list
|
||||
each item, index in i.album_list
|
||||
li.album-item
|
||||
.album-content
|
||||
p.datacont= item.content
|
||||
if item.image
|
||||
.album-container-img
|
||||
each iten, indey in item.image
|
||||
a.album-content-img(href=item.image[indey], target="_blank", data-fancybox="gallery", data-caption="")
|
||||
img(src=item.image[indey])
|
||||
.album-content-noimg
|
||||
.album-content-noimg
|
||||
.album-content-noimg
|
||||
if item.aplayer
|
||||
.album-music
|
||||
.aplayer.no-destroy(data-id=item.aplayer.id data-server=item.aplayer.server data-type="song" data-order="list" data-preload="none" data-autoplay="false" data-mutex="true" data-theme='var(--anzhiyu-main)')
|
||||
hr
|
||||
.album-bottom
|
||||
.album-info
|
||||
.album-info-time
|
||||
- var datedata = new Date(item.date).toISOString()
|
||||
i.anzhiyufont.anzhiyu-icon-instagram
|
||||
time.datatime(datetime= item.date)= datedata
|
||||
if item.link
|
||||
a.album-content-link(target="_blank", title="跳转到短文指引的链接", href=item.link, rel="external nofollow")
|
||||
i.anzhiyufont.anzhiyu-icon-link
|
||||
| 链接
|
||||
if item.address
|
||||
.album-info-address
|
||||
i.anzhiyufont.anzhiyu-icon-location-dot
|
||||
span=item.address
|
||||
if item.from
|
||||
.album-info-from
|
||||
i.anzhiyufont.anzhiyu-icon-fw-fire
|
||||
span=item.from
|
||||
.album-reply(onclick="rm.rightMenuCommentText(" + `'${item.content}'` + ")")
|
||||
i.anzhiyufont.anzhiyu-icon-message
|
||||
else if type == 2
|
||||
.type-gallery
|
||||
- const rowHeight = i.rowHeight != "undefined" ? i.rowHeight : 220
|
||||
- const limit = i.limit != "undefined" ? i.limit : 10
|
||||
- const lazyload = i.lazyload != "undefined" ? i.lazyload : true
|
||||
- const lazyloadClass = lazyload == true ? "lazyload" : "";
|
||||
- const btn = i.btnLazyload != "undefined" ? i.btnLazyload : false
|
||||
- const btnLazyloadClass = btn == true ? " btn_album_detail_lazyload" : "";
|
||||
- const imgType = i.url ? " url" : " data";
|
||||
- let dataStr = []
|
||||
- let durl = i.url ?? false
|
||||
each item, index in i.album_list
|
||||
each iten, indey in item.image
|
||||
- let obj = {}
|
||||
- obj.url = iten
|
||||
- obj.alt = item.content
|
||||
- obj.title = item.content
|
||||
- obj.address = item.address
|
||||
- dataStr.push(obj)
|
||||
.gallery
|
||||
.fj-gallery(data-rowHeight=rowHeight data-limit=limit class=`${lazyloadClass + btnLazyloadClass + imgType}`)
|
||||
if durl
|
||||
span.gallery-data=durl
|
||||
else
|
||||
span.gallery-data=JSON.stringify(dataStr)
|
||||
if btn
|
||||
button.gallery-load-more
|
||||
span=_p('load_more')
|
||||
i.anzhiyufont.anzhiyu-icon-arrow-down
|
||||
else
|
||||
#album_detail_gallery_load_more
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#tag
|
||||
.category-lists#tag-page-tags!= tags_page_list("categories")
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user