forked from isnowfy/isnowfy.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
about-simple.html
201 lines (164 loc) · 7.29 KB
/
about-simple.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="Keywords" content="blog"/>
<meta name="Description" content="blog"/>
<title>Simple</title>
<link rel="shortcut icon" href="/static/favicon.png"/>
<link rel="stylesheet" type="text/css" href="/main.css" />
</head>
<body>
<div class="main">
<div class="header">
<ul id="pages">
<li><a href="/">home</a></li>
<li><a href="/#/tags">tags</a></li>
<li><a href="/#/archive">archive</a></li>
</ul>
</div>
<div class="wrap-header">
<h1>
<a href="/" id="title"></a>
</h1>
</div>
<div id="md" style="display: none;">
<!-- markdown -->
[Simple](https://github.com/isnowfy/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)
##Demo
[simple](http://isnowfy.github.io/simple)
[blog demo](http://isnowfy.github.io/)
[lightweight markdown editor](http://isnowfy.github.io/simple/editor.html)
##Usage
With simple and github pages you can easily create your static blog. Here is what you need to do.
1. Create github account.
2. Create a repo named `your_user_name.github.io` (remember to check `Initilize and create README`).
3. Sign in [simple](http://isnowfy.github.io/simple) with your github account.
4. Click `Initilize` to set up basic file for your static blog site.
5. Click `Go` and start writing.
![simple](http://isnowfy.github.io/img/Simple.png)
* You can use your own blog name, just modify the `main.json` file, and change `name="username"`.
* You can use disqus comment system, just modify the `main.json` file, and change `disqus_shortname=""` to `disqus_shortname="your_shortname"`.
* 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)).
##Features
* Simple, no backend need
* Static blog
* Markdown editor
* Code highlight support
* Tex formula support
##Custom
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.
##Todo
Enhance error display, Search, Sitemap, Rss
##License
MIT licensed.
<!-- markdown end -->
</div>
<div class="entry" id="main">
<!-- content -->
<p><a href="https://github.com/isnowfy/simple">Simple</a> 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 <code>username.github.io</code> which is supported by <a href="https://pages.github.com">github pages</a></p>
<h2 id="demo">Demo</h2>
<p><a href="http://isnowfy.github.io/simple">simple</a></p>
<p><a href="http://isnowfy.github.io/">blog demo</a></p>
<p><a href="http://isnowfy.github.io/simple/editor.html">lightweight markdown editor</a></p>
<h2 id="usage">Usage</h2>
<p>With simple and github pages you can easily create your static blog. Here is what you need to do.</p>
<ol>
<li>Create github account.</li>
<li>Create a repo named <code>your_user_name.github.io</code> (remember to check <code>Initilize and create README</code>).</li>
<li>Sign in <a href="http://isnowfy.github.io/simple">simple</a> with your github account.</li>
<li>Click <code>Initilize</code> to set up basic file for your static blog site.</li>
<li>Click <code>Go</code> and start writing.</li>
</ol>
<p><img src="http://isnowfy.github.io/img/Simple.png" alt="simple" title=""></p>
<ul>
<li><p>You can use your own blog name, just modify the <code>main.json</code> file, and change <code>name="username"</code>.</p></li>
<li><p>You can use disqus comment system, just modify the <code>main.json</code> file, and change <code>disqus_shortname=""</code> to <code>disqus_shortname="your_shortname"</code>.</p></li>
<li><p>You can use your own custom domain, just modify the <code>CNAME</code> file.(see <a href="https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages">also</a>).</p></li>
</ul>
<h2 id="features">Features</h2>
<ul>
<li>Simple, no backend need</li>
<li>Static blog</li>
<li>Markdown editor</li>
<li>Code highlight support</li>
<li>Tex formula support</li>
</ul>
<h2 id="custom">Custom</h2>
<p>The template files are at <code>/src/template</code>, 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 <code>src</code> folder in your <code>gh-pages</code> branch which will allow you generate your own static blog.</p>
<h2 id="todo">Todo</h2>
<p>Enhance error display, Search, Sitemap, Rss</p>
<h2 id="license">License</h2>
<p>MIT licensed.</p>
<!-- content end -->
</div>
<br>
<br>
<div id="disqus_thread"></div>
<div class="footer">
<p>© Copyright 2014 by isnowfy, Designed by isnowfy</p>
</div>
</div>
<script src="main.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ["\\(", "\\)"]], processEscapes: true}});
</script>
<script id="content" type="text/mustache">
<h1>{{title}}</h1>
<div class="tag">
{{date}}
{{#tags}}
<a href="/#/tag/{{name}}">#{{name}}</a>
{{/tags}}
</div>
</script>
<script id="pagesTemplate" type="text/mustache">
{{#pages}}
<li>
<a href="{{path}}">{{title}}</a>
</li>
{{/pages}}
</script>
<script>
$(document).ready(function() {
$.ajax({
url: "main.json",
type: "GET",
dataType: "json",
success: function(data) {
$("#title").html(data.name);
var pagesTemplate = Hogan.compile($("#pagesTemplate").html());
var pagesHtml = pagesTemplate.render({"pages": data.pages});
$("#pages").append(pagesHtml);
//path
var path = "about-simple.html";
//path end
var now = 0;
for (var i = 0; i < data.posts.length; ++i)
if (path == data.posts[i].path)
now = i;
var post = data.posts[now];
var tmp = post.tags.split(" ");
var tags = [];
for (var i = 0; i < tmp.length; ++i)
if (tmp[i].length > 0)
tags.push({"name": tmp[i]});
var contentTemplate = Hogan.compile($("#content").html());
var contentHtml = contentTemplate.render({"title": post.title, "tags": tags, "date": post.date});
$("#main").prepend(contentHtml);
if (data.disqus_shortname.length > 0) {
var disqus_shortname = data.disqus_shortname;
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
}
}
});
});
</script>
</body>
</html>