jekyll-zeta 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +674 -0
- data/README.md +188 -0
- data/_config.yml +66 -0
- data/_includes/back_link.html +0 -0
- data/_includes/collecttags.html +17 -0
- data/_includes/encrypted.html +172 -0
- data/_includes/goat_counter.html +6 -0
- data/_includes/head.html +35 -0
- data/_includes/main.css +65 -0
- data/_includes/menu_item.html +26 -0
- data/_includes/navbar.html +27 -0
- data/_includes/post_list.html +25 -0
- data/_layouts/archive.html +38 -0
- data/_layouts/default.html +23 -0
- data/_layouts/home.html +15 -0
- data/_layouts/page.html +9 -0
- data/_layouts/post.html +24 -0
- data/_layouts/tagpage.html +21 -0
- data/_layouts/tags.html +50 -0
- data/assets/css/main.css +104 -0
- data/assets/js/mouse_coords.js +9 -0
- metadata +92 -0
data/README.md
ADDED
@@ -0,0 +1,188 @@
|
|
1
|
+
# no style, please!
|
2
|
+
|
3
|
+
<img src="https://raw.githubusercontent.com/riggraz/no-style-please/master/logo.png" width="64" align="left" />A (nearly) no-CSS, fast, minimalist [Jekyll](https://jekyllrb.com/) theme.
|
4
|
+
Inspired by [elly's site](http://tilde.town/~elly/) [riggraz](https://riggraz.dev/)
|
5
|
+
|
6
|
+
<h3 align="center"><a href="https://vitock.github.io/no-style-please">Try the demo out!</a></h3>
|
7
|
+
|
8
|
+
<img src="https://raw.githubusercontent.com/riggraz/no-style-please/master/_screenshots/featured-image.png" />
|
9
|
+
|
10
|
+
## Features
|
11
|
+
|
12
|
+
+ ### new
|
13
|
+
+ tags support
|
14
|
+
+ mathjax , inluce_code post_link support, include support, link to other post
|
15
|
+
+ encrytion support. Only those who know the password can view the article
|
16
|
+
|
17
|
+
**IMPORTANT NOTE**
|
18
|
+
ONLY textual contents of article will be encrypted ,the pictures will **NOT** be encrypted
|
19
|
+
|
20
|
+
|
21
|
+
#### how to encrypt your post
|
22
|
+
1. generate your own public & private key to protect your password
|
23
|
+
```
|
24
|
+
ltectool g
|
25
|
+
```
|
26
|
+
you will get
|
27
|
+
```
|
28
|
+
publickey: AAA
|
29
|
+
privatekey: BBBBB
|
30
|
+
```
|
31
|
+
|
32
|
+
2. encrypt your password
|
33
|
+
|
34
|
+
|
35
|
+
``` bash
|
36
|
+
# ltectool e [your publickey] [your password]
|
37
|
+
# like below
|
38
|
+
ltectool e Arkuf0hG0sjifj+G57o4gwPgnXXD72kIhjhSGjyyGCdS 123
|
39
|
+
|
40
|
+
# output
|
41
|
+
AQAQACAAIQCVKE9YHFT4pzyMa84kqGK+4Olo3EeDlymDa0oZcsQ48j8S4D4fMFb37gUT4LgrxZQDCFLa402i9VhhMIYWXZP+WSsv2Ia+uQpEH5vYKgDR5vL4xXC/76wXl3K7abU7u9du
|
42
|
+
|
43
|
+
```
|
44
|
+
you get your encrypted password ,
|
45
|
+
then put it in `_config.yml`
|
46
|
+
|
47
|
+
```yaml
|
48
|
+
enc_tags:
|
49
|
+
- tag: encrypt1
|
50
|
+
password: "123" # plain text ,NOT recommended
|
51
|
+
|
52
|
+
- tag: encrypt2
|
53
|
+
# 123
|
54
|
+
password: AQAQACAAIQCVKE9YHFT4pzyMa84kqGK+4Olo3EeDlymDa0oZcsQ48j8S4D4fMFb37gUT4LgrxZQDCFLa402i9VhhMIYWXZP+WSsv2Ia+uQpEH5vYKgDR5vL4xXC/76wXl3K7abU7u9du
|
55
|
+
```
|
56
|
+
add JEKYLL_EC_PRIVATEKEY to ENV before you run jekyll build
|
57
|
+
or set JEKYLL_EC_PRIVATEKEY to your CI environment
|
58
|
+
``` bash
|
59
|
+
#export set JEKYLL_EC_PRIVATEKEY=[Private key]
|
60
|
+
export set JEKYLL_EC_PRIVATEKEY="NWWtiQbDnSDvTdogCzAjqNqHGTZrRXdmXQrEKiv3vNs="
|
61
|
+
```
|
62
|
+
|
63
|
+
**for security, I recommend you to use different repos to store your source files and the `_site` files**
|
64
|
+
|
65
|
+
+ ### origin:
|
66
|
+
* Fast (**1kb of CSS!** For more information on performance and more, see [Page Speed Insights report](https://raw.githubusercontent.com/riggraz/no-style-please/master/_screenshots/page-speed-insights-report.png) and [Lighthouse report](https://raw.githubusercontent.com/riggraz/no-style-please/master/_screenshots/lighthouse-report.png))
|
67
|
+
* Light, dark and auto modes
|
68
|
+
* Responsive
|
69
|
+
* Content first (typography optimized for maximum readability)
|
70
|
+
* ~~SEO optimized (uses [Jekyll SEO Tag](https://github.com/jekyll/jekyll-seo-tag))~~
|
71
|
+
* ~~RSS feed (uses [Jekyll Feed](https://github.com/jekyll/jekyll-feed))~~
|
72
|
+
* ~~Fully compatible with [GitHub Pages](https://pages.github.com/) (see [GitHub Pages installation](#github-pages-installation))~~
|
73
|
+
> you should build the _site by yourself , because githubpage do not support all plugins
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
## Installation
|
78
|
+
|
79
|
+
If you haven't already created your blog using Jekyll, follow the [instructions](https://jekyllrb.com/docs/) to do so from Jekyll's documentation.
|
80
|
+
|
81
|
+
NOTE: if you are using Jekyll with GitHub Pages, see the [GitHub Pages installation section](#github-pages-installation).
|
82
|
+
|
83
|
+
Then, to style your blog with this theme, add this line to your Jekyll site's `Gemfile`:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
gem "no-style-please2"
|
87
|
+
```
|
88
|
+
|
89
|
+
And add this line to your Jekyll site's `_config.yml`:
|
90
|
+
|
91
|
+
```yaml
|
92
|
+
theme: no-style-please2
|
93
|
+
```
|
94
|
+
|
95
|
+
And then execute:
|
96
|
+
|
97
|
+
$ bundle
|
98
|
+
|
99
|
+
Or install it yourself as:
|
100
|
+
|
101
|
+
$ gem install no-style-please
|
102
|
+
|
103
|
+
### Customize the menu
|
104
|
+
|
105
|
+
In order to add/edit/delete entries from the main menu, you have to edit the `menu.yml` file inside `_data` folder. Through that file you can define the structure of the menu. Take a look at the default configuration to get an idea of how it works and read on for a more comprehensive explanation.
|
106
|
+
|
107
|
+
The `menu.yml` file accepts the following fields:
|
108
|
+
|
109
|
+
- `entries` define a new unordered list that will contain menu entries
|
110
|
+
- each entry is marked by a `-` at the beginning of the line
|
111
|
+
- each entry can have the following attributes:
|
112
|
+
- `title`, which defines the text to render for this menu entry (**NB: you can also specify HTML!**)
|
113
|
+
- `url`, which can be used to specify an URL for this entry. If not specified, `title` will be rendered as-is; otherwise `title` will be sorrounded by a link tag pointing to the specified URL. Note that the URL can either be relative or absolute. Also note that you can get the same result by placing an ```<a>``` tag in the `title` field.
|
114
|
+
- `post_list`, which can be set either to `true` or to an object. If it is true, the entry will have a list of all posts as subentries. This is used to render your post list. If you want to customize which posts to render (e.g. by category), you can add one or more of the following attributes under `post_list`:
|
115
|
+
- `category`, which can be set to a string. It is used to render a list of posts of the specified category only. If you don't set it, then posts of all categories will be rendered.
|
116
|
+
- `limit`, which can be set to a number. It specifies the number of posts to show. If not set, all posts will be rendered.
|
117
|
+
- `show_more`, which can be true. If it is true and if the number of posts to show is greater than the specified `limit`, render a link to another page. To specify the URL and the text of the link, you can set `show_more_url` and `show_more_text` attributes, which are documented below.
|
118
|
+
- `show_more_url`, which can be a string. It specifies the URL for the show more link. Use only if `show_more` is true. This will usually redirect to a page containing all posts, which you can easily create using an archive page (see [create archive pages](#create-archive-pages) section)
|
119
|
+
- `show_more_text`, which can be a string. It specifies the text for the show more link. Use only if `show_more` is true.
|
120
|
+
- `entries`, yes, you can have entries inside entries. In this way you can create nested sublists!
|
121
|
+
### Show all tags
|
122
|
+
create a `tags.md` with content below
|
123
|
+
``` yml
|
124
|
+
---
|
125
|
+
title: TAGS
|
126
|
+
layout: tags
|
127
|
+
permalink: /tags/index.html
|
128
|
+
---
|
129
|
+
```
|
130
|
+
|
131
|
+
add a entry in the _data/menu.yml
|
132
|
+
``` yml
|
133
|
+
- title: tags
|
134
|
+
url: tags
|
135
|
+
```
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
### Create archive pages
|
141
|
+
|
142
|
+
A so-called archive page is a page that shows a list of posts (see [this](https://riggraz.dev/no-style-please/all-posts) for an example). You can create an archive page by creating a page and putting the following frontmatter:
|
143
|
+
|
144
|
+
```
|
145
|
+
---
|
146
|
+
layout: archive
|
147
|
+
title: The title of the page here
|
148
|
+
which_category: name-of-category
|
149
|
+
---
|
150
|
+
```
|
151
|
+
|
152
|
+
`which_category` is optional: if you don't put it, then all posts of the blog will be listed; on the other hand, if you specify a category, only posts of that category will be shown.
|
153
|
+
|
154
|
+
This feature is particularly useful if used together with the `show_more` attribute in the menu. For example, if you want to limit the number of posts shown in the home page to 5 but add a link to view them all, then you can create an archive page using the method showed above and link to it using the `show_more_url` attribute in `menu.yml`. See [this example](https://github.com/riggraz/no-style-please/blob/master/_data/menu.yml) if you're in doubt.
|
155
|
+
|
156
|
+
### Customize the index page
|
157
|
+
|
158
|
+
The `index.md` page should use layout `home`, which is the layout that displays the menu. If you want to have some content after the menu, you can just add that content in the `index.md` file, and it will automatically show under the menu.
|
159
|
+
|
160
|
+
Another thing you can do to customize the index page is show the description of your blog between the title and the menu. To do this, just edit `_config.yml` and change `theme_config.show_description` to `true`.
|
161
|
+
|
162
|
+
### Pro tips
|
163
|
+
|
164
|
+
#### Dark mode for images
|
165
|
+
|
166
|
+
This theme provides dark mode by inverting all colors of light mode throught the CSS `invert()` function. This approach would also invert the color of all images, but, since this is not the behaviour one would expect, images are not inverted by default.
|
167
|
+
|
168
|
+
However, if you would like to force the color inversion on a specific image you can do so by applying `class="ioda"` to that image ("ioda" stands for "invert on dark appearance"). See the image in the [overview post](https://github.com/riggraz/no-style-please/blob/master/_posts/2020-07-07-overview-post.md) for an example of this approach. Note that color inversion will take place only when the theme has dark appearance!
|
169
|
+
|
170
|
+
For example, if you have a black and white image it could make sense to invert it in dark mode. On the other hand, a colorful image will probably look bad if inverted.
|
171
|
+
|
172
|
+
## Contributing
|
173
|
+
|
174
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/riggraz/no-style-please. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
175
|
+
|
176
|
+
## Development
|
177
|
+
|
178
|
+
To set up your environment to develop this theme, run `bundle install`.
|
179
|
+
|
180
|
+
Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.
|
181
|
+
|
182
|
+
When your theme is released, only the files in `_layouts`, `_includes`, `_sass` and `assets` tracked with Git will be bundled.
|
183
|
+
To add a custom directory to your theme-gem, please edit the regexp in `no-style-please.gemspec` accordingly.
|
184
|
+
|
185
|
+
## License
|
186
|
+
|
187
|
+
The theme is available as open source under the terms of the [GPL License](./LICENSE.txt).
|
188
|
+
|
data/_config.yml
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
title: jekyll-zeta! # name of the site
|
2
|
+
author: vitock # name of site's author
|
3
|
+
email: "" # email of site's author
|
4
|
+
url: "" # root address of the site
|
5
|
+
baseurl: "/jekyll-zeta" # subpath of the site, e.g. "/blog" (leave it blank "" if you're site shouldn't use a subpath)
|
6
|
+
description: > # description of the site (multiple lines allowed)
|
7
|
+
A (nearly) no-CSS, fast, minimalist Jekyll theme.
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
favicon: "logo.png" # name+extension of favicon (which must be put on the root folder)
|
13
|
+
# goat_counter: "yoursitename" # put your GoatCounter name if you want to use GoatCounter analytics
|
14
|
+
|
15
|
+
# theme: no-style-please2 # if you are using GitHub Pages, change it to remote_theme: riggraz/no-style-please
|
16
|
+
|
17
|
+
theme_config:
|
18
|
+
appearance: "auto" # can be "light", "dark" or "auto"
|
19
|
+
date_format: "%Y-%m-%d" # customize how date is formatted
|
20
|
+
post_date_format: "%Y/%m/%d"
|
21
|
+
encrypt_title: "Content is Encryped :)"
|
22
|
+
# encrypt_clear_btn: "清空缓存密码"
|
23
|
+
# decrypt_btn: 解密
|
24
|
+
# encrypt_btn: 重新加密
|
25
|
+
tag_showall: true
|
26
|
+
all_tags_path: tags
|
27
|
+
all_tags_title: All Tags
|
28
|
+
archive_date_format: "%Y"
|
29
|
+
archive_title_date_format: "%m-%d"
|
30
|
+
tags_layout_style: 'auto' # flat auto list
|
31
|
+
combine_css_html: false
|
32
|
+
menu:
|
33
|
+
- title: 主页
|
34
|
+
url: /
|
35
|
+
- title: 归档
|
36
|
+
url: /archive.html
|
37
|
+
- title: 标签
|
38
|
+
url: /tags.html
|
39
|
+
- title: 关于
|
40
|
+
url: /about.html
|
41
|
+
|
42
|
+
#
|
43
|
+
# forbid_cache_password: true
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
plugins:
|
50
|
+
- no-style-please2-plugins
|
51
|
+
# - jekyll-seo-tag
|
52
|
+
|
53
|
+
|
54
|
+
enc_tags:
|
55
|
+
- tag: ZZ
|
56
|
+
password: '1'
|
57
|
+
- tag: encrypt1
|
58
|
+
password: "12345" # plain text ,not recommed
|
59
|
+
|
60
|
+
# do Not write you public or privatekey in your repo,
|
61
|
+
# use ltectool g to generate a new one for your own blog
|
62
|
+
# publickey: Aos74Reqw/veNVVdCJJ8v8uTUx178mJIw1kjHjDtZ561
|
63
|
+
# privatekey: L28e3HZofHGGIr3ZZTIPhtfBfTbvxedNYF1xpJdx5PA=
|
64
|
+
- tag: encrypt2
|
65
|
+
# 123
|
66
|
+
password: AQAQACAAIQCvWkhJdhn0b21Pz381AdTeMLb5bRO4d2F3usQtpIL0fDD0G8cg4klENXxJNX+rAHwD8VW2iJo4hZKDQrjdOjbJFugo60XnMmbdLEfzXpkqGpjjbe875/owWyNnGGPk3Vf4
|
File without changes
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{% assign rawtags = "" %}
|
2
|
+
{% for post in site.posts %}
|
3
|
+
{% assign ttags = post.tags | join:'|' | append:'|' %}
|
4
|
+
{% assign rawtags = rawtags | append:ttags %}
|
5
|
+
{% endfor %}
|
6
|
+
{% assign rawtags = rawtags | split:'|' | sort %}
|
7
|
+
{% assign site.tags = "" %}
|
8
|
+
{% for tag in rawtags %}
|
9
|
+
{% if tag != "" %}
|
10
|
+
{% if tags == "" %}
|
11
|
+
{% assign tags = tag | split:'|' %}
|
12
|
+
{% endif %}
|
13
|
+
{% unless tags contains tag %}
|
14
|
+
{% assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' %}
|
15
|
+
{% endunless %}
|
16
|
+
{% endif %}
|
17
|
+
{% endfor %}
|
@@ -0,0 +1,172 @@
|
|
1
|
+
|
2
|
+
<div id="encrypted">
|
3
|
+
<h3> {{ site.theme_config.encrypt_title | default : 'Content is Encrypted'}} </h3>
|
4
|
+
|
5
|
+
<input style="width:100%; " type="password" id="passwordinput" placeholder="输入密码"></input>
|
6
|
+
<p>
|
7
|
+
<input type="button" value= "{{ site.theme_config.decrypt_btn | default : 'Decrypt' }}" id="DecryptBtn"/>
|
8
|
+
<input type="button" value= "{{ site.theme_config.encrypt_clear_btn | default: 'Clear password cache' }}" id="ClearBtn1"/>
|
9
|
+
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div id="decrypted" style = "display:none">
|
13
|
+
<p>
|
14
|
+
<div>
|
15
|
+
|
16
|
+
<input type="button" value= "{{ site.theme_config.encrypt_btn | default: 'Encrypt' }}" id="EncryptBtn"/>
|
17
|
+
|
18
|
+
<input type="button" value= "{{ site.theme_config.encrypt_clear_btn | default: 'Clear password cache' }}" id="ClearBtn2"/>
|
19
|
+
|
20
|
+
</div>
|
21
|
+
<div id = 'decryptContent'>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<script>
|
25
|
+
var exports = exports || {}
|
26
|
+
</script>
|
27
|
+
<script src="//cdn.jsdelivr.net/gh/vitock/jsdelivr@0.1.2/js/base64js.js"></script>
|
28
|
+
<script>
|
29
|
+
!function(){
|
30
|
+
|
31
|
+
const substl = crypto.subtle
|
32
|
+
const preFix = '{{encid}}';
|
33
|
+
const encid = preFix
|
34
|
+
const encryptedContent = '{{ content | encrypt_content:page, encid}}'
|
35
|
+
const base64str = encryptedContent.substring(3)
|
36
|
+
const bfMsg = base64js.decode(base64str)
|
37
|
+
const bfIv = bfMsg.subarray(0,12)
|
38
|
+
const bfCipher = bfMsg.subarray(12)
|
39
|
+
|
40
|
+
async function genKey(psw){
|
41
|
+
var keyRaw = new TextEncoder().encode(psw)
|
42
|
+
var key = await substl.importKey('raw',keyRaw,'PBKDF2',false,["deriveBits"])
|
43
|
+
const salt = 'this is a salt string 20221019'
|
44
|
+
let pbkdf2 = {
|
45
|
+
name:"PBKDF2",hash: "SHA-256",iterations: 12345,salt: new TextEncoder().encode(salt)
|
46
|
+
}
|
47
|
+
return await substl.deriveBits(pbkdf2,key,256);
|
48
|
+
}
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
async function decrypt (key0,isCached){
|
53
|
+
// const key = Uint8Array([...]); // 32 bytes key
|
54
|
+
|
55
|
+
var key = ''
|
56
|
+
if(isCached){
|
57
|
+
key = readKey()
|
58
|
+
}
|
59
|
+
else{
|
60
|
+
var keyS = preFix + key0 + preFix
|
61
|
+
key = await genKey(keyS)
|
62
|
+
}
|
63
|
+
if (key.length == 0) {
|
64
|
+
return
|
65
|
+
}
|
66
|
+
|
67
|
+
var aeskey = {
|
68
|
+
name:"AES-GCM",
|
69
|
+
length:256
|
70
|
+
}
|
71
|
+
var keyObj = await substl.importKey('raw',key,aeskey,false,['decrypt'])
|
72
|
+
var aesDec= {name: "AES-GCM",iv:bfIv,tagLength:128}
|
73
|
+
try {
|
74
|
+
var bfDec = await substl.decrypt(aesDec,keyObj,bfCipher)
|
75
|
+
var plain = new TextDecoder().decode(bfDec);
|
76
|
+
setKey(key)
|
77
|
+
document.getElementById("encrypted").style.display = 'none'
|
78
|
+
// / show decrypted
|
79
|
+
|
80
|
+
document.getElementById("decrypted").style.display = 'block'
|
81
|
+
document.getElementById("decryptContent").innerHTML = plain
|
82
|
+
|
83
|
+
setTimeout(function(){
|
84
|
+
var loadevent = document.createEvent("Event")
|
85
|
+
loadevent.initEvent("load", true, true)
|
86
|
+
|
87
|
+
var DOMContentLoaded_event = document.createEvent("Event")
|
88
|
+
DOMContentLoaded_event.initEvent("DOMContentLoaded", true, true)
|
89
|
+
|
90
|
+
window.dispatchEvent(loadevent)
|
91
|
+
window.dispatchEvent(DOMContentLoaded_event)
|
92
|
+
|
93
|
+
}, 500);
|
94
|
+
} catch (error) {
|
95
|
+
alert("wrong password.")
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
document.getElementById("DecryptBtn").onclick = function(){
|
100
|
+
var key = document.getElementById("passwordinput").value
|
101
|
+
decrypt(key);
|
102
|
+
}
|
103
|
+
|
104
|
+
document.getElementById("EncryptBtn").onclick = function(){
|
105
|
+
/// hide input
|
106
|
+
document.getElementById("encrypted").style.display = 'block'
|
107
|
+
// / show decrypted
|
108
|
+
document.getElementById("decrypted").style.display = "none"
|
109
|
+
|
110
|
+
clearKey()
|
111
|
+
}
|
112
|
+
|
113
|
+
document.getElementById("EncryptBtn").onclick = function(){
|
114
|
+
/// hide input
|
115
|
+
document.getElementById("encrypted").style.display = 'block'
|
116
|
+
// / show decrypted
|
117
|
+
document.getElementById("decrypted").style.display = "none"
|
118
|
+
|
119
|
+
clearKey()
|
120
|
+
}
|
121
|
+
|
122
|
+
document.getElementById("ClearBtn1").onclick = function(){
|
123
|
+
localStorage.clear();
|
124
|
+
}
|
125
|
+
document.getElementById("ClearBtn2").onclick = function(){
|
126
|
+
localStorage.clear();
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
{% if site.theme_config.forbid_cache_password %}
|
134
|
+
function readKey(){
|
135
|
+
}
|
136
|
+
function setKey(value){
|
137
|
+
}
|
138
|
+
function clearKey() {
|
139
|
+
}
|
140
|
+
{% else %}
|
141
|
+
function readKey(){
|
142
|
+
var key = encid;
|
143
|
+
var v = localStorage.getItem(key)
|
144
|
+
if (v) {
|
145
|
+
return base64js.decode(v)
|
146
|
+
}else{
|
147
|
+
return null
|
148
|
+
}
|
149
|
+
}
|
150
|
+
function setKey(value){
|
151
|
+
var key = encid
|
152
|
+
var arr = new Uint8Array(value)
|
153
|
+
var b64 = base64js.encode(arr)
|
154
|
+
return localStorage.setItem(key,b64)
|
155
|
+
}
|
156
|
+
function clearKey() {
|
157
|
+
var key = encid
|
158
|
+
localStorage.removeItem(key)
|
159
|
+
}
|
160
|
+
var cachekey = readKey()
|
161
|
+
if(cachekey){
|
162
|
+
decrypt(cachekey,true)
|
163
|
+
}
|
164
|
+
|
165
|
+
{% endif %}
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
}()
|
170
|
+
|
171
|
+
</script>
|
172
|
+
|
data/_includes/head.html
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
<head>
|
2
|
+
<meta charset="utf-8" />
|
3
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
5
|
+
|
6
|
+
{% if page.mathjax %}
|
7
|
+
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
|
8
|
+
<script type="text/javascript" async src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
|
9
|
+
{% endif %}
|
10
|
+
<title>
|
11
|
+
{%- if page.title -%}
|
12
|
+
{{ page.title }}
|
13
|
+
{%- else -%}
|
14
|
+
{{ site.title }}
|
15
|
+
{%- endif -%}
|
16
|
+
</title>
|
17
|
+
{%- capture enc %}{{ content | encrypt_if_need:page}}{% endcapture -%}
|
18
|
+
{%- if enc == '' -%}
|
19
|
+
{% endif %}
|
20
|
+
|
21
|
+
{% if site.tags != "" %}
|
22
|
+
{% include collecttags.html %}
|
23
|
+
{% endif %}
|
24
|
+
|
25
|
+
<link rel="shortcut icon" type="image/x-icon" href="{{ site.favicon | relative_url }}" />
|
26
|
+
{% if site.theme_config.combine_css_html %}
|
27
|
+
<style>
|
28
|
+
{%- include main.css -%}
|
29
|
+
</style>
|
30
|
+
{% else %}
|
31
|
+
<link rel="stylesheet" href="{{ "/assets/css/main.css" | relative_url }}" />
|
32
|
+
{% endif %}
|
33
|
+
|
34
|
+
|
35
|
+
</head>
|
data/_includes/main.css
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
|
2
|
+
li{
|
3
|
+
padding: 0.2rem;
|
4
|
+
}
|
5
|
+
.w {
|
6
|
+
margin: auto;
|
7
|
+
max-width: 55.8rem;
|
8
|
+
padding: 4rem 2rem;
|
9
|
+
}
|
10
|
+
|
11
|
+
code.highlighter-rouge{
|
12
|
+
color: #fff;
|
13
|
+
background: #000;
|
14
|
+
border-radius: 2px;
|
15
|
+
padding: 2px;
|
16
|
+
margin: 5px;
|
17
|
+
}
|
18
|
+
|
19
|
+
code{
|
20
|
+
color: #333;
|
21
|
+
background: #F0f2f4; }
|
22
|
+
|
23
|
+
div.highlighter-rouge code {
|
24
|
+
border-radius: 4px;
|
25
|
+
display: block;
|
26
|
+
overflow-x: auto;
|
27
|
+
white-space: pre-wrap;
|
28
|
+
padding: 1rem;
|
29
|
+
}
|
30
|
+
|
31
|
+
img {
|
32
|
+
width: 60%;
|
33
|
+
display: block;
|
34
|
+
margin: 0 auto;
|
35
|
+
}
|
36
|
+
|
37
|
+
blockquote {
|
38
|
+
font-style: italic;
|
39
|
+
border-left:.2rem solid #dfe2e5;
|
40
|
+
color: #999;
|
41
|
+
padding: 0.25rem 0 .25rem 0.5rem;
|
42
|
+
margin: 1rem;
|
43
|
+
}
|
44
|
+
blockquote p {
|
45
|
+
margin:0
|
46
|
+
}
|
47
|
+
|
48
|
+
table {
|
49
|
+
width: 100%; }
|
50
|
+
|
51
|
+
table, th, td {
|
52
|
+
border: thin solid black;
|
53
|
+
border-collapse: collapse;
|
54
|
+
padding: 0.4rem;
|
55
|
+
}
|
56
|
+
|
57
|
+
hr {
|
58
|
+
margin-top: 2rem;
|
59
|
+
margin-bottom: 2rem;
|
60
|
+
border-color: lightgray
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<ul >
|
2
|
+
{%-for item in include.collection-%}
|
3
|
+
<li>
|
4
|
+
{%- if item.url -%}
|
5
|
+
<a href="{{ item.url }}">{{ item.title }}</a>
|
6
|
+
{%- else -%}
|
7
|
+
{{ item.title }}
|
8
|
+
{%- endif -%}
|
9
|
+
</li>
|
10
|
+
|
11
|
+
{%-if item.post_list-%}
|
12
|
+
{%
|
13
|
+
include post_list.html
|
14
|
+
category=item.post_list.category
|
15
|
+
limit=item.post_list.limit
|
16
|
+
show_more=item.post_list.show_more
|
17
|
+
show_more_text=item.post_list.show_more_text
|
18
|
+
show_more_url=item.post_list.show_more_url
|
19
|
+
-%}
|
20
|
+
{%-endif-%}
|
21
|
+
|
22
|
+
{%-if item.entries-%}
|
23
|
+
{%-include menu_item.html collection=item.entries-%}
|
24
|
+
{%-endif-%}
|
25
|
+
{%-endfor-%}
|
26
|
+
</ul>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h1> <a href="{{ '/' | relative_url }}"> {{ site.title }} </a></h1>
|
2
|
+
{%- capture currentUrl %}{{ page.url | relative_url}}{% endcapture -%}
|
3
|
+
<nav>
|
4
|
+
<ul class="navul">
|
5
|
+
|
6
|
+
|
7
|
+
{%-for item in site.theme_config.menu -%}
|
8
|
+
<li class="navli">
|
9
|
+
|
10
|
+
|
11
|
+
{%- if item.url -%}
|
12
|
+
{%- capture itemurl %}{{ item.url | relative_url}}{% endcapture -%}
|
13
|
+
|
14
|
+
|
15
|
+
{%- if currentUrl == itemurl -%}
|
16
|
+
<text class="curNav">{{ item.title }}</text>
|
17
|
+
{%- else -%}
|
18
|
+
<a href="{{ itemurl }}">{{ item.title }}</a>
|
19
|
+
{%- endif - %}
|
20
|
+
|
21
|
+
{%- else -%}
|
22
|
+
{{ item.title }}
|
23
|
+
{%- endif -%}
|
24
|
+
</li>
|
25
|
+
{%-endfor-%}
|
26
|
+
</ul>
|
27
|
+
</nav>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{%-if include.category-%}
|
2
|
+
{%-assign posts = site.categories[include.category]-%}
|
3
|
+
{%-else-%}
|
4
|
+
{%-assign posts = site.posts-%}
|
5
|
+
{%-endif-%}
|
6
|
+
|
7
|
+
{%-if include.limit and posts.size > include.limit-%}
|
8
|
+
{%-assign limit_exceeded = true-%}
|
9
|
+
{%-else-%}
|
10
|
+
{%-assign limit_exceeded = false-%}
|
11
|
+
{%-endif-%}
|
12
|
+
|
13
|
+
{%- if posts.size > 0 -%}
|
14
|
+
<ul class="postlistul">
|
15
|
+
{%- for post in posts limit: include.limit -%}
|
16
|
+
<li class="postlistli">
|
17
|
+
<a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a>
|
18
|
+
<date>{{- post.date | date: site.theme_config.date_format -}}</date>
|
19
|
+
</li>
|
20
|
+
{%- endfor -%}
|
21
|
+
{%- if include.show_more and limit_exceeded -%}
|
22
|
+
<li><a href="{{ include.show_more_url }}">{{ include.show_more_text | default: "Show more..." }}</a></li>
|
23
|
+
{%- endif -%}
|
24
|
+
</ul>
|
25
|
+
{%- endif -%}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
layout: default
|
3
|
+
---
|
4
|
+
|
5
|
+
{%-include back_link.html-%}
|
6
|
+
|
7
|
+
<h1>{{ page.title }}</h1>
|
8
|
+
|
9
|
+
|
10
|
+
{%-assign posts = site.posts-%}
|
11
|
+
{%- if posts.size > 0 -%}
|
12
|
+
|
13
|
+
{% assign ymPre = "" %}
|
14
|
+
{% capture archive_date_format %} {{ site.theme_config.archive_date_format | default: "%Y"}}{% endcapture %}
|
15
|
+
|
16
|
+
{% capture archive_date_titleformat %} {{ site.theme_config.archive_title_date_format | default: "%m-%d"}}{% endcapture %}
|
17
|
+
<ul class="postlistul">
|
18
|
+
{%- for post in posts limit: include.limit -%}
|
19
|
+
{% capture ymCur %} {{post.date | date: archive_date_format}} {% endcapture %}
|
20
|
+
{% if ymCur != ymPre %}
|
21
|
+
{% if ymPre != "" %}
|
22
|
+
</ul>
|
23
|
+
{% endif %}
|
24
|
+
<li class="postlistli"><h2>{{ymCur}}</h2></li>
|
25
|
+
<ul class="postlistul">
|
26
|
+
{% endif %}
|
27
|
+
{% assign ymPre = ymCur %}
|
28
|
+
|
29
|
+
<li class="postlistli">
|
30
|
+
<a href="{{ post.url | relative_url }}">{{ post.title | downcase }}</a>
|
31
|
+
<date datetime="{{post.date}}">{{- post.date | date: archive_date_titleformat }}</date>
|
32
|
+
</li>
|
33
|
+
|
34
|
+
{%- endfor -%}
|
35
|
+
</ul>
|
36
|
+
{%- endif -%}
|
37
|
+
|
38
|
+
|