Skip to content

Commit 906b43a

Browse files
committed
feat(web): add blog generation infrastructure
- Use pyssg for static site generation - Add build script for blog with basic content and styling
1 parent e097e04 commit 906b43a

File tree

7 files changed

+295
-0
lines changed

7 files changed

+295
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ go.work.sum
3333
# air - go hot reloading
3434
tmp/
3535
testdata/
36+
37+
# Blog generation
38+
.pyssg/
39+
__pycache__/
40+
*.pyc

build-blog.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
# Blog build script for req project
4+
# Builds the static site using pyssg
5+
6+
set -e
7+
8+
echo "Building req blog..."
9+
10+
# Check if pyssg is installed
11+
if [ ! -d ".pyssg" ]; then
12+
echo "Installing pyssg..."
13+
git clone https://github.com/maniac-en/pyssg.git .pyssg
14+
cd .pyssg
15+
git checkout 46d6632bff1259ae045a116ba6ee4332cbae5f26
16+
cd ..
17+
fi
18+
19+
# Generate the site
20+
echo "Generating static site..."
21+
cd .pyssg
22+
PYTHONPATH=. python3 src/main.py --config ../pyssg.config.json
23+
cd ..
24+
25+
# Remove pyssg example images that we don't need
26+
echo "Cleaning up unnecessary images..."
27+
if [ -d "docs/images" ]; then
28+
rm -rf docs/images
29+
fi
30+
31+
echo "Blog built successfully! Files are in /docs directory."
32+
echo "The site is ready for GitHub Pages deployment."

docs/index.css

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
body {
2+
background-color: #1f1c25;
3+
color: #f0e6d1;
4+
font-family: "Luminari", "Georgia", serif;
5+
line-height: 1.7;
6+
margin: 0;
7+
padding: 20px;
8+
max-width: 800px;
9+
margin-left: auto;
10+
margin-right: auto;
11+
}
12+
13+
b {
14+
font-weight: 900;
15+
}
16+
17+
h1,
18+
h2,
19+
h3,
20+
h4,
21+
h5,
22+
h6 {
23+
color: #dda15e;
24+
margin-top: 24px;
25+
margin-bottom: 16px;
26+
text-shadow: 2px 2px 4px #000;
27+
}
28+
29+
h1 {
30+
font-size: 2.5em;
31+
}
32+
33+
h2 {
34+
font-size: 2em;
35+
}
36+
37+
h3 {
38+
font-size: 1.5em;
39+
}
40+
41+
h4,
42+
h5,
43+
h6 {
44+
font-size: 1.2em;
45+
}
46+
47+
a {
48+
color: #e0a96d;
49+
text-decoration: none;
50+
border-bottom: 2px solid #e0a96d;
51+
}
52+
53+
a:hover {
54+
color: #f4a261;
55+
border-color: #f4a261;
56+
}
57+
58+
ul,
59+
ol {
60+
padding-left: 30px;
61+
}
62+
63+
code {
64+
background-color: #3c3c42;
65+
border-radius: 6px;
66+
color: #e9c46a;
67+
padding: 0.4em 0.6em;
68+
font-family: "Courier New", monospace;
69+
}
70+
71+
pre code {
72+
padding: 0;
73+
}
74+
75+
pre {
76+
background-color: #3c3c42;
77+
border-radius: 6px;
78+
padding: 1em;
79+
overflow: auto;
80+
box-shadow: 2px 2px 6px #000;
81+
}
82+
83+
blockquote {
84+
background-color: #2e2c35;
85+
border-left: 4px solid #8d99ae;
86+
padding-left: 2em;
87+
margin-left: 0;
88+
padding-top: 0.5em;
89+
padding-bottom: 0.5em;
90+
padding-right: 0.5em;
91+
color: #ddd;
92+
font-style: italic;
93+
}
94+
95+
img {
96+
max-width: 100%;
97+
height: auto;
98+
border-radius: 6px;
99+
border: 3px solid #3c3c42;
100+
box-shadow: 3px 3px 6px #000;
101+
}
102+
103+
::-webkit-scrollbar {
104+
width: 12px;
105+
height: 12px;
106+
}
107+
108+
::-webkit-scrollbar-track {
109+
background: #1f1c25;
110+
border-radius: 6px;
111+
}
112+
113+
::-webkit-scrollbar-thumb {
114+
background-color: #3c3c42;
115+
border-radius: 6px;
116+
border: 3px solid #1f1c25;
117+
}
118+
119+
::-webkit-scrollbar-thumb:hover {
120+
background-color: #5a5466;
121+
}
122+
123+
* {
124+
scrollbar-width: thin;
125+
scrollbar-color: #3c3c42 #1f1c25;
126+
}
127+
128+
::-webkit-scrollbar-corner {
129+
background: #1f1c25;
130+
}

docs/index.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title> req - Terminal API Client </title>
8+
<link href="/req/index.css" rel="stylesheet">
9+
10+
</head>
11+
12+
<body>
13+
<article>
14+
<div><h1>req - Terminal API Client</h1><blockquote><b>Note</b>: This page is not up to date and serves as a boilerplate for the blog setup.</blockquote><p>A terminal-based API client built for the <a href="https://blog.boot.dev/news/hackathon-2025/">Boot.dev Hackathon 2025</a>.</p><h2>Features</h2><ul><li>Terminal user interface</li><li>Request collections</li><li>Environment variables</li><li>Request history</li></ul><h2>Tech Stack</h2><p>The project uses:</p><ol><li><b>Go</b> for core logic</li><li><b>Bubble Tea</b> for TUI</li><li><b>SQLite</b> for storage</li></ol><h3>Code Example</h3><pre>go
15+
func main() {
16+
fmt.Println("Hello, req!")
17+
}
18+
</pre><h2>Installation</h2><pre>bash
19+
go build -o req .
20+
./req
21+
</pre><h3>Commands</h3><ul><li><code>req --help</code> - Show help</li><li><code>req --verbose</code> - Verbose output</li></ul><h2>Lists Test</h2><p><b>Unordered list:</b>
22+
- Item one
23+
- Item two
24+
- Item three</p><p><b>Ordered list:</b>
25+
1. First step
26+
2. Second step
27+
3. Third step</p><h2>Text Formatting</h2><p>This has <b>bold text</b>, <i>italic text</i>, and <code>inline code</code>.</p><p>---</p><p>This blog is built with ❤️ using <a href="https://github.com/maniac-en/pyssg">pyssg</a> - A guided learning project at <a href="https://www.boot.dev/courses/build-static-site-generator">boot.dev</a></p></div>
28+
</article>
29+
</body>
30+
31+
</html>

pyssg.config.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"project": {
3+
"name": "req",
4+
"title": "req - Terminal API Client"
5+
},
6+
"paths": {
7+
"content_dir": "web/content",
8+
"static_dir": ".pyssg/src/static",
9+
"template_path": ".pyssg/template.html",
10+
"build_dir": "docs"
11+
},
12+
"server": {
13+
"enable_hot_reload": true,
14+
"port": 8080
15+
},
16+
"build": {
17+
"base_path": "/req/",
18+
"css_path": "/index.css"
19+
}
20+
}

web/content/index.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# req - Terminal API Client
2+
3+
> **Note**: This page is not up to date and serves as a boilerplate for the blog setup.
4+
5+
A terminal-based API client built for the [Boot.dev Hackathon 2025](https://blog.boot.dev/news/hackathon-2025/).
6+
7+
## Features
8+
9+
- Terminal user interface
10+
- Request collections
11+
- Environment variables
12+
- Request history
13+
14+
## Tech Stack
15+
16+
The project uses:
17+
18+
1. **Go** for core logic
19+
2. **Bubble Tea** for TUI
20+
3. **SQLite** for storage
21+
22+
### Code Example
23+
24+
```go
25+
func main() {
26+
fmt.Println("Hello, req!")
27+
}
28+
```
29+
30+
## Installation
31+
32+
```bash
33+
go build -o req .
34+
./req
35+
```
36+
37+
### Commands
38+
39+
- `req --help` - Show help
40+
- `req --verbose` - Verbose output
41+
42+
## Lists Test
43+
44+
**Unordered list:**
45+
- Item one
46+
- Item two
47+
- Item three
48+
49+
**Ordered list:**
50+
1. First step
51+
2. Second step
52+
3. Third step
53+
54+
## Text Formatting
55+
56+
This has **bold text**, _italic text_, and `inline code`.
57+
58+
---
59+
60+
This blog is built with ❤️ using [pyssg](https://github.com/maniac-en/pyssg) - A guided learning project at [boot.dev](https://www.boot.dev/courses/build-static-site-generator)

web/template.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<title> {{ Title }} </title>
8+
<link href="{{ CSSPath }}" rel="stylesheet">
9+
</head>
10+
11+
<body>
12+
<article>
13+
{{ Content }}
14+
</article>
15+
</body>
16+
17+
</html>

0 commit comments

Comments
 (0)