Skip to content

Commit cc032a0

Browse files
committed
up
1 parent 9d4ba04 commit cc032a0

File tree

133 files changed

+4348
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+4348
-0
lines changed

404.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: mypost
3+
title: 页面未找到
4+
---
5+
6+
```js
7+
// 404 page not found.
8+
if (!found) {
9+
throw ("(╯°□°)╯︵ ┻━┻");
10+
}
11+
```
12+

CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deoncn.github.io

Gemfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'jekyll', '3.8.5'
4+
gem 'rouge', '3.11.0'
5+
gem 'wdm', '>= 0.1.0'

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 TMaize
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# 介绍
2+
3+
[![Language](https://img.shields.io/badge/Jekyll-Theme-blue)](https://github.com/TMaize/tmaize-blog)
4+
[![license](https://img.shields.io/github/license/TMaize/tmaize-blog)](https://github.com/TMaize/tmaize-blog)
5+
[![GitHub stars](https://img.shields.io/github/stars/TMaize/tmaize-blog?style=social)](https://github.com/TMaize/tmaize-blog)
6+
7+
一款 jekyll 主题([GitHub 地址](https://github.com/TMaize/tmaize-blog)),简洁纯净(主题资源请求<20KB),未引入任何框架,秒开页面,支持自适应,支持全文检索,支持夜间模式
8+
9+
你可以到[TMaize Blog](https://blog.tmaize.net/)查看主题效果,欢迎添加友链
10+
11+
## 感谢
12+
13+
[JetBrains](https://www.jetbrains.com/?from=tmaize-blog) 免费提供的开发工具[![JetBrains](./static/img/jetbrains.svg)](https://www.jetbrains.com/?from=tmaize-blog)
14+
15+
[夜间模式代码高亮配色](https://github.com/mgyongyosi/OneDarkJekyll)
16+
17+
# 本地运行
18+
19+
一般提交到 github 过个几十秒就可以看到效果,如果你需要对在本地查看效果需要安装 ruby 环境和依赖
20+
21+
windows 下推荐在 wsl 下装 ruby,直接一句`apt install build-essential ruby ruby-dev` 就行了
22+
23+
```bash
24+
# linux下需要gcc
25+
26+
# gem sources --add https://gems.ruby-china.com/
27+
# gem sources --remove https://rubygems.org/
28+
# gem sources --remove https://mirrors.aliyun.com/rubygems/
29+
# gem sources -l
30+
gem install bundler
31+
# bundle config mirror.https://rubygems.org https://gems.ruby-china.com
32+
bundle install
33+
```
34+
35+
通过下面命令启动/编译项目
36+
37+
```bash
38+
bundle exec jekyll serve --watch --host=127.0.0.1 --port=8080
39+
bundle exec jekyll build --destination=dist
40+
```
41+
42+
如果需要替换代码高亮的样式可以通过下面的命令生成 css
43+
44+
```bash
45+
rougify help style
46+
rougify style github > highlighting.css
47+
```
48+
49+
# 项目配置
50+
51+
1. 如果使用自己的域名,`CNAME`文件里的内容请换成你自己的域名,然后 CNAME 解析到`用户名.github.com`
52+
53+
2. 如果使用 GitHub 的的域名,请删除`CNAME`文件,然后把你的项目修改为`用户名.github.io`
54+
55+
3. 修改`pages/about.md`中关于我的内容
56+
57+
4. 修改`_config.yml`文件,具体作用请参考注释
58+
59+
5. 清空`post _posts`目录下所有文件,注意是清空,不是删除这两个目录
60+
61+
6. 网站的 logo 和 favicon 放在了`static/img/`下,替换即可,大小无所谓,图片比例最好是 1:1
62+
63+
7. 如果你是把项目 fork 过去的,想要删除我的提交记录可以先软重置到第一个提交,然后再提交一次,最后强制推送一次就行了
64+
65+
# 使用
66+
67+
文章放在`_posts`目录下,命名为`yyyy-MM-dd-xxxx-xxxx.md`,内容格式如下
68+
69+
```yaml
70+
---
71+
layout: mypost
72+
title: 标题
73+
categories: [分类1, 分类2]
74+
---
75+
文章内容,Markdown格式
76+
```
77+
78+
文章资源放在`posts`目录,如文章文件名是`2019-05-01-theme-usage.md`,则该篇文章的资源需要放在`posts/2019/05/01`下,在文章使用时直接引用即可。当然了,写作的时候会提示资源不存在忽略即可
79+
80+
```md
81+
![这是图片](xxx.png)
82+
83+
[xxx.zip 下载](xxx.zip)
84+
```

_config.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
encoding: utf-8
2+
3+
# SEO相关信息
4+
title: 🍆在下茄酱,有何贵干
5+
description: 🍆在下茄酱,有何贵干
6+
keywords: 川川,Deoncn,Blog,Java,Deon,Html,JavaScript,
7+
author:
8+
footerText: 'Copyright 2021 - 2022 Deoncn. All Rights Reserved'
9+
10+
# 这些不要动
11+
permalink: /posts/:year/:month/:day/:title.html
12+
kramdown:
13+
auto_ids: true
14+
input: GFM
15+
syntax_highlighter: rouge
16+
exclude: ['CNAME', 'README.md', 'LICENSE', '_site', 'dist', 'Gemfile', 'Gemfile.lock', 'blog.sh']
17+
18+
# 域名配置
19+
# baseurl配置,如果网站部署在根目录下的其他目录中,请设置为 /目录名
20+
domainUrl: 'https://deoncn.github.io'
21+
baseurl: ''
22+
23+
# 吐个槽地址,会在chat页面中重定向到该地址
24+
tucaoUrl: https://support.qq.com/products/297659
25+
26+
27+
# 菜单
28+
menu:
29+
30+
- title: 主页
31+
url: /
32+
- title: 日志
33+
url: /pages/blog.html
34+
- title: 归类
35+
url: /pages/categories.html
36+
- title: 搜索
37+
url: /pages/search.html
38+
- title: 友链
39+
url: /pages/links.html
40+
- title: 留言板
41+
url: /pages/chat.html
42+
- title: 关于
43+
url: /pages/about.html
44+
- title: 导航
45+
url: /pages/deonpageindex.html
46+
- title: 下载页
47+
url: /pages/downloadpage.html
48+
- title: 礼物
49+
url: /pages/gift/index.html
50+
51+
52+
# 点击页面文字冒出特效,不需要请设置为false
53+
extClickEffect: false
54+
55+
# Google Adsense,不需要请设置为false
56+
# _includes/ext-adsense.html 里面修改为自己的配置
57+
extAdsense: false
58+
59+
# 数学公式支持,比较影响加载速度,不需要请设置为false
60+
extMath: false
61+
62+
63+
# 友情链接
64+
links:
65+
- title: 文科中的技术宅
66+
url: https://www.townwang.com
67+
- title: Py's Whisper
68+
url: https://whisper.pyliubaolin.top/

_includes/ext-adsense.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- Google Adsense -->
2+
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
3+
<ins class="adsbygoogle"
4+
style="display:block"
5+
data-ad-client="ca-pub-1121695299360400"
6+
data-ad-slot="6446850432"
7+
data-ad-format="auto"
8+
data-full-width-responsive="true"></ins>
9+
<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>

_includes/ext-mathjax.html

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!-- MathJax数学公式支持 -->
2+
<style>
3+
.has-jax {
4+
-webkit-user-select: none;
5+
-moz-user-select: none;
6+
-ms-user-select: none;
7+
user-select: none;
8+
background-color: transparent !important;
9+
line-height: normal !important;
10+
word-break: normal !important;
11+
padding: 0 !important;
12+
margin: 0 !important;
13+
}
14+
.has-jax * {
15+
outline: 0;
16+
}
17+
</style>
18+
<script type="text/x-mathjax-config">
19+
MathJax.Hub.Config({
20+
showProcessingMessages: false,
21+
messageStyle: "none",
22+
tex2jax: {
23+
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
24+
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
25+
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'a']
26+
},
27+
"HTML-CSS": {
28+
showMathMenu: false
29+
}
30+
});
31+
// 父级元素添加类名,便于css控制
32+
MathJax.Hub.Queue(function() {
33+
var all = MathJax.Hub.getAllJax();
34+
var i = 0;
35+
for(i=0; i < all.length; i += 1) {
36+
all[i].SourceElement().parentNode.className += ' has-jax';
37+
}
38+
});
39+
</script>
40+
<script
41+
type="text/javascript"
42+
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
43+
></script>

_includes/ext-serviceWorker.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script>
2+
;(function () {
3+
// var extServiceWorker = true
4+
var extServiceWorker = '{{ site.extServiceWorker }}' === 'true'
5+
if (!extServiceWorker) return
6+
if (!navigator.serviceWorker) return
7+
if (location.protocol !== 'https:' && location.hostname !== '127.0.0.1') return
8+
window.addEventListener('load', function () {
9+
navigator.serviceWorker.register(blog.baseurl + '/service-worker.js').catch(function (e) {
10+
console.error('serviceWorker register fail', e)
11+
})
12+
navigator.serviceWorker.addEventListener('controllerchange', () => {
13+
window.location.reload()
14+
})
15+
})
16+
})()
17+
</script>

_includes/footer.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<footer class="footer">
2+
<center>
3+
<span>{{ site.footerText }}</span>
4+
<a href="{{ site.baseurl }}/static/xml/rss.xml" target="_blank">RSS订阅</a>
5+
{%- comment %} 请保留主题来源,么么哒~ {% endcomment %}
6+
<span>Theme By</span>
7+
<a href="https://github.com/TMaize/tmaize-blog" target="_blank">TMaize</a>
8+
</center>
9+
10+
</footer>
11+
<div id="to-top">
12+
<span></span>
13+
<span></span>
14+
</div>

_includes/head.html

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{%- assign buildAt = site.time | date: "%Y%m%d%H%M%S" -%}
2+
<head>
3+
<title>{{ page.title }}-{{ site.title }}</title>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="content-language" content="zh-CN" />
6+
<meta name="theme-color" content="#ffffff" />
7+
<meta name="supported-color-schemes" content="light dark">
8+
<meta name="renderer" content="webkit">
9+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
10+
<meta name="viewport" content="width=device-width,initial-scale=1" />
11+
<meta name="applicable-device" content="pc,mobile">
12+
<meta name="author" content="{{ site.author }}" />
13+
{%- if page.categories %}
14+
<meta name="description" content="{{ page.title }}"/>
15+
<meta name="keywords" content="{{ site.author }}{% for category in page.categories %},{{ category }}{% endfor %}"/>
16+
{% else %}
17+
<meta name="description" content="{{ site.description }}"/>
18+
<meta name="keywords" content="{{ site.keywords }}"/>
19+
{% endif -%}
20+
<link rel="icon" href="{{site.baseurl}}/static/img/favicon.ico" />
21+
<link rel="apple-touch-icon" href="{{site.baseurl}}/static/img/logo.png" />
22+
<link rel="stylesheet" href="{{site.baseurl}}/static/css/common.css?t={{buildAt}}">
23+
<link rel="stylesheet" href="{{site.baseurl}}/static/css/theme-dark.css?t={{buildAt}}">
24+
{%- if page.layout == "mypost" %}
25+
<link rel="stylesheet" href="{{site.baseurl}}/static/css/post.css?t={{buildAt}}">
26+
<link rel="stylesheet" href="{{site.baseurl}}/static/css/code-dark.css?t={{buildAt}}">
27+
<link rel="stylesheet" href="{{site.baseurl}}/static/css/code-light.css?t={{buildAt}}">
28+
{%- endif %}
29+
{%- if page.layout == "page" %}
30+
<link rel="stylesheet" href="{{site.baseurl}}/static/css/page.css?t={{buildAt}}">
31+
{%- endif %}
32+
<link rel="prefetch" href="{{site.baseurl}}/static/xml/search.xml?t={{ buildAt }}">
33+
<link rel="prefetch" href="{{site.baseurl}}/static/js/search.js?t={{ buildAt }}">
34+
<script>
35+
window.blog = {
36+
baseurl:"{{site.baseurl}}",
37+
buildAt:"{{buildAt}}",
38+
darkTheme: false,
39+
setDarkTheme: function (dark) {
40+
this.darkTheme = Boolean(dark);
41+
document.documentElement.className = this.darkTheme ? 'dark': '';
42+
document.querySelector('meta[name=theme-color]').setAttribute('content', this.darkTheme ? '#2D2E32': '#FFFFFF');
43+
}
44+
}
45+
if (sessionStorage.darkTheme !== undefined) {
46+
blog.setDarkTheme(sessionStorage.darkTheme === 'true'); // 记忆值,单个窗口内有效
47+
} else {
48+
blog.setDarkTheme(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches); // 跟随系统
49+
}
50+
if (window.matchMedia) {
51+
var media = window.matchMedia('(prefers-color-scheme: dark)');
52+
media.addListener(function (ev) {
53+
blog.setDarkTheme(ev.currentTarget.matches);
54+
sessionStorage.removeItem('darkTheme');
55+
});
56+
}
57+
</script>
58+
</head>

_includes/header.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<header class="header">
2+
<img class="logo" src="https://thirdqq.qlogo.cn/g?b=oidb&k=7JfQDPgsztTjt8KBlzV6Aw&s=100&t=1605528403" alt="logo"/>
3+
<nav class="menu">
4+
{% for menu in site.menu -%}
5+
<a href="{{ site.baseurl }}{{ menu.url }}" class="hover-underline">{{ menu.title }}</a>
6+
{% endfor -%}
7+
</nav>
8+
</header>

_includes/music.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<audio id="audio" controls="" preload="none">
2+
<source id="mp3" src="http://music.163.com/song/media/outer/url?id=1369820.mp3">
3+
</audio>

_includes/script.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{%- assign buildAt = site.time | date: "%Y%m%d%H%M%S" -%}
2+
<script type="text/javascript" src="{{site.baseurl}}/static/js/blog.js?t={{ buildAt }}"></script>
3+
<script type="text/javascript" src="{{site.baseurl}}/static/js/search.js?t={{ buildAt }}"></script>
4+
5+
{%- if site.extClickEffect %}
6+
<!-- 点击页面文字冒出特效 -->
7+
<script>
8+
;(function(){
9+
var textArr = ['富强', '民主', '文明', '和谐', '自由', '平等', '公正', '法治', '爱国', '敬业', '诚信', '友善']
10+
window.blog.initClickEffect(textArr)
11+
})()
12+
</script>
13+
{% endif %}
14+
15+
{%- if site.extMath and page.layout=="mypost" -%}
16+
{% include ext-mathjax.html %}
17+
{% endif %}

0 commit comments

Comments
 (0)