├── .gitignore
├── Gruntfile.js
├── LICENSE.md
├── README.md
├── package.json
└── src
├── app.js
├── css
├── bootstrap.min.css
├── font
│ ├── fontello.eot
│ ├── fontello.svg
│ ├── fontello.ttf
│ └── fontello.woff
├── loading.css
└── main.css
├── editor.html
├── index.html
├── lib
├── ajax.js
├── base64.js
├── github.js
├── jquery.js
├── local.js
├── manager.js
├── route.js
├── showdown.js
├── spine.js
└── underscore.js
└── template
├── css
├── entry.css
├── prism.css
└── style.css
├── index.html
├── js
├── hogan.min.js
└── prism.js
├── main.css
├── main.js
├── main.json
├── page.html
└── post.html
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = function(grunt) {
4 |
5 | grunt.initConfig({
6 | pkg: grunt.file.readJSON('package.json'),
7 | cssmin: {
8 | minify: {
9 | src: 'src/template/css/*.css',
10 | dest: 'src/template/main.css'
11 | }
12 | },
13 |
14 | concat: {
15 | dist: {
16 | src: ['src/lib/jquery.js', "src/template/js/prism.js", "src/template/js/hogan.min.js", 'src/lib/spine.js', 'src/lib/route.js', 'src/lib/manager.js'],
17 | dest: 'src/template/main.js'
18 | }
19 | },
20 |
21 | uglify: {
22 | build: {
23 | src: 'src/template/main.js',
24 | dest: 'src/template/main.js'
25 | }
26 | }
27 |
28 | });
29 |
30 | grunt.loadNpmTasks('grunt-contrib-uglify');
31 | grunt.loadNpmTasks('grunt-contrib-cssmin');
32 | grunt.loadNpmTasks('grunt-contrib-concat');
33 |
34 | grunt.registerTask('default', ['cssmin', 'concat', 'uglify']);
35 |
36 | };
37 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 isnowfy
4 |
5 | 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:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | 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.
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple
2 |
3 | Simple is a static blog generator with a single static page. You can write you blog online, and it will generate static html files at your repo named `username.github.io` which is supported by [github pages](https://pages.github.com)
4 |
5 | ## Demo
6 |
7 | [Simple](http://isnowfy.github.io/simple)
8 |
9 | [Blog demo](http://isnowfy.github.io/)
10 |
11 | [Lightweight markdown editor](http://isnowfy.github.io/simple/editor.html)
12 |
13 | ## Usage
14 |
15 | With Simple and github pages you can easily create your static blog. Here is what you need to do.
16 |
17 | 1. Create a github account.
18 | 2. Create a repo named `your_user_name.github.io` (remember to check `Initilize and create README`).
19 | 3. Sign in [Simple](http://isnowfy.github.io/simple) with your github account.
20 | 4. Click `Initilize` to set up basic files for your static blog site.(maybe a little slow)
21 | 5. Click `Go` and start writing.
22 | 6. Click `New post` to create a new post and when finish writing click `save` to generate the static page.
23 | 7. Now you can browse the `your_user_name.github.io` site and enjoy it!
24 |
25 | 
26 |
27 | * You can use your own blog name, just modify the `main.json` file, and change `name="username"`.
28 |
29 | * You can use disqus comment system, just modify the `main.json` file, and change `disqus_shortname=""` to `disqus_shortname="your_shortname"`.
30 |
31 | * You can use your own custom domain, just modify the `CNAME` file.(see [also](https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages))
32 |
33 | ## Features
34 |
35 | * Simple, no backend need
36 | * Static blog
37 | * Markdown editor
38 | * Code highlight support
39 | * Tex formula support
40 | * Responsive html
41 | * Drag and drop to upload image
42 |
43 | ## Custom
44 |
45 | The template files are at `/src/template`, so you can modify the template files and css files. If you want use your own theme you can clone the project, modify the template files and push the entire `src` folder in your `gh-pages` branch which will allow you generate your own static blog.
46 |
47 | ## Todo
48 |
49 | Enhance error display, Search, Sitemap, Rss
50 |
51 | ## License
52 |
53 | MIT licensed.
54 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "simple",
3 | "version": "0.1.0",
4 | "dependencies": {},
5 | "devDependencies": {
6 | "grunt": "~0.4.1",
7 | "grunt-contrib-uglify": "~0.2.7",
8 | "grunt-contrib-cssmin": "~0.9.0",
9 | "grunt-contrib-concat": "~0.4.0"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/app.js:
--------------------------------------------------------------------------------
1 | var global = {};
2 | var gconfig = null;
3 | var repo = null;
4 | var editor = null;
5 | var contentpattern = /\n([\s\S]*)\n\n/m;
6 | var pathpattern = /\/\/path\nvar path=\"(.*)\";\n\/\/path end\n/m;
7 | var mdpattern = /\n([\s\S]*)\n\n/m;
8 | Date.prototype.yyyymmdd = function() {
9 | var yyyy = this.getFullYear().toString();
10 | var mm = (this.getMonth()+1).toString();
11 | var dd = this.getDate().toString();
12 | return yyyy + "-" + (mm[1]?mm:"0"+mm[0]) + "-" + (dd[1]?dd:"0"+dd[0]);
13 | };
14 | function reescape(data) {
15 | return data.replace(/>/g, ">").replace(/"+reescape(a3)+"
";});
22 | tmp = tmp.replace(/~~~~\n([\s\S]*?)~~~~\n/mg, function(a1, a2) {return "
"+reescape(a2)+"
"});
23 | tmp = converter.makeHtml(tmp);
24 | $("#edithtml").html(tmp);
25 | Prism.highlightAll();
26 | MathJax.Hub.Queue(["Typeset", MathJax.Hub, "edithtml"]);
27 | }
28 | function curry(fn) {
29 | var args = Array.prototype.slice.call(arguments, 1);
30 | return function() {
31 | var innerArgs = Array.prototype.slice.call(arguments);
32 | var finalArgs = args.concat(innerArgs);
33 | return fn.apply(null, finalArgs);
34 | };
35 | }
36 | function asyncFinish(total, success) {
37 | var cnt = 0;
38 | $("#loading").show();
39 | return function() {
40 | cnt++;
41 | if (cnt == total) {
42 | $("#loading").hide();
43 | if (typeof success == "function")
44 | success();
45 | }
46 | }
47 | }
48 | function asyncSeq(success) {
49 | var args = Array.prototype.slice.call(arguments, 1);
50 | var finish = asyncFinish(args.length, success);
51 | for (var i = 0; i < args.length; ++i) {
52 | args[i](finish);
53 | }
54 | }
55 | function syncSeq(success) {
56 | var args = Array.prototype.slice.call(arguments, 1);
57 | var finish = asyncFinish(1, success);
58 | var l = args.length;
59 | var tmp = curry(args[l-1], finish);
60 | for (var i = l-2; i >= 0; --i)
61 | tmp = curry(args[i], tmp);
62 | tmp();
63 | }
64 | function errShow(item, err) {
65 | if (typeof err != "undefined" && err != null) {
66 | console.log(err);
67 | $("#loading").hide();
68 | item.show();
69 | return true;
70 | }
71 | return false;
72 | }
73 | function asyncWrite(data, target, err, finish) {
74 | if (!repo)
75 | Spine.Route.navigate("");
76 | repo.write("master", target, data, "simple",
77 | function(e) {
78 | var ret = err(e);
79 | if (ret == false)
80 | finish();
81 | });
82 | }
83 | function asyncWriteFile(source, target, err, finish) {
84 | if (!repo)
85 | Spine.Route.navigate("");
86 | $.ajax({
87 | url: source,
88 | type: "GET",
89 | success: function(data) {asyncWrite(data, target, err, finish)},
90 | error: function(e) {err(e);}
91 | });
92 | }
93 | function checkpass(user, pass, cbsuccess, cberror) {
94 | var github = new Github({
95 | username: user,
96 | password: pass,
97 | auth: "basic"
98 | });
99 | var u = github.getUser();
100 | u.show(user, function(err, ret){
101 | $("#loading").hide()
102 | if (!cberror(err)) {
103 | global.github = github;
104 | global.user = user;
105 | repo = github.getRepo(user, user+".github.io");
106 | cbsuccess();
107 | }
108 | });
109 | }
110 | $(document).ready(function() {
111 | var Logins = Spine.Controller.sub({
112 | el: $("#login"),
113 | elements: {
114 | "form": "form",
115 | "#loginuser": "user",
116 | "#loginpass": "pass",
117 | "#loginerror": "err",
118 | },
119 | events: {
120 | "submit form": "check",
121 | },
122 | check: function(e) {
123 | $("#loading").show();
124 | e.preventDefault();
125 | checkpass(this.user.val(), this.pass.val(),
126 | function(){Spine.Route.navigate("/main");},
127 | curry(errShow, this.err));
128 | },
129 | init: function() {
130 | this.user.val("");
131 | this.pass.val("");
132 | $("#loading").hide();
133 | this.err.hide();
134 | }
135 | });
136 | var Mains = Spine.Controller.sub({
137 | el: $("#main"),
138 | elements: {
139 | "#initerror": "err",
140 | "#initok": "ok",
141 | },
142 | events: {
143 | "click #init": "initRepo",
144 | "click #go": "go",
145 | },
146 | initRepo: function(e) {
147 | e.preventDefault();
148 | var error = curry(errShow, this.err);
149 | var a1 = curry(asyncWriteFile, "template/index.html", "index.html", error);
150 | var a2 = curry(asyncWriteFile, "template/main.css", "main.css", error);
151 | var a3 = curry(asyncWriteFile, "template/main.js", "main.js", error);
152 | var config = {"name": global.user, "number_of_posts_per_page": 7, "disqus_shortname": "", "posts": [], "pages": []};
153 | var a4 = curry(asyncWrite, JSON.stringify(config), "main.json", error);
154 | var a5 = curry(asyncWrite, "", "CNAME", error);
155 | syncSeq(function() {$("#initok").show()}, a1, a2, a3, a4, a5);
156 | },
157 | go: function(e) {
158 | this.navigate("/posts");
159 | },
160 | init: function() {
161 | $("#loading").hide();
162 | this.err.hide();
163 | }
164 | });
165 | var Posts = Spine.Controller.sub({
166 | el: $("#posts"),
167 | init: function(param) {
168 | $("#loading").hide();
169 | if (editor != null)
170 | editor.destroy();
171 | var type = null;
172 | var num = null;
173 | var now = null;
174 | if (typeof param != "undefined" && param.hasOwnProperty("type"))
175 | type = param.type;
176 | if (typeof param != "undefined" && param.hasOwnProperty("num"))
177 | num = param.num;
178 | if (repo != null) {
179 | $("#loading").show();
180 | repo.read("master", "main.json", function(err, data) {
181 | $("#loading").hide();
182 | $("#posttitle").val("");
183 | $("#postpath").val("");
184 | $("#postdate").val("");
185 | $("#posttags").val("");
186 | $("#editmd").val(sessionStorage.getItem("editmd") || "before begin to write please click 'new post' or 'new page' first");
187 | $("#edithtml").html("");
188 | var config = JSON.parse(data);
189 | config.posts.sort(function(a, b){
190 | if (a.date > b.date)
191 | return -1;
192 | if (a.date < b.date)
193 | return 1;
194 | return 0;
195 | });
196 | gconfig = config;
197 | var posts = config.posts;
198 | var pages = config.pages;
199 | for (var i = 0; i < posts.length; ++i) {
200 | posts[i].num = i;
201 | posts[i].type = "post";
202 | posts[i].active = false;
203 | if (type == "post" && num != "null" && Math.floor(num) == i) {
204 | posts[i].active = true;
205 | now = posts[i];
206 | $("#postSave").attr("href", "#/posts/savepost");
207 | $("#postDelete").attr("href", "#/posts/deletepost/"+i);
208 | }
209 | }
210 | for (var i = 0; i < pages.length; ++i) {
211 | pages[i].num = i;
212 | pages[i].type = "page";
213 | pages[i].active = false;
214 | if (type == "page" && num != "null" && Math.floor(num) == i) {
215 | pages[i].active = true;
216 | now = pages[i];
217 | $("#postSave").attr("href", "#/posts/savepage");
218 | $("#postDelete").attr("href", "#/posts/deletepage/"+i);
219 | }
220 | }
221 | var itemTemplate = Hogan.compile($("#postsItem").html());
222 | var postsItemHtml = itemTemplate.render({items: posts});
223 | var pagesItemHtml = itemTemplate.render({items: pages});
224 | $("#postItems").html(postsItemHtml);
225 | $("#pageItems").html(pagesItemHtml);
226 | if (type != null && type.slice(0, 3) == "new") {
227 | if (type.slice(3) == "post") {
228 | $("#postSave").attr("href", "#/posts/savepost");
229 | $("#postDelete").attr("href", "#/posts");
230 | }
231 | if (type.slice(3) == "page") {
232 | $("#postSave").attr("href", "#/posts/savepage");
233 | $("#postDelete").attr("href", "#/posts");
234 | }
235 | $("#postdate").val((new Date()).yyyymmdd());
236 | }
237 | if (now != null) {
238 | $("#posttitle").val(now.title);
239 | $("#postpath").val(now.path);
240 | $("#postdate").val(now.date);
241 | $("#posttags").val(now.tags);
242 | if (now.path.slice(0, 5) != "http:" && now.path.slice(0, 6) != "https:") {
243 | $("#loading").show();
244 | repo.read("master", now.path, function(err, data) {
245 | $("#loading").hide();
246 | var content = data.match(contentpattern)[1];
247 | var md = data.match(mdpattern)[1];
248 | $("#editmd").val(md);
249 | $("#edithtml").html(content);
250 | });
251 | }
252 | }
253 | });
254 | }
255 | }
256 | });
257 | var SimpleApp = Spine.Controller.sub({
258 | el: $("body"),
259 | init: function() {
260 | this.logins = new Logins();
261 | this.mains = new Mains();
262 | this.posts = new Posts();
263 | $("#postDelete").click(function(){return confirm("Are you sure you want to delete?");});
264 | this.routes({
265 | "": function() {this.logins.init();this.logins.active();},
266 | "/main": function() {this.mains.init();this.mains.active();},
267 | "/posts/:type/:num": function(param) {
268 | var type = param.type;
269 | var num = Math.floor(param.num);
270 | var temp = this;
271 | if (type.slice(0, 6) == "delete") {
272 | $("#loading").show();
273 | var posts = [];
274 | if (type == "deletepost") {
275 | var now = gconfig.posts[num];
276 | for (var i = 0; i < gconfig.posts.length; ++i) {
277 | if (i != num)
278 | posts.push(gconfig.posts[i]);
279 | }
280 | gconfig.posts = posts;
281 | }
282 | if (type == "deletepage") {
283 | var now = gconfig.pages[num];
284 | for (var i = 0; i < gconfig.pages.length; ++i) {
285 | if (i != num)
286 | posts.push(gconfig.pages[i]);
287 | }
288 | gconfig.pages = posts;
289 | }
290 | repo.write("master", "main.json", JSON.stringify(gconfig), "remove", function(err) {
291 | if (now.path.slice(0, 5) != "http:" && now.path.slice(0, 6) != "https:") {
292 | repo.delete("master", now.path, function(err) {
293 | temp.posts.init(param);
294 | temp.posts.active();
295 | });
296 | }
297 | else {
298 | temp.posts.init(param);
299 | temp.posts.active();
300 | }
301 | });
302 | }
303 | else {
304 | temp.posts.init(param);
305 | temp.posts.active();
306 | }
307 | },
308 | "/posts/:type": function(param) {
309 | var type = param.type;
310 | var temp = this;
311 | if (type.slice(0, 4) == "save") {
312 | $("#loading").show();
313 | if (type == "savepost") {
314 | var template = "template/post.html";
315 | var posts = gconfig.posts;
316 | }
317 | if (type == "savepage") {
318 | var template = "template/page.html";
319 | var posts = gconfig.pages;
320 | }
321 | var now = {"title": $("#posttitle").val(),
322 | "date": $("#postdate").val(),
323 | "tags": $("#posttags").val(),
324 | "path": $("#postpath").val()};
325 | var mark = null;
326 | for (var i = 0; i < posts.length; ++i)
327 | if (posts[i].path == now.path)
328 | mark = i;
329 | if (mark != null)
330 | posts[mark] = now;
331 | else
332 | posts.unshift(now);
333 | var content = $("#edithtml").html().replace(/\$/mg, "$$$$");
334 | var md = $("#editmd").val().replace(/\$/mg, "$$$$");
335 | $.ajax({
336 | url: template,
337 | type: "GET",
338 | success: function(data) {
339 | $("#saveerror").hide();
340 | data = data.replace(contentpattern, "\n"+content+"\n\n");
341 | data = data.replace("//path//", now.path);
342 | data = data.replace(mdpattern, "\n"+md+"\n\n");
343 | if (now.path.slice(0, 5) != "http:" && now.path.slice(0, 6) != "https:") {
344 | repo.write("master", now.path, data, "save", function(err) {
345 | repo.write("master", "main.json", JSON.stringify(gconfig), "save", function(err) {
346 | if (!errShow($("saveerror", err))) {
347 | temp.posts.init(param);
348 | temp.posts.active();
349 | }
350 | });
351 | });
352 | }
353 | else {
354 | repo.write("master", "main.json", JSON.stringify(gconfig), "save", function(err) {
355 | if (!errShow($("saveerror", err))) {
356 | temp.posts.init(param);
357 | temp.posts.active();
358 | }
359 | });
360 | }
361 | },
362 | error: function(e) {err(e);}
363 | });
364 | }
365 | else {
366 | temp.posts.init(param);
367 | temp.posts.active();
368 | }
369 | },
370 | "/posts": function() {this.posts.init();this.posts.active();}
371 | });
372 | this.manager = new Spine.Manager(this.logins, this.mains, this.posts);
373 | Spine.Route.setup();
374 | }
375 | });
376 | new SimpleApp();
377 | $("#editmd").on("keyup", function() {
378 | mdupdate();
379 | });
380 | $("#editmd").on("dragenter", function(e) {
381 | e.stopPropagation();
382 | e.preventDefault();
383 | });
384 | $("#editmd").on("dragover", function(e) {
385 | e.stopPropagation();
386 | e.preventDefault();
387 | });
388 | $("#editmd").on("drop", function(e) {
389 | e.stopPropagation();
390 | e.preventDefault();
391 | var a = e.originalEvent;
392 | var files = a.target.files || a.dataTransfer && a.dataTransfer.files;
393 | var tmp = null;
394 | for (var i = 0; i < files.length; i++) {
395 | if (files[i].type.match("image.*")) {
396 | tmp = files[i];
397 | break;
398 | }
399 | }
400 | if (tmp != null) {
401 | var reader = new FileReader();
402 | reader.onload = function() {
403 | var name = tmp.name;
404 | var data = reader.result;
405 | var cursor = $("#editmd")[0].selectionStart;
406 | var content = $("#editmd").val();
407 | var l = content.length;
408 | var head = content.substring(0, cursor);
409 | var tail = content.substring(cursor, l);
410 | var url = " ";
411 | $("#editmd").val(head+"upload image now!"+tail);
412 | mdupdate();
413 | repo.write("master", "img/"+name, data, "upload image",
414 | function(e) {
415 | if (typeof err != "undefined" && err != null) {
416 | console.log(err);
417 | $("#editmd").val(head+"upload image failed"+tail);
418 | }
419 | else {
420 | $("#editmd").val(head+url+tail);
421 | }
422 | mdupdate();
423 | });
424 | };
425 | reader.readAsArrayBuffer(tmp);
426 | }
427 | });
428 | });
429 |
--------------------------------------------------------------------------------
/src/css/font/fontello.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isnowfy/simple/05320ed867db2fe0871cd532a755f705102f16e4/src/css/font/fontello.eot
--------------------------------------------------------------------------------
/src/css/font/fontello.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/css/font/fontello.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isnowfy/simple/05320ed867db2fe0871cd532a755f705102f16e4/src/css/font/fontello.ttf
--------------------------------------------------------------------------------
/src/css/font/fontello.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isnowfy/simple/05320ed867db2fe0871cd532a755f705102f16e4/src/css/font/fontello.woff
--------------------------------------------------------------------------------
/src/css/loading.css:
--------------------------------------------------------------------------------
1 | .spinner {
2 | margin: auto;
3 | width: 40px;
4 | height: 40px;
5 | position: fixed;
6 | top: 0; left: 0; bottom: 0; right: 0;
7 |
8 | -webkit-animation: rotate 2.0s infinite linear;
9 | animation: rotate 2.0s infinite linear;
10 | }
11 |
12 | #loading:before {
13 | content: '';
14 | display: block;
15 | position: fixed;
16 | top: 0;
17 | left: 0;
18 | width: 100%;
19 | height: 100%;
20 | background-color: rgba(0,0,0,0.3);
21 | }
22 |
23 | .dot1, .dot2 {
24 | width: 60%;
25 | height: 60%;
26 | display: inline-block;
27 | position: absolute;
28 | top: 0;
29 | background-color: #333;
30 | border-radius: 100%;
31 |
32 | -webkit-animation: bounce 2.0s infinite ease-in-out;
33 | animation: bounce 2.0s infinite ease-in-out;
34 | }
35 |
36 | .dot2 {
37 | top: auto;
38 | bottom: 0px;
39 | -webkit-animation-delay: -1.0s;
40 | animation-delay: -1.0s;
41 | }
42 |
43 | @-webkit-keyframes rotate { 100% { -webkit-transform: rotate(360deg) }}
44 | @keyframes rotate {
45 | 100% {
46 | transform: rotate(360deg);
47 | -webkit-transform: rotate(360deg);
48 | }
49 | }
50 |
51 | @-webkit-keyframes bounce {
52 | 0%, 100% { -webkit-transform: scale(0.0) }
53 | 50% { -webkit-transform: scale(1.0) }
54 | }
55 |
56 | @keyframes bounce {
57 | 0%, 100% {
58 | transform: scale(0.0);
59 | -webkit-transform: scale(0.0);
60 | } 50% {
61 | transform: scale(1.0);
62 | -webkit-transform: scale(1.0);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/css/main.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding-top: 20px;
3 | padding-bottom: 20px;
4 | }
5 |
6 | #fork {
7 | position: fixed;
8 | right: 0;
9 | top: 0;
10 | }
11 |
12 | .header, .main, .footer {
13 | padding-right: 15px;
14 | padding-left: 15px;
15 | }
16 |
17 | .header {
18 | border-bottom: 1px solid #e5e5e5;
19 | }
20 |
21 | .header h3 {
22 | padding-bottom: 19px;
23 | margin-top: 0;
24 | margin-bottom: 0;
25 | line-height: 40px;
26 | }
27 |
28 | .footer {
29 | padding-top: 19px;
30 | color: #777;
31 | border-top: 1px solid #e5e5e5;
32 | }
33 |
34 | @media (min-width: 768px) {
35 | .container {
36 | max-width: 730px;
37 | }
38 | }
39 | .container-narrow > hr {
40 | margin: 30px 0;
41 | }
42 |
43 | .block {
44 | text-align: center;
45 | border-bottom: 1px solid #e5e5e5;
46 | padding: 30px;
47 | margin-bottom: 30px;
48 | color: inherit;
49 | background-color: #eee;
50 | border-radius: 6px;
51 | display: block;
52 | }
53 |
54 | .block .btn {
55 | padding: 14px 24px;
56 | font-size: 21px;
57 | }
58 |
59 | .main {
60 | margin: 40px 0;
61 | }
62 |
63 | .main p + h4 {
64 | margin-top: 28px;
65 | }
66 |
67 | @media screen and (min-width: 768px) {
68 | .header, .main, .footer {
69 | padding-right: 0;
70 | padding-left: 0;
71 | }
72 | .header {
73 | margin-bottom: 30px;
74 | }
75 | .block {
76 | border-bottom: 0;
77 | }
78 | }
79 |
80 | #login {
81 | padding: 20px 40px;
82 | border: 1px solid #e5e5e5;
83 | border-radius: 4px;
84 | width: 400px;
85 | height: 240px;
86 | margin: auto;
87 | position: fixed;
88 | top: 0; right: 0; bottom: 0; left: 0;
89 | }
90 |
91 | #views > *:not(.active) {
92 | display: none;
93 | }
94 |
95 | .sidebar {
96 | position: absolute;
97 | left: 0;
98 | top: 0;
99 | bottom: 0;
100 | background-color: #f5f5f5;
101 | border-right: 1px solid #eee;
102 | }
103 |
104 | .nav-sidebar {
105 | margin-top: 10px;
106 | margin-right:-16px;
107 | margin-bottom: 20px;
108 | margin-left: -15px;
109 | font-size: 14px;
110 | }
111 |
112 | .nav {
113 | padding-left: 0;
114 | list-style: none;
115 | }
116 |
117 | .nav-active {
118 | background: #428bca;
119 | }
120 |
121 | .nav-active > a {
122 | color: #fff;
123 | }
124 |
125 | .nav > a {
126 | position: relative;
127 | display: block;
128 | padding: 10px 15px;
129 | }
130 |
131 | .page-header {
132 | padding: 9px;
133 | margin: 0;
134 | border-bottom: 0;
135 | }
136 |
137 | .post-content {
138 | position: absolute;
139 | right: 0;
140 | }
141 |
142 | .nav-btn {
143 | margin: 10px 30px;
144 | width: 70%;
145 | }
146 |
147 | html, body, .container, #views, #posts, .row, .post-content {
148 | height: 100%;
149 | }
150 |
151 | .post-content {
152 | display: table;
153 | }
154 |
155 | .post-wrap-header {
156 | display: table-row;
157 | }
158 |
159 | .post-wrap-edit {
160 | display: table-row;
161 | height: 100%;
162 | }
163 |
164 | #editContent {
165 | top: 80px;
166 | bottom: 0;
167 | left: 0;
168 | right: 0;
169 | position: absolute;
170 | border-top: 1px solid #eee;
171 | overflow-y: auto;
172 | }
173 |
174 | #editmd {
175 | width: 50%;
176 | height: 100%;
177 | position: relative;
178 | float: left;
179 | display: block;
180 | margin: 0;
181 | border: 0;
182 | resize: none;
183 | padding: 16px;
184 | border-right: 1px solid #d9d9d9;
185 | -webkit-box-sizing: border-box;
186 | -moz-box-sizing: border-box;
187 | box-sizing: border-box;
188 | }
189 |
190 | #edithtml {
191 | width: 50%;
192 | height: 100%;
193 | float: right;
194 | display: block;
195 | margin: 0;
196 | background-color: #fcfaf2;
197 | overflow-y: auto;
198 | -webkit-box-sizing: border-box;
199 | -moz-box-sizing: border-box;
200 | box-sizing: border-box;
201 | }
202 |
203 | .loading {
204 | background-color:#428bca;
205 | background-image:-webkit-linear-gradient(45deg, #f8f7f4 25%, transparent 25%, transparent 50%, #f8f7f4 50%, #f8f7f4 75%, transparent 75%, transparent);
206 | background-image:linear-gradient(45deg, #f8f7f4 25%, transparent 25%, transparent 50%, #f8f7f4 50%, #f8f7f4 75%, transparent 75%, transparent);
207 | background-size:40px 40px;
208 | -webkit-animation:progress-bar-stripes 2s linear infinite;
209 | -moz-animation:progress-bar-stripes 2s linear infinite;
210 | animation:progress-bar-stripes 2s linear infinite;
211 | border-radius:5px;
212 | }
213 |
--------------------------------------------------------------------------------
/src/editor.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Head over to GitHub and create a new repository named username.github.io, where username is your username on GitHub.(Please selected the "Initialize this repository with a README" when creating the repo.)
56 |If you had initialized the repository you can go to next page directly.
66 | 67 |"+d+"\n
",A(d)+e}),a=a.replace(/~0/,""),a},z=function(a){return a+="~0",a=a.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(a,b,c){var d=b,e=c;return e=C(e),e=M(e),e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,""),e=""+e+"\n
",A(e)}),a=a.replace(/~0/,""),a},A=function(a){return a=a.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(d.push(a)-1)+"K\n\n"},B=function(a){return a=a.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(a,b,c,d,e){var f=d;return f=f.replace(/^([ \t]*)/g,""),f=f.replace(/[ \t]*$/g,""),f=C(f),b+""+f+"
"}),a},C=function(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=N(a,"*_{}[]\\",!1),a},D=function(a){return a=a.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2"),a=a.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2"),a},E=function(a){return a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,b){var c=b;return c=c.replace(/^[ \t]*>[ \t]?/gm,"~0"),c=c.replace(/~0/g,""),c=c.replace(/^[ \t]+$/gm,""),c=o(c),c=c.replace(/(^|\n)/g,"$1 "),c=c.replace(/(\s*[^\r]+?<\/pre>)/gm,function(a,b){var c=b;return c=c.replace(/^ /mg,"~0"),c=c.replace(/~0/g,""),c}),A("\n"+c+"\n")}),a},F=function(a){a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");var b=a.split(/\n{2,}/g),c=[],e=b.length;for(var f=0;f=0?c.push(g):g.search(/\S/)>=0&&(g=p(g),g=g.replace(/^([ \t]*)/g," "),g+="
",c.push(g))}e=c.length;for(var f=0;f=0){var h=d[RegExp.$1];h=h.replace(/\$/g,"$$$$"),c[f]=c[f].replace(/~K\d+K/,h)}return c.join("\n\n")},G=function(a){return a=a.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),a=a.replace(/<(?![a-z\/?\$!])/gi,"<"),a},H=function(a){return a=a.replace(/\\(\\)/g,O),a=a.replace(/\\([`*_{}\[\]()>#+-.!])/g,O),a},I=function(a){return a=a.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'$1'),a=a.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(a,b){return J(K(b))}),a},J=function(a){var b=[function(a){return""+a.charCodeAt(0)+";"},function(a){return""+a.charCodeAt(0).toString(16)+";"},function(a){return a}];return a="mailto:"+a,a=a.replace(/./g,function(a){if(a=="@")a=b[Math.floor(Math.random()*2)](a);else if(a!=":"){var c=Math.random();a=c>.9?b[2](a):c>.45?b[1](a):b[0](a)}return a}),a=''+a+"",a=a.replace(/">.+:/g,'">'),a},K=function(a){return a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)}),a},L=function(a){return a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,""),a},M=function(a){return a=a.replace(/\t(?=\t)/g," "),a=a.replace(/\t/g,"~A~B"),a=a.replace(/~B(.+?)~A/g,function(a,b,c){var d=b,e=4-d.length%4;for(var f=0;f 2;e==null&&(e=[]);if(d&&e.reduce===d)return r&&(t=T.bind(t,r)),i?e.reduce(t,n):e.reduce(t);N(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.reduceRight=T.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(v&&e.reduceRight===v)return r&&(t=T.bind(t,r)),arguments.length>2?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=T.keys(e);s=o.length}N(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.find=T.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},T.filter=T.select=function(e,t,n){var r=[];return e==null?r:m&&e.filter===m?e.filter(t,n):(N(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},T.reject=function(e,t,n){var r=[];return e==null?r:(N(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r)},T.every=T.all=function(e,t,r){t||(t=T.identity);var i=!0;return e==null?i:g&&e.every===g?e.every(t,r):(N(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=T.some=T.any=function(e,t,r){t||(t=T.identity);var i=!1;return e==null?i:y&&e.some===y?e.some(t,r):(N(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};T.contains=T.include=function(e,t){var n=!1;return e==null?n:b&&e.indexOf===b?e.indexOf(t)!=-1:(n=C(e,function(e){return e===t}),n)},T.invoke=function(e,t){var n=u.call(arguments,2);return T.map(e,function(e){return(T.isFunction(t)?t:e[t]).apply(e,n)})},T.pluck=function(e,t){return T.map(e,function(e){return e[t]})},T.where=function(e,t){return T.isEmpty(t)?[]:T.filter(e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},T.max=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&T.isEmpty(e))return-Infinity;var r={computed:-Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},T.min=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&T.isEmpty(e))return Infinity;var r={computed:Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o r||n===void 0)return 1;if(n >>1;n.call(r,e[u])=0})})},T.difference=function(e){var t=a.apply(r,u.call(arguments,1));return T.filter(e,function(e){return!T.contains(t,e)})},T.zip=function(){var e=u.call(arguments),t=T.max(T.pluck(e,"length")),n=new Array(t);for(var r=0;r =0;n--)t=[e[n].apply(this,t)];return t[0]}},T.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},T.keys=S||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)T.has(e,n)&&(t[t.length]=n);return t},T.values=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push(e[n]);return t},T.pairs=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push([n,e[n]]);return t},T.invert=function(e){var t={};for(var n in e)T.has(e,n)&&(t[e[n]]=n);return t},T.functions=T.methods=function(e){var t=[];for(var n in e)T.isFunction(e[n])&&t.push(n);return t.sort()},T.extend=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},T.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return N(n,function(n){n in e&&(t[n]=e[n])}),t},T.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)T.contains(n,i)||(t[i]=e[i]);return t},T.defaults=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},T.clone=function(e){return T.isObject(e)?T.isArray(e)?e.slice():T.extend({},e):e},T.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof T&&(e=e._wrapped),t instanceof T&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,f=t.constructor;if(a!==f&&!(T.isFunction(a)&&a instanceof a&&T.isFunction(f)&&f instanceof f))return!1;for(var c in e)if(T.has(e,c)){o++;if(!(u=T.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(T.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};T.isEqual=function(e,t){return M(e,t,[],[])},T.isEmpty=function(e){if(e==null)return!0;if(T.isArray(e)||T.isString(e))return e.length===0;for(var t in e)if(T.has(e,t))return!1;return!0},T.isElement=function(e){return!!e&&e.nodeType===1},T.isArray=E||function(e){return l.call(e)=="[object Array]"},T.isObject=function(e){return e===Object(e)},N(["Arguments","Function","String","Number","Date","RegExp"],function(e){T["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),T.isArguments(arguments)||(T.isArguments=function(e){return!!e&&!!T.has(e,"callee")}),typeof /./!="function"&&(T.isFunction=function(e){return typeof e=="function"}),T.isFinite=function(e){return T.isNumber(e)&&isFinite(e)},T.isNaN=function(e){return T.isNumber(e)&&e!=+e},T.isBoolean=function(e){return e===!0||e===!1||l.call(e)=="[object Boolean]"},T.isNull=function(e){return e===null},T.isUndefined=function(e){return e===void 0},T.has=function(e,t){return c.call(e,t)},T.noConflict=function(){return e._=t,this},T.identity=function(e){return e},T.times=function(e,t,n){for(var r=0;r ":">",'"':""","'":"'","/":"/"}};_.unescape=T.invert(_.escape);var D={escape:new RegExp("["+T.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(_.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(e){T[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),T.result=function(e,t){if(e==null)return null;var n=e[t];return T.isFunction(n)?n.call(e):n},T.mixin=function(e){N(T.functions(e),function(t){var n=T[t]=e[t];T.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(T,e))}})};var P=0;T.uniqueId=function(e){var t=P++;return e?e+t:t},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(e,t,n){n=T.defaults({},n,T.templateSettings);var r=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){s+=e.slice(i,u).replace(j,function(e){return"\\"+B[e]}),s+=n?"'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?"'+\n((__t=("+r+"))==null?'':__t)+\n'":o?"';\n"+o+"\n__p+='":"",i=u+t.length}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(n.variable||"obj","_",s)}catch(u){throw u.source=s,u}if(t)return o(t,T);var a=function(e){return o.call(this,e,T)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},T.chain=function(e){return T(e).chain()};var F=function(e){return this._chain?T(e).chain():e};T.mixin(T),N(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];T.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),N(["concat","join","slice"],function(e){var t=r[e];T.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); -------------------------------------------------------------------------------- /src/template/css/entry.css: -------------------------------------------------------------------------------- 1 | body{padding:0;margin:0} 2 | .entry{margin-top:0;margin-bottom:0;margin-left:0;margin-left:auto;margin-right:auto;padding:0 16px;line-height:2;color:#424b50;word-wrap:break-word;font-size:16px;font-family:"ff-tisa-web-pro-1","ff-tisa-web-pro-2","Lucida Grande","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","wenquanyi micro hei",sans-serif,"Apple Color Emoji";-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}.entry div,.entry p,.entry blockquote,.entry pre,.entry ul,.entry ol,.entry table,.entry figure,.entry section,.entry article,.entry header,.entry footer{margin:0;padding:0;margin-top:16px;margin-bottom:16px}.entry div:first-child,.entry p:first-child,.entry blockquote:first-child,.entry pre:first-child,.entry ul:first-child,.entry ol:first-child,.entry table:first-child,.entry figure:first-child,.entry section:first-child,.entry article:first-child,.entry header:first-child,.entry footer:first-child{margin-top:0} 3 | .entry div:last-child,.entry p:last-child,.entry blockquote:last-child,.entry pre:last-child,.entry ul:last-child,.entry ol:last-child,.entry table:last-child,.entry figure:last-child,.entry section:last-child,.entry article:last-child,.entry header:last-child,.entry footer:last-child{margin-bottom:0} 4 | .entry ul div,.entry ol div,.entry ul p,.entry ol p,.entry ul blockquote,.entry ol blockquote,.entry ul pre,.entry ol pre,.entry ul ul,.entry ol ul,.entry ul ol,.entry ol ol,.entry ul table,.entry ol table,.entry ul figure,.entry ol figure,.entry ul iframe,.entry ol iframe,.entry ul section,.entry ol section,.entry ul article,.entry ol article,.entry ul header,.entry ol header,.entry ul footer,.entry ol footer{margin-top:0;margin-bottom:0} 5 | .entry>iframe{display:block;margin-top:16px;margin-bottom:16px} 6 | .entry>img,.entry>video{margin-top:16px;margin-bottom:16px;display:block} 7 | .entry h1,.entry h2,.entry h3,.entry h4,.entry h5,.entry h6{margin-top:0;margin-bottom:0;padding:0}.entry h1:first-child,.entry h2:first-child,.entry h3:first-child,.entry h4:first-child,.entry h5:first-child,.entry h6:first-child{margin-top:0} 8 | .entry>h3,.entry>h4,.entry>h5,.entry>h6{margin-top:32px}.entry>h3+*,.entry>h4+*,.entry>h5+*,.entry>h6+*{margin-top:0} 9 | .entry>h1,.entry>h2{margin:24px 0 5px}.entry>h1+*,.entry>h2+*{margin-top:0} 10 | .entry h1,.entry h2,.entry h3,.entry h4,.entry h5,.entry h6{font-weight:inherit} 11 | .entry h1,.entry h2{color:#424b50;background-color:transparent}.entry h1 a,.entry h2 a{color:#424b50} 12 | .entry h1 a,.entry h2 a,.entry h1 em,.entry h2 em,.entry h1 u,.entry h2 u,.entry h1 abbr[title],.entry h2 abbr[title]{border-bottom-color:#424b50} 13 | .entry h3 a,.entry h4 a,.entry h5 a,.entry h6 a{color:#424b50;border-bottom-color:#424b50} 14 | .entry h1{font-size:28px;line-height:48px;text-align:center;font-weight:bold} 15 | .entry h2{font-size:21px;line-height:32px;font-weight:bold} 16 | .entry h3{font-size:18px;line-height:32px;text-align:left} 17 | .entry h4,.entry h5,.entry h6{line-height:32px;font-size:16px;text-align:left} 18 | .entry blockquote{position:relative;padding:32px 64px} 19 | .entry blockquote:before{position:absolute;content:'\275D';top:0;left:16px;font-size:3em;color:#ccc} 20 | .entry blockquote:after{position:absolute;content:'\275E';bottom:0;right:16px;margin-right:-0.25em;font-size:3em;color:#ccc} 21 | .entry pre{padding:15px 16px;line-height:16px;font-size:14px;white-space:pre;word-wrap:normal;overflow:auto;font-family:consolas,monaco,monospace,serif;border:1px solid #e1e1e8;border-right:none;border-left:none;background-color:#f7f7f9} 22 | .entry ul,.entry ol{padding-left:32px}.entry ul li,.entry ol li{margin:0;padding:0;list-style-position:outside} 23 | .entry ul li{list-style-type:square}.entry ul li ul li{list-style-type:disc}.entry ul li ul li ul li{list-style-type:circle} 24 | .entry ol li{list-style-type:decimal}.entry ol li ol li{list-style-type:upper-roman}.entry ol li ol li ol li{list-style-type:lower-roman} 25 | .entry li>ul,.entry li>ol{padding-left:32px} 26 | .entry hr{position:relative;padding-top:32px;margin-top:-2px;margin-bottom:64px;height:0;background:none;border:none;border-bottom:2px dashed #888}.entry hr:before,.entry hr:after{content:'';position:absolute;bottom:-2px;width:30%;height:2px;pointer-events:none} 27 | .entry hr:before{left:0;background-image:-webkit-linear-gradient(right, rgba(255,255,255,0) 0, #fff 80%, #fff 100%);background-image:-moz-linear-gradient(right, rgba(255,255,255,0) 0, #fff 80%, #fff 100%);background-image:-ms-linear-gradient(right, rgba(255,255,255,0) 0, #fff 80%, #fff 100%);background-image:-o-linear-gradient(right, rgba(255,255,255,0) 0, #fff 80%, #fff 100%);background-image:linear-gradient(right, rgba(255,255,255,0) 0, #fff 80%, #fff 100%)} 28 | .entry hr:after{right:0;background-image:-webkit-linear-gradient(left, rgba(255,255,255,0) 0, #fff 80%, #fff 100%);background-image:-moz-linear-gradient(left, rgba(255,255,255,0) 0, #fff 80%, #fff 100%);background-image:-ms-linear-gradient(left, rgba(255,255,255,0) 0, #fff 80%, #fff 100%);background-image:-o-linear-gradient(left, rgba(255,255,255,0) 0, #fff 80%, #fff 100%);background-image:linear-gradient(left, rgba(255,255,255,0) 0, #fff 80%, #fff 100%)} 29 | .entry table{display:table;padding:0;margin-left:auto;margin-right:auto;min-width:336px;border-collapse:collapse;border-spacing:0;-webkit-border-radius:.5em;-moz-border-radius:.5em;-ms-border-radius:.5em;-o-border-radius:.5em;border-radius:.5em}.entry table caption{padding:0} 30 | .entry table thead th{text-align:left} 31 | .entry table tbody{margin:0 16px}.entry table tbody tr:nth-child(odd) td,.entry table tbody tr:nth-child(odd) th{background-color:#f9f9f9} 32 | .entry table tbody tr:last-child td,.entry table tbody tr:last-child th{padding-bottom:6px} 33 | .entry table td,.entry table th{padding:8px 16px 7px;border:1px solid #ddd} 34 | .entry iframe{vertical-align:text-bottom} 35 | .entry a{padding-bottom:.025em;color:#E93071;text-decoration:none}.entry a[onclick],.entry a[href^="javascript:"]{margin:0 .25em;padding:.25em .5em;font-size:.8571428571428571em;color:#fff;background-color:#96b3d3;-webkit-border-radius:.25em;-moz-border-radius:.25em;-ms-border-radius:.25em;-o-border-radius:.25em;border-radius:.25em;border-bottom:none} 36 | .entry a[onclick]:visited,.entry a[href^="javascript:"]:visited{color:#fff} 37 | .entry a:focus{outline:thin dotted} 38 | .entry a:visited{color:#551a8b;border-bottom-color:#551a8b} 39 | .entry a:hover{border-bottom-width:1px;border-bottom-style:solid} 40 | .entry a:hover,.entry a:active{outline:0} 41 | .entry b,.entry strong{font-weight:bold} 42 | .entry u,.entry em{padding-bottom:.05em;font-style:inherit;font-weight:inherit;border-bottom:2px dotted #8b98a0} 43 | .entry u{text-decoration:inherit;border-bottom-width:1px;border-bottom-style:solid} 44 | .entry em+em,.entry em+u,.entry u+em,.entry u+u{margin-left:.125em} 45 | .entry code{padding:0 .25em;margin:0 .25em;background:#fee9cc;font-family:consolas,monaco,monospace,serif;font-size:16px;color:#424b50;-webkit-border-radius:.25em;-moz-border-radius:.25em;-ms-border-radius:.25em;-o-border-radius:.25em;border-radius:.25em} 46 | .entry pre code{padding:0;margin:0;font-size:14px;color:#424b50;background:none;border:none} 47 | .entry img,.entry video{max-width:100%;border:0} 48 | .entry figure img{display:block;margin:0 auto} 49 | .entry figure figcaption{display:block;text-align:center;font-style:italic} 50 | .entry cite{font-style:inherit}.entry cite:before,.entry cite:after{content:"《";line-height:inherit} 51 | .entry cite:after{content:"》"} 52 | .entry abbr[title]{padding-bottom:.05em;cursor:help;border-bottom:1px dotted #424b50} 53 | .entry dfn{font-style:italic} 54 | .entry mark{background:#ff0;color:#424b50} 55 | .entry q{quotes:"\201C" "\201D" "\2018" "\2019"} 56 | .entry small{font-size:80%} 57 | .entry sub,.entry sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} 58 | .entry sup{top:-0.5em} 59 | .entry sub{bottom:-0.25em} 60 | .entry #disqus_thread{margin-top:32px} 61 | -------------------------------------------------------------------------------- /src/template/css/prism.css: -------------------------------------------------------------------------------- 1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+java+php+coffeescript+scss+bash+c+cpp+python+sql+http+ruby+csharp+go&plugins=line-numbers */ 2 | /** 3 | * prism.js default theme for JavaScript, CSS and HTML 4 | * Based on dabblet (http://dabblet.com) 5 | * @author Lea Verou 6 | */ 7 | 8 | code[class*="language-"], 9 | pre[class*="language-"] { 10 | color: black; 11 | text-shadow: 0 1px white; 12 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 13 | direction: ltr; 14 | text-align: left; 15 | white-space: pre; 16 | word-spacing: normal; 17 | word-break: normal; 18 | 19 | 20 | -moz-tab-size: 4; 21 | -o-tab-size: 4; 22 | tab-size: 4; 23 | 24 | -webkit-hyphens: none; 25 | -moz-hyphens: none; 26 | -ms-hyphens: none; 27 | hyphens: none; 28 | } 29 | 30 | pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, 31 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { 32 | text-shadow: none; 33 | background: #b3d4fc; 34 | } 35 | 36 | pre[class*="language-"]::selection, pre[class*="language-"] ::selection, 37 | code[class*="language-"]::selection, code[class*="language-"] ::selection { 38 | text-shadow: none; 39 | background: #b3d4fc; 40 | } 41 | 42 | @media print { 43 | code[class*="language-"], 44 | pre[class*="language-"] { 45 | text-shadow: none; 46 | } 47 | } 48 | 49 | /* Code blocks */ 50 | pre[class*="language-"] { 51 | padding: 1em; 52 | margin: .5em 0; 53 | overflow: auto; 54 | } 55 | 56 | :not(pre) > code[class*="language-"], 57 | pre[class*="language-"] { 58 | background: #f5f2f0; 59 | } 60 | 61 | /* Inline code */ 62 | :not(pre) > code[class*="language-"] { 63 | padding: .1em; 64 | border-radius: .3em; 65 | } 66 | 67 | .token.comment, 68 | .token.prolog, 69 | .token.doctype, 70 | .token.cdata { 71 | color: slategray; 72 | } 73 | 74 | .token.punctuation { 75 | color: #999; 76 | } 77 | 78 | .namespace { 79 | opacity: .7; 80 | } 81 | 82 | .token.property, 83 | .token.tag, 84 | .token.boolean, 85 | .token.number, 86 | .token.constant, 87 | .token.symbol { 88 | color: #905; 89 | } 90 | 91 | .token.selector, 92 | .token.attr-name, 93 | .token.string, 94 | .token.builtin { 95 | color: #690; 96 | } 97 | 98 | .token.operator, 99 | .token.entity, 100 | .token.url, 101 | .language-css .token.string, 102 | .style .token.string, 103 | .token.variable { 104 | color: #a67f59; 105 | background: hsla(0,0%,100%,.5); 106 | } 107 | 108 | .token.atrule, 109 | .token.attr-value, 110 | .token.keyword { 111 | color: #07a; 112 | } 113 | 114 | 115 | .token.regex, 116 | .token.important { 117 | color: #e90; 118 | } 119 | 120 | .token.important { 121 | font-weight: bold; 122 | } 123 | 124 | .token.entity { 125 | cursor: help; 126 | } 127 | 128 | pre.line-numbers { 129 | position: relative; 130 | padding-left: 3.8em; 131 | counter-reset: linenumber; 132 | } 133 | 134 | pre.line-numbers > code { 135 | position: relative; 136 | } 137 | 138 | .line-numbers .line-numbers-rows { 139 | position: absolute; 140 | pointer-events: none; 141 | top: 0; 142 | font-size: 100%; 143 | left: -3.8em; 144 | width: 3em; /* works for line-numbers below 1000 lines */ 145 | letter-spacing: -1px; 146 | border-right: 1px solid #999; 147 | 148 | -webkit-user-select: none; 149 | -moz-user-select: none; 150 | -ms-user-select: none; 151 | user-select: none; 152 | 153 | } 154 | 155 | .line-numbers-rows > span { 156 | pointer-events: none; 157 | display: block; 158 | counter-increment: linenumber; 159 | } 160 | 161 | .line-numbers-rows > span:before { 162 | content: counter(linenumber); 163 | color: #999; 164 | display: block; 165 | padding-right: 0.8em; 166 | text-align: right; 167 | } 168 | -------------------------------------------------------------------------------- /src/template/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: Georgia, serif; 4 | } 5 | .main { 6 | margin: 0 auto; 7 | width: 600px; 8 | position: relative; 9 | } 10 | #disqus_thread { 11 | padding: 16px; 12 | } 13 | .wrap-header h1 { 14 | width: 100%; 15 | height: 40px; 16 | color: #E93071; 17 | padding: 20px 0 10px 0; 18 | border-bottom: 2px dashed #888; 19 | margin: 0 0 10px; 20 | font-family: "Comic Sans MS", cursive, sans-serif; 21 | } 22 | #title:hover { 23 | border: 0; 24 | } 25 | .header { 26 | margin: 70px 0 0 -210px; 27 | width: 140px; 28 | float: left; 29 | text-align: right; 30 | font-family: Verdana, Geneva, sans-serif; 31 | } 32 | .header li { 33 | list-style: none; 34 | text-transform: uppercase; 35 | margin: 30px 0; 36 | } 37 | .header a { 38 | color: black; 39 | } 40 | a { 41 | text-decoration: none; 42 | color: #E93071; 43 | } 44 | a:hover { 45 | border-bottom: 1px solid #E93071; 46 | } 47 | .selected { 48 | color: black; 49 | } 50 | .item { 51 | margin: 10px 0; 52 | padding: 1px 0; 53 | } 54 | .little { 55 | float: left; 56 | margin-right: 10px; 57 | width: 3px; 58 | height: 30px; 59 | border-radius: 4px; 60 | background: #C5C5BD; 61 | } 62 | .date { 63 | float: left; 64 | color: #C5C5BD; 65 | font-size: 17px; 66 | text-transform: uppercase; 67 | font-weight: bold; 68 | width: 140px; 69 | padding: 16px 0 0; 70 | } 71 | .title { 72 | padding: 0; 73 | margin: 0 0 0 140px; 74 | } 75 | .title a:hover { 76 | padding-bottom: 2px; 77 | border-bottom: 1px solid #E93071; 78 | } 79 | .title h2 { 80 | font-size: 17px; 81 | line-height: 25px; 82 | } 83 | .footer { 84 | border-top: 1px dotted #888; 85 | margin-top: 20px; 86 | text-align: center; 87 | color: #555; 88 | } 89 | .pages { 90 | text-align: center; 91 | margin: 25px 25px 35px; 92 | font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; 93 | } 94 | .pages a:hover{ 95 | border: 1px solid #E93071; 96 | border-radius: 4px; 97 | } 98 | .pages > li { 99 | margin: 0 4px; 100 | display: inline; 101 | } 102 | .pages > li > a, .pages > li > span { 103 | padding: 3px 10px; 104 | border: 1px solid #eee; 105 | border-radius: 4px; 106 | } 107 | .tag { 108 | color: #888; 109 | } 110 | .archive { 111 | margin: 10px; 112 | } 113 | .archive > span { 114 | color: #C5C5BD; 115 | margin-right: 20px; 116 | } 117 | @media (max-width: 800px) { 118 | .main { 119 | width: 500px; 120 | } 121 | .header { 122 | margin: 70px 0 0 -180px; 123 | } 124 | } 125 | @media (max-width: 600px) { 126 | .main { 127 | width: 100%; 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /src/template/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Simple 9 | 10 | 11 | 12 | 13 |14 | 27 | 32 |38 | 39 | 68 | 79 | 86 | 95 | 231 | 232 | 233 | -------------------------------------------------------------------------------- /src/template/js/hogan.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 Twitter, Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */var HoganTemplate=function(){function a(a){this.text=a}function h(a){var h=String(a===null?"":a);return g.test(h)?h.replace(b,"&").replace(c,"<").replace(d,">").replace(e,"'").replace(f,"""):h}a.prototype={r:function(a,b){return""},v:h,render:function(a,b){return this.r(a,b)},rp:function(a,b,c,d){var e=c[a];return e?e.render(b,c):""},rs:function(a,b,c){var d="",e=a[a.length-1];if(!i(e))return d=c(a,b),d;for(var f=0;f33 |34 | 37 |=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d){var e=a.call(b,d,function(a){return Hogan.compile(a).render(b)}),f=Hogan.compile(e.toString()).render(b,c);return this.b=f,!1},b:"",ls:function(a,b,c,d,e){var f=b[b.length-1];if(a.length>0)return this.ho(a,f,c,this.text.substring(d,e));var g=a.call(f);return typeof g=="function"?this.ho(g,f,c,this.text.substring(d,e)):g},lv:function(a,b,c){var d=b[b.length-1];return Hogan.compile(a.call(d).toString()).render(d,c)}};var b=/&/g,c=//g,e=/\'/g,f=/\"/g,g=/[&<>\"\']/,i=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"};return a}(),Hogan=function(){function a(a){function s(){l.length>0&&(m.push(new String(l)),l="")}function t(){var a=!0;for(var b=p;b 0){j=a.shift();if(j.tag=="#"||j.tag=="^"||g(j,d))c.push(j),j.nodes=f(a,j.tag,c,d),e.push(j);else{if(j.tag=="/"){if(c.length==0)throw new Error("Closing tag without opener: /"+j.n);i=c.pop();if(j.n!=i.n&&!h(j.n,i.n,d))throw new Error("Nesting error: "+i.n+" vs. "+j.n);return i.end=j.i,e}e.push(j)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function g(a,b){for(var c=0,d=b.length;c "?b+=s(a[c].n):e=="{"||e=="&"?b+=t(a[c].n,o(a[c].n)):e=="\n"?b+=v("\n"):e=="_v"?b+=u(a[c].n,o(a[c].n)):e===undefined&&(b+=v(a[c]))}return b}function q(a,b,c,d,e){var f="if(_.s(_."+c+'("'+n(b)+'",c,p,1),';return f+="c,p,0,"+d+","+e+")){",f+="b += _.rs(c,p,",f+='function(c,p){ var b = "";',f+=p(a),f+="return b;});c.pop();}",f+='else{b += _.b; _.b = ""};',f}function r(a,b,c){var d="if (!_.s(_."+c+'("'+n(b)+'",c,p,1),c,p,1,0,0)){';return d+=p(a),d+="};",d}function s(a){return'b += _.rp("'+n(a)+'",c[c.length - 1],p);'}function t(a,b){return"b += (_."+b+'("'+n(a)+'",c,p,0));'}function u(a,b){return"b += (_.v(_."+b+'("'+n(a)+'",c,p,0)));'}function v(a){return'b += "'+n(a)+'";'}var c=/\S/,d={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10},j=/\"/g,k=/\n/g,l=/\r/g,m=/\\/g;return{scan:a,parse:function(a,b){return b=b||{},f(a,"",[],b.sectionTags||[])},cache:{},compile:function(b,c){c=c||{};var d=this.cache[b];return d?d:(d=i(this.parse(a(b),c),b,c),this.cache[b]=d)}}}();typeof module!="undefined"&&module.exports?(module.exports=Hogan,module.exports.Template=HoganTemplate):typeof exports!="undefined"&&(exports.Hogan=Hogan,exports.HoganTemplate=HoganTemplate); -------------------------------------------------------------------------------- /src/template/js/prism.js: -------------------------------------------------------------------------------- 1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+java+php+coffeescript+scss+bash+c+cpp+python+sql+http+ruby+csharp+go&plugins=line-numbers */ 2 | var self=typeof window!="undefined"?window:{},Prism=function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&").replace(/e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+""+s.tag+">"};if(!self.document){if(!self.addEventListener)return self.Prism;self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return self.Prism}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}return self.Prism}();typeof module!="undefined"&&module.exports&&(module.exports=Prism);; 3 | Prism.languages.markup={comment:/<!--[\w\W]*?-->/g,prolog:/<\?.+?\?>/,doctype:/<!DOCTYPE.+?>/,cdata:/<!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/<\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|[^\s'">=]+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^<\/?[\w:-]+/i,inside:{punctuation:/^<\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))});; 4 | Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(<|<)style[\w\W]*?(>|>)[\w\W]*?(<|<)\/style(>|>)/ig,inside:{tag:{pattern:/(<|<)style[\w\W]*?(>|>)|(<|<)\/style(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});; 5 | Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}},number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|<=?|>=?|={1,3}|(&){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};; 6 | Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|get|set|new|with|typeof|try|throw|catch|finally|null|break|continue|this)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(<|<)script[\w\W]*?(>|>)[\w\W]*?(<|<)\/script(>|>)/ig,inside:{tag:{pattern:/(<|<)script[\w\W]*?(>|>)|(<|<)\/script(>|>)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});; 7 | Prism.languages.java=Prism.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/g,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+[e]?[\d]*[df]\b|\W\d*\.?\d+\b/gi,operator:{pattern:/([^\.]|^)([-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\/|%|\^|(<){2}|($gt;){2,3}|:|~)/g,lookbehind:!0}});; 8 | /** 9 | * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/ 10 | * Modified by Miles Johnson: http://milesj.me 11 | * 12 | * Supports the following: 13 | * - Extends clike syntax 14 | * - Support for PHP 5.3 and 5.4 (namespaces, traits, etc) 15 | * - Smarter constant and function matching 16 | * 17 | * Adds the following new token classes: 18 | * constant, delimiter, variable, function, package 19 | */Prism.languages.php=Prism.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/ig,constant:/\b[A-Z0-9_]{2,}\b/g});Prism.languages.insertBefore("php","keyword",{delimiter:/(\?>|<\?php|<\?)/ig,variable:/(\$\w+)\b/ig,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/g,lookbehind:!0,inside:{punctuation:/\\/}}});Prism.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/g,lookbehind:!0}});if(Prism.languages.markup){Prism.hooks.add("before-highlight",function(e){if(e.language!=="php")return;e.tokenStack=[];e.code=e.code.replace(/(?:<\?php|<\?|<\?php|<\?)[\w\W]*?(?:\?>|\?>)/ig,function(t){e.tokenStack.push(t);return"{{{PHP"+e.tokenStack.length+"}}}"})});Prism.hooks.add("after-highlight",function(e){if(e.language!=="php")return;for(var t=0,n;n=e.tokenStack[t];t++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(t+1)+"}}}",Prism.highlight(n,e.grammar,"php"));e.element.innerHTML=e.highlightedCode});Prism.hooks.add("wrap",function(e){e.language==="php"&&e.type==="markup"&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))});Prism.languages.insertBefore("php","comment",{markup:{pattern:/(<|<)[^?]\/?(.*?)(>|>)/g,inside:Prism.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/g})};; 20 | Prism.languages.coffeescript=Prism.languages.extend("javascript",{"block-comment":/([#]{3}\s*\r?\n(.*\s*\r*\n*)\s*?\r?\n[#]{3})/g,comment:/(\s|^)([#]{1}[^#^\r^\n]{2,}?(\r?\n|$))/g,keyword:/\b(this|window|delete|class|extends|namespace|extend|ar|let|if|else|while|do|for|each|of|return|in|instanceof|new|with|typeof|try|catch|finally|null|undefined|break|continue)\b/g});Prism.languages.insertBefore("coffeescript","keyword",{"function":{pattern:/[a-z|A-z]+\s*[:|=]\s*(\([.|a-z\s|,|:|{|}|\"|\'|=]*\))?\s*->/gi,inside:{"function-name":/[_?a-z-|A-Z-]+(\s*[:|=])| @[_?$?a-z-|A-Z-]+(\s*)| /g,operator:/[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g}},"attr-name":/[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g});; 21 | Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|\/\/.*?(\r?\n|$))/g,lookbehind:!0},atrule:/@[\w-]+(?=\s+(\(|\{|;))/gi,url:/([-a-z]+-)*url(?=\()/gi,selector:/([^@;\{\}\(\)]?([^@;\{\}\(\)]|&|\#\{\$[-_\w]+\})+)(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/gm});Prism.languages.insertBefore("scss","atrule",{keyword:/@(if|else if|else|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)|(?=@for\s+\$[-_\w]+\s)+from/i});Prism.languages.insertBefore("scss","property",{variable:/((\$[-_\w]+)|(#\{\$[-_\w]+\}))/i});Prism.languages.insertBefore("scss","ignore",{placeholder:/%[-_\w]+/i,statement:/\B!(default|optional)\b/gi,"boolean":/\b(true|false)\b/g,"null":/\b(null)\b/g,operator:/\s+([-+]{1,2}|={1,2}|!=|\|?\||\?|\*|\/|\%)\s+/g});; 22 | Prism.languages.bash=Prism.languages.extend("clike",{comment:{pattern:/(^|[^"{\\])(#.*?(\r?\n|$))/g,lookbehind:!0},string:{pattern:/("|')(\\?[\s\S])*?\1/g,inside:{property:/\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^\}]+\})/g}},keyword:/\b(if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)\b/g});Prism.languages.insertBefore("bash","keyword",{property:/\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^}]+\})/g});Prism.languages.insertBefore("bash","comment",{important:/(^#!\s*\/bin\/bash)|(^#!\s*\/bin\/sh)/g});; 23 | Prism.languages.c=Prism.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/g,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|={1,2}|\^|~|%|(&){1,2}|\|?\||\?|\*|\//g});Prism.languages.insertBefore("c","keyword",{property:{pattern:/#[a-zA-Z]+\ .*/g,inside:{property:/<[a-zA-Z.]+>/g}}});; 24 | Prism.languages.cpp=Prism.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|delete\[\]|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|new\[\]|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/g,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|(&){1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/g});; 25 | Prism.languages.python={comment:{pattern:/(^|[^\\])#.*?(\r?\n|$)/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,keyword:/\b(as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/g,"boolean":/\b(True|False)\b/g,number:/\b-?(0x)?\d*\.?[\da-f]+\b/g,operator:/[-+]{1,2}|=?<|=?>|!|={1,2}|(&){1,2}|(&){1,2}|\|?\||\?|\*|\/|~|\^|%|\b(or|and|not)\b/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};; 26 | Prism.languages.sql={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|((--)|(\/\/)|#).*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,keyword:/\b(ACTION|ADD|AFTER|ALGORITHM|ALTER|ANALYZE|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADE|CASCADED|CASE|CHAIN|CHAR VARYING|CHARACTER VARYING|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLUMN|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATA|DATABASE|DATABASES|DATETIME|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DOUBLE PRECISION|DROP|DUMMY|DUMP|DUMPFILE|DUPLICATE KEY|ELSE|ENABLE|ENCLOSED BY|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPE|ESCAPED BY|EXCEPT|EXEC|EXECUTE|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR|FOR EACH ROW|FORCE|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GEOMETRY|GEOMETRYCOLLECTION|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|IDENTITY|IDENTITY_INSERT|IDENTITYCOL|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTO|INVOKER|ISOLATION LEVEL|JOIN|KEY|KEYS|KILL|LANGUAGE SQL|LAST|LEFT|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONGBLOB|LONGTEXT|MATCH|MATCHED|MEDIUMBLOB|MEDIUMINT|MEDIUMTEXT|MERGE|MIDDLEINT|MODIFIES SQL DATA|MODIFY|MULTILINESTRING|MULTIPOINT|MULTIPOLYGON|NATIONAL|NATIONAL CHAR VARYING|NATIONAL CHARACTER|NATIONAL CHARACTER VARYING|NATIONAL VARCHAR|NATURAL|NCHAR|NCHAR VARCHAR|NEXT|NO|NO SQL|NOCHECK|NOCYCLE|NONCLUSTERED|NULLIF|NUMERIC|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUT|OUTER|OUTFILE|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREV|PRIMARY|PRINT|PRIVILEGES|PROC|PROCEDURE|PUBLIC|PURGE|QUICK|RAISERROR|READ|READS SQL DATA|READTEXT|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEATABLE|REPLICATION|REQUIRE|RESTORE|RESTRICT|RETURN|RETURNS|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROWCOUNT|ROWGUIDCOL|ROWS?|RTREE|RULE|SAVE|SAVEPOINT|SCHEMA|SELECT|SERIAL|SERIALIZABLE|SESSION|SESSION_USER|SET|SETUSER|SHARE MODE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|START|STARTING BY|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLE|TABLES|TABLESPACE|TEMPORARY|TEMPTABLE|TERMINATED BY|TEXT|TEXTSIZE|THEN|TIMESTAMP|TINYBLOB|TINYINT|TINYTEXT|TO|TOP|TRAN|TRANSACTION|TRANSACTIONS|TRIGGER|TRUNCATE|TSEQUAL|TYPE|TYPES|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNPIVOT|UPDATE|UPDATETEXT|USAGE|USE|USER|USING|VALUE|VALUES|VARBINARY|VARCHAR|VARCHARACTER|VARYING|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH|WITH ROLLUP|WITHIN|WORK|WRITE|WRITETEXT)\b/gi,"boolean":/\b(TRUE|FALSE|NULL)\b/gi,number:/\b-?(0x)?\d*\.?[\da-f]+\b/g,operator:/\b(ALL|AND|ANY|BETWEEN|EXISTS|IN|LIKE|NOT|OR|IS|UNIQUE|CHARACTER SET|COLLATE|DIV|OFFSET|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b|[-+]{1}|!|=?<|=?>|={1}|(&){1,2}|\|?\||\?|\*|\//gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[;[\]()`,.]/g};; 27 | Prism.languages.http={"request-line":{pattern:/^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b\shttps?:\/\/\S+\sHTTP\/[0-9.]+/g,inside:{property:/^\b(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/g,"attr-name":/:\w+/g}},"response-status":{pattern:/^HTTP\/1.[01] [0-9]+.*/g,inside:{property:/[0-9]+[A-Z\s-]+$/g}},keyword:/^[\w-]+:(?=.+)/gm};var httpLanguages={"application/json":Prism.languages.javascript,"application/xml":Prism.languages.markup,"text/xml":Prism.languages.markup,"text/html":Prism.languages.markup};for(var contentType in httpLanguages)if(httpLanguages[contentType]){var options={};options[contentType]={pattern:new RegExp("(content-type:\\s*"+contentType+"[\\w\\W]*?)\\n\\n[\\w\\W]*","gi"),lookbehind:!0,inside:{rest:httpLanguages[contentType]}};Prism.languages.insertBefore("http","keyword",options)};; 28 | /** 29 | * Original by Samuel Flores 30 | * 31 | * Adds the following new token classes: 32 | * constant, builtin, variable, symbol, regex 33 | */Prism.languages.ruby=Prism.languages.extend("clike",{comment:/#[^\r\n]*(\r?\n|$)/g,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g,builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g});Prism.languages.insertBefore("ruby","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0},variable:/[@$]+\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g,symbol:/:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g});; 34 | Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/g,string:/@?("|')(\\?.)*?\1/g,preprocessor:/^\s*#.*/gm,number:/\b-?(0x)?\d*\.?\d+\b/g});; 35 | Prism.languages.go=Prism.languages.extend("clike",{keyword:/\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/g,builtin:/\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64|)|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(ln)?|real|recover)\b/g,"boolean":/\b(_|iota|nil|true|false)\b/g,operator:/([(){}\[\]]|[*\/%^!]=?|\+[=+]?|-[>=-]?|\|[=|]?|>[=>]?|<(<|[=-])?|==?|&(&|=|^=?)?|\.(\.\.)?|[,;]|:=?)/g,number:/\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/ig,string:/("|'|`)(\\?.|\r|\n)*?\1/g});delete Prism.languages.go["class-name"];; 36 | Prism.hooks.add("after-highlight",function(e){var t=e.element.parentNode;if(!t||!/pre/i.test(t.nodeName)||t.className.indexOf("line-numbers")===-1){return}var n=1+e.code.split("\n").length;var r;lines=new Array(n);lines=lines.join("");r=document.createElement("span");r.className="line-numbers-rows";r.innerHTML=lines;if(t.hasAttribute("data-start")){t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)}e.element.appendChild(r)}) 37 | ; 38 | -------------------------------------------------------------------------------- /src/template/main.css: -------------------------------------------------------------------------------- 1 | body{padding:0;margin:0}.entry{margin-top:0;margin-bottom:0;margin-left:0;margin-left:auto;margin-right:auto;padding:0 16px;line-height:2;color:#424b50;word-wrap:break-word;font-size:16px;font-family:ff-tisa-web-pro-1,ff-tisa-web-pro-2,"Lucida Grande","Hiragino Sans GB","Hiragino Sans GB W3","Microsoft YaHei","wenquanyi micro hei",sans-serif,"Apple Color Emoji";-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}.entry article,.entry blockquote,.entry div,.entry figure,.entry footer,.entry header,.entry ol,.entry p,.entry pre,.entry section,.entry table,.entry ul{margin:0;padding:0;margin-top:16px;margin-bottom:16px}.entry article:first-child,.entry blockquote:first-child,.entry div:first-child,.entry figure:first-child,.entry footer:first-child,.entry header:first-child,.entry ol:first-child,.entry p:first-child,.entry pre:first-child,.entry section:first-child,.entry table:first-child,.entry ul:first-child{margin-top:0}.entry article:last-child,.entry blockquote:last-child,.entry div:last-child,.entry figure:last-child,.entry footer:last-child,.entry header:last-child,.entry ol:last-child,.entry p:last-child,.entry pre:last-child,.entry section:last-child,.entry table:last-child,.entry ul:last-child{margin-bottom:0}.entry ol article,.entry ol blockquote,.entry ol div,.entry ol figure,.entry ol footer,.entry ol header,.entry ol iframe,.entry ol ol,.entry ol p,.entry ol pre,.entry ol section,.entry ol table,.entry ol ul,.entry ul article,.entry ul blockquote,.entry ul div,.entry ul figure,.entry ul footer,.entry ul header,.entry ul iframe,.entry ul ol,.entry ul p,.entry ul pre,.entry ul section,.entry ul table,.entry ul ul{margin-top:0;margin-bottom:0}.entry>iframe{display:block;margin-top:16px;margin-bottom:16px}.entry>img,.entry>video{margin-top:16px;margin-bottom:16px;display:block}.entry h1,.entry h2,.entry h3,.entry h4,.entry h5,.entry h6{margin-top:0;margin-bottom:0;padding:0}.entry h1:first-child,.entry h2:first-child,.entry h3:first-child,.entry h4:first-child,.entry h5:first-child,.entry h6:first-child{margin-top:0}.entry>h3,.entry>h4,.entry>h5,.entry>h6{margin-top:32px}.entry>h3+*,.entry>h4+*,.entry>h5+*,.entry>h6+*{margin-top:0}.entry>h1,.entry>h2{margin:24px 0 5px}.entry>h1+*,.entry>h2+*{margin-top:0}.entry h1,.entry h2,.entry h3,.entry h4,.entry h5,.entry h6{font-weight:inherit}.entry h1,.entry h2{color:#424b50;background-color:transparent}.entry h1 a,.entry h2 a{color:#424b50}.entry h1 a,.entry h1 abbr[title],.entry h1 em,.entry h1 u,.entry h2 a,.entry h2 abbr[title],.entry h2 em,.entry h2 u{border-bottom-color:#424b50}.entry h3 a,.entry h4 a,.entry h5 a,.entry h6 a{color:#424b50;border-bottom-color:#424b50}.entry h1{font-size:28px;line-height:48px;text-align:center;font-weight:700}.entry h2{font-size:21px;line-height:32px;font-weight:700}.entry h3{font-size:18px;line-height:32px;text-align:left}.entry h4,.entry h5,.entry h6{line-height:32px;font-size:16px;text-align:left}.entry blockquote{position:relative;padding:32px 64px}.entry blockquote:before{position:absolute;content:'\275D';top:0;left:16px;font-size:3em;color:#ccc}.entry blockquote:after{position:absolute;content:'\275E';bottom:0;right:16px;margin-right:-.25em;font-size:3em;color:#ccc}.entry pre{padding:15px 16px;line-height:16px;font-size:14px;white-space:pre;word-wrap:normal;overflow:auto;font-family:consolas,monaco,monospace,serif;border:1px solid #e1e1e8;border-right:none;border-left:none;background-color:#f7f7f9}.entry ol,.entry ul{padding-left:32px}.entry ol li,.entry ul li{margin:0;padding:0;list-style-position:outside}.entry ul li{list-style-type:square}.entry ul li ul li{list-style-type:disc}.entry ul li ul li ul li{list-style-type:circle}.entry ol li{list-style-type:decimal}.entry ol li ol li{list-style-type:upper-roman}.entry ol li ol li ol li{list-style-type:lower-roman}.entry li>ol,.entry li>ul{padding-left:32px}.entry hr{position:relative;padding-top:32px;margin-top:-2px;margin-bottom:64px;height:0;background:0 0;border:none;border-bottom:2px dashed #888}.entry hr:after,.entry hr:before{content:'';position:absolute;bottom:-2px;width:30%;height:2px;pointer-events:none}.entry hr:before{left:0;background-image:-webkit-linear-gradient(right,rgba(255,255,255,0)0,#fff 80%,#fff 100%);background-image:-moz-linear-gradient(right,rgba(255,255,255,0)0,#fff 80%,#fff 100%);background-image:-ms-linear-gradient(right,rgba(255,255,255,0)0,#fff 80%,#fff 100%);background-image:-o-linear-gradient(right,rgba(255,255,255,0)0,#fff 80%,#fff 100%);background-image:linear-gradient(right,rgba(255,255,255,0)0,#fff 80%,#fff 100%)}.entry hr:after{right:0;background-image:-webkit-linear-gradient(left,rgba(255,255,255,0)0,#fff 80%,#fff 100%);background-image:-moz-linear-gradient(left,rgba(255,255,255,0)0,#fff 80%,#fff 100%);background-image:-ms-linear-gradient(left,rgba(255,255,255,0)0,#fff 80%,#fff 100%);background-image:-o-linear-gradient(left,rgba(255,255,255,0)0,#fff 80%,#fff 100%);background-image:linear-gradient(left,rgba(255,255,255,0)0,#fff 80%,#fff 100%)}.entry table{display:table;padding:0;margin-left:auto;margin-right:auto;min-width:336px;border-collapse:collapse;border-spacing:0;-webkit-border-radius:.5em;-moz-border-radius:.5em;-ms-border-radius:.5em;-o-border-radius:.5em;border-radius:.5em}.entry table caption{padding:0}.entry table thead th{text-align:left}.entry table tbody{margin:0 16px}.entry table tbody tr:nth-child(odd) td,.entry table tbody tr:nth-child(odd) th{background-color:#f9f9f9}.entry table tbody tr:last-child td,.entry table tbody tr:last-child th{padding-bottom:6px}.entry table td,.entry table th{padding:8px 16px 7px;border:1px solid #ddd}.entry iframe{vertical-align:text-bottom}.entry a{padding-bottom:.025em;color:#E93071;text-decoration:none}.entry a[href^="javascript:"],.entry a[onclick]{margin:0 .25em;padding:.25em .5em;font-size:.8571428571428571em;color:#fff;background-color:#96b3d3;-webkit-border-radius:.25em;-moz-border-radius:.25em;-ms-border-radius:.25em;-o-border-radius:.25em;border-radius:.25em;border-bottom:none}.entry a[href^="javascript:"]:visited,.entry a[onclick]:visited{color:#fff}.entry a:focus{outline:thin dotted}.entry a:visited{color:#551a8b;border-bottom-color:#551a8b}.entry a:hover{border-bottom-width:1px;border-bottom-style:solid}.entry a:active,.entry a:hover{outline:0}.entry b,.entry strong{font-weight:700}.entry em,.entry u{padding-bottom:.05em;font-style:inherit;font-weight:inherit;border-bottom:2px dotted #8b98a0}.entry u{text-decoration:inherit;border-bottom-width:1px;border-bottom-style:solid}.entry em+em,.entry em+u,.entry u+em,.entry u+u{margin-left:.125em}.entry code{padding:0 .25em;margin:0 .25em;background:#fee9cc;font-family:consolas,monaco,monospace,serif;font-size:16px;color:#424b50;-webkit-border-radius:.25em;-moz-border-radius:.25em;-ms-border-radius:.25em;-o-border-radius:.25em;border-radius:.25em}.entry pre code{padding:0;margin:0;font-size:14px;color:#424b50;background:0 0;border:none}.entry img,.entry video{max-width:100%;border:0}.entry figure img{display:block;margin:0 auto}.entry figure figcaption{display:block;text-align:center;font-style:italic}.entry cite{font-style:inherit}.entry cite:after,.entry cite:before{content:"《";line-height:inherit}.entry cite:after{content:"》"}.entry abbr[title]{padding-bottom:.05em;cursor:help;border-bottom:1px dotted #424b50}.entry dfn{font-style:italic}.entry mark{background:#ff0;color:#424b50}.entry q{quotes:"\201C" "\201D" "\2018" "\2019"}.entry small{font-size:80%}.entry sub,.entry sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.entry sup{top:-.5em}.entry sub{bottom:-.25em}.entry #disqus_thread{margin-top:32px}code[class*=language-],pre[class*=language-]{color:#000;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono',monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#a67f59;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.important,.token.regex{color:#e90}.token.important{font-weight:700}.token.entity{cursor:help}pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre.line-numbers>code{position:relative}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}body{margin:0;font-family:Georgia,serif}.main{margin:0 auto;width:600px;position:relative}#disqus_thread{padding:16px}.wrap-header h1{width:100%;height:40px;color:#E93071;padding:20px 0 10px;border-bottom:2px dashed #888;margin:0 0 10px;font-family:"Comic Sans MS",cursive,sans-serif}#title:hover{border:0}.header{margin:70px 0 0 -210px;width:140px;float:left;text-align:right;font-family:Verdana,Geneva,sans-serif}.header li{list-style:none;text-transform:uppercase;margin:30px 0}.header a{color:#000}a{text-decoration:none;color:#E93071}a:hover{border-bottom:1px solid #E93071}.selected{color:#000}.item{margin:10px 0;padding:1px 0}.little{float:left;margin-right:10px;width:3px;height:30px;border-radius:4px;background:#C5C5BD}.date{float:left;color:#C5C5BD;font-size:17px;text-transform:uppercase;font-weight:700;width:140px;padding:16px 0 0}.title{padding:0;margin:0 0 0 140px}.title a:hover{padding-bottom:2px;border-bottom:1px solid #E93071}.title h2{font-size:17px;line-height:25px}.footer{border-top:1px dotted #888;margin-top:20px;text-align:center;color:#555}.pages{text-align:center;margin:25px 25px 35px;font-family:"Lucida Sans Unicode","Lucida Grande",sans-serif}.pages a:hover{border:1px solid #E93071;border-radius:4px}.pages>li{margin:0 4px;display:inline}.pages>li>a,.pages>li>span{padding:3px 10px;border:1px solid #eee;border-radius:4px}.tag{color:#888}.archive{margin:10px}.archive>span{color:#C5C5BD;margin-right:20px}@media (max-width:800px){.main{width:500px}.header{margin:70px 0 0 -180px}}@media (max-width:600px){.main{width:100%}} -------------------------------------------------------------------------------- /src/template/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "isnowfy", 3 | "number_of_posts_per_page": 7, 4 | "disqus_shortname": "", 5 | "posts": [ 6 | { 7 | "title": "title tile tile tile", 8 | "path": "/", 9 | "date": "2013-07-01", 10 | "tags": "split with space" 11 | }, 12 | { 13 | "title": "title111111111 1111111 11111", 14 | "path": "/", 15 | "date": "2012-07-01", 16 | "tags": "test with space" 17 | }, 18 | { 19 | "title": "这是个测试的标题", 20 | "path": "/", 21 | "date": "2012-07-01", 22 | "tags": "test with space" 23 | }, 24 | { 25 | "title": "我是一个比较长长长的标题呢啊啊啊", 26 | "path": "/", 27 | "date": "2014-07-01", 28 | "tags": "test with space" 29 | }, 30 | { 31 | "title": "title111111111 1111111 11111", 32 | "path": "/", 33 | "date": "2013-07-01", 34 | "tags": "test with space" 35 | }, 36 | { 37 | "title": "title这个标题啊1111", 38 | "path": "/", 39 | "date": "2013-07-01", 40 | "tags": "test with space" 41 | }, 42 | { 43 | "title": "title111111111 1111111 11111", 44 | "path": "/", 45 | "date": "2013-07-01", 46 | "tags": "test with space" 47 | }, 48 | { 49 | "title": "title111111111 1111111 11111", 50 | "path": "/", 51 | "date": "2013-07-01", 52 | "tags": "test with space" 53 | }, 54 | { 55 | "title": "title111111111 1111111 11111", 56 | "path": "/", 57 | "date": "2013-07-01", 58 | "tags": "test with space" 59 | }, 60 | { 61 | "title": "title2", 62 | "path": "/", 63 | "date": "2013-07-01", 64 | "tags": "test test2 space" 65 | } 66 | ], 67 | "pages": [ 68 | { 69 | "title": "about", 70 | "path": "/", 71 | "date": "2013-07-01", 72 | "tags": "" 73 | } 74 | ] 75 | } 76 | -------------------------------------------------------------------------------- /src/template/page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Simple 9 | 10 | 11 | 12 | 13 |14 | 21 | 26 | 31 |43 | 44 | 53 | 60 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/template/post.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |32 | 33 | //content// 34 | 35 |36 |
37 |
38 | 39 | 42 |Simple 9 | 10 | 11 | 12 | 13 | 43 | 44 | 53 | 60 | 99 | 100 | 103 | 104 | 105 | --------------------------------------------------------------------------------