Skip to content

Commit f73b584

Browse files
committed
setup new blog section
1 parent 8734b15 commit f73b584

File tree

12 files changed

+585
-490
lines changed

12 files changed

+585
-490
lines changed

assets/style.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
header {
2-
display: flex;
3-
flex-direction: column;
4-
}
5-
61
#main-nav, .release-nav {
72
display: flex;
83
justify-content: center;
@@ -118,6 +113,10 @@ p {
118113
margin-bottom: 0.5rem;
119114
}
120115

116+
p, li {
117+
line-height: 1.5;
118+
}
119+
121120
p code {
122121
font-weight: bold;
123122
}
@@ -213,6 +212,10 @@ ul {
213212
padding-left: 1.5rem;
214213
}
215214

215+
li {
216+
margin-bottom: 0.4rem;
217+
}
218+
216219
/* Classes */
217220

218221
.centered {

content/blog/index.smd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
.title = "Blog",
3+
.date = @date("2020-07-06T00:00:00"),
4+
.author = "Sample Author",
5+
.layout = "blog.shtml",
6+
.alternatives = [{
7+
.name = "rss",
8+
.layout = "blog.xml",
9+
.output = "index.xml",
10+
}],
11+
.draft = false,
12+
---
13+
14+
This blog section is also available as an [RSS feed]($link.alternative('rss')).

layouts/blog.shtml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<extend template="base.shtml">
2+
<title id="title" :text="$page.title"></title>
3+
<head id="head">
4+
<style>
5+
.date {
6+
font-size: 0.9em;
7+
}
8+
9+
.title h3{
10+
margin-top: 0;
11+
}
12+
</style>
13+
</head>
14+
<div id="content">
15+
<h1 class="title" :text="$page.title"></h1>
16+
<div :html="$page.content()"></div>
17+
<div>
18+
<h2>Post list</h2>
19+
<div :loop="$page.subpages()">
20+
<span class="date" :text="$loop.it.date.format('02 January 2006')"></span>
21+
<a class="title" href="$loop.it.link()">
22+
<h3 :text="$loop.it.title"></h3>
23+
</a>
24+
</div>
25+
</div>
26+
</div>

layouts/blog.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<rss version="2.0">
2+
<channel>
3+
<title :text="$site.title"></title>
4+
<link :text="$site.host_url"></link>
5+
<description :text="$site.title.suffix(' - Blog')"></description>
6+
<generator>Zine -- https://zine-ssg.io</generator>
7+
<language>en-US</language>
8+
<lastBuildDate :text="$build.generated.formatHTTP()"></lastBuildDate>
9+
<ctx :loop="$page.subpages()">
10+
<item>
11+
<title :text="$loop.it.title"></title>
12+
<description :text="$loop.it.content()"></description>
13+
<link :text="$site.host_url.addPath($loop.it.link())"></link>
14+
<pubDate :text="$loop.it.date.formatHTTP()"></pubDate>
15+
<guid :text="$site.host_url.addPath($loop.it.link())"></guid>
16+
</item>
17+
</ctx>
18+
</channel>
19+
</rss>

layouts/index.shtml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
<extend template="base.shtml">
22
<title id="title" :text="$page.title"></title>
33
<head id="head">
4-
<style>
5-
h1 {
6-
font-size: 3.25rem;
7-
margin-top: 1rem;
8-
margin-bottom: 0.5rem;
9-
}
10-
11-
h2 {
12-
margin-top: 1.5rem;
13-
margin-bottom: 0.25rem;
14-
}
15-
16-
li + li {
17-
margin-top: 0.6rem;
18-
}
19-
</style>
4+
<style>
5+
h1 {
6+
font-size: 3.25rem;
7+
margin-top: 1rem;
8+
margin-bottom: 0.5rem;
9+
}
10+
11+
h2 {
12+
margin-top: 1.5rem;
13+
margin-bottom: 0.25rem;
14+
}
15+
</style>
2016
</head>
21-
<header id="header">
22-
<h1>Zigtools</h1>
23-
<p class="centered">We make free and open-source tools
24-
<br>
25-
for the
26-
<i><a href="https://ziglang.org/">@ziglang</a></i>
27-
community.</p>
28-
</header>
2917
<div id="content">
30-
<main id="page" :html="$page.content()"></main>
31-
</div>
18+
<h1>Zigtools</h1>
19+
<p class="centered">We make free and open-source tools
20+
<br>
21+
for the
22+
<i><a href="https://ziglang.org/">@ziglang</a></i>
23+
community.</p>
24+
<main id="page" :html="$page.content()"></main>
25+
</div>

layouts/page.shtml

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
11
<extend template="base.shtml">
22
<title id="title" :text="$page.title"></title>
33
<head id="head">
4-
<style>
5-
h1,
6-
h2 {
7-
margin-top: 1.2rem;
8-
margin-bottom: 0.8rem;
9-
}
10-
11-
h1 {
12-
align-self: center;
13-
text-align: center;
14-
}
15-
16-
h3,
17-
h4,
18-
h5,
19-
h6 {
20-
margin-top: 0.8rem;
21-
margin-bottom: 0.5rem;
22-
}
23-
24-
h2,
25-
h3,
26-
h4 {
27-
border-bottom: 1px dashed var(--border-color);
28-
}
29-
</style>
4+
<style>
5+
h1,
6+
h2 {
7+
margin-top: 1.2rem;
8+
margin-bottom: 0.8rem;
9+
}
10+
11+
h1 {
12+
align-self: center;
13+
text-align: center;
14+
}
15+
16+
h3,
17+
h4,
18+
h5,
19+
h6 {
20+
margin-top: 0.8rem;
21+
margin-bottom: 0.5rem;
22+
}
23+
24+
h2,
25+
h3,
26+
h4 {
27+
border-bottom: 1px dashed var(--border-color);
28+
}
29+
</style>
3030
</head>
31-
<header id="header">
32-
<h1 class="title" :text="$page.title"></h1>
33-
</header>
3431
<div id="content">
35-
<main id="page" :html="$page.content()"></main>
36-
</div>
32+
<h1 class="title" :text="$page.title"></h1>
33+
<main id="page" :html="$page.content()"></main>
34+
</div>

layouts/post.shtml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<extend template="base.shtml">
2+
<title id="title" :text="$page.title"></title>
3+
<head id="head">
4+
<style>
5+
#prev-next {
6+
display: flex;
7+
flex-direction: row;
8+
justify-content: space-between;
9+
margin-top: 40px;
10+
}
11+
12+
figure {
13+
align-self: center;
14+
text-align: center;
15+
font-style: italic;
16+
}
17+
18+
.post {
19+
display:flex;
20+
flex-direction: column;
21+
}
22+
23+
h1 {
24+
text-align: left;
25+
margin-bottom: 0;
26+
}
27+
28+
h2 {
29+
margin-bottom: 0.25rem;
30+
}
31+
</style>
32+
</head>
33+
<div id="content">
34+
<h1 class="title" :text="$page.title"></h1>
35+
<div class="post" :html="$page.content()"></div>
36+
<div id="prev-next">
37+
<div :if="$page.prevPage?()">
38+
<a href="$if.link()">
39+
40+
<span :text="$if.title"></span>
41+
</a>
42+
</div>
43+
<div :if="$page.nextPage?()">
44+
<a href="$if.link()">
45+
<span :text="$if.title"></span>
46+
47+
</a>
48+
</div>
49+
</div>
50+
</div>

layouts/templates/base.shtml

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,35 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head id="head">
4-
<meta charset="UTF-8">
5-
<meta name="description" content="zigtools: We make free and open-source tools for the @ziglang community.">
6-
<meta http-equiv="x-ua-compatible" content="ie=edge">
7-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8-
<title id="title">
9-
<super>
10-
- zigtools
11-
</title>
12-
<style :html="$site.asset('style.css').bytes()"></style>
13-
<super>
14-
</head>
15-
<body>
16-
<header id="header">
17-
<nav id="main-nav" class="centered">
18-
<a href="/">Home</a>
19-
<a href="/zls/install">ZLS</a>
20-
<a href="https://playground.zigtools.org/">Playground</a>
21-
<a href="https://github.com/sponsors/zigtools">Sponsor</a>
22-
<a href="https://github.com/zigtools" target="_blank">GitHub</a>
23-
</nav>
24-
<super>
25-
</header>
26-
<div id="content">
27-
<super>
28-
</div>
29-
<footer>
30-
<p>This
31-
<a href="https://github.com/zigtools/www.zigtools.org">Website</a>
32-
was made with
33-
<a href="https://zine-ssg.io">Zine</a></p>
34-
<!-- by someone who has no clue about web design -->
35-
</footer>
36-
</body>
37-
</html>
3+
<head id="head">
4+
<meta charset="UTF-8">
5+
<meta name="description" content="zigtools: We make free and open-source tools for the @ziglang community.">
6+
<meta http-equiv="x-ua-compatible" content="ie=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
8+
<title id="title">
9+
<super>
10+
- zigtools
11+
</title>
12+
<style :html="$site.asset('style.css').bytes()"></style>
13+
<super>
14+
</head>
15+
<body>
16+
<nav id="main-nav" class="centered">
17+
<a href="/">Home</a>
18+
<a href="/zls/install">ZLS</a>
19+
<a href="https://playground.zigtools.org/">Playground</a>
20+
<a href="https://github.com/sponsors/zigtools">Sponsor</a>
21+
<a href="https://github.com/zigtools" target="_blank">GitHub</a>
22+
<a href="/blog">Blog</a>
23+
</nav>
24+
<div id="content">
25+
<super>
26+
</div>
27+
<footer>
28+
<p>This
29+
<a href="https://github.com/zigtools/www.zigtools.org">Website</a>
30+
was made with
31+
<a href="https://zine-ssg.io">Zine</a></p>
32+
<!-- by someone who has no clue about web design -->
33+
</footer>
34+
</body>
35+
</html>

0 commit comments

Comments
 (0)