Skip to content

Commit ef74d1f

Browse files
committed
Initial commit
0 parents  commit ef74d1f

File tree

6 files changed

+132
-0
lines changed

6 files changed

+132
-0
lines changed

.github/workflows/ci.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build & Deploy
2+
on: push
3+
permissions:
4+
contents: write
5+
6+
jobs:
7+
report:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
13+
- name: Install Deps
14+
run: |
15+
sudo apt-get install libcmark-dev curl
16+
curl -L https://codeberg.org/0ref/jelly/releases/download/0.1.0/jelly-linux-x86_64 --output jelly
17+
curl -L https://github.com/wilsonzlin/minify-html/releases/download/v0.15.0/minhtml-0.15.0-x86_64-unknown-linux-gnu --output minhtml
18+
chmod +x ./jelly
19+
chmod +x ./minhtml
20+
./jelly -i src -o build
21+
./minhtml --keep-closing-tags --minify-css --minify-js \
22+
--keep-spaces-between-attributes \
23+
--keep-input-type-text-attr \
24+
--keep-html-and-head-opening-tags \
25+
$(find build/ -type f -name "*.html")
26+
27+
- name: Deploy
28+
uses: peaceiris/actions-gh-pages@v4
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
publish_dir: ./public

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/

build.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
BUILD="build"
6+
CMD=${1:-}
7+
8+
if [ "$CMD" = "clean" ]; then
9+
rm -rf $BUILD
10+
exit 0
11+
elif [ "$CMD" = "serve" ]; then
12+
find src/ | entr -rs "jelly -i src -o $BUILD && python3 -m http.server -d $BUILD 4000"
13+
exit 0
14+
else
15+
echo "Invalid command '$CMD', Available commands are: clean/serve/release."
16+
exit 1
17+
fi

src/404.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title 404 Not Found!
3+
date
4+
last_modified_at
5+
---
6+
7+
The resource you're looking for could not be found!

src/index.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title Home
3+
date
4+
last_modified_at
5+
---
6+

src/template.html

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>{{title}} | csprite</title>
8+
<link rel="icon" type="image/png" href="/favicon.png" />
9+
<link rel="stylesheet" type="text/css" href="/css/styles.css" />
10+
<style>
11+
* {
12+
box-sizing: border-box;
13+
font-smooth: never;
14+
font-kerning: normal;
15+
font-feature-settings: kern;
16+
text-rendering: optimizeLegibility;
17+
-webkit-font-smoothing: antialiased;
18+
-moz-osx-font-smoothing: grayscale;
19+
scroll-behavior: smooth;
20+
}
21+
:root {
22+
font-size: 100%;
23+
font-family: monospace;
24+
tab-size: 2;
25+
}
26+
body {
27+
color: #000;
28+
background: #FFF;
29+
margin: 1rem auto 3rem auto;
30+
padding: 0 0.75rem;
31+
max-width: 720px;
32+
}
33+
a, a:visited {
34+
color: #000;
35+
text-decoration-color: #000 !important;
36+
line-height: 1.5 !important;
37+
text-decoration: underline;
38+
text-underline-offset: 0.17rem;
39+
}
40+
a:hover {
41+
text-decoration: none;
42+
}
43+
hr {
44+
border-top: 1px solid #000;
45+
}
46+
img {
47+
display: block;
48+
margin: 0 auto;
49+
max-width: 100%;
50+
}
51+
</style>
52+
<meta property="og:locale" content="en_US">
53+
<meta property="og:site_name" content="csprite">
54+
<meta property="og:type" content="website">
55+
<meta property="og:image" content="/favicon.png">
56+
</head>
57+
<body>
58+
<nav>
59+
<a href="/">Home</a>
60+
</nav>
61+
<header>
62+
<h1>{{title}}</h1>
63+
<div>
64+
<time>{{date}}</time>
65+
<time class="modified_on">{{last_modified_at}}</time>
66+
</div>
67+
</header>
68+
<article>{{content}}</article>
69+
</body>
70+
</html>

0 commit comments

Comments
 (0)