mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
❤
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
db.json
|
||||
*.log
|
||||
node_modules/
|
||||
public/
|
||||
.deploy*/
|
101
_config.yml
Normal file
101
_config.yml
Normal file
@ -0,0 +1,101 @@
|
||||
# Hexo Configuration
|
||||
## Docs: https://hexo.io/docs/configuration.html
|
||||
## Source: https://github.com/hexojs/hexo/
|
||||
|
||||
# Site
|
||||
title: Defectink
|
||||
subtitle: ''
|
||||
description: ''
|
||||
keywords:
|
||||
author: Defectink
|
||||
language: cn
|
||||
timezone: ''
|
||||
|
||||
# URL
|
||||
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
|
||||
url: https://defect.ink
|
||||
root: /
|
||||
permalink: /defect/:url.html
|
||||
permalink_defaults:
|
||||
pretty_urls:
|
||||
trailing_index: true # Set to false to remove trailing 'index.html' 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
|
||||
highlight:
|
||||
enable: false
|
||||
line_number: true
|
||||
auto_detect: false
|
||||
tab_replace: ''
|
||||
wrap: true
|
||||
hljs: false
|
||||
|
||||
# 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
|
||||
## Use post's date for updated date unless set in front-matter
|
||||
use_date_for_updated: false
|
||||
|
||||
# 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: fluid
|
||||
|
||||
# Deployment
|
||||
## Docs: https://hexo.io/docs/deployment.html
|
||||
deploy:
|
||||
type: ''
|
3416
package-lock.json
generated
Normal file
3416
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
25
package.json
Normal file
25
package.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "hexo-site",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "hexo generate",
|
||||
"clean": "hexo clean",
|
||||
"deploy": "hexo deploy",
|
||||
"server": "hexo server"
|
||||
},
|
||||
"hexo": {
|
||||
"version": "4.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"hexo": "^4.0.0",
|
||||
"hexo-generator-archive": "^1.0.0",
|
||||
"hexo-generator-category": "^1.0.0",
|
||||
"hexo-generator-index": "^1.0.0",
|
||||
"hexo-generator-tag": "^1.0.0",
|
||||
"hexo-renderer-ejs": "^1.0.0",
|
||||
"hexo-renderer-stylus": "^1.1.0",
|
||||
"hexo-renderer-marked": "^2.0.0",
|
||||
"hexo-server": "^1.0.0"
|
||||
}
|
||||
}
|
4
scaffolds/draft.md
Normal file
4
scaffolds/draft.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
tags:
|
||||
---
|
4
scaffolds/page.md
Normal file
4
scaffolds/page.md
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
date: {{ date }}
|
||||
---
|
7
scaffolds/post.md
Normal file
7
scaffolds/post.md
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
title: {{ title }}
|
||||
date: {{ date }}
|
||||
tags:
|
||||
cates:
|
||||
url:
|
||||
---
|
40
source/_posts/hello-world.md
Normal file
40
source/_posts/hello-world.md
Normal file
@ -0,0 +1,40 @@
|
||||
---
|
||||
title: Hello World
|
||||
tags: test
|
||||
url: test
|
||||
---
|
||||
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)
|
7
themes/fluid/.gitignore
vendored
Normal file
7
themes/fluid/.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
.idea/
|
||||
.DS_Store
|
||||
*.log
|
||||
*.iml
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
node_modules/
|
168
themes/fluid/Changelog.md
Normal file
168
themes/fluid/Changelog.md
Normal file
@ -0,0 +1,168 @@
|
||||
### 2019/12/19
|
||||
|
||||
- 增加强制 HTTPS 功能
|
||||
- 修复搜索功能 BUG
|
||||
|
||||
### 2019/12/14
|
||||
|
||||
- 感谢 [@KiritoXF](https://github.com/KiritoXF) 贡献主题日语配置
|
||||
- 感谢 [@ss-xiong](https://github.com/ss-xiong) 贡献公安备案图标
|
||||
|
||||
### 2019/12/08
|
||||
|
||||
- 感谢 [@juukee](https://github.com/juukee) 贡献以下功能代码
|
||||
- 增加畅言评论插件
|
||||
- 增加来必力(Livere)评论插件
|
||||
- 增加 daovoice 在线聊天功能
|
||||
- 增加鼠标点击动效
|
||||
|
||||
### 2019/12/05
|
||||
|
||||
- TOC 增加滚动
|
||||
- 修复分类标签没有翻页
|
||||
- 暂时隐藏分类标签的计数
|
||||
- 修复多个已知 BUG
|
||||
|
||||
### 2019/11/03
|
||||
|
||||
- 感谢 [@julydate](https://github.com/julydate)
|
||||
提供了很多意见,以下均采纳自他的代码
|
||||
- 增加翻页的页码
|
||||
- 支持更多的网站统计
|
||||
- 优化 disqus 评论区的加载
|
||||
- 增加文章字数/阅读时间
|
||||
|
||||
### 2019/10/29
|
||||
|
||||
- 增加 LaTeX 语法公式的支持
|
||||
|
||||
### 2019/10/26
|
||||
|
||||
- 增加微信二维码悬浮框
|
||||
- 增加页面平滑滚动效果
|
||||
- 增加 PV 与 UV 统计
|
||||
|
||||
### 2019/10/20
|
||||
|
||||
- 增加谷歌统计配置
|
||||
- 代码行号可以通过 Hexo 配置关闭
|
||||
|
||||
### 2019/10/14
|
||||
|
||||
- 固定 Banner 在 iOS 和 Safari 环境下不再生效
|
||||
- 调整文章标题与日期的间隔
|
||||
|
||||
### 2019/9/17
|
||||
|
||||
- 替换新的 favicon
|
||||
- 新增图片懒加载功能
|
||||
- 优化首页摘要问题
|
||||
|
||||
### 2019/9/13
|
||||
|
||||
- 修复 valine 加载问题
|
||||
- 移除顶部进度条
|
||||
- 统一默认 banner_img
|
||||
- 增加英文 README
|
||||
|
||||
### 2019/9/11
|
||||
|
||||
- 增加 `_static_prefix.yml` 作为资源 URL 独立配置
|
||||
- 移除 `source_base_path` 配置项
|
||||
- 增加配置项 `about.md_path` 用于指定 about.md 的路径
|
||||
|
||||
### 2019/9/10
|
||||
|
||||
- 增加向下滚屏与向顶部滚屏的按钮
|
||||
- 优化导航栏配置
|
||||
|
||||
### 2019/9/9
|
||||
|
||||
- 更名为 Fluid 并迁移至 Fluid-dev organization
|
||||
- 增加一组配置项 `post_meta`,可配置首页一些元素的可见性
|
||||
|
||||
### 2019/9/3
|
||||
|
||||
- 增加一个配置项 `source_base_path` ,可配置资源文件的父级路径
|
||||
- 增加覆盖配置功能,彻底解决升级时的配置冲突
|
||||
- zh_CN.yml 修改为 zh-CN.yml
|
||||
- 修复 about.md 路径引用问题
|
||||
|
||||
### 2019/8/30
|
||||
|
||||
- 支持 i18n (zh-Hans,en)
|
||||
- 修复 #63
|
||||
|
||||
### 2019/8/22
|
||||
|
||||
- 新增 Utterances、Gitalk 评论系统
|
||||
- 新增本地搜索功能
|
||||
|
||||
### 2019/8/17
|
||||
|
||||
- 新增页面右上角的加载进度条
|
||||
- 新增配置项用于调整主题颜色
|
||||
- 优化一些样式
|
||||
|
||||
### 2019/8/15
|
||||
|
||||
- 使用 stylus 重构所有自定义 css
|
||||
- 新增标签归档、分类归档,重构归档页
|
||||
|
||||
### 2019/8/9
|
||||
|
||||
- 移动端适配,调整文章和 TOC 左右边
|
||||
- 文章图片增加阴影效果
|
||||
- 拆分 page 属性
|
||||
- 新增 404 页面
|
||||
|
||||
### 2019/8/2
|
||||
|
||||
- 新增 about 页自定义功能
|
||||
- 调整 about 页 icon 的配置写法
|
||||
- 增加百度统计
|
||||
- 调整 slogan 和标题
|
||||
- 调整代码高亮样式的优先级
|
||||
- 移动端优化
|
||||
|
||||
### 2019/8/1
|
||||
|
||||
- 新增 subtitle 打字机效果
|
||||
- 优化文章页中锚的效果
|
||||
- 文章页底部新增支持 HTML 的 custom 区域,可自定义展示赞赏码等内容
|
||||
- 优化配置文件和目录结构
|
||||
- package 升级并移至本地
|
||||
|
||||
### 2019/7/31
|
||||
|
||||
结合 @zkqiang 的优化建议:
|
||||
|
||||
- 文章页样式更换为 Github 风格
|
||||
- 增加页脚备案信息
|
||||
- 优化配置文件结构
|
||||
- 页面细节优化
|
||||
|
||||
### 2019/6/6
|
||||
|
||||
- 完善 archive 渲染逻辑
|
||||
|
||||
### 2019/3/15
|
||||
|
||||
- 重新设计基本完成,特别感谢 @zhugaoqi 同学的设计指导;
|
||||
- 将所有第三方库、图片替换为 CDN 引用,极大精简仓库大小;
|
||||
- 重新设计 archive 渲染逻辑;
|
||||
- 统一文章页布局,新增文章版权声明;
|
||||
- 精简页面,配置项;
|
||||
- 老版本逐渐放弃维护,代码归档在 `v0.9` 分支;
|
||||
|
||||
### 2019/1/28
|
||||
|
||||
1. _config.yml结构大改,图片路径统一为相对于根目录
|
||||
2. 可自定义index、archive、post、about页面的顶部图像高度(0 - 100)
|
||||
3. 文章页顶部图像可统一设置,也可文章内单独设置。优先级:文章内banner_img属性 > 主题配置
|
||||
4. 新增一种文章页布局,在配置文件中可选(post.layout)
|
||||
5. 新增默认摘要功能,可配置是否开启、默认字数。优先级:文章内<!-- more -->设置 > 主题配置
|
||||
6. 可自定义首页文章date、tags是否显示 (@喜欢首页只罗列文章标题的同学)
|
||||
7. 优化toc、字体尺寸,修复断行错误、图片超宽等问题
|
||||
8. 优化渲染逻辑,去除冗余js
|
||||
9. 新增多个bug
|
21
themes/fluid/LICENSE
Normal file
21
themes/fluid/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Fluid-dev organization
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
86
themes/fluid/README.md
Normal file
86
themes/fluid/README.md
Normal file
@ -0,0 +1,86 @@
|
||||
<p align="right">中文简体 | <a title="English" href="README_en.md">English</a></p>
|
||||
|
||||
<p align="center">
|
||||
<img alt="Fluid Logo" src="https://avatars2.githubusercontent.com/t/3419353?s=280&v=4" width="128">
|
||||
</p>
|
||||
|
||||
<p align="center">一款 Material Design 风格的主题</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/fluid-dev/hexo-theme-fluid/releases"><img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/fluid-dev/hexo-theme-fluid"></a>
|
||||
<a href="https://hexo.io/zh-cn/"><img alt="Hexo version" src="https://img.shields.io/badge/Hexo-3%2B-orange"></a>
|
||||
<a href="https://github.com/fluid-dev/hexo-theme-fluid/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/fluid-dev/hexo-theme-fluid.svg?style=flat"></a>
|
||||
<a href="https://github.com/fluid-dev/hexo-theme-fluid/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/fluid-dev/hexo-theme-fluid.svg?style=flat"></a>
|
||||
</p>
|
||||
|
||||

|
||||
|
||||
|
||||
## 示例
|
||||
|
||||
[Rook1e's blog](https://0x2e.github.io)
|
||||
|
||||
[zkqiang's blog](http://zkqiang.cn)
|
||||
|
||||
|
||||
## 文档
|
||||
|
||||
[使用指南](https://fluid-dev.github.io/hexo-fluid-docs/)
|
||||
|
||||
[更新日志](https://github.com/fluid-dev/hexo-theme-fluid/blob/master/Changelog.md)
|
||||
|
||||
[文章配置](https://hexo.io/zh-cn/docs/front-matter)
|
||||
|
||||
## 快速开始
|
||||
|
||||
#### 1. 获取最新版本
|
||||
|
||||
请优先下载 [最新 release 版本](https://github.com/fluid-dev/hexo-theme-fluid/releases),master 分支无法保证稳定。
|
||||
|
||||
下载后解压到 themes 目录下并重命名为 `fluid`。
|
||||
|
||||
#### 2. 必要的配置
|
||||
|
||||
必须修改 Hexo 根目录中的 `_config.yml`,关闭默认的代码高亮
|
||||
|
||||
```yaml
|
||||
highlight:
|
||||
enable: false
|
||||
```
|
||||
|
||||
#### 3. 指定主题
|
||||
|
||||
依然是根目录中的 `_config.yml`,如下修改:
|
||||
```yaml
|
||||
# Extensions
|
||||
theme: fluid
|
||||
```
|
||||
|
||||
## 常见问题
|
||||
|
||||
#### 代码高亮异常(比如出现多重行号)
|
||||
|
||||
- 没有按快速开始第二步关闭代码高亮
|
||||
|
||||
#### 配置无效
|
||||
|
||||
- 请检查配置文件是否符合 yml 语法,如冒号后需要有空格,缩进需要 2 个空格等
|
||||
|
||||
## 贡献者
|
||||
|
||||
[](https://github.com/fluid-dev/hexo-theme-fluid/graphs/contributors)
|
||||
|
||||
非 PR 贡献:@zhugaoqi [@julydate](https://github.com/julydate)
|
||||
|
||||
如你也想贡献代码,可参照[贡献指南](https://fluid-dev.github.io/hexo-fluid-docs/contribute/)
|
||||
|
||||
## 微信交流群
|
||||
|
||||
<p>
|
||||
<p>扫描后添加好友,<strong>回复「fluid」</strong>(在聊天回复,不是加好友验证)自动拉群</p>
|
||||
<img width="250" src="https://camo.githubusercontent.com/c4eecc5dcd28b9128d8af86b8fc80b526a605a1b/687474703a2f2f7374617469632e7a6b7169616e672e636e2f696d616765732f32303139313230363231313434342e6a7065672d736c696d">
|
||||
</p>
|
||||
|
||||
## Star 走势图
|
||||
|
||||
[](https://starchart.cc/fluid-dev/hexo-theme-fluid)
|
81
themes/fluid/README_en.md
Normal file
81
themes/fluid/README_en.md
Normal file
@ -0,0 +1,81 @@
|
||||
<p align="right">English | <a title="Chinese" href="README.md">中文简体</a></p>
|
||||
|
||||
<p align="center">
|
||||
<img alt="Fluid Logo" src="https://avatars2.githubusercontent.com/t/3419353?s=280&v=4" width="128">
|
||||
</p>
|
||||
|
||||
<p align="center">An elegant Material-Design theme for Hexo</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/fluid-dev/hexo-theme-fluid/releases"><img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/fluid-dev/hexo-theme-fluid"></a>
|
||||
<a href="https://hexo.io"><img alt="Hexo version" src="https://img.shields.io/badge/Hexo-3%2B-orange"></a>
|
||||
<a href="https://github.com/fluid-dev/hexo-theme-fluid/graphs/contributors"><img alt="Contributors" src="https://img.shields.io/github/contributors/fluid-dev/hexo-theme-fluid.svg?style=flat"></a>
|
||||
<a href="https://github.com/fluid-dev/hexo-theme-fluid/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/github/license/fluid-dev/hexo-theme-fluid.svg?style=flat"></a>
|
||||
</p>
|
||||
|
||||

|
||||
|
||||
|
||||
## Live Preview
|
||||
|
||||
[Rook1e's blog](https://0x2e.github.io)
|
||||
|
||||
[zkqiang's blog](http://zkqiang.cn)
|
||||
|
||||
## Quick Start
|
||||
|
||||
#### 1. Get the latest version
|
||||
|
||||
Please download the [latest release version](https://github.com/fluid-dev/hexo-theme-fluid/releases) first, and the master branch cannot guarantee stability.
|
||||
|
||||
After downloading, extract it to the themes directory and rename it to `fluid`.
|
||||
|
||||
#### 2. Necessary configuration
|
||||
|
||||
Modify `_config.yml` in the root directory as follows:
|
||||
|
||||
```yaml
|
||||
# Turn off default highlighting
|
||||
highlight:
|
||||
enable: false
|
||||
```
|
||||
|
||||
#### 3. Enable theme
|
||||
|
||||
Still the `_config.yml` in the root directory, modified as follows:
|
||||
```yaml
|
||||
# Extensions
|
||||
theme: fluid
|
||||
```
|
||||
|
||||
## Smooth upgrade
|
||||
|
||||
Starting with v1.4.0, you can use Hexo [data files](https://hexo.io/docs/data-files.html) to host theme configurations:
|
||||
|
||||
1. Go to the site's `/source/_data/` directory (note: not the `source` directory of the theme), create `_data` directory if it did not exist.
|
||||
2. Create `fluid_config.yml` and copy the modified or all configuration items from the theme configuration file into it. In this way, configuration item in `fluid_config.yml` will automatically override the theme's `_config.yml` when `hexo g` and will not be lost after updating the theme.
|
||||
3. Move your custom resource files (head_img, about.md, etc.) to site's `source` folder (don't forget to change the reference address for the resource in the configuration file)
|
||||
4. (v1.5.0 version and above) If you need to use a CDN or other means to store static resources: Copy theme's `_static_prefix.yml` to site's `/source/_data/`, rename it to `fluid_static_prefix.yml` and modify its configuration. If `_data/fluid_static_prefix.yml` exists, it will automatically overwrite theme's `_static_prefix.yml`.
|
||||
|
||||
After completing the above steps, in the future update, you only need to overwrite the `theme/fluid` folder with the new release.
|
||||
|
||||
## FAQ
|
||||
|
||||
#### Code highlighting exception
|
||||
|
||||
- Please confirm that the above "Turn off default highlighting" step has been completed.
|
||||
- Try "clean" command: `hexo clean && hexo g` `hexo clean && hexo g`
|
||||
|
||||
#### Configuration cannot take effect
|
||||
|
||||
- Please check if the configuration file conforms to the yml syntax, such as spaces after the colon, 2 spaces for indentation, etc.
|
||||
|
||||
## Contributors
|
||||
|
||||
[](https://github.com/fluid-dev/hexo-theme-fluid/graphs/contributors)
|
||||
|
||||
Contributors outside PR:@zhugaoqi [@julydate](https://github.com/julydate)
|
||||
|
||||
## Star chart
|
||||
|
||||
[](https://starchart.cc/fluid-dev/hexo-theme-fluid)
|
323
themes/fluid/_config.yml
Normal file
323
themes/fluid/_config.yml
Normal file
@ -0,0 +1,323 @@
|
||||
#---------------------------
|
||||
# Fluid
|
||||
# Author: Fluid-dev organization
|
||||
# Github: https://github.com/fluid-dev/hexo-theme-fluid
|
||||
#
|
||||
# 本配置的详细指南请见:https://fluid-dev.github.io/hexo-fluid-docs/guide/
|
||||
#---------------------------
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 全局
|
||||
# Site
|
||||
#---------------------------
|
||||
favicon: /img/favicon.png # 网站标签页的 icon
|
||||
|
||||
apple_touch_icon: /img/apple-touch-icon.png # 用于苹果设备的 icon
|
||||
|
||||
title_join_string: ' ~ ' # 浏览器标签页中的标题分隔符,效果: 文章名 ~ 站点名
|
||||
|
||||
force_https: false # 强制所有链接升级为 HTTPS(适用于图片等资源出现 HTTP 混入报错)
|
||||
|
||||
highlight: # 代码高亮
|
||||
enable: true
|
||||
theme: tomorrow-night-eighties # available: github-v2 | tomorrow | tomorrow-night | tomorrow-night-eighties,更多主题可从 https://jmblog.github.io/color-themes-for-google-code-prettify/ 获取,保存为 `*.min.css` 到 `source/lib/prettify/`,在其中 .prettyprint{ background: ***; ...} 的background 值后加上 !important,例如:.prettyprint{background:#fafbfc!important; ...}
|
||||
|
||||
fun_features: # 一些好玩的功能
|
||||
typing: # 为 subtitle 添加打字机效果
|
||||
enable: true
|
||||
typeSpeed: 70 # 打印速度
|
||||
cursorChar: "_" # 游标字符
|
||||
loop: false # 是否循环播放效果
|
||||
anchorjs: # 为文章内容中的标题添加锚图标
|
||||
enable: true
|
||||
element: h1,h2,h3,h4,h5,h6
|
||||
placement: right # icon放置的位置: left | right
|
||||
visible: false # 默认悬浮显示,可选:always(一会显示) | touch(移动端触摸显示)
|
||||
icon: "" # 可选:§ | # | ❡ 等,留空则为默认效果
|
||||
mouse_click: # 鼠标点击动效
|
||||
enable: false
|
||||
style: values # 目前设置两个值:values(价值观词汇) | love(爱心)
|
||||
|
||||
color: # 主体颜色配置,可以从这里寻找启发: https://www.webdesignrankings.com/resources/lolcolors/
|
||||
body_bg_color: "#eee"
|
||||
navbar_bg_color: "#2f4154"
|
||||
navbar_text_color: "white"
|
||||
text_color: "#3c4858"
|
||||
link_color: "#3c4858"
|
||||
link_hover_color: "#1abc9c"
|
||||
board_color: "#fff"
|
||||
|
||||
web_analytics: # 网页访问统计
|
||||
enable: true
|
||||
baidu: # 百度统计的Key,参见 https://tongji.baidu.com/sc-web/10000033910/home/site/getjs?siteId=13751376 代码获取中 hm.js? 后边的字符串
|
||||
google: # Google统计的Tracking ID,参见 https://analytics.google.com/analytics/web/
|
||||
tencent: # 腾讯统计的H5 App id,参见 https://mta.qq.com/h5/manage/ctr_app_manage
|
||||
woyaola: # 51.la站点统计ID,参见 https://www.51.la/user/site/index
|
||||
cnzz: # 友盟/cnzz站点统计web_id,参见 https://web.umeng.com/main.php?c=site&a=show
|
||||
|
||||
lazyload: # 对页面中的图片进行懒加载处理,可见范围外的图片不会加载
|
||||
enable: true
|
||||
onlypost: false # 仅在文章页使用懒加载
|
||||
|
||||
smooth_scroll: # 平滑滚动效果
|
||||
enable: true
|
||||
|
||||
daovoice: # 在线客服 Daovoice 参考:http://dashboard.daovoice.io
|
||||
enable: false # 是否开启在线客服聊天
|
||||
appid: '' # 应用ID设置
|
||||
|
||||
#---------------------------
|
||||
# 页头
|
||||
# Header
|
||||
#---------------------------
|
||||
navbar:
|
||||
blog_title: # 导航栏左侧的标题,为空则按 hexo config.title 显示
|
||||
menu: # 可自行增减,若想减去某个入口,可以将值留空,显示文本关联 languages
|
||||
home: /
|
||||
archive: /archives/
|
||||
category: /categories/
|
||||
tag: /tags/
|
||||
about: /about/
|
||||
#links: /links/ # 友链页,把前面#去掉即可展示
|
||||
|
||||
search: # 搜索栏
|
||||
enable: true
|
||||
path: /local-search.xml # 文件引用地址,默认是下方生成位置,也可以将生成后的 local-search.xml 上传到其它位置引用,如:https://www.example.com/local-search.xml
|
||||
generate_path: /local-search.xml # 文件生成位置,必须为相对位置
|
||||
field: post
|
||||
content: true
|
||||
|
||||
scroll_down_arrow: # 向下滚动的箭头
|
||||
enable: true
|
||||
banner_height_limit: 90 # 头图高度不小于指定比例,才显示箭头
|
||||
scroll_after_turning_page: true # 翻页后自动滚动
|
||||
|
||||
banner_scroll: false # 头图是否跟随页面滚动
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 页脚
|
||||
# Footer
|
||||
#---------------------------
|
||||
footer:
|
||||
statistics: # 统计网站 PV、UV,使用的是不蒜子,显示在页脚
|
||||
enable: true
|
||||
pv_format: "总访问量 {} 次" # 显示的文本,{}是数字的占位符(必须包含),下同
|
||||
uv_format: "总访客数 {} 人"
|
||||
|
||||
beian: # The footer of China's website policy, other areas keep disable
|
||||
enable: false
|
||||
icp_text: 京ICP证123456号 # ICP证号
|
||||
police_text: 京公网安备12345678号 # 公安备案号,不填则只显示ICP
|
||||
police_code: 12345678 # 公安备案的编号,用于URL跳转查询
|
||||
police_icon: /img/police_beian.png # 公安备案的图片. 为空时不显示备案图片
|
||||
|
||||
scroll_top_arrow: # 向顶部滚动的箭头
|
||||
enable: true
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 首页
|
||||
# Index Page
|
||||
#---------------------------
|
||||
index:
|
||||
banner_img: /img/default.png # 首页 Banner 头图,以下相同
|
||||
banner_img_height: 100 # 头图高度,屏幕百分比,available: 0 - 100
|
||||
slogan: # 首页副标题的独立设置
|
||||
enable: true # 为 false 则不显示任何内容
|
||||
text: # 为空则按 hexo config.subtitle 显示
|
||||
auto_excerpt:
|
||||
enable: true
|
||||
post_url_target: _self # available: _blank | _self
|
||||
post_meta: # 是否显示文章信息(时间、分类、标签)
|
||||
date: true
|
||||
category: true
|
||||
tag: true
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 文章页
|
||||
# Post Page
|
||||
#---------------------------
|
||||
post:
|
||||
banner_img: /img/default.png
|
||||
banner_img_height: 70 # available: 0 - 100
|
||||
meta: # 文章标题下方的信息
|
||||
date: # 文章日期
|
||||
enable: true
|
||||
format: "dddd, MMMM Do YYYY, h:mm a" # 格式参照 ISO-8601 日期格式化
|
||||
wordcount: # 字数统计
|
||||
enable: true
|
||||
format: "{} 字" # 显示的文本,{}是数字的占位符(必须包含),下同
|
||||
min2read: # 阅读时间
|
||||
enable: true
|
||||
format: "{} 分钟"
|
||||
views: # 阅读次数,统计基于不蒜子
|
||||
enable: true
|
||||
format: "{} 次"
|
||||
toc: # 右侧导航条
|
||||
enable: true
|
||||
copyright: # 版权声明
|
||||
enable: true
|
||||
content: '本博客所有文章除特别声明外,均采用 <a href="https://zh.wikipedia.org/wiki/Wikipedia:CC_BY-SA_3.0%E5%8D%8F%E8%AE%AE%E6%96%87%E6%9C%AC" rel="nofollow noopener">CC BY-SA 3.0协议</a> 。转载请注明出处!'
|
||||
custom: # 文章底部自定义内容
|
||||
enable: false
|
||||
content: '<img src="https://octodex.github.com/images/jetpacktocat.png" class="rounded mx-auto d-block mt-5" style="width:150px; height:150px;">' # 自定义区域,支持 HTML,可自行插入赞赏码、公众号二维码等内容
|
||||
comments: # 评论
|
||||
enable: false # 开启评论
|
||||
type: disqus # 指定使用的评论模块 available: disqus | valine | gitalk | utterances | changyan | livere
|
||||
image_zoom: # 文章图片可点击放大
|
||||
enable: true
|
||||
math: # 数学公式,开启之前需要更换 Markdown 渲染器,否则复杂公式会有兼容问题,具体请见 https://fluid-dev.github.io/hexo-fluid-docs/guide/#数学公式
|
||||
enable: false
|
||||
specific: false # 开启后,只有在文章 Front-matter 里指定 `math: true` 才会在文章页启动公式转换,以便在页面不包含公式时提高加载速度
|
||||
engine: mathjax # 公式引擎 available: mathjax | katex
|
||||
|
||||
#---------------------------
|
||||
# 评论
|
||||
# Comments
|
||||
#---------------------------
|
||||
|
||||
# 开启评论在上方的 post.comments 配置
|
||||
|
||||
# utterances
|
||||
# You can install utterances with https://utteranc.es/ and generate your configuration
|
||||
utterances:
|
||||
repo:
|
||||
issue_term:
|
||||
label: utterances
|
||||
theme: github-light
|
||||
crossorigin: anonymous
|
||||
|
||||
# Disqus
|
||||
disqus:
|
||||
shortname: # your shortname
|
||||
|
||||
# Gitalk
|
||||
# You can get yout ClientID and ClientSecret from https://github.com/settings/applications/new
|
||||
# More info available at https://github.com/gitalk/gitalk#options
|
||||
gitalk:
|
||||
clientID: # GitHub Application Client ID
|
||||
clientSecret: # GitHub Application Client Secret
|
||||
repo: # The repo to store comments
|
||||
owner: # GitHub repository owner. Can be personal user or organization.
|
||||
admin: # GitHub repo owner and collaborators, only these guys can initialize github issues, should be like "['admin']" or "['admin1','admin2']"
|
||||
id: location.pathname # The unique id of the page. Length must less than 50.
|
||||
language: zh-CN # Localization language key, en, zh-CN and zh-TW are currently available.
|
||||
labels: "['Gitalk']" # GitHub issue labels.
|
||||
perPage: 15 # Pagination size, with maximum 100.
|
||||
pagerDirection: last # Comment sorting direction, available values are last and first.
|
||||
distractionFreeMode: false # Facebook-like distraction free mode.
|
||||
createIssueManually: true # By default, Gitalk will create a corresponding github issue for your every single page automatically when the logined user is belong to the admin users. You can create it manually by setting this option to true.
|
||||
|
||||
# Valine
|
||||
# You can get your appid and appkey from https://leancloud.cn
|
||||
# More info available at https://valine.js.org
|
||||
valine:
|
||||
appid: # your leancloud application appid
|
||||
appkey: # your leancloud application appkey
|
||||
notify: false # mail notifier, See: https://github.com/xCss/Valine/wiki
|
||||
verify: false # Verification code
|
||||
placeholder: 说点什么 # comment box placeholder
|
||||
avatar: retro # gravatar style https://valine.js.org/avatar.html
|
||||
pageSize: 10 # pagination size
|
||||
|
||||
# Changyan
|
||||
# You can get your appid from http://changyan.kuaizhan.com/setting/common/isv-mgr
|
||||
# Install: http://changyan.kuaizhan.com/static/help/f-fitself.html
|
||||
changyan:
|
||||
appid: '' # your changyan application appid # 畅言ID
|
||||
conf: '' # conf # 畅言设置
|
||||
notify: false # beian warning message # 备案提示
|
||||
libopen: true # open laboratory # 畅言实验室功能开关
|
||||
cyEmoji: true # comments emoji # 评论表情
|
||||
cyWallsplugin: true # Hot text matching # 热文配图
|
||||
cyReping: true # hot comments # 热门评论
|
||||
cyReward: true # reward # 打赏
|
||||
cyQing: true # Light comment # 轻评论
|
||||
cyHotusers: true # User evaluation # 热评用户
|
||||
cyHotnews: true # Hot news # 热门新闻
|
||||
cyHotnewswall: true # News wall # 新闻墙
|
||||
cyPk: '' # Topic debate # 辩论
|
||||
cyPoll: true # vote # 投票
|
||||
cyBarrage: true # Picture barrage # 图片弹幕
|
||||
cyTvbarrage: true # Video barrage # 视频弹幕
|
||||
|
||||
# Livere 来必力
|
||||
# You can get your uid from https://www.livere.com/my_Livere
|
||||
livere:
|
||||
uid: '' # your livere application uid # 来必力ID
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 归档页
|
||||
# Archive Page
|
||||
#---------------------------
|
||||
archive:
|
||||
banner_img: /img/default.png
|
||||
banner_img_height: 80 # available: 0 - 100
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 分类归档页
|
||||
# Categories Page
|
||||
#---------------------------
|
||||
category:
|
||||
banner_img: /img/default.png
|
||||
banner_img_height: 80 # available: 0 - 100
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 标签归档页
|
||||
# Tags Page
|
||||
#---------------------------
|
||||
tag:
|
||||
banner_img: /img/default.png
|
||||
banner_img_height: 80 # available: 0 - 100
|
||||
tagcloud: # 标签云
|
||||
min_font: 15
|
||||
max_font: 30
|
||||
unit: px # 字号单位
|
||||
start_color: "#BBBBEE"
|
||||
end_color: "#337ab7"
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 关于页
|
||||
# About Page
|
||||
#---------------------------
|
||||
about: # 以下仅为页面顶部的基本信息,更多内容请在 ./pages/about.md 中编辑,支持 markdown 和 HTML
|
||||
md_path: ./pages/about.md # 关于页文档的相对路径,可以按相对文档设置主题之外的路径,从而避免更新冲突
|
||||
banner_img: /img/default.png
|
||||
banner_img_height: 80 # available: 0 - 100
|
||||
avatar: /img/avatar.png # 头像
|
||||
name: myname
|
||||
introduce: info / info / info # 支持 HTML
|
||||
icons: # 更多图标可从 https://fontawesome.com/v5.10.0/icons?d=gallery 查找,并以 "图标名: url" 的格式添加在下方
|
||||
"fab fa-github": https://github.com
|
||||
"fab fa-twitter": https://twitter.com
|
||||
"fab fa-weixin": # 微信图标,这个是特殊图标,点击不会跳转而是悬浮二维码,所以链接需要对应二维码图片地址
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 404页
|
||||
# 404 Page
|
||||
#---------------------------
|
||||
page404:
|
||||
banner_img: /img/default.png
|
||||
banner_img_height: 80 # available: 0 - 100
|
||||
subtitle: 'Page not found'
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 友链页
|
||||
# Links Page
|
||||
#---------------------------
|
||||
links:
|
||||
banner_img: /img/default.png
|
||||
banner_img_height: 80 # available: 0 - 100
|
||||
items:
|
||||
Fluid Docs: [https://fluid-dev.github.io/hexo-fluid-docs/, 主题使用指南]
|
||||
Fluid Repo: [https://github.com/fluid-dev/hexo-theme-fluid, 主题 GitHub 仓库]
|
||||
Fluid Changelog: [https://github.com/fluid-dev/hexo-theme-fluid/blob/master/Changelog.md, 主题更新日志]
|
66
themes/fluid/_static_prefix.yml
Normal file
66
themes/fluid/_static_prefix.yml
Normal file
@ -0,0 +1,66 @@
|
||||
#---------------------------
|
||||
# Fluid
|
||||
# Author: Fluid-dev organization
|
||||
# Github: https://github.com/fluid-dev/hexo-theme-fluid
|
||||
#---------------------------
|
||||
|
||||
#---------------------------
|
||||
# 这里是配置 JS CSS 静态资源的 URL 前缀,可以自定义成 CDN 地址,
|
||||
# 请注意,您最好使用与内部版本相同的版本,以避免潜在的问题,
|
||||
# 在站点上启用 https 时,请使用 CDN 地址的 https 协议,
|
||||
# 同样,这里的配置也支持覆盖功能
|
||||
# ** 如果你不知道如何设置,请不要做任何改动 **
|
||||
#
|
||||
# Here is the url prefix to configure JS and CSS static assets. Set CDN addresses you want to customize.
|
||||
# Be aware that you would better use the same version as internal ones to avoid potential problems.
|
||||
# Please use the https protocol of CDN files when you enable https on your site.
|
||||
# the configuration here supports overwrite
|
||||
# DO NOT EDIT THE FOLLOWING SETTINGS UNLESS YOU KNOW WHAT YOU ARE DOING
|
||||
#---------------------------
|
||||
|
||||
#---------------------------
|
||||
# 内部静态
|
||||
# Internal static
|
||||
#---------------------------
|
||||
|
||||
internal_js: /js
|
||||
internal_css: /css
|
||||
internal_img: /img
|
||||
|
||||
|
||||
#---------------------------
|
||||
# 第三方库
|
||||
# Third-party library
|
||||
#---------------------------
|
||||
|
||||
anchor: /lib/anchor
|
||||
|
||||
font_awesome: /lib/font-awesome
|
||||
|
||||
github_markdown: /lib/github-markdown
|
||||
|
||||
jquery: /lib/jquery
|
||||
|
||||
bootstrap: /lib/bootstrap
|
||||
|
||||
mdbootstrap: /lib/mdbootstrap
|
||||
|
||||
# umd
|
||||
popper: /lib/popper
|
||||
|
||||
prettify: /lib/prettify
|
||||
# 高亮主题的路径,只支持 min.css,文件名需要与 _config.highlight.theme 对应
|
||||
# the path of highlight theme, only support `min.css` file,filename need to be the same as _config.highlight.theme
|
||||
prettify_theme: /lib/prettify
|
||||
|
||||
tocbot: /lib/tocbot
|
||||
|
||||
typed: /lib/typed
|
||||
|
||||
fancybox: /lib/fancybox
|
||||
|
||||
smooth_scroll: /lib/smoothscroll
|
||||
|
||||
mathjax: https://cdn.staticfile.org/mathjax/2.7.6/
|
||||
|
||||
katex: /lib/katex
|
42
themes/fluid/languages/en.yml
Normal file
42
themes/fluid/languages/en.yml
Normal file
@ -0,0 +1,42 @@
|
||||
search:
|
||||
title: Search
|
||||
keyword: keyword
|
||||
status:
|
||||
success: v
|
||||
error: x
|
||||
|
||||
postTotal: "%d posts in total."
|
||||
|
||||
paginator:
|
||||
pre: Previous
|
||||
next: Next
|
||||
|
||||
post:
|
||||
toc: TOC
|
||||
|
||||
home:
|
||||
title: Home
|
||||
|
||||
archive:
|
||||
title: Archives
|
||||
subtitle: Archive
|
||||
|
||||
tag:
|
||||
title: Tags
|
||||
subtitle: Tag
|
||||
|
||||
category:
|
||||
title: Categories
|
||||
subtitle: Category
|
||||
|
||||
about:
|
||||
title: About
|
||||
subtitle: About
|
||||
|
||||
page404:
|
||||
title: Page not found
|
||||
subtitle: Oops, Page not found...
|
||||
|
||||
links:
|
||||
title: Links
|
||||
subtitle: Links
|
42
themes/fluid/languages/ja.yml
Normal file
42
themes/fluid/languages/ja.yml
Normal file
@ -0,0 +1,42 @@
|
||||
search:
|
||||
title: 検索
|
||||
keyword: キーワード
|
||||
status:
|
||||
success: v
|
||||
error: x
|
||||
|
||||
postTotal: 合計 %d 件のポスト
|
||||
|
||||
paginator:
|
||||
pre: 前のページ
|
||||
next: 次のページ
|
||||
|
||||
post:
|
||||
toc: ディレクトリ
|
||||
|
||||
home:
|
||||
title: ホーム
|
||||
|
||||
archive:
|
||||
title: アーカイブ
|
||||
subtitle: アーカイブ
|
||||
|
||||
tag:
|
||||
title: タグ
|
||||
subtitle: タグ
|
||||
|
||||
category:
|
||||
title: カテゴリー
|
||||
subtitle: カテゴリー
|
||||
|
||||
about:
|
||||
title: 本ブログ情報
|
||||
subtitle: 本ブログ情報
|
||||
|
||||
page404:
|
||||
title: ページが見つかりませんでした
|
||||
subtitle: ページが見つかりませんでした
|
||||
|
||||
links:
|
||||
title: 相互リンク
|
||||
subtitle: 相互リンク
|
42
themes/fluid/languages/zh-CN.yml
Normal file
42
themes/fluid/languages/zh-CN.yml
Normal file
@ -0,0 +1,42 @@
|
||||
search:
|
||||
title: 搜索
|
||||
keyword: 关键词
|
||||
status:
|
||||
success: v
|
||||
error: x
|
||||
|
||||
postTotal: 共计 %d 篇文章
|
||||
|
||||
paginator:
|
||||
pre: 上一页
|
||||
next: 下一页
|
||||
|
||||
post:
|
||||
toc: 目录
|
||||
|
||||
home:
|
||||
title: 首页
|
||||
|
||||
archive:
|
||||
title: 归档
|
||||
subtitle: 归档
|
||||
|
||||
tag:
|
||||
title: 标签
|
||||
subtitle: 标签
|
||||
|
||||
category:
|
||||
title: 分类
|
||||
subtitle: 分类
|
||||
|
||||
about:
|
||||
title: 关于
|
||||
subtitle: 关于
|
||||
|
||||
page404:
|
||||
title: 页面走丢啦~
|
||||
subtitle: 页面走丢啦~
|
||||
|
||||
links:
|
||||
title: 友链
|
||||
subtitle: 友情链接
|
15
themes/fluid/layout/404.ejs
Normal file
15
themes/fluid/layout/404.ejs
Normal file
@ -0,0 +1,15 @@
|
||||
<%
|
||||
page.layout = "404"
|
||||
page.title = __('page404.title')
|
||||
page.subtitle = theme.page404.subtitle || __('page404.subtitle')
|
||||
page.banner_img = theme.page404.banner_img
|
||||
page.banner_img_height = theme.page404.banner_img_height
|
||||
%>
|
||||
|
||||
<script>
|
||||
function redirect() {
|
||||
location.href = "/";
|
||||
}
|
||||
|
||||
//setTimeout(redirect, 3000)
|
||||
</script>
|
19
themes/fluid/layout/_partial/beian.ejs
Normal file
19
themes/fluid/layout/_partial/beian.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<% if(theme.footer.beian.enable) { %>
|
||||
<!-- 备案信息 -->
|
||||
<a href="http://beian.miit.gov.cn/" target="_blank"
|
||||
rel="nofollow noopener"><%- theme.footer.beian.icp_text %></a>
|
||||
<% if(theme.footer.beian.police_text && theme.footer.beian.police_code) { %>
|
||||
<a
|
||||
href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=<%- theme.footer.beian.police_code %>"
|
||||
rel="nofollow noopener"
|
||||
class="police-beian"
|
||||
target="_blank"
|
||||
>
|
||||
<span class="police-beian-sep"> | </span>
|
||||
<% if(theme.footer.beian.police_icon) { %>
|
||||
<img src="<%- theme.footer.beian.police_icon%>" />
|
||||
<% } %>
|
||||
<span><%- theme.footer.beian.police_text %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
<% } %>
|
15
themes/fluid/layout/_partial/busuanzi.ejs
Normal file
15
themes/fluid/layout/_partial/busuanzi.ejs
Normal file
@ -0,0 +1,15 @@
|
||||
<% if(theme.footer.statistics.enable) { %>
|
||||
<% if (theme.footer.statistics.pv_format) { %>
|
||||
<!-- 不蒜子统计PV -->
|
||||
<% var pv_texts = theme.footer.statistics.pv_format.split('{}') %>
|
||||
<span id="busuanzi_container_site_pv"></span><%= pv_texts[0] %>
|
||||
<span id="busuanzi_value_site_pv"></span><%= pv_texts[1] %>
|
||||
<% } %>
|
||||
<% if (theme.footer.statistics.uv_format) { %>
|
||||
<!-- 不蒜子统计UV -->
|
||||
<% var uv_texts = theme.footer.statistics.uv_format.split('{}') %>
|
||||
<span id="busuanzi_container_site_uv"></span><%= uv_texts[0] %>
|
||||
<span id="busuanzi_value_site_uv"></span><%= uv_texts[1] %>
|
||||
<% } %>
|
||||
<br>
|
||||
<% } %>
|
44
themes/fluid/layout/_partial/comments/changyan.ejs
Normal file
44
themes/fluid/layout/_partial/comments/changyan.ejs
Normal file
@ -0,0 +1,44 @@
|
||||
<% if(theme.changyan.appid){ %>
|
||||
<!--PC和WAP自适应版-->
|
||||
<div id="SOHUCS" sid='<%= page.permalink %>'></div>
|
||||
<script type="text/javascript">
|
||||
(function () {
|
||||
var appid = '<%= theme.changyan.appid %>';
|
||||
var conf = '<%= theme.changyan.conf %>';
|
||||
var width = window.innerWidth || document.documentElement.clientWidth;
|
||||
if (width < 960) {
|
||||
var head = document.getElementsByTagName('head')[0] || document.head || document.documentElement;
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.charset = 'utf-8';
|
||||
script.id = 'changyan_mobile_js';
|
||||
script.src = 'https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf;
|
||||
head.appendChild(script);
|
||||
} else {
|
||||
var loadJs = function (d, a) {
|
||||
var c = document.getElementsByTagName('head')[0] || document.head || document.documentElement;
|
||||
var b = document.createElement('script');
|
||||
b.setAttribute('type', 'text/javascript');
|
||||
b.setAttribute('charset', 'UTF-8');
|
||||
b.setAttribute('src', d);
|
||||
if (typeof a === 'function') {
|
||||
if (window.attachEvent) {
|
||||
b.onreadystatechange = function () {
|
||||
var e = b.readyState;
|
||||
if (e === 'loaded' || e === 'complete') {
|
||||
b.onreadystatechange = null;
|
||||
a();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
b.onload = a;
|
||||
}
|
||||
}
|
||||
c.appendChild(b);
|
||||
};
|
||||
loadJs('https://changyan.sohu.com/upload/changyan.js', function () {
|
||||
window.changyan.api.config({ appid: appid, conf: conf });
|
||||
});
|
||||
}
|
||||
})(); </script>
|
||||
<% } %>
|
21
themes/fluid/layout/_partial/comments/disqus.ejs
Normal file
21
themes/fluid/layout/_partial/comments/disqus.ejs
Normal file
@ -0,0 +1,21 @@
|
||||
<% if (theme.disqus.shortname) { %>
|
||||
<div class="disqus" style="width:100%">
|
||||
<div id="disqus_thread"></div>
|
||||
<script>
|
||||
var disqus_config = function () {
|
||||
this.page.url = '<%= config.url %>/<%= page.path %>';
|
||||
this.page.identifier = '/<%= page.path %>';
|
||||
};
|
||||
var oldLoad = window.onload;
|
||||
window.onload = function () {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.type = 'text/javascript';
|
||||
s.src = '//' + '<%- theme.disqus.shortname %>' + '.disqus.com/embed.js';
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
};
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow noopener">comments
|
||||
powered by Disqus.</a></noscript>
|
||||
</div>
|
||||
<% } %>
|
23
themes/fluid/layout/_partial/comments/gitalk.ejs
Normal file
23
themes/fluid/layout/_partial/comments/gitalk.ejs
Normal file
@ -0,0 +1,23 @@
|
||||
<% if(theme.gitalk.clientID && theme.gitalk.clientSecret && theme.gitalk.repo){ %>
|
||||
<div id="gitalk-container"></div>
|
||||
<link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css">
|
||||
<script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.11.1/js/md5.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var gitalk = new Gitalk({
|
||||
clientID: '<%- theme.gitalk.clientID %>',
|
||||
clientSecret: '<%- theme.gitalk.clientSecret %>',
|
||||
repo: '<%- theme.gitalk.repo %>',
|
||||
owner: '<%- theme.gitalk.owner %>',
|
||||
admin: '<%- theme.gitalk.admin %>',
|
||||
id: md5(<%- theme.gitalk.id %>),
|
||||
language: '<%- theme.gitalk.language %>',
|
||||
perPage: <%- theme.gitalk.perPage %>,
|
||||
pagerDirection: '<%- theme.gitalk.pagerDirection %>',
|
||||
createIssueManually: '<%- theme.gitalk.createIssueManually %>',
|
||||
distractionFreeMode: '<%- theme.gitalk.distractionFreeMode %>'
|
||||
});
|
||||
|
||||
gitalk.render('gitalk-container')
|
||||
</script>
|
||||
<% } %>
|
21
themes/fluid/layout/_partial/comments/livere.ejs
Normal file
21
themes/fluid/layout/_partial/comments/livere.ejs
Normal file
@ -0,0 +1,21 @@
|
||||
<% if(theme.livere.uid){ %>
|
||||
<!-- 来必力City版安装代码 -->
|
||||
<div id="lv-container" data-id="city" data-uid="<%= theme.livere.uid %>">
|
||||
<script type="text/javascript">
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
|
||||
if (typeof LivereTower === 'function') { return; }
|
||||
|
||||
j = d.createElement(s);
|
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||
j.async = true;
|
||||
|
||||
e.parentNode.insertBefore(j, e);
|
||||
})(document, 'script');
|
||||
</script>
|
||||
<noscript> 为正常使用来必力评论功能请激活JavaScript</noscript>
|
||||
</div>
|
||||
<!-- City版安装代码已完成 -->
|
||||
<% } %>
|
||||
|
12
themes/fluid/layout/_partial/comments/utterances.ejs
Normal file
12
themes/fluid/layout/_partial/comments/utterances.ejs
Normal file
@ -0,0 +1,12 @@
|
||||
<% if(theme.utterances.repo && theme.utterances.issue_term){ %>
|
||||
<script defer src="https://utteranc.es/client.js"
|
||||
repo="<%- theme.utterances.repo %>"
|
||||
issue-term="<%- theme.utterances.issue_term %>"
|
||||
<% if(theme.utterances.label != null ){ %>
|
||||
label="<%- theme.utterances.label %>"
|
||||
<% } %>
|
||||
theme="<%- theme.utterances.theme %>"
|
||||
crossorigin="<%- theme.utterances.crossorigin %>"
|
||||
async>
|
||||
</script>
|
||||
<% } %>
|
27
themes/fluid/layout/_partial/comments/valine.ejs
Normal file
27
themes/fluid/layout/_partial/comments/valine.ejs
Normal file
@ -0,0 +1,27 @@
|
||||
<% if(theme.valine.appid && theme.valine.appkey){ %>
|
||||
<div id="vcomments" style="width: 90%; margin: 0 auto;"></div>
|
||||
<script defer src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
|
||||
<script defer src="//unpkg.com/valine/dist/Valine.min.js"></script>
|
||||
|
||||
<script>
|
||||
var notify = '<%= theme.valine.notify %>' === true;
|
||||
var verify = '<%= theme.valine.verify %>' === true;
|
||||
var oldLoad = window.onload;
|
||||
window.onload = function () {
|
||||
new Valine({
|
||||
el: '#vcomments',
|
||||
notify: notify,
|
||||
verify: verify,
|
||||
app_id: "<%= theme.valine.appid %>",
|
||||
app_key: "<%= theme.valine.appkey %>",
|
||||
placeholder: "<%= theme.valine.placeholder %>",
|
||||
avatar: "<%= theme.valine.avatar %>",
|
||||
meta: ['nick', 'mail', 'link'],
|
||||
pageSize: "<%= theme.valine.pageSize %>",
|
||||
});
|
||||
oldLoad && oldLoad();
|
||||
};
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="https://valine.js.org" rel="nofollow noopener">comments
|
||||
powered by Valine.</a></noscript>
|
||||
<% } %>
|
14
themes/fluid/layout/_partial/css.ejs
Normal file
14
themes/fluid/layout/_partial/css.ejs
Normal file
@ -0,0 +1,14 @@
|
||||
<%- css_ex(theme.static_prefix.font_awesome, "css/all.min.css") %>
|
||||
<%- css_ex(theme.static_prefix.bootstrap, "css/bootstrap.min.css") %>
|
||||
<%- css_ex(theme.static_prefix.mdbootstrap, "css/mdb.min.css") %>
|
||||
<%- css_ex(theme.static_prefix.github_markdown, "github-markdown.min.css") %>
|
||||
<%- css("//at.alicdn.com/t/font_1067060_qzomjdt8bmp.css") %>
|
||||
|
||||
<% if(theme.highlight.enable){ %>
|
||||
<%- css_ex(theme.static_prefix.prettify_theme, theme.highlight.theme + '.min.css') %>
|
||||
<% } %>
|
||||
<%- css_ex(theme.static_prefix.internal_css, "main.css") %>
|
||||
|
||||
<% if (is_post && theme.post.image_zoom.enable) { %>
|
||||
<%- css_ex(theme.static_prefix.fancybox, "jquery.fancybox.min.css") %>
|
||||
<% } %>
|
21
themes/fluid/layout/_partial/footer.ejs
Normal file
21
themes/fluid/layout/_partial/footer.ejs
Normal file
@ -0,0 +1,21 @@
|
||||
<footer class="mt-5">
|
||||
<div class="text-center py-3">
|
||||
<a href="https://hexo.io" target="_blank" rel="nofollow noopener"><b>Hexo</b></a>
|
||||
<i class="iconfont icon-love"></i>
|
||||
<a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"> <b>Fluid</b></a>
|
||||
<br>
|
||||
|
||||
<%- partial('_partial/busuanzi.ejs') %>
|
||||
|
||||
<%- partial('_partial/beian.ejs') %>
|
||||
|
||||
<!-- cnzz Analytics icon -->
|
||||
<% if(theme.web_analytics.cnzz) { %>
|
||||
<span id="cnzz_stat_icon_<%- theme.web_analytics.cnzz %>" style="display: none"></span>
|
||||
<% } %>
|
||||
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- SCRIPTS -->
|
||||
<%- partial('_partial/scripts.ejs') %>
|
25
themes/fluid/layout/_partial/head.ejs
Normal file
25
themes/fluid/layout/_partial/head.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<%
|
||||
var joinStr = theme.title_join_string
|
||||
var title = config.title
|
||||
if (page.title) {
|
||||
title = [page.title, title].join(joinStr)
|
||||
}
|
||||
%>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="<%- url_for(theme.apple_touch_icon) %>">
|
||||
<link rel="icon" type="image/png" href="<%- url_for(theme.favicon) %>">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<% if (theme.force_https) { %>
|
||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
||||
<% } %>
|
||||
<meta name="description" content="<%= config.description %>">
|
||||
<meta name="author" content="<%= config.author %>">
|
||||
<meta name="keywords" content="<%= config.keywords %>">
|
||||
<title><%= title %></title>
|
||||
|
||||
<%- partial('_partial/css.ejs') %>
|
||||
</head>
|
35
themes/fluid/layout/_partial/nav.ejs
Normal file
35
themes/fluid/layout/_partial/nav.ejs
Normal file
@ -0,0 +1,35 @@
|
||||
<nav id="navbar" class="navbar fixed-top navbar-expand-lg navbar-dark scrolling-navbar">
|
||||
<div class="container">
|
||||
<a class="navbar-brand"
|
||||
href="<%- url_for() %>"> <strong><%- theme.navbar.blog_title || config.title %></strong> </a>
|
||||
|
||||
<button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
|
||||
data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<div class="animated-icon"><span></span><span></span><span></span></div>
|
||||
</button>
|
||||
|
||||
<!-- Collapsible content -->
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ml-auto text-center">
|
||||
<% for(const each in theme.navbar.menu) { %>
|
||||
<% var link = theme.navbar.menu[each] %>
|
||||
<% if (!link) continue %>
|
||||
<% var text = __(each + '.title') || each %>
|
||||
<% if (text.indexOf('.title') !== -1) {
|
||||
text = each
|
||||
} %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<%- url_for(link) %>"><%- text %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
<% if(theme.search.enable) { %>
|
||||
<li class="nav-item" id="search-btn">
|
||||
<a class="nav-link" data-toggle="modal" data-target="#modalSearch"> <i
|
||||
class="iconfont icon-search"></i> </a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
18
themes/fluid/layout/_partial/paginator.ejs
Normal file
18
themes/fluid/layout/_partial/paginator.ejs
Normal file
@ -0,0 +1,18 @@
|
||||
<% if (page.total > 1){ %>
|
||||
<nav aria-label="index posts navigation">
|
||||
<span class="pagination pg-blue justify-content-center mt-5" id="pagination">
|
||||
<%- paginator({
|
||||
prev_text: '<i class="fas fa-angle-double-left"></i>',
|
||||
next_text: '<i class="fas fa-angle-double-right"></i>',
|
||||
mid_size: 2,
|
||||
escape: false
|
||||
}) %>
|
||||
</span>
|
||||
</nav>
|
||||
<% var point = theme.scroll_down_arrow.scroll_after_turning_page ? '#board' : '' %>
|
||||
<script>
|
||||
for (ele of document.getElementById("pagination").getElementsByClassName("page-number")) {
|
||||
ele.href += '<%- point %>';
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
60
themes/fluid/layout/_partial/plugins/analytics.ejs
Normal file
60
themes/fluid/layout/_partial/plugins/analytics.ejs
Normal file
@ -0,0 +1,60 @@
|
||||
<% if (theme.web_analytics.enable) { %>
|
||||
|
||||
<% if(theme.web_analytics.baidu) { %>
|
||||
<!-- Baidu Analytics -->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function () {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?<%= theme.web_analytics.baidu %>";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.web_analytics.google){ %>
|
||||
<!-- Google Analytics -->
|
||||
<script>
|
||||
(function (i, s, o, g, r, a, m) {
|
||||
i['GoogleAnalyticsObject'] = r;
|
||||
i[r] = i[r] || function () {
|
||||
(i[r].q = i[r].q || []).push(arguments)
|
||||
}, i[r].l = 1 * new Date();
|
||||
a = s.createElement(o),
|
||||
m = s.getElementsByTagName(o)[0];
|
||||
a.async = 1;
|
||||
a.src = g;
|
||||
m.parentNode.insertBefore(a, m)
|
||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
|
||||
|
||||
ga('create', '<%= theme.web_analytics.google %>', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.web_analytics.tencent) { %>
|
||||
<!-- Tencent Analytics -->
|
||||
<script>
|
||||
var _mtac = {};
|
||||
(function () {
|
||||
var mta = document.createElement("script");
|
||||
mta.src = "//pingjs.qq.com/h5/stats.js?v2.0.4";
|
||||
mta.setAttribute("name", "MTAH5");
|
||||
mta.setAttribute("sid", "<%= theme.web_analytics.tencent %>");
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(mta, s);
|
||||
})();
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.web_analytics.woyaola) { %>
|
||||
<!-- 51.la Analytics -->
|
||||
<script type="text/javascript" src="//js.users.51.la/<%= theme.web_analytics.woyaola %>.js"></script>
|
||||
<% } %>
|
||||
|
||||
<!-- cnzz Analytics -->
|
||||
<% if(theme.web_analytics.cnzz) { %>
|
||||
<script src="//s4.cnzz.com/z_stat.php?id=<%- theme.web_analytics.cnzz %>&show=pic" type="text/javascript"></script>
|
||||
<% } %>
|
||||
<% } %>
|
18
themes/fluid/layout/_partial/plugins/anchor.ejs
Normal file
18
themes/fluid/layout/_partial/plugins/anchor.ejs
Normal file
@ -0,0 +1,18 @@
|
||||
<% if(theme.fun_features.anchorjs.enable){ %>
|
||||
<%- js_ex(theme.static_prefix.anchor, "/anchor.min.js") %>
|
||||
<script>
|
||||
anchors.options = {
|
||||
placement: "<%- theme.fun_features.anchorjs.placement %>",
|
||||
visible: "<%- theme.fun_features.anchorjs.visible %>",
|
||||
<% if(theme.fun_features.anchorjs.icon != ""){ %>
|
||||
icon: "<%- theme.fun_features.anchorjs.icon %>"
|
||||
<% } %>
|
||||
};
|
||||
var el = "<%- theme.fun_features.anchorjs.element || 'h1,h2,h3,h4,h5,h6' %>".split(",");
|
||||
var res = [];
|
||||
for (item of el) {
|
||||
res.push(".markdown-body > " + item)
|
||||
}
|
||||
anchors.add(res.join(", "))
|
||||
</script>
|
||||
<% } %>
|
22
themes/fluid/layout/_partial/plugins/daovoice.ejs
Normal file
22
themes/fluid/layout/_partial/plugins/daovoice.ejs
Normal file
@ -0,0 +1,22 @@
|
||||
<% if(theme.daovoice.enable && theme.daovoice.appid){ %>
|
||||
<script>(function (i, s, o, g, r, a, m) {
|
||||
i['DaoVoiceObject'] = r;
|
||||
i[r] = i[r] ||
|
||||
function () {
|
||||
(i[r].q = i[r].q || []).push(arguments);
|
||||
};
|
||||
i[r].l = 1 * new Date();
|
||||
a = s.createElement(o);
|
||||
m = s.getElementsByTagName(o)[0];
|
||||
a.async = 1;
|
||||
a.src = g;
|
||||
a.charset = 'utf-8';
|
||||
m.parentNode.insertBefore(a, m);
|
||||
})(window, document, 'script', ('https:' === document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/<%= theme.daovoice.appid %>.js", 'daovoice');
|
||||
daovoice('init', {
|
||||
app_id: "<%= theme.daovoice.appid %>",
|
||||
});
|
||||
daovoice('update');
|
||||
</script>
|
||||
<% } %>
|
||||
|
13
themes/fluid/layout/_partial/plugins/fancybox.ejs
Normal file
13
themes/fluid/layout/_partial/plugins/fancybox.ejs
Normal file
@ -0,0 +1,13 @@
|
||||
<% if (is_post && theme.post.image_zoom.enable) { %>
|
||||
<%- js_ex(theme.static_prefix.fancybox, "jquery.fancybox.min.js") %>
|
||||
<script>
|
||||
$("#post img:not(.no-zoom img, img[no-zoom])").each(
|
||||
function () {
|
||||
var element = document.createElement("a");
|
||||
$(element).attr("data-fancybox", "images");
|
||||
$(element).attr("href", $(this).attr("src"));
|
||||
$(this).wrap(element);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<% } %>
|
11
themes/fluid/layout/_partial/plugins/local-search.ejs
Normal file
11
themes/fluid/layout/_partial/plugins/local-search.ejs
Normal file
@ -0,0 +1,11 @@
|
||||
<% if(theme.search.enable){ %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, "local-search.js") %>
|
||||
<script>
|
||||
var path = "<%- url_for(theme.search.path) || '/local-search.xml' %>";
|
||||
var inputArea = document.querySelector("#local-search-input");
|
||||
inputArea.onclick = function () {
|
||||
getSearchFile(path);
|
||||
this.onclick = null
|
||||
}
|
||||
</script>
|
||||
<% } %>
|
30
themes/fluid/layout/_partial/plugins/math.ejs
Normal file
30
themes/fluid/layout/_partial/plugins/math.ejs
Normal file
@ -0,0 +1,30 @@
|
||||
<% if(theme.post.math.enable && (!theme.post.math.specific || (theme.post.math.specific && page.math))) { %>
|
||||
<% var engine = theme.post.math.engine; %>
|
||||
|
||||
<% if(engine === 'mathjax') { %>
|
||||
<!-- MathJax -->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {
|
||||
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
||||
processEscapes: true,
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
|
||||
}
|
||||
});
|
||||
|
||||
MathJax.Hub.Queue(function() {
|
||||
var all = MathJax.Hub.getAllJax(), i;
|
||||
for(i=0; i < all.length; i += 1) {
|
||||
all[i].SourceElement().parentNode.className += ' has-jax';
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<%- js_ex(theme.static_prefix.mathjax, "MathJax.js?config=TeX-MML-AM_CHTML") %>
|
||||
|
||||
<% } else if (engine === 'katex') { %>
|
||||
<!-- KaTeX -->
|
||||
<%- css_ex(theme.static_prefix.katex, "katex.min.css") %>
|
||||
<% } %>
|
||||
<% } %>
|
99
themes/fluid/layout/_partial/plugins/mouse-click.ejs
Normal file
99
themes/fluid/layout/_partial/plugins/mouse-click.ejs
Normal file
@ -0,0 +1,99 @@
|
||||
<% if (theme.fun_features.mouse_click && theme.fun_features.mouse_click.enable) { %>
|
||||
<% var style = theme.fun_features.mouse_click.style %>
|
||||
<% if (style === 'values') { %>
|
||||
<script type="text/javascript">
|
||||
//定义获取词语下标
|
||||
var a_idx = 0;
|
||||
jQuery(document).ready(function ($) {
|
||||
//点击body时触发事件
|
||||
$("body").click(function (e) {
|
||||
//需要显示的词语
|
||||
var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善");
|
||||
//设置词语给span标签
|
||||
var $i = $("<span/>").text(a[a_idx]);
|
||||
//下标等于原来下标+1 余 词语总数
|
||||
a_idx = (a_idx + 1) % a.length;
|
||||
//获取鼠标指针的位置,分别相对于文档的左和右边缘。
|
||||
//获取x和y的指针坐标
|
||||
var x = e.pageX, y = e.pageY;
|
||||
//在鼠标的指针的位置给$i定义的span标签添加css样式
|
||||
$i.css({
|
||||
"z-index": 999,
|
||||
"top": y - 20,
|
||||
"left": x,
|
||||
"position": "absolute",
|
||||
"font-weight": "bold",
|
||||
"color": rand_color()
|
||||
});
|
||||
// 随机颜色
|
||||
function rand_color() {
|
||||
return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
|
||||
}
|
||||
//在body添加这个标签
|
||||
$("body").append($i);
|
||||
//animate() 方法执行 CSS 属性集的自定义动画。
|
||||
//该方法通过CSS样式将元素从一个状态改变为另一个状态。CSS属性值是逐渐改变的,这样就可以创建动画效果。
|
||||
//详情请看http://www.w3school.com.cn/jquery/effect_animate.asp
|
||||
$i.animate({
|
||||
//将原来的位置向上移动180
|
||||
"top": y - 180,
|
||||
"opacity": 0
|
||||
//1500动画的速度
|
||||
}, 1500, function () {
|
||||
//时间到了自动删除
|
||||
$i.remove();
|
||||
});
|
||||
});
|
||||
})
|
||||
;
|
||||
</script>
|
||||
<% } else if (style === 'love') { %>
|
||||
<script>
|
||||
!function (e, t, a) {
|
||||
function r() {
|
||||
for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999");
|
||||
requestAnimationFrame(r)
|
||||
}
|
||||
|
||||
function n() {
|
||||
var t = "function" == typeof e.onclick && e.onclick;
|
||||
e.onclick = function (e) {
|
||||
t && t(), o(e)
|
||||
}
|
||||
}
|
||||
|
||||
function o(e) {
|
||||
var a = t.createElement("div");
|
||||
a.className = "heart", s.push({
|
||||
el: a,
|
||||
x: e.clientX - 5,
|
||||
y: e.clientY - 5,
|
||||
scale: 1,
|
||||
alpha: 1,
|
||||
color: c()
|
||||
}), t.body.appendChild(a)
|
||||
}
|
||||
|
||||
function i(e) {
|
||||
var a = t.createElement("style");
|
||||
a.type = "text/css";
|
||||
try {
|
||||
a.appendChild(t.createTextNode(e))
|
||||
} catch (t) {
|
||||
a.styleSheet.cssText = e
|
||||
}
|
||||
t.getElementsByTagName("head")[0].appendChild(a)
|
||||
}
|
||||
|
||||
function c() {
|
||||
return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
|
||||
}
|
||||
|
||||
var s = [];
|
||||
e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function (e) {
|
||||
setTimeout(e, 1e3 / 60)
|
||||
}, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r()
|
||||
}(window, document);
|
||||
</script>
|
||||
<% } %>
|
||||
<% } %>
|
9
themes/fluid/layout/_partial/plugins/prettify.ejs
Normal file
9
themes/fluid/layout/_partial/plugins/prettify.ejs
Normal file
@ -0,0 +1,9 @@
|
||||
<% if(theme.highlight.enable){ %>
|
||||
<%- js_ex(theme.static_prefix.prettify, "/prettify.min.js") %>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('pre').addClass('prettyprint <%- config.highlight.line_number ? 'linenums' : '' %>');
|
||||
prettyPrint();
|
||||
})
|
||||
</script>
|
||||
<% } %>
|
19
themes/fluid/layout/_partial/plugins/typed.ejs
Normal file
19
themes/fluid/layout/_partial/plugins/typed.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<% if(theme.fun_features.typing.enable){ %>
|
||||
<%- js_ex(theme.static_prefix.typed, "/typed.min.js") %>
|
||||
<script>
|
||||
var typed = new Typed('#subtitle', {
|
||||
strings: [
|
||||
' ',
|
||||
"<%- data.subtitle %> ",
|
||||
],
|
||||
cursorChar: "<%- theme.fun_features.typing.cursorChar %>",
|
||||
typeSpeed: <%- theme.fun_features.typing.typeSpeed %>,
|
||||
loop: <%- theme.fun_features.typing.loop %>,
|
||||
});
|
||||
typed.stop();
|
||||
$(document).ready(function () {
|
||||
$(".typed-cursor").addClass("h2");
|
||||
typed.start();
|
||||
});
|
||||
</script>
|
||||
<% } %>
|
35
themes/fluid/layout/_partial/scripts.ejs
Normal file
35
themes/fluid/layout/_partial/scripts.ejs
Normal file
@ -0,0 +1,35 @@
|
||||
<%- js_ex(theme.static_prefix.jquery, "jquery.min.js") %>
|
||||
<%- js_ex(theme.static_prefix.popper, "popper.min.js") %>
|
||||
<%- js_ex(theme.static_prefix.bootstrap, "js/bootstrap.min.js") %>
|
||||
<%- js_ex(theme.static_prefix.mdbootstrap, "js/mdb.min.js") %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, "main.js") %>
|
||||
|
||||
<% if(theme.lazyload.enable){ %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, "lazyload.js") %>
|
||||
<% } %>
|
||||
|
||||
<% if(is_post()){ %>
|
||||
<% if(theme.post.toc.enable){ %>
|
||||
<%- js_ex(theme.static_prefix.tocbot, "/tocbot.min.js") %>
|
||||
<% } %>
|
||||
<%- js_ex(theme.static_prefix.internal_js, "post.js") %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.smooth_scroll.enable) { %>
|
||||
<%- js_ex(theme.static_prefix.smooth_scroll, "SmoothScroll.min.js") %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.footer.statistics.enable || theme.post.meta.views.enable) { %>
|
||||
<%- js_async("//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js") %>
|
||||
<% } %>
|
||||
|
||||
<!-- Plugins -->
|
||||
<%- partial('_partial/plugins/analytics.ejs') %>
|
||||
<%- partial('_partial/plugins/prettify.ejs') %>
|
||||
<%- partial('_partial/plugins/typed.ejs') %>
|
||||
<%- partial('_partial/plugins/anchor.ejs') %>
|
||||
<%- partial('_partial/plugins/local-search.ejs') %>
|
||||
<%- partial('_partial/plugins/fancybox.ejs') %>
|
||||
<%- partial('_partial/plugins/math.ejs') %>
|
||||
<%- partial('_partial/plugins/mouse-click.ejs') %>
|
||||
<%- partial('_partial/plugins/daovoice.ejs') %>
|
21
themes/fluid/layout/_partial/search.ejs
Normal file
21
themes/fluid/layout/_partial/search.ejs
Normal file
@ -0,0 +1,21 @@
|
||||
<div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header text-center">
|
||||
<h4 class="modal-title w-100 font-weight-bold"><%= __('search.title') %></h4>
|
||||
<button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body mx-3">
|
||||
<div class="md-form mb-5">
|
||||
<input type="text" id="local-search-input" class="form-control validate">
|
||||
<label data-error="<%= __('search.status.error') %>" data-success="<%= __('search.status.success') %>"
|
||||
for="local-search-input"><%= __('search.keyword') %></label>
|
||||
</div>
|
||||
<div class="list-group" id="local-search-result"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
6
themes/fluid/layout/_partial/toc.ejs
Normal file
6
themes/fluid/layout/_partial/toc.ejs
Normal file
@ -0,0 +1,6 @@
|
||||
<% if(theme.post.toc.enable){ %>
|
||||
<div id="toc">
|
||||
<p class="h4"><i class="far fa-list-alt"></i> <%= __('post.toc') %></p>
|
||||
<div id="tocbot"></div>
|
||||
</div>
|
||||
<% } %>
|
26
themes/fluid/layout/about.ejs
Normal file
26
themes/fluid/layout/about.ejs
Normal file
@ -0,0 +1,26 @@
|
||||
<%
|
||||
page.layout = "about"
|
||||
page.title = __('about.title')
|
||||
page.subtitle = __('about.subtitle')
|
||||
page.banner_img = theme.about.banner_img
|
||||
page.banner_img_height = theme.about.banner_img_height
|
||||
%>
|
||||
|
||||
<div class="text-center">
|
||||
<p class="h3"><%= theme.about.name %></p>
|
||||
<p><%- theme.about.introduce %></p>
|
||||
<% for(const i in theme.about.icons) { %>
|
||||
<% var href = theme.about.icons[i]; %>
|
||||
<% if (!href) continue; %>
|
||||
<a href="<%- i.search('weixin') == -1 ? href : 'javascript:;' %>"
|
||||
class="h4 px-1 <%- i.search('weixin') == -1 ? '' : 'wechat' %>">
|
||||
<i class="<%- i %>" aria-hidden="true"></i>
|
||||
<% if (i.search('weixin') != -1) { %>
|
||||
<div class="wechat-qrcode"></div>
|
||||
<% } %>
|
||||
</a>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class="mt-5 markdown-body">
|
||||
<%- about_body() %>
|
||||
</div>
|
24
themes/fluid/layout/archive.ejs
Normal file
24
themes/fluid/layout/archive.ejs
Normal file
@ -0,0 +1,24 @@
|
||||
<%
|
||||
page.layout = "archive"
|
||||
page.title = __('archive.title')
|
||||
page.subtitle = __('archive.subtitle')
|
||||
page.banner_img = theme.archive.banner_img
|
||||
page.banner_img_height = theme.archive.banner_img_height
|
||||
var date_cursor = 'xxx'
|
||||
%>
|
||||
|
||||
<div class="list-group">
|
||||
<p class="h4"><%= __('postTotal', site.posts.length) %></p>
|
||||
<hr>
|
||||
<% page.posts.each(function (post) { %>
|
||||
<% if(date(post.date, "YYYY") != date_cursor) { %>
|
||||
<% date_cursor = date(post.date, "YYYY") %>
|
||||
<p class="h5"><%= date_cursor %></p>
|
||||
<% } %>
|
||||
<a href="<%- url_for(post.path) %>" class="list-group-item list-group-item-action">
|
||||
<span class="archive-post-title"><%= post.title %></span>
|
||||
<span style="float: right;"><%- date(post.date, "MM-DD") %></span>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<%- partial('_partial/paginator') %>
|
10
themes/fluid/layout/categories.ejs
Normal file
10
themes/fluid/layout/categories.ejs
Normal file
@ -0,0 +1,10 @@
|
||||
<%
|
||||
page.layout = "categories"
|
||||
page.title = __('category.title')
|
||||
page.subtitle = __('category.subtitle')
|
||||
page.banner_img = theme.category.banner_img
|
||||
page.banner_img_height = theme.category.banner_img_height
|
||||
%>
|
||||
|
||||
<%- list_categories({ class: "category-tree" }) %>
|
||||
|
25
themes/fluid/layout/category.ejs
Normal file
25
themes/fluid/layout/category.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<%
|
||||
page.layout = "category"
|
||||
page.title = [__('category.title'), page.category].join(" - ")
|
||||
page.subtitle = [__('category.subtitle'), page.category].join(" - ")
|
||||
page.banner_img = theme.category.banner_img
|
||||
page.banner_img_height = theme.category.banner_img_height
|
||||
|
||||
var date_cursor = 'xxx'
|
||||
%>
|
||||
|
||||
<div class="list-group">
|
||||
<!-- <p class="h4"><%= __('postTotal', page.posts.length) %></p>-->
|
||||
<hr>
|
||||
<% page.posts.each(function (post) { %>
|
||||
<% if(date(post.date, "YYYY") != date_cursor) { %>
|
||||
<% date_cursor = date(post.date, "YYYY") %>
|
||||
<p class="h5"><%= date_cursor %></p>
|
||||
<% } %>
|
||||
<a href="<%- url_for(post.path) %>" class="list-group-item list-group-item-action">
|
||||
<span class="archive-post-title"><%= post.title %></span>
|
||||
<span style="float: right;"><%- date(post.date, "MM-DD") %></span>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<%- partial('_partial/paginator') %>
|
57
themes/fluid/layout/index.ejs
Normal file
57
themes/fluid/layout/index.ejs
Normal file
@ -0,0 +1,57 @@
|
||||
<%
|
||||
if (theme.index.slogan.enable) {
|
||||
page.subtitle = theme.index.slogan.text || config.subtitle || ''
|
||||
}
|
||||
page.banner_img = theme.index.banner_img
|
||||
page.banner_img_height = theme.index.banner_img_height
|
||||
%>
|
||||
|
||||
<% page.posts.each(function (post) { %>
|
||||
<div class="row mb-4 mx-auto">
|
||||
<% var post_url = url_for(post.path) %>
|
||||
<% if(post.index_img != null) { %>
|
||||
<div class="col-12 col-md-4 m-auto">
|
||||
<a href="<%- post_url %>" target="<%- theme.index.post_url_target %>">
|
||||
<img src="<%- post.index_img %>" alt="<%= post.title %>" class="img-fluid rounded z-depth-3 index-thumbnails">
|
||||
</a>
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="col-12 col-md-8 m-auto">
|
||||
<a href="<%- post_url %>">
|
||||
<p class="h4 index-header"><%= post.title %></p>
|
||||
<% var height_limit = '' %>
|
||||
<% if(post.excerpt.length > 0) { %>
|
||||
<% var excerpt = strip_html(post.excerpt) + "..." %>
|
||||
<% var height_limit = 'style="max-height: none;"' %>
|
||||
<% } else if(theme.index.auto_excerpt.enable){ %>
|
||||
<% var excerpt = strip_html(post.content).substr(0, 500) %>
|
||||
<% } else { %>
|
||||
<% var excerpt = strip_html(post.content) %>
|
||||
<% } %>
|
||||
<div class="index-excerpt" <%- height_limit %>>
|
||||
<div class="index-text mb-1"><%- excerpt %></div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div>
|
||||
<% if(theme.index.post_meta.date ) { %>
|
||||
<i class="iconfont icon-riqi2"></i> <%- date(post.date, config.date_format) %>
|
||||
<% } %>
|
||||
<% if(theme.index.post_meta.category && post.categories.length) { %>
|
||||
<i class="iconfont icon-inbox"></i>
|
||||
<% post.categories.each(function(cate){ %>
|
||||
<a href="/categories/<%- encodeURI(cate.name.replace('.', '-')) %>"><%= cate.name %></a>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
<% if(theme.index.post_meta.tag && post.tags.length) { %>
|
||||
<i class="iconfont icon-tag"></i>
|
||||
<% post.tags.each(function(tag){ %>
|
||||
<a href="/tags/<%- encodeURI(tag.name.replace('.', '-')) %>"><%= tag.name %></a>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% }) %>
|
||||
|
||||
<%- partial('_partial/paginator') %>
|
114
themes/fluid/layout/layout.ejs
Normal file
114
themes/fluid/layout/layout.ejs
Normal file
@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= config.language %>">
|
||||
|
||||
<%
|
||||
var subtitle = page.subtitle || page.title
|
||||
var banner_img = page.banner_img || theme.index.banner_img
|
||||
var banner_img_height = page.banner_img_height || theme.index.banner_img_height
|
||||
%>
|
||||
|
||||
<%- partial('_partial/head') %>
|
||||
|
||||
<body>
|
||||
<header style="height: <%- banner_img_height %>vh;">
|
||||
<%- partial('_partial/nav') %>
|
||||
<div class="view intro-2" id="background"
|
||||
style="background: url('<%- banner_img %>')no-repeat center center;
|
||||
background-size: cover;
|
||||
background-attachment: <%- theme.banner_scroll == true ? 'scroll' : 'fixed' %>;">
|
||||
<div class="full-bg-img">
|
||||
<div class="mask rgba-black-light flex-center">
|
||||
<div class="container text-center white-text fadeInUp">
|
||||
<span class="h2" id="subtitle">
|
||||
<% if(theme.fun_features.typing.enable == false) { %>
|
||||
<%- subtitle %>
|
||||
<% } %>
|
||||
</span>
|
||||
|
||||
<% if(is_post()) { %>
|
||||
<br>
|
||||
<% if (theme.post.meta.date.enable) { %>
|
||||
<p class="mt-3">
|
||||
<i class="fas fa-calendar-alt" aria-hidden="true"></i>
|
||||
<%- full_date(page.date, theme.post.meta.date.format) %>
|
||||
</p>
|
||||
<% } %>
|
||||
|
||||
<p>
|
||||
<% if (theme.post.meta.wordcount.enable) { %>
|
||||
<% var wordcount_texts = theme.post.meta.wordcount.format.split('{}') %>
|
||||
<i class="far fa-chart-bar"></i>
|
||||
<span class="post-count">
|
||||
<%= wordcount_texts[0] %><%- wordcount(page.content) %><%= wordcount_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.post.meta.min2read.enable) { %>
|
||||
<% var min2read_texts = theme.post.meta.min2read.format.split('{}') %>
|
||||
<i class="far fa-clock"></i>
|
||||
<span class="post-count">
|
||||
<%= min2read_texts[0] %><%- min2read(page.content) %><%= min2read_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.post.meta.views.enable) { %>
|
||||
<!-- 不蒜子统计文章PV -->
|
||||
<% var views_texts = theme.post.meta.views.format.split('{}') %>
|
||||
<i class="far fa-eye" aria-hidden="true"></i>
|
||||
<span id="busuanzi_container_page_pv">
|
||||
<%- views_texts[0] %><span id="busuanzi_value_page_pv"></span><%- views_texts[1] %>
|
||||
</span>
|
||||
<% } %>
|
||||
</p>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if (theme.scroll_down_arrow.enable && theme.scroll_down_arrow.banner_height_limit <= banner_img_height) { %>
|
||||
<div class="scroll-down-bar">
|
||||
<i class="fas fa-angle-down scroll-down-arrow"></i>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<% if(is_post() || page.layout == '404') { %>
|
||||
<%- body %>
|
||||
<% } else { %>
|
||||
<div class="container nopadding-md">
|
||||
<div class="py-5 z-depth-3" id="board">
|
||||
<% if(page.layout == 'about') { %>
|
||||
<div class="about-avatar">
|
||||
<img src="<%- url_for(theme.about.avatar) %>"
|
||||
class="img-fluid z-depth-1 rounded-circle"
|
||||
alt="avatar">
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 m-auto">
|
||||
<%- body %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</main>
|
||||
|
||||
<% if (theme.scroll_top_arrow.enable) { %>
|
||||
<a class="z-depth-1" id="scroll-top-button" href="#" role="button">
|
||||
<i class="fa fa-chevron-up scroll-top-arrow" aria-hidden="true"></i>
|
||||
</a>
|
||||
<% } %>
|
||||
|
||||
<% if(theme.search.enable) { %>
|
||||
<%- partial('_partial/search') %>
|
||||
<% } %>
|
||||
|
||||
<%- partial('_partial/footer', { data: { 'subtitle': subtitle } }) %>
|
||||
|
||||
</body>
|
||||
</html>
|
22
themes/fluid/layout/links.ejs
Normal file
22
themes/fluid/layout/links.ejs
Normal file
@ -0,0 +1,22 @@
|
||||
<%
|
||||
page.layout = "links"
|
||||
page.title = __('links.title')
|
||||
page.subtitle = theme.links.subtitle || __('links.subtitle')
|
||||
page.banner_img = theme.links.banner_img
|
||||
page.banner_img_height = theme.links.banner_img_height
|
||||
%>
|
||||
|
||||
<div class="row links">
|
||||
<% for(const each in theme.links.items) { %>
|
||||
<div class="card link-card col-lg-4 col-md-6 col-sm-12">
|
||||
<div class="card-body">
|
||||
<% var props = theme.links.items[each] %>
|
||||
<% if (!props) continue %>
|
||||
<a href="<%= url_for(props[0]) %>">
|
||||
<h5 class="card-title link-card-title"><%- each %></h5>
|
||||
<p class="card-text link-card-text"><%- props[1] %></p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
0
themes/fluid/layout/page.ejs
Normal file
0
themes/fluid/layout/page.ejs
Normal file
70
themes/fluid/layout/post.ejs
Normal file
70
themes/fluid/layout/post.ejs
Normal file
@ -0,0 +1,70 @@
|
||||
<%
|
||||
if (!page.banner_img) {
|
||||
page.banner_img = theme.post.banner_img
|
||||
}
|
||||
page.banner_img_height = theme.post.banner_img_height
|
||||
%>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="d-none d-lg-block col-lg-2"></div>
|
||||
<div class="col-lg-8 nopadding-md">
|
||||
<div class="py-5 z-depth-3" id="board">
|
||||
<div class="post-content mx-auto" id="post">
|
||||
<div class="markdown-body">
|
||||
<%- page.content %>
|
||||
<hr>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<p>
|
||||
<% if (page.categories.length > 0) { %>
|
||||
<span>
|
||||
<i class="iconfont icon-inbox"></i>
|
||||
<% page.categories.each(function(cate) { %>
|
||||
<a class="hover-with-bg" href="/categories/<%- encodeURI(cate.name).replace('.', '-') %>"><%= cate.name %></a>
|
||||
|
||||
<% }) %>
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (page.tags.length > 0 ) { %>
|
||||
<span>
|
||||
<i class="iconfont icon-tag"></i>
|
||||
<% page.tags.each(function(tag) { %>
|
||||
<a class="hover-with-bg" href="/tags/<%- encodeURI(tag.name).replace('.', '-') %>"><%= tag.name %></a>
|
||||
<% }) %>
|
||||
</span>
|
||||
<% } %>
|
||||
</p>
|
||||
<% if(theme.post.copyright.enable && theme.post.copyright.content) { %>
|
||||
<p class="note note-warning"><%- theme.post.copyright.content %></p>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-none d-lg-block col-lg-2 toc-container">
|
||||
<%- partial('_partial/toc') %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- custom -->
|
||||
<% if(theme.post.custom.enable) { %>
|
||||
<div class="col-lg-7 mx-auto nopadding-md">
|
||||
<div class="container custom post-content mx-auto">
|
||||
<%- theme.post.custom.content %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<!-- Comments -->
|
||||
<div class="col-lg-7 mx-auto nopadding-md">
|
||||
<div class="container comments mx-auto" id="comments">
|
||||
<% if(page.comments && theme.post.comments.enable) { %>
|
||||
<br><br>
|
||||
<% var type = '_partial/comments/' + theme.post.comments.type %>
|
||||
<%- partial(type) %>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
25
themes/fluid/layout/tag.ejs
Normal file
25
themes/fluid/layout/tag.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<%
|
||||
page.layout = "tag"
|
||||
page.title = [__('tag.title'), page.tag].join(" - ")
|
||||
page.subtitle = [__('tag.subtitle'), page.tag].join(" - ")
|
||||
page.banner_img = theme.tag.banner_img
|
||||
page.banner_img_height = theme.tag.banner_img_height
|
||||
|
||||
var date_cursor = 'xxx'
|
||||
%>
|
||||
|
||||
<div class="list-group">
|
||||
<!-- <p class="h4"><%= __('postTotal', page.posts.length) %></p>-->
|
||||
<hr>
|
||||
<% page.posts.each(function (post) { %>
|
||||
<% if(date(post.date, "YYYY") != date_cursor) { %>
|
||||
<% date_cursor = date(post.date, "YYYY") %>
|
||||
<p class="h5"><%= date_cursor %></p>
|
||||
<% } %>
|
||||
<a href="<%- url_for(post.path) %>" class="list-group-item list-group-item-action">
|
||||
<span class="archive-post-title"><%= post.title %></span>
|
||||
<span style="float: right;"><%- date(post.date, "MM-DD") %></span>
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
<%- partial('_partial/paginator') %>
|
25
themes/fluid/layout/tags.ejs
Normal file
25
themes/fluid/layout/tags.ejs
Normal file
@ -0,0 +1,25 @@
|
||||
<%
|
||||
page.layout = "tags"
|
||||
page.title = __('tag.title')
|
||||
page.subtitle = __('tag.subtitle')
|
||||
page.banner_img = theme.tag.banner_img
|
||||
page.banner_img_height = theme.tag.banner_img_height
|
||||
|
||||
var min_font = theme.tag.tagcloud.min_font || 15
|
||||
var max_font = theme.tag.tagcloud.max_font || 30
|
||||
var unit = theme.tag.tagcloud.unit || 'px'
|
||||
var start_color = theme.tag.tagcloud.start_color || '#BBBBEE'
|
||||
var end_color = theme.tag.tagcloud.end_color || '#337ab7'
|
||||
%>
|
||||
|
||||
<div class="text-center tagcloud">
|
||||
<%- tagcloud({
|
||||
min_font: min_font,
|
||||
max_font: max_font,
|
||||
amount: 999,
|
||||
unit: unit,
|
||||
color: true,
|
||||
start_color,
|
||||
end_color
|
||||
}) %>
|
||||
</div>
|
0
themes/fluid/pages/about.md
Normal file
0
themes/fluid/pages/about.md
Normal file
45
themes/fluid/pages/local-search.xml
Normal file
45
themes/fluid/pages/local-search.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<search>
|
||||
{% if posts %}
|
||||
{% for post in posts.toArray() %}
|
||||
{% if post.indexing == undefined or post.indexing %}
|
||||
<entry>
|
||||
<title>{{ post.title }}</title>
|
||||
<link href="{{ (url + post.path) | uriencode }}"/>
|
||||
<url>{{ (url + post.path) | uriencode }}</url>
|
||||
{% if content %}
|
||||
<content type="html"><![CDATA[{{ post.content | noControlChars | safe }}]]></content>
|
||||
{% endif %}
|
||||
{% if post.categories and post.categories.length>0 %}
|
||||
<categories>
|
||||
{% for cate in post.categories.toArray() %}
|
||||
<category>{{ cate.name }}</category>
|
||||
{% endfor %}
|
||||
</categories>
|
||||
{% endif %}
|
||||
{% if post.tags and post.tags.length>0 %}
|
||||
<tags>
|
||||
{% for tag in post.tags.toArray() %}
|
||||
<tag>{{ tag.name }}</tag>
|
||||
{% endfor %}
|
||||
</tags>
|
||||
{% endif %}
|
||||
</entry>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if pages %}
|
||||
{% for page in pages.toArray() %}
|
||||
{% if post.indexing == undefined or post.indexing %}
|
||||
<entry>
|
||||
<title>{{ page.title }}</title>
|
||||
<link href="{{ (url + page.path) | uriencode }}"/>
|
||||
<url>{{ (url + page.path) | uriencode }}</url>
|
||||
{% if content %}
|
||||
<content type="html"><![CDATA[{{ page.content | noControlChars | safe }}]]></content>
|
||||
{% endif %}
|
||||
</entry>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</search>
|
13
themes/fluid/scripts/helpers.js
Normal file
13
themes/fluid/scripts/helpers.js
Normal file
@ -0,0 +1,13 @@
|
||||
const joinPath = require('./utils/join-path');
|
||||
|
||||
hexo.extend.helper.register('css_ex', function (base, relative, ex = "") {
|
||||
return '<link rel="stylesheet" href="' + this.url_for(joinPath(base, relative)) + '" ' + ex + ' >';
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('js_ex', function (base, relative, ex = "") {
|
||||
return '<script src="' + this.url_for(joinPath(base, relative)) + '" ' + ex + '></script>';
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('js_async', function (base, relative, ex = "") {
|
||||
return '<script async src="' + this.url_for(joinPath(base, relative)) + '" ' + ex + '></script>';
|
||||
});
|
30
themes/fluid/scripts/lazyload.js
Normal file
30
themes/fluid/scripts/lazyload.js
Normal file
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
const joinPath = require('./utils/join-path');
|
||||
|
||||
|
||||
module.exports.lazyload = function (hexo) {
|
||||
var config = hexo.theme.config;
|
||||
let loadingImage = joinPath(joinPath(hexo.config.root, config.static_prefix.internal_img), 'loading.gif');
|
||||
if (!config.lazyload || !config.lazyload.enable || !loadingImage) {
|
||||
return;
|
||||
}
|
||||
if (config.lazyload.onlypost) {
|
||||
hexo.extend.filter.register('after_post_render', function (data) {
|
||||
data.content = lazyProcess.call(this, data.content, loadingImage);
|
||||
return data;
|
||||
});
|
||||
} else {
|
||||
hexo.extend.filter.register('after_render:html', function (str, data) {
|
||||
return lazyProcess.call(this, str, loadingImage);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function lazyProcess(htmlContent, loadingImage) {
|
||||
return htmlContent.replace(/<img(\s*?)src="(.*?)"(.*?)>/gi, (str, p1, p2) => {
|
||||
if (/srcset=/gi.test(str)) {
|
||||
return str;
|
||||
}
|
||||
return str.replace(p2, `${p2}" srcset="${loadingImage}`);
|
||||
});
|
||||
}
|
57
themes/fluid/scripts/local-search.js
Normal file
57
themes/fluid/scripts/local-search.js
Normal file
@ -0,0 +1,57 @@
|
||||
'use strict';
|
||||
hexo.extend.generator.register('_hexo_generator_search', function (locals) {
|
||||
var config = this.theme.config;
|
||||
if (!config.search.enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
var nunjucks = require('nunjucks');
|
||||
var env = new nunjucks.Environment();
|
||||
var pathFn = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
env.addFilter('uriencode', function (str) {
|
||||
return encodeURI(str);
|
||||
});
|
||||
|
||||
env.addFilter('noControlChars', function (str) {
|
||||
return str && str.replace(/[\x00-\x1F\x7F]/g, '');
|
||||
});
|
||||
|
||||
var searchTmplSrc = pathFn.join(__dirname, '../pages/local-search.xml');
|
||||
var searchTmpl = nunjucks.compile(fs.readFileSync(searchTmplSrc, 'utf8'), env);
|
||||
|
||||
var searchConfig = config.search;
|
||||
var template = searchTmpl;
|
||||
var searchField = searchConfig.field;
|
||||
var content = searchConfig.content || true;
|
||||
|
||||
var posts, pages;
|
||||
|
||||
if (searchField.trim() != '') {
|
||||
searchField = searchField.trim();
|
||||
if (searchField == 'post') {
|
||||
posts = locals.posts.sort('-date');
|
||||
} else if (searchField == 'page') {
|
||||
pages = locals.pages;
|
||||
} else {
|
||||
posts = locals.posts.sort('-date');
|
||||
pages = locals.pages;
|
||||
}
|
||||
} else {
|
||||
posts = locals.posts.sort('-date');
|
||||
}
|
||||
|
||||
var xml = template.render({
|
||||
config: config,
|
||||
posts: posts,
|
||||
pages: pages,
|
||||
content: content,
|
||||
url: hexo.config.root
|
||||
});
|
||||
|
||||
return {
|
||||
path: searchConfig.generate_path || '/local-search.xml',
|
||||
data: xml
|
||||
};
|
||||
});
|
39
themes/fluid/scripts/merge-configs.js
Normal file
39
themes/fluid/scripts/merge-configs.js
Normal file
@ -0,0 +1,39 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
hexo.on('generateBefore', function () {
|
||||
if (hexo.locals.get) {
|
||||
var data = hexo.locals.get('data');
|
||||
sourceConfig = {};
|
||||
if (data && data.fluid_config) {
|
||||
sourceConfig = data.fluid_config;
|
||||
}
|
||||
staticPrefix = {};
|
||||
if (data && data.fluid_static_prefix) {
|
||||
staticPrefix = data.fluid_static_prefix;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge configs in /source/_data/fluid_static_prefix.yml into hexo.theme.config.
|
||||
*/
|
||||
const configPath = path.join(__dirname, '../_static_prefix.yml');
|
||||
const yamlDoc = yaml.safeLoad(fs.readFileSync(configPath, 'utf8'));
|
||||
hexo.theme.config.static_prefix = Object.assign({}, yamlDoc, staticPrefix);
|
||||
this.log.debug("Fluid: theme static_prefix config merged");
|
||||
|
||||
/**
|
||||
* Merge configs in hexo.config.theme_config and /source/_data/fluid_config.yml into hexo.theme.config.
|
||||
*/
|
||||
hexo.theme.config = Object.assign({}, hexo.theme.config, sourceConfig, hexo.config.theme_config);
|
||||
this.log.debug("Fluid: theme config merged");
|
||||
|
||||
/**
|
||||
* Trigger action that requires configuration data.
|
||||
*/
|
||||
require("./lazyload").lazyload(hexo);
|
||||
|
||||
this.log.debug("Configs:\n", hexo.theme.config);
|
||||
|
||||
});
|
50
themes/fluid/scripts/pages.js
Normal file
50
themes/fluid/scripts/pages.js
Normal file
@ -0,0 +1,50 @@
|
||||
// generate 404 page
|
||||
hexo.extend.generator.register('_404', function (locals) {
|
||||
return {
|
||||
path: '404.html',
|
||||
data: locals.theme,
|
||||
layout: '404'
|
||||
};
|
||||
});
|
||||
|
||||
// generate tags Page
|
||||
hexo.extend.generator.register('_tags', function (locals) {
|
||||
return {
|
||||
path: 'tags/index.html',
|
||||
data: locals.theme,
|
||||
layout: 'tags'
|
||||
};
|
||||
});
|
||||
|
||||
// generate categories Page
|
||||
hexo.extend.generator.register('_categories', function (locals) {
|
||||
return {
|
||||
path: 'categories/index.html',
|
||||
data: locals.theme,
|
||||
layout: 'categories'
|
||||
};
|
||||
});
|
||||
|
||||
// generate links page
|
||||
hexo.extend.generator.register('_links', function (locals) {
|
||||
return {
|
||||
path: 'links/index.html',
|
||||
data: locals.theme,
|
||||
layout: 'links'
|
||||
};
|
||||
});
|
||||
|
||||
// generate about page
|
||||
hexo.extend.generator.register('_about', function (locals) {
|
||||
return {
|
||||
path: 'about/index.html',
|
||||
data: locals.theme,
|
||||
layout: 'about'
|
||||
};
|
||||
});
|
||||
const path = require('path');
|
||||
hexo.extend.helper.register('about_body', function () {
|
||||
var rootPath = path.join(__dirname, '../');
|
||||
var mdPath = path.join(rootPath, hexo.theme.config.about.md_path);
|
||||
return hexo.render.renderSync({ path: mdPath });
|
||||
});
|
7
themes/fluid/scripts/utils/join-path.js
Normal file
7
themes/fluid/scripts/utils/join-path.js
Normal file
@ -0,0 +1,7 @@
|
||||
const joinPath = function (base, relative) {
|
||||
return relative
|
||||
? base.replace(/\/+$/, '') + '/' + relative.replace(/^\/+/, '')
|
||||
: base;
|
||||
};
|
||||
|
||||
module.exports = joinPath;
|
37
themes/fluid/scripts/wordcount.js
Normal file
37
themes/fluid/scripts/wordcount.js
Normal file
@ -0,0 +1,37 @@
|
||||
let util = require('hexo-util');
|
||||
let stripHTML = util.stripHTML;
|
||||
|
||||
let counter = function (content) {
|
||||
content = stripHTML(content);
|
||||
const cn = (content.match(/[\u4E00-\u9FA5]/g) || []).length;
|
||||
const en = (content.replace(/[\u4E00-\u9FA5]/g, '').match(
|
||||
/[a-zA-Z0-9_\u0392-\u03c9\u0400-\u04FF]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|[\u00E4\u00C4\u00E5\u00C5\u00F6\u00D6]+|\w+/g) || []).length;
|
||||
return [cn, en];
|
||||
};
|
||||
|
||||
hexo.extend.helper.register('min2read', function (content, { cn = 300, en = 160 } = {}) {
|
||||
let len = counter(content);
|
||||
let readingTime = len[0] / cn + len[1] / en;
|
||||
return readingTime < 1 ? '1' : parseInt(readingTime, 10);
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('wordcount', function (content) {
|
||||
let len = counter(content);
|
||||
let count = len[0] + len[1];
|
||||
if (count < 1000) {
|
||||
return count;
|
||||
}
|
||||
return Math.round(count / 100) / 10 + 'k';
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('totalcount', function (site) {
|
||||
let count = 0;
|
||||
site.posts.forEach(function (post) {
|
||||
let len = counter(post.content);
|
||||
count += len[0] + len[1];
|
||||
});
|
||||
if (count < 1000) {
|
||||
return count;
|
||||
}
|
||||
return Math.round(count / 100) / 10 + 'k';
|
||||
});
|
1
themes/fluid/source/css/_custom/custom.styl
Normal file
1
themes/fluid/source/css/_custom/custom.styl
Normal file
@ -0,0 +1 @@
|
||||
// Custom styles
|
4
themes/fluid/source/css/_functions/base.styl
Normal file
4
themes/fluid/source/css/_functions/base.styl
Normal file
@ -0,0 +1,4 @@
|
||||
theme-config(config, predef)
|
||||
unquote(hexo-config(config) ? hexo-config(config):predef)
|
||||
|
||||
@import "custom"
|
0
themes/fluid/source/css/_functions/custom.styl
Normal file
0
themes/fluid/source/css/_functions/custom.styl
Normal file
1
themes/fluid/source/css/_mixins/base.styl
Normal file
1
themes/fluid/source/css/_mixins/base.styl
Normal file
@ -0,0 +1 @@
|
||||
@import "custom"
|
0
themes/fluid/source/css/_mixins/custom.styl
Normal file
0
themes/fluid/source/css/_mixins/custom.styl
Normal file
5
themes/fluid/source/css/_pages/_about/about.styl
Normal file
5
themes/fluid/source/css/_pages/_about/about.styl
Normal file
@ -0,0 +1,5 @@
|
||||
.about-avatar
|
||||
position relative
|
||||
margin -8rem auto 1rem
|
||||
max-width 10rem
|
||||
z-index 3
|
329
themes/fluid/source/css/_pages/_base/base.styl
Normal file
329
themes/fluid/source/css/_pages/_base/base.styl
Normal file
@ -0,0 +1,329 @@
|
||||
html, body, header, .view
|
||||
height 100%
|
||||
overflow-wrap break-word
|
||||
|
||||
body
|
||||
background-color $body-bg-color
|
||||
color $text-color
|
||||
|
||||
a
|
||||
color $link-color
|
||||
|
||||
&:hover
|
||||
color $link-hover-color
|
||||
|
||||
.hover-with-bg
|
||||
display inline-block
|
||||
padding: .45rem
|
||||
|
||||
&:hover
|
||||
background-color $link-hover-bg!important
|
||||
|
||||
.visitors
|
||||
font-size .8em
|
||||
padding .45rem
|
||||
float right
|
||||
|
||||
#board
|
||||
position relative
|
||||
margin-top -3rem
|
||||
background-color $board-bg-color
|
||||
border-radius 0.5rem
|
||||
z-index 3
|
||||
|
||||
@media (max-width: 768px)
|
||||
header
|
||||
.h2
|
||||
font-size 1.5rem
|
||||
|
||||
.nopadding-md
|
||||
padding-left 0 !important
|
||||
padding-right 0 !important
|
||||
|
||||
.row
|
||||
padding-top 0.5rem
|
||||
padding-bottom 0.5rem
|
||||
|
||||
#local-search-result
|
||||
.search-list-title
|
||||
border-left 3px solid #0d47a1
|
||||
|
||||
.search-list-content
|
||||
padding 0 1.25rem
|
||||
|
||||
// Rewrite github-markdown.css
|
||||
|
||||
.markdown-body
|
||||
hr
|
||||
height .2em
|
||||
margin 2rem 0
|
||||
|
||||
strong
|
||||
font-weight bold
|
||||
|
||||
// Rewrite mdb.css
|
||||
|
||||
.list-group-item
|
||||
border 0
|
||||
|
||||
.page-link
|
||||
font-size 1.1rem
|
||||
|
||||
// Navbar
|
||||
|
||||
.navbar
|
||||
background-color transparent
|
||||
font-size 0.875rem
|
||||
color $navbar-text-color
|
||||
|
||||
a
|
||||
color $navbar-text-color
|
||||
|
||||
&:hover
|
||||
background-color rgba(0, 0, 0, 0.1)
|
||||
|
||||
.navbar-custom
|
||||
color $navbar-text-color
|
||||
|
||||
a
|
||||
color $navbar-text-color
|
||||
|
||||
.top-nav-collapse
|
||||
background-color $navbar-bg-color
|
||||
|
||||
.navbar-col-show
|
||||
background-color $navbar-bg-color
|
||||
|
||||
@media (max-width: 768px)
|
||||
.navbar
|
||||
font-size 1rem
|
||||
line-height 2.5rem
|
||||
|
||||
.pagination a, .pagination .current
|
||||
outline 0
|
||||
border 0
|
||||
background-color transparent
|
||||
font-size .9rem
|
||||
padding .5rem .75rem
|
||||
line-height 1.25
|
||||
-webkit-border-radius .125rem
|
||||
border-radius .125rem
|
||||
-webkit-transition all .3s linear
|
||||
-o-transition all .3s linear
|
||||
transition all .3s linear
|
||||
|
||||
.pagination a:hover, .pagination .current
|
||||
background-color #eee
|
||||
|
||||
.scroll-down-bar
|
||||
position absolute
|
||||
width 100%
|
||||
font-size 2rem
|
||||
height 8rem
|
||||
text-align center
|
||||
cursor pointer
|
||||
bottom 0
|
||||
|
||||
.scroll-down-arrow
|
||||
position absolute
|
||||
padding-top 2rem
|
||||
color #ff
|
||||
-webkit-transform: translateZ(0);
|
||||
-moz-transform: translateZ(0);
|
||||
-ms-transform: translateZ(0);
|
||||
-o-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
-webkit-animation scroll-down 1.5s infinite
|
||||
animation scroll-down 1.5s infinite
|
||||
|
||||
#scroll-top-button
|
||||
position fixed
|
||||
background #fff
|
||||
border-radius 4px
|
||||
width 40px
|
||||
height 40px
|
||||
bottom -60px
|
||||
-webkit-transition bottom .3s ease
|
||||
-moz-transform bottom .3s ease
|
||||
-ms-transform bottom .3s ease
|
||||
-o-transform bottom .3s ease
|
||||
transition bottom .3s ease
|
||||
outline none
|
||||
display flex
|
||||
display -webkit-flex
|
||||
align-items center
|
||||
|
||||
#scroll-top-button i
|
||||
-webkit-transform translateZ(0)
|
||||
-moz-transform translateZ(0)
|
||||
-ms-transform translateZ(0)
|
||||
-o-transform translateZ(0)
|
||||
transform translateZ(0)
|
||||
|
||||
#scroll-top-button:hover i, #scroll-top-button:active i
|
||||
-webkit-animation-name scroll-top
|
||||
animation-name scroll-top
|
||||
-webkit-animation-duration 1s
|
||||
animation-duration 1s
|
||||
-webkit-animation-delay .1s
|
||||
animation-delay .1s
|
||||
-webkit-animation-timing-function ease-in-out
|
||||
animation-timing-function ease-in-out
|
||||
-webkit-animation-iteration-count infinite
|
||||
animation-iteration-count infinite
|
||||
-webkit-animation-fill-mode forwards
|
||||
animation-fill-mode forwards
|
||||
-webkit-animation-direction alternate
|
||||
animation-direction alternate
|
||||
|
||||
.scroll-top-arrow
|
||||
margin auto
|
||||
font-size 24px
|
||||
color #8590AB
|
||||
|
||||
.animated-icon
|
||||
width 30px
|
||||
height 20px
|
||||
position relative
|
||||
margin 0
|
||||
-webkit-transform rotate(0deg)
|
||||
-moz-transform rotate(0deg)
|
||||
-o-transform rotate(0deg)
|
||||
transform rotate(0deg)
|
||||
-webkit-transition .5s ease-in-out
|
||||
-moz-transition .5s ease-in-out
|
||||
-o-transition .5s ease-in-out
|
||||
transition .5s ease-in-out
|
||||
cursor pointer
|
||||
|
||||
span
|
||||
display block
|
||||
position absolute
|
||||
height 3px
|
||||
width 100%
|
||||
border-radius 9px
|
||||
opacity 1
|
||||
left 0
|
||||
-webkit-transform rotate(0deg)
|
||||
-moz-transform rotate(0deg)
|
||||
-o-transform rotate(0deg)
|
||||
transform rotate(0deg)
|
||||
-webkit-transition .25s ease-in-out
|
||||
-moz-transition .25s ease-in-out
|
||||
-o-transition .25s ease-in-out
|
||||
transition .25s ease-in-out
|
||||
background #ffffff
|
||||
|
||||
&:nth-child(1)
|
||||
top 0
|
||||
|
||||
&:nth-child(2)
|
||||
top 10px
|
||||
|
||||
&:nth-child(3)
|
||||
top 20px
|
||||
|
||||
&.open
|
||||
span
|
||||
&:nth-child(1)
|
||||
top 11px
|
||||
-webkit-transform rotate(135deg)
|
||||
-moz-transform rotate(135deg)
|
||||
-o-transform rotate(135deg)
|
||||
transform rotate(135deg)
|
||||
|
||||
&:nth-child(2)
|
||||
opacity 0
|
||||
left -60px
|
||||
|
||||
&:nth-child(3)
|
||||
top 11px
|
||||
-webkit-transform rotate(-135deg)
|
||||
-moz-transform rotate(-135deg)
|
||||
-o-transform rotate(-135deg)
|
||||
transform rotate(-135deg)
|
||||
|
||||
|
||||
@keyframes scroll-down
|
||||
0%
|
||||
opacity 0.8
|
||||
top 0
|
||||
50%
|
||||
opacity 0.4
|
||||
top -1em
|
||||
100%
|
||||
opacity 0.8
|
||||
top 0
|
||||
|
||||
@keyframes scroll-top
|
||||
0%
|
||||
-webkit-transform translateY(0)
|
||||
transform translateY(0)
|
||||
50%
|
||||
-webkit-transform translateY(-0.35rem)
|
||||
transform translateY(-0.35rem)
|
||||
100%
|
||||
-webkit-transform translateY(0)
|
||||
transform translateY(0)
|
||||
|
||||
|
||||
.wechat
|
||||
cursor pointer
|
||||
position relative
|
||||
|
||||
&:hover .wechat-qrcode
|
||||
display block
|
||||
|
||||
.wechat-qrcode
|
||||
width 200px
|
||||
height 300px
|
||||
background url($about-wechat-qrcode) no-repeat
|
||||
background-size 100%
|
||||
position absolute
|
||||
right -100px
|
||||
z-index 99
|
||||
display none
|
||||
|
||||
// Footer police 添加备案图标
|
||||
a.police-beian
|
||||
position relative
|
||||
overflow hidden
|
||||
display inline-flex
|
||||
align-items center
|
||||
justify-content center
|
||||
|
||||
img
|
||||
margin 0 3px
|
||||
width 18px
|
||||
height 18px
|
||||
|
||||
@media (max-width: 320px)
|
||||
a.police-beian
|
||||
span.police-beian-sep
|
||||
display none
|
||||
|
||||
// 友链页
|
||||
@media (max-width: 768px)
|
||||
.links
|
||||
margin-left .5em
|
||||
margin-right .5em
|
||||
|
||||
.link-card
|
||||
box-shadow none
|
||||
|
||||
&:hover
|
||||
box-shadow: 0 0 25px 0 rgba(0,0,0,0.16);
|
||||
z-index 1
|
||||
|
||||
&-title
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
&-text
|
||||
height: 3em;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
20
themes/fluid/source/css/_pages/_category/categories.styl
Normal file
20
themes/fluid/source/css/_pages/_category/categories.styl
Normal file
@ -0,0 +1,20 @@
|
||||
.category-tree-list
|
||||
font-size s = 1rem
|
||||
list-style-type circle
|
||||
|
||||
.category-tree-list-link
|
||||
display inline-block
|
||||
padding .1rem .55rem
|
||||
font-weight 350
|
||||
|
||||
.category-tree-list-count
|
||||
padding-left .5rem
|
||||
color #99a9bf
|
||||
font-size s* (3 / 4)
|
||||
|
||||
&::before
|
||||
content: "("
|
||||
|
||||
&::after
|
||||
content: ")"
|
||||
|
53
themes/fluid/source/css/_pages/_index/index.styl
Normal file
53
themes/fluid/source/css/_pages/_index/index.styl
Normal file
@ -0,0 +1,53 @@
|
||||
.index-header
|
||||
font-weight 700
|
||||
white-space nowrap
|
||||
overflow hidden
|
||||
text-overflow ellipsis
|
||||
|
||||
@media (max-width: 768px)
|
||||
.index-header
|
||||
font-size 1.25rem
|
||||
white-space normal
|
||||
overflow hidden
|
||||
margin-top 1.25rem
|
||||
|
||||
.index-thumbnails
|
||||
display block
|
||||
width 100%
|
||||
height 10rem
|
||||
object-fit cover
|
||||
|
||||
.index-excerpt
|
||||
margin 0.5rem 0 0.5rem 0
|
||||
height auto
|
||||
max-height 5rem
|
||||
line-height 1.25rem
|
||||
overflow hidden
|
||||
|
||||
.index-text
|
||||
float right
|
||||
margin-left -0.25rem
|
||||
width 100%
|
||||
word-break break-word
|
||||
|
||||
&::before
|
||||
float left
|
||||
width 0.25rem
|
||||
content ''
|
||||
height 2rem
|
||||
|
||||
// .index-excerpt::after {
|
||||
// float: right;
|
||||
// content: "...";
|
||||
// height: 1rem;
|
||||
// line-height: 1rem;
|
||||
// !* 为三个省略号的宽度 *!
|
||||
// width: 3em;
|
||||
// !* 使盒子不占位置 *!
|
||||
// margin-left: -3em;
|
||||
// !* 移动省略号位置 *!
|
||||
// position: relative;
|
||||
// left: 100%;
|
||||
// top: -1rem;
|
||||
// padding-right: 0.25rem;
|
||||
// }
|
90
themes/fluid/source/css/_pages/_post/post.styl
Normal file
90
themes/fluid/source/css/_pages/_post/post.styl
Normal file
@ -0,0 +1,90 @@
|
||||
.post-content
|
||||
box-sizing border-box
|
||||
padding-left 10%
|
||||
padding-right 10%
|
||||
max-width 64rem
|
||||
|
||||
img
|
||||
max-width 90%
|
||||
margin 1.5rem auto
|
||||
display block
|
||||
box-shadow $img-shadow
|
||||
|
||||
@media (max-width: 768px)
|
||||
.post-content
|
||||
padding-left 2rem
|
||||
padding-right 2rem
|
||||
|
||||
@media (max-width: 425px)
|
||||
.post-content
|
||||
padding-left 1rem
|
||||
padding-right 1rem
|
||||
|
||||
.post-content h1::before, h2::before, h3::before, h4::before, h5::before, h6::before
|
||||
display block
|
||||
content ""
|
||||
margin-top -50px
|
||||
height 50px
|
||||
width 1px
|
||||
visibility hidden
|
||||
|
||||
|
||||
// toc
|
||||
|
||||
#toc
|
||||
padding 3rem 0 0 0
|
||||
height 80%
|
||||
|
||||
#tocbot
|
||||
max-height 100%
|
||||
overflow-y auto
|
||||
overflow -moz-scrollbars-none
|
||||
-ms-overflow-style none
|
||||
ol
|
||||
list-style none
|
||||
padding-inline-start 1rem
|
||||
&::-webkit-scrollbar
|
||||
display none
|
||||
|
||||
.tocbot-list
|
||||
ol
|
||||
list-style none
|
||||
padding-left 1rem
|
||||
a
|
||||
font-size: 15px
|
||||
|
||||
.tocbot-link
|
||||
color $tocbot-link-color
|
||||
|
||||
.tocbot-active-link
|
||||
font-weight 600
|
||||
color $tocbot-link-active-color
|
||||
|
||||
.tocbot-is-collapsible
|
||||
max-height 1000px
|
||||
overflow hidden
|
||||
transition all 300ms ease-in-out
|
||||
|
||||
.tocbot-is-collapsed
|
||||
max-height 0
|
||||
|
||||
@media (max-width: 1024px)
|
||||
.toc-container
|
||||
padding-left 0
|
||||
padding-right 0
|
||||
|
||||
.custom, .comments
|
||||
margin-left: 2rem
|
||||
margin-right: 2rem
|
||||
|
||||
@media (max-width: 425px)
|
||||
.custom, .comments
|
||||
margin-left: 1rem
|
||||
margin-right: 1rem
|
||||
|
||||
@media (min-width: 64rem)
|
||||
.custom, .comments
|
||||
max-width: 64rem
|
||||
|
||||
.katex-block
|
||||
overflow-x auto
|
0
themes/fluid/source/css/_pages/_tag/tag.styl
Normal file
0
themes/fluid/source/css/_pages/_tag/tag.styl
Normal file
8
themes/fluid/source/css/_pages/_tag/tags.styl
Normal file
8
themes/fluid/source/css/_pages/_tag/tags.styl
Normal file
@ -0,0 +1,8 @@
|
||||
.tagcloud
|
||||
a
|
||||
display inline-block
|
||||
padding .1rem .55rem
|
||||
font-weight 350
|
||||
|
||||
&:hover
|
||||
color $link-hover-color!important
|
7
themes/fluid/source/css/_pages/pages.styl
Normal file
7
themes/fluid/source/css/_pages/pages.styl
Normal file
@ -0,0 +1,7 @@
|
||||
@import "_base/base"
|
||||
@import "_index/index"
|
||||
@import "_post/post"
|
||||
@import "_archive/archive"
|
||||
@import "_about/about"
|
||||
@import "_category/*"
|
||||
@import "_tag/*"
|
36
themes/fluid/source/css/_variables/base.styl
Normal file
36
themes/fluid/source/css/_variables/base.styl
Normal file
@ -0,0 +1,36 @@
|
||||
// Colors
|
||||
// -----------------------
|
||||
|
||||
// body
|
||||
$body-bg-color = theme-config("color.body_bg_color", "#eee")
|
||||
|
||||
// global
|
||||
$text-color = theme-config("color.text_color", "#3c4858")
|
||||
$link-color = theme-config("color.link_color", $text-color)
|
||||
$link-hover-color = theme-config("color.link_hover_color", "#1abc9c")
|
||||
$link-hover-bg = #f8f9fa
|
||||
|
||||
// navbar
|
||||
$navbar-bg-color = theme-config("color.navbar_bg_color", "#2f4154")
|
||||
$navbar-text-color = theme-config("color.navbar_text_color", $text-color)
|
||||
|
||||
// board
|
||||
$board-bg-color = theme-config("color.board_color", "#fff")
|
||||
|
||||
// post
|
||||
$tocbot-link-color = $text-color
|
||||
$tocbot-link-active-color = $link-hover-color
|
||||
|
||||
// about
|
||||
$about-wechat-qrcode = theme-config("about.icons.fab fa-weixin", "")
|
||||
|
||||
// Shadow
|
||||
// -----------------------
|
||||
|
||||
$img-shadow = 0 5px 11px 0 rgba(0, 0, 0, .18), 0 4px 15px 0 rgba(0, 0, 0, .15) !important
|
||||
|
||||
|
||||
|
||||
// User custom
|
||||
// -----------------------
|
||||
@import "custom"
|
0
themes/fluid/source/css/_variables/custom.styl
Normal file
0
themes/fluid/source/css/_variables/custom.styl
Normal file
14
themes/fluid/source/css/main.styl
Normal file
14
themes/fluid/source/css/main.styl
Normal file
@ -0,0 +1,14 @@
|
||||
// --------------------------------------
|
||||
// Fluid
|
||||
// https://github.com/fluid-dev/hexo-theme-fluid
|
||||
// --------------------------------------
|
||||
|
||||
@import "_variables/base"
|
||||
|
||||
@import "_functions/base"
|
||||
|
||||
@import "_mixins/base"
|
||||
|
||||
@import "_pages/pages"
|
||||
|
||||
@import "_custom/custom"
|
BIN
themes/fluid/source/img/apple-touch-icon.png
Normal file
BIN
themes/fluid/source/img/apple-touch-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
BIN
themes/fluid/source/img/avatar.png
Normal file
BIN
themes/fluid/source/img/avatar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
BIN
themes/fluid/source/img/default.png
Normal file
BIN
themes/fluid/source/img/default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
BIN
themes/fluid/source/img/favicon.png
Normal file
BIN
themes/fluid/source/img/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
BIN
themes/fluid/source/img/loading.gif
Normal file
BIN
themes/fluid/source/img/loading.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
themes/fluid/source/img/police_beian.png
Normal file
BIN
themes/fluid/source/img/police_beian.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
49
themes/fluid/source/js/lazyload.js
Normal file
49
themes/fluid/source/js/lazyload.js
Normal file
@ -0,0 +1,49 @@
|
||||
(function (window) {
|
||||
var images = Array.prototype.slice.call(document.querySelectorAll('img[srcset]'));
|
||||
|
||||
function elementInViewport(el) {
|
||||
var rect = el.getBoundingClientRect();
|
||||
var height = window.innerHeight || document.documentElement.clientHeight;
|
||||
return (
|
||||
rect.top >= 0
|
||||
&& rect.left >= 0
|
||||
&& rect.top <= height * 3
|
||||
);
|
||||
}
|
||||
function loadImage(el, fn) {
|
||||
var img = new Image(), src = el.getAttribute('src');
|
||||
img.onload = function () {
|
||||
el.srcset = src;
|
||||
fn ? fn() : null;
|
||||
};
|
||||
img.srcset = src;
|
||||
}
|
||||
|
||||
function processImages() {
|
||||
for (var i = 0; i < images.length; i++) {
|
||||
if (elementInViewport(images[i])) {
|
||||
(function(index){
|
||||
var loadingImage = images[index];
|
||||
loadImage(loadingImage, function () {
|
||||
images = images.filter(function(t) {
|
||||
return loadingImage !== t;
|
||||
});
|
||||
});
|
||||
})(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function throttle(method, context) {
|
||||
clearTimeout(method.tId);
|
||||
method.tId = setTimeout(function () {
|
||||
method.call(context);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
processImages();
|
||||
|
||||
window.addEventListener('scroll', function () {
|
||||
throttle(processImages, window);
|
||||
});
|
||||
})(this);
|
135
themes/fluid/source/js/local-search.js
Normal file
135
themes/fluid/source/js/local-search.js
Normal file
@ -0,0 +1,135 @@
|
||||
// A local search script with the help of [hexo-generator-search](https://github.com/PaicHyperionDev/hexo-generator-search)
|
||||
// Copyright (C) 2017
|
||||
// Liam Huang <https://github.com/Liam0205>
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library 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
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
// 02110-1301 USA
|
||||
//
|
||||
// Updated by Rook1e <https://github.com/0x2E>
|
||||
|
||||
var searchFunc = function (path, search_id, content_id) {
|
||||
// 0x00. environment initialization
|
||||
'use strict';
|
||||
var $input = document.getElementById(search_id);
|
||||
var $resultContent = document.getElementById(content_id);
|
||||
$resultContent.innerHTML = "<div class='m-auto text-center'><div class='spinner-border' role='status'><span class='sr-only'>Loading...</span></div><br/>Loading...</div>";
|
||||
$.ajax({
|
||||
// 0x01. load xml file
|
||||
url: path,
|
||||
dataType: "xml",
|
||||
success: function (xmlResponse) {
|
||||
// 0x02. parse xml file
|
||||
var dataList = $("entry", xmlResponse).map(function () {
|
||||
return {
|
||||
title: $("title", this).text(),
|
||||
content: $("content", this).text(),
|
||||
url: $("url", this).text()
|
||||
};
|
||||
}).get();
|
||||
$resultContent.innerHTML = "";
|
||||
|
||||
$input.addEventListener('input', function () {
|
||||
// 0x03. parse query to keywords list
|
||||
var str = '';
|
||||
var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
|
||||
$resultContent.innerHTML = "";
|
||||
if (this.value.trim().length <= 0) {
|
||||
return;
|
||||
}
|
||||
// 0x04. perform local searching
|
||||
dataList.forEach(function (data) {
|
||||
var isMatch = true;
|
||||
var content_index = [];
|
||||
if (!data.title || data.title.trim() === '') {
|
||||
data.title = "Untitled";
|
||||
}
|
||||
var orig_data_title = data.title.trim();
|
||||
var data_title = orig_data_title.toLowerCase();
|
||||
var orig_data_content = data.content.trim().replace(/<[^>]+>/g, "");
|
||||
var data_content = orig_data_content.toLowerCase();
|
||||
var data_url = data.url;
|
||||
var index_title = -1;
|
||||
var index_content = -1;
|
||||
var first_occur = -1;
|
||||
// only match articles with not empty contents
|
||||
if (data_content !== '') {
|
||||
keywords.forEach(function (keyword, i) {
|
||||
index_title = data_title.indexOf(keyword);
|
||||
index_content = data_content.indexOf(keyword);
|
||||
|
||||
if (index_title < 0 && index_content < 0) {
|
||||
isMatch = false;
|
||||
} else {
|
||||
if (index_content < 0) {
|
||||
index_content = 0;
|
||||
}
|
||||
if (i === 0) {
|
||||
first_occur = index_content;
|
||||
}
|
||||
//content_index.push({index_content:index_content, keyword_len:keyword_len});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
isMatch = false;
|
||||
}
|
||||
// 0x05. show search results
|
||||
if (isMatch) {
|
||||
str += "<a href='" + data_url + "' class='list-group-item list-group-item-action font-weight-bolder search-list-title'>" + orig_data_title + "</a>";
|
||||
var content = orig_data_content;
|
||||
if (first_occur >= 0) {
|
||||
// cut out 100 characters
|
||||
var start = first_occur - 20;
|
||||
var end = first_occur + 80;
|
||||
|
||||
if (start < 0) {
|
||||
start = 0;
|
||||
}
|
||||
|
||||
if (start === 0) {
|
||||
end = 100;
|
||||
}
|
||||
|
||||
if (end > content.length) {
|
||||
end = content.length;
|
||||
}
|
||||
|
||||
var match_content = content.substring(start, end);
|
||||
|
||||
// highlight all keywords
|
||||
keywords.forEach(function (keyword) {
|
||||
var regS = new RegExp(keyword, "gi");
|
||||
match_content = match_content.replace(regS, "<span class='pink-text'>" + keyword + "</span>");
|
||||
});
|
||||
|
||||
str += "<p class='search-list-content'>" + match_content + "...</p>"
|
||||
}
|
||||
}
|
||||
});
|
||||
if (str.indexOf('list-group-item') === -1) {
|
||||
return $('#local-search-input').addClass("invalid").removeClass("valid");
|
||||
}
|
||||
$('#local-search-input').addClass("valid").removeClass("invalid");
|
||||
$resultContent.innerHTML = str;
|
||||
});
|
||||
}
|
||||
});
|
||||
$(document).on('click', '#local-search-close', function () {
|
||||
$('#local-search-input').val('').removeClass("invalid").removeClass("valid");
|
||||
$('#local-search-result').html('');
|
||||
});
|
||||
};
|
||||
|
||||
var getSearchFile = function (path) {
|
||||
searchFunc(path, 'local-search-input', 'local-search-result');
|
||||
};
|
74
themes/fluid/source/js/main.js
Normal file
74
themes/fluid/source/js/main.js
Normal file
@ -0,0 +1,74 @@
|
||||
function scrollToElement(target, offset) {
|
||||
var scroll_offset = $(target).offset();
|
||||
$("body,html").animate({
|
||||
scrollTop: scroll_offset.top + (offset || 0),
|
||||
easing: 'swing'
|
||||
})
|
||||
}
|
||||
|
||||
function scrollToBoard() {
|
||||
scrollToElement('#board', -$("#navbar").height());
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
// 顶部菜单的动效
|
||||
var navbar = $("#navbar");
|
||||
if (navbar.offset().top > 0) {
|
||||
navbar.addClass("navbar-custom");
|
||||
navbar.removeClass("navbar-dark");
|
||||
}
|
||||
$(window).scroll(function () {
|
||||
if (navbar.offset().top > 0) {
|
||||
navbar.addClass("navbar-custom");
|
||||
navbar.removeClass("navbar-dark");
|
||||
} else {
|
||||
navbar.addClass("navbar-dark");
|
||||
}
|
||||
});
|
||||
$('#navbar-toggler-btn').on('click', function () {
|
||||
$('.animated-icon').toggleClass('open');
|
||||
$('#navbar').toggleClass('navbar-col-show');
|
||||
});
|
||||
|
||||
// 向下滚动箭头的点击
|
||||
$(".scroll-down-bar").on("click", scrollToBoard);
|
||||
|
||||
// 向顶部滚动箭头
|
||||
var topArrow = $("#scroll-top-button");
|
||||
var posDisplay = false;
|
||||
var scrollDisplay = false;
|
||||
// 位置
|
||||
var setTopArrowPos = function () {
|
||||
var boardRight = document.getElementById('board').getClientRects()[0].right;
|
||||
var bodyWidth = document.body.offsetWidth;
|
||||
var right = bodyWidth - boardRight;
|
||||
posDisplay = right >= 50;
|
||||
topArrow.css({
|
||||
"bottom": posDisplay && scrollDisplay ? "20px" : "-60px",
|
||||
"right": right - 64 + "px"
|
||||
});
|
||||
};
|
||||
setTopArrowPos();
|
||||
$(window).resize(setTopArrowPos);
|
||||
// 显示
|
||||
var headerHeight = $("#board").offset().top;
|
||||
$(window).scroll(function () {
|
||||
var scrollHeight = document.body.scrollTop + document.documentElement.scrollTop;
|
||||
scrollDisplay = scrollHeight >= headerHeight;
|
||||
topArrow.css({
|
||||
"bottom": posDisplay && scrollDisplay ? "20px" : "-60px"
|
||||
});
|
||||
});
|
||||
// 点击
|
||||
topArrow.on("click", function () {
|
||||
$("body,html").animate({
|
||||
scrollTop: 0,
|
||||
easing: 'swing'
|
||||
})
|
||||
});
|
||||
|
||||
// 因兼容问题,在 iOS 和 Safari 环境下不使用固定 Banner
|
||||
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent) || (/Safari/i.test(navigator.userAgent) && !/Chrome/i.test(navigator.userAgent))) {
|
||||
$("#background").css("background-attachment", "scroll");
|
||||
}
|
||||
});
|
36
themes/fluid/source/js/post.js
Normal file
36
themes/fluid/source/js/post.js
Normal file
@ -0,0 +1,36 @@
|
||||
$(document).ready(function () {
|
||||
var navHeight = $("#navbar").height();
|
||||
var toc = $("#toc");
|
||||
var main = $("main");
|
||||
var tocT = navHeight + (toc.offset().top - main.offset().top);
|
||||
var tocLimMin = main.offset().top - navHeight;
|
||||
var tocLimMax = $("#comments").offset().top - navHeight;
|
||||
$(window).scroll(function () {
|
||||
var scroH = document.body.scrollTop + document.documentElement.scrollTop;
|
||||
if (tocLimMin <= scroH && scroH <= tocLimMax) {
|
||||
toc.css({
|
||||
"display": "block",
|
||||
"position": "fixed",
|
||||
"top": tocT
|
||||
})
|
||||
} else if (scroH <= tocLimMin) {
|
||||
toc.css({
|
||||
"position": "",
|
||||
"top": ''
|
||||
})
|
||||
} else if (scroH > tocLimMax) {
|
||||
toc.css("display", "none")
|
||||
}
|
||||
});
|
||||
tocbot.init({
|
||||
tocSelector: '#tocbot',
|
||||
contentSelector: '.post-content',
|
||||
headingSelector: 'h1, h2, h3, h4, h5, h6',
|
||||
linkClass: 'tocbot-link',
|
||||
activeLinkClass: 'tocbot-active-link',
|
||||
listClass: 'tocbot-list',
|
||||
isCollapsedClass: 'tocbot-is-collapsed',
|
||||
collapsibleClass: 'tocbot-is-collapsible',
|
||||
scrollSmooth: true,
|
||||
});
|
||||
});
|
9
themes/fluid/source/lib/anchor/anchor.min.js
vendored
Normal file
9
themes/fluid/source/lib/anchor/anchor.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
themes/fluid/source/lib/bootstrap/css/bootstrap.min.css
vendored
Normal file
6
themes/fluid/source/lib/bootstrap/css/bootstrap.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
6
themes/fluid/source/lib/bootstrap/js/bootstrap.min.js
vendored
Normal file
6
themes/fluid/source/lib/bootstrap/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
themes/fluid/source/lib/fancybox/jquery.fancybox.min.css
vendored
Normal file
1
themes/fluid/source/lib/fancybox/jquery.fancybox.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
13
themes/fluid/source/lib/fancybox/jquery.fancybox.min.js
vendored
Normal file
13
themes/fluid/source/lib/fancybox/jquery.fancybox.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
themes/fluid/source/lib/font-awesome/css/all.min.css
vendored
Normal file
5
themes/fluid/source/lib/font-awesome/css/all.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
themes/fluid/source/lib/font-awesome/webfonts/fa-brands-400.eot
Normal file
BIN
themes/fluid/source/lib/font-awesome/webfonts/fa-brands-400.eot
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user