krz/php-blog

A PHP blogging system with built-in static comments. blog comments php static

Commit e23604c27a

e23604c27a88ae45a8eaae6d012f14b8bc5055d2

parent: 12df45442b

Verified · cmc

cmc <hello@cleberg.net> · 2026-08-31 22:22 UTC

Convert README.nfo to README.org

Layout: unified · split

README.nfo deleted −69
@@ -1,69 +0,0 @@
1┌──────────────────────────────────────────────────────────────┐
2│ P H P - B L O G [ KRZ ] krz.sh │
3└──────────────────────────────────────────────────────────────┘
4
5WHAT
6 php-blog. database-free blogging app in php. articles in markdown,
7 metadata and comments in json.
8
9PHILOSOPHY
10 a blog should degrade gracefully over time. articles, metadata, and
11 comments live in the git repo, not a database.
12
13INSTALL
14 cd yourBlog.com
15 git clone <REPO_URL>
16
17 set the globals at the top of index.php:
18
19 $websiteProtocol = 'https://';
20 $shortDomain = 'yourBlog.com';
21
22 clear the sample data and posts:
23
24 cd _data/ && rm -rf *
25 touch comments.json && touch metadata.json
26 cd ../posts/ && rm -rf *
27 touch 001-your-first-post.md
28
29 add a metadata object in _data/metadata.json for every post. enable
30 FallbackResource in apache .conf or .htaccess:
31
32 FallbackResource /index.php
33
34STRUCTURE
35 index.php fallback resource; routes requests, calls
36 functions, fills the template
37 _classes/ Comment.php, Parsedown.php (erusev/parsedown, MIT),
38 Template.php
39 _data/ metadata.json (one object per post), comments.json
40 (written server-side as comments arrive)
41 _functions/ loadJSON.php, loadRSS.php, parseMarkdown.php,
42 submitComment.php
43 _templates/ template.html
44 posts/ markdown post bodies
45 static/ app.css, optional prism.css / prism.js for syntax
46 highlighting
47
48 metadata object:
49
50 {
51 "id": "001",
52 "title": "Title of Post",
53 "author": "Your Name",
54 "description": "...",
55 "tag": "my-category",
56 "created": "2018-12-08 00:00:00",
57 "modified": "2018-12-08 00:00:00",
58 "link": "https://www.example.com/post/name.html",
59 "published": "Yes"
60 }
61
62 let the web user write comments.json (apache is usually www-data):
63
64 chgrp -R www-data /path/to/website/
65 chmod -R g+w _data/comments.json
66
67┌──────────────────────────────────────────────────────────────┐
68│ krz.sh │
69└──────────────────────────────────────────────────────────────┘
README.org added +77
@@ -0,0 +1,77 @@
1#+title: php-blog
2
3* what
4php-blog. database-free blogging app in php. articles in markdown,
5metadata and comments in json.
6
7* philosophy
8a blog should degrade gracefully over time. articles, metadata, and
9comments live in the git repo, not a database.
10
11* install
12#+begin_src sh
13cd yourBlog.com
14git clone <REPO_URL>
15#+end_src
16
17set the globals at the top of index.php:
18
19#+begin_src sh
20$websiteProtocol = 'https://';
21$shortDomain = 'yourBlog.com';
22#+end_src
23
24clear the sample data and posts:
25
26#+begin_src sh
27cd _data/ && rm -rf *
28touch comments.json && touch metadata.json
29cd ../posts/ && rm -rf *
30touch 001-your-first-post.md
31#+end_src
32
33add a metadata object in _data/metadata.json for every post. enable
34FallbackResource in apache .conf or .htaccess:
35
36#+begin_src sh
37FallbackResource /index.php
38#+end_src
39
40* structure
41#+begin_example
42index.php fallback resource; routes requests, calls
43 functions, fills the template
44_classes/ Comment.php, Parsedown.php (erusev/parsedown, MIT),
45 Template.php
46_data/ metadata.json (one object per post), comments.json
47 (written server-side as comments arrive)
48_functions/ loadJSON.php, loadRSS.php, parseMarkdown.php,
49 submitComment.php
50_templates/ template.html
51posts/ markdown post bodies
52static/ app.css, optional prism.css / prism.js for syntax
53 highlighting
54#+end_example
55
56metadata object:
57
58#+begin_src sh
59{
60 "id": "001",
61 "title": "Title of Post",
62 "author": "Your Name",
63 "description": "...",
64 "tag": "my-category",
65 "created": "2018-12-08 00:00:00",
66 "modified": "2018-12-08 00:00:00",
67 "link": "https://www.example.com/post/name.html",
68 "published": "Yes"
69}
70#+end_src
71
72let the web user write comments.json (apache is usually www-data):
73
74#+begin_src sh
75chgrp -R www-data /path/to/website/
76chmod -R g+w _data/comments.json
77#+end_src