@bivabdas/sharq 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +83 -0
- package/bin/create-sharq.js +33 -0
- package/bin/sharq.js +57 -0
- package/index.js +4 -0
- package/lib/config.js +51 -0
- package/lib/generator.js +172 -0
- package/lib/package-info.js +8 -0
- package/lib/renderer.js +298 -0
- package/lib/scaffold.js +161 -0
- package/lib/server.js +199 -0
- package/lib/sitemap.js +21 -0
- package/package.json +36 -0
- package/scaffold/template/content/hello-sharq.md +17 -0
- package/scaffold/template/public/assets/site.css +224 -0
- package/scaffold/template/templates/archive.html +22 -0
- package/scaffold/template/templates/index.html +26 -0
- package/scaffold/template/templates/post.html +23 -0
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bivabdas/sharq",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Minimal on-demand static rendering framework and scaffolder",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"static-site-generator",
|
|
8
|
+
"blog",
|
|
9
|
+
"markdown",
|
|
10
|
+
"landing-pages",
|
|
11
|
+
"publishing"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20.0.0"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./index.js"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"sharq": "./bin/sharq.js",
|
|
22
|
+
"create-sharq": "./bin/create-sharq.js"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"start": "node ./bin/sharq.js start",
|
|
26
|
+
"dev": "node --watch ./bin/sharq.js dev",
|
|
27
|
+
"build": "node ./bin/sharq.js build",
|
|
28
|
+
"test": "node --input-type=module -e \"import('./index.js').then((m) => console.log('exports:', Object.keys(m).sort().join(', ')))\""
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin",
|
|
32
|
+
"lib",
|
|
33
|
+
"scaffold",
|
|
34
|
+
"index.js"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hello sharq
|
|
3
|
+
description: Your first sharq post.
|
|
4
|
+
date: 2026-04-03
|
|
5
|
+
author: You
|
|
6
|
+
tags: welcome, getting-started
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Hello sharq
|
|
10
|
+
|
|
11
|
+
This site was scaffolded with sharq.
|
|
12
|
+
|
|
13
|
+
## Start here
|
|
14
|
+
|
|
15
|
+
- Add markdown files in `content/`
|
|
16
|
+
- Edit your templates in `templates/`
|
|
17
|
+
- Tweak your branding in `public/assets/site.css`
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light;
|
|
3
|
+
--bg: #efe6d6;
|
|
4
|
+
--bg-deep: #ddd3c4;
|
|
5
|
+
--panel: rgba(255, 251, 245, 0.9);
|
|
6
|
+
--panel-strong: #fff8ef;
|
|
7
|
+
--text: #221d18;
|
|
8
|
+
--muted: #6d645b;
|
|
9
|
+
--accent: #0f766e;
|
|
10
|
+
--accent-strong: #9a3412;
|
|
11
|
+
--border: rgba(108, 92, 76, 0.16);
|
|
12
|
+
--shadow: 0 18px 45px rgba(64, 40, 20, 0.08);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
* {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
html {
|
|
20
|
+
font-size: 16px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
body {
|
|
24
|
+
margin: 0;
|
|
25
|
+
min-height: 100vh;
|
|
26
|
+
color: var(--text);
|
|
27
|
+
font-family: Georgia, "Times New Roman", serif;
|
|
28
|
+
background:
|
|
29
|
+
radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
|
|
30
|
+
radial-gradient(circle at 80% 20%, rgba(154, 52, 18, 0.14), transparent 22%),
|
|
31
|
+
linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
a {
|
|
35
|
+
color: var(--accent);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.button-link {
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
padding: 0.7rem 1rem;
|
|
42
|
+
border-radius: 999px;
|
|
43
|
+
background: var(--accent);
|
|
44
|
+
color: #f8fbfb;
|
|
45
|
+
text-decoration: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.shell {
|
|
49
|
+
max-width: 920px;
|
|
50
|
+
margin: 0 auto;
|
|
51
|
+
padding: 56px 20px 80px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.eyebrow {
|
|
55
|
+
margin: 0 0 12px;
|
|
56
|
+
letter-spacing: 0.08em;
|
|
57
|
+
text-transform: uppercase;
|
|
58
|
+
color: var(--accent-strong);
|
|
59
|
+
font-size: 0.8rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.hero {
|
|
63
|
+
margin-bottom: 28px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.hero h1 {
|
|
67
|
+
margin: 0;
|
|
68
|
+
font-size: clamp(3rem, 9vw, 5.5rem);
|
|
69
|
+
line-height: 0.95;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.hero p:last-child {
|
|
73
|
+
max-width: 58ch;
|
|
74
|
+
color: var(--muted);
|
|
75
|
+
line-height: 1.8;
|
|
76
|
+
font-size: 1.04rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.panel,
|
|
80
|
+
.article-card {
|
|
81
|
+
background: var(--panel);
|
|
82
|
+
border: 1px solid var(--border);
|
|
83
|
+
border-radius: 24px;
|
|
84
|
+
box-shadow: var(--shadow);
|
|
85
|
+
backdrop-filter: blur(10px);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.panel {
|
|
89
|
+
padding: 24px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.article-card {
|
|
93
|
+
padding: 32px;
|
|
94
|
+
background: var(--panel-strong);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.post-list {
|
|
98
|
+
list-style: none;
|
|
99
|
+
padding: 0;
|
|
100
|
+
margin: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.post-list li {
|
|
104
|
+
display: flex;
|
|
105
|
+
justify-content: space-between;
|
|
106
|
+
align-items: baseline;
|
|
107
|
+
gap: 20px;
|
|
108
|
+
padding: 18px 0;
|
|
109
|
+
border-bottom: 1px solid var(--border);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.post-list li:last-child {
|
|
113
|
+
border-bottom: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.post-list a {
|
|
117
|
+
text-decoration: none;
|
|
118
|
+
font-size: 1.15rem;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.post-list p {
|
|
122
|
+
margin: 0.45rem 0 0;
|
|
123
|
+
color: var(--muted);
|
|
124
|
+
line-height: 1.7;
|
|
125
|
+
max-width: 52ch;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.post-list span,
|
|
129
|
+
.meta {
|
|
130
|
+
color: var(--muted);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.tag-list {
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-wrap: wrap;
|
|
136
|
+
gap: 0.5rem;
|
|
137
|
+
list-style: none;
|
|
138
|
+
padding: 0;
|
|
139
|
+
margin: 0 0 1.25rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.tag {
|
|
143
|
+
padding: 0.35rem 0.7rem;
|
|
144
|
+
border-radius: 999px;
|
|
145
|
+
background: rgba(15, 118, 110, 0.1);
|
|
146
|
+
color: var(--accent);
|
|
147
|
+
font-size: 0.85rem;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.article-content p,
|
|
151
|
+
.article-content li {
|
|
152
|
+
line-height: 1.8;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.article-content h2,
|
|
156
|
+
.article-content h3 {
|
|
157
|
+
margin-top: 2rem;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.article-content ul,
|
|
161
|
+
.article-content ol {
|
|
162
|
+
padding-left: 1.2rem;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.article-content pre {
|
|
166
|
+
overflow-x: auto;
|
|
167
|
+
padding: 16px;
|
|
168
|
+
background: #241d18;
|
|
169
|
+
color: #f7efe7;
|
|
170
|
+
border-radius: 14px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.article-content code {
|
|
174
|
+
font-family: "SFMono-Regular", Consolas, monospace;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.article-content blockquote {
|
|
178
|
+
margin: 1.5rem 0;
|
|
179
|
+
padding: 0.1rem 0 0.1rem 1rem;
|
|
180
|
+
border-left: 4px solid rgba(15, 118, 110, 0.35);
|
|
181
|
+
color: var(--muted);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.archive-list {
|
|
185
|
+
display: grid;
|
|
186
|
+
gap: 1rem;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.archive-item {
|
|
190
|
+
padding: 1.1rem 0;
|
|
191
|
+
border-bottom: 1px solid var(--border);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.archive-item:last-child {
|
|
195
|
+
border-bottom: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.archive-item h2 {
|
|
199
|
+
margin: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.archive-item p {
|
|
203
|
+
margin: 0.5rem 0 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.archive-meta {
|
|
207
|
+
color: var(--muted);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
@media (max-width: 640px) {
|
|
211
|
+
.shell {
|
|
212
|
+
padding-top: 40px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.article-card,
|
|
216
|
+
.panel {
|
|
217
|
+
padding: 22px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.post-list li {
|
|
221
|
+
flex-direction: column;
|
|
222
|
+
align-items: flex-start;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>{{title}}</title>
|
|
7
|
+
<meta name="description" content="{{description}}">
|
|
8
|
+
<link rel="stylesheet" href="/assets/site.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body class="archive-page">
|
|
11
|
+
<main class="shell">
|
|
12
|
+
<section class="hero">
|
|
13
|
+
<p class="eyebrow">Archive</p>
|
|
14
|
+
<h1>All posts</h1>
|
|
15
|
+
<p>Everything currently discoverable in the content folder, sorted newest first.</p>
|
|
16
|
+
</section>
|
|
17
|
+
<section class="panel archive-list">
|
|
18
|
+
{{content}}
|
|
19
|
+
</section>
|
|
20
|
+
</main>
|
|
21
|
+
</body>
|
|
22
|
+
</html>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>{{title}}</title>
|
|
7
|
+
<meta name="description" content="{{description}}">
|
|
8
|
+
<link rel="stylesheet" href="/assets/site.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body class="index-page">
|
|
11
|
+
<main class="shell">
|
|
12
|
+
<section class="hero">
|
|
13
|
+
<p class="eyebrow">Minimal static blog engine</p>
|
|
14
|
+
<h1>{{title}}</h1>
|
|
15
|
+
<p>{{description}}</p>
|
|
16
|
+
<p><a class="button-link" href="/archive">Browse the archive</a></p>
|
|
17
|
+
</section>
|
|
18
|
+
|
|
19
|
+
<section class="panel">
|
|
20
|
+
<ul class="post-list">
|
|
21
|
+
{{content}}
|
|
22
|
+
</ul>
|
|
23
|
+
</section>
|
|
24
|
+
</main>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>{{title}}</title>
|
|
7
|
+
<meta name="description" content="{{description}}">
|
|
8
|
+
<link rel="stylesheet" href="/assets/site.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body class="post-page">
|
|
11
|
+
<main class="shell">
|
|
12
|
+
<article class="article-card">
|
|
13
|
+
<p class="eyebrow"><a href="/">Back to home</a></p>
|
|
14
|
+
<h1>{{title}}</h1>
|
|
15
|
+
<p class="meta">{{date}} · {{author}}</p>
|
|
16
|
+
<ul class="tag-list">{{tags}}</ul>
|
|
17
|
+
<div class="article-content">
|
|
18
|
+
{{content}}
|
|
19
|
+
</div>
|
|
20
|
+
</article>
|
|
21
|
+
</main>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|