-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
160 lines (157 loc) · 7.04 KB
/
index.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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-inline'">
<meta name="referrer" content="no-referrer">
<title>Good Generator.py</title>
<link rel="canonical" href="https://oliz.io/ggpy/">
<link rel="shortcut icon" href="https://oliz.io/ggpy/static/gg.png">
<style>
body {
font-family: sans-serif;
line-height: 1.5;
color: #363636;
background: #FFF;
margin: 1rem auto;
padding: 0 .6rem 1rem .6rem;
max-width: 44em;
scroll-behavior: smooth;
}
a { color: #07A; text-decoration: none; }
blockquote {
background: #EAEAEA;
border-left: .3rem solid #07A;
border-radius: .3rem;
margin: 0 .2rem;
padding: 0 .5rem;
}
code {
font-size: .9rem;
background: #EAEAEA;
padding: .2rem .5rem;
white-space: nowrap;
}
footer { margin-top: 1rem; }
h1 { text-align: center; margin: 0 auto; }
h1, h2, h3, h4, h5, h6 { font-family: serif; font-weight: bold; }
header { text-align:center; }
img { max-width: 100%; }
ul.task-list, ul.task-list li.task-list-item {
list-style-type: none;
list-style-image: none;
}
pre { border-left: .3rem solid #07A; }
pre > code {
font-size: .9rem;
background: #EAEAEA;
box-sizing: inherit;
display: block;
overflow-x: auto;
margin: 0 .2rem;
white-space: pre;
}
table {
border-spacing: 0;
width: 100%;
}
td, th {
border-bottom: .1rem solid;
padding: .8rem 1rem;
text-align: left;
vertical-align: top;
}
.dark-mode { color: #CACACA; background: #363636; }
.dark-mode a { color: #0A7; }
.dark-mode blockquote { background: #222; border-left: .3rem solid #0A7; }
.dark-mode code { background: #222; }
.dark-mode pre { border-left: .3rem solid #0A7; }
.large-font { font-size: 1.2em; }
.avatar { border-radius: 50%; max-width: 5rem; }
.nav { float: left; margin-right: 1rem; }
.card { background: rgba(0, 0, 0, 0.1); border-radius: 5px; padding: .8rem; margin-top: .8rem; }
.social { float: right; margin-left: 1rem; }
</style>
<script>
function toggleTheme() { document.body.classList.toggle("dark-mode") }
function initTheme() { let h=new Date().getHours(); if (h <= 8 || h >= 20) { toggleTheme() } }
function toggleFontSize() { document.body.classList.toggle("large-font") }
</script>
<meta name="author" content="Good Gen">
<meta property="og:title" content="">
<meta property="og:type" content="article">
<meta property="og:url" content="https://oliz.io/ggpy/">
<meta property="og:description" content="">
<meta property="og:image" content="https://oliz.io/ggpy/static/gg.png">
<meta property="og:locale" content="en-US">
<script type="application/ld+json">{"@context":"http://schema.org","@type":"WebSite","headline":"","url":"https://oliz.io/ggpy/","name":"Good Generator.py","description":""}</script>
</head>
<body onload="initTheme()">
<header>
<a href="https://oliz.io/ggpy"><img src="https://oliz.io/ggpy/static/gg.png" class="avatar" /></a>
</header>
<section>
<h1 id="good-generatorpy">Good Generator<code>.py</code></h1>
<p><a href="https://circleci.com/gh/ooz/ggpy"><img alt="CircleCI" src="https://circleci.com/gh/ooz/ggpy.svg?style=shield" /></a>
<a href="LICENSE.txt"><img alt="GNU AGPLv3 Badge" src="https://img.shields.io/badge/license-AGPLv3-blue.svg" /></a>
<a href="LICENSE.txt"><img alt="MIT License Badge" src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
<a href="CHANGELOG.html"><img alt="Changelog" src="https://img.shields.io/badge/-CHANGELOG-blueviolet.svg" /></a></p>
<hr />
<p>Yet another static site generator. Written in Python.
<a href="https://oliz.io/blog/2018/why-i-wrote-yet-another-static-site-gen.html">Why?</a></p>
<p>It powers <a href="https://oliz.io/ggpy">its website</a>, which is its <a href="https://github.com/ooz/ggpy">README.md</a> rendered via <a href="https://circleci.com/gh/ooz/ggpy">CircleCI</a>.
An infinite incepted loop!
It also powers <a href="https://oliz.io">my website</a> and <a href="https://oliz.io/blog/">blog</a>.</p>
<h2 id="features">Features</h2>
<ul>
<li>Static site generator supporting <a href="https://oliz.io/ggpy/test/features/">Markdown with various extensions</a>
and <a href="https://oliz.io/ggpy/test/features/meta.html">Markdown meta header format</a></li>
<li>Renders all <code>*.md</code> to <code>*.html</code> files in the passed directories and recursively in their sub-directories</li>
<li>Files named <code>README.md</code> are converted to <code>index.html</code>. Thus, it is fully compatible with GitHub Pages</li>
<li>It may render a time-stamped index of all generated HTML files, suitable for blogs. Documents may also be inlined into the index, suitable for micro-blogs</li>
<li>Built-in responsive style with light mode and dark mode</li>
<li>Open Graph and schema.org support</li>
<li>Generates <code>sitemap.xml</code> with <code>lastmod</code> timestamps taken from git history</li>
<li>Generates <code>rss.xml</code> RSS feed</li>
<li>Requires <code>python3</code>, <code>pip</code>, and optionally <code>git</code> (for more accurate, CI-friendly timestamps) and <code>make</code> if you want to use the provided Makefile. Thus, it <a href="https://oliz.io/blog/2018/code-and-deploy-using-termux.html">runs in Termux on Android</a></li>
<li>The provided <a href="https://github.com/ooz/ggpy/blob/master/.circleci/config.yml">CircleCI configuration</a> may serve as a blueprint to let CircleCI build your page on every commit</li>
</ul>
<h2 id="usage">Usage</h2>
<ul>
<li>Copy <code>gg.py</code>, <code>ggconfig.py</code>, <code>Pipfile</code> and <code>Makefile</code> to the root of your website/blog</li>
<li>Adjust <code>ggconfig.py</code> to your preferences. Since it is an imported Python file, you can use it for preprocessing hooks, too!</li>
<li>Place markdown files everywhere</li>
<li>Install dependencies
<pre class="highlight"><code>make install_pipenv
make init</code></pre></li>
<li>Generate your site
<pre class="highlight"><code>make</code></pre></li>
<li>To update your <code>gg.py</code> "installation", run (your configuration will not be touched)
<pre class="highlight"><code>make update</code></pre></li>
<li>See all make targets with short documentation
<pre class="highlight"><code>make help</code></pre></li>
</ul>
<h2 id="tests">Tests</h2>
<ul>
<li>Install dependencies (if you have not yet)
<pre class="highlight"><code>make install_pipenv
make init</code></pre></li>
<li>Run tests with coverage
<pre class="highlight"><code>make test</code></pre></li>
</ul>
<h2 id="license">License</h2>
<p>This software is dual-licensed under GNU AGPLv3 or MIT License,
see <a href="https://oliz.io/ggpy/LICENSE.txt">LICENSE.txt</a> file for details.</p>
</section>
<footer>
<a href="#" class="nav">top</a>
<a href="javascript:toggleTheme()" class="nav">🌓</a>
<a href="javascript:toggleFontSize()" class="nav">aA</a>
<a href="https://oliz.io/about.html" class="social">about</a>
<a href="https://github.com/ooz/ggpy" class="social">github</a>
<a href="https://nitter.net/" class="social">twitter</a>
<a href="mailto:example@example.com" class="social">email</a>
</footer>
</body>
</html>