diff options
| author | Christian Cleberg <[email protected]> | 2026-08-02 15:29:36 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-08-02 15:29:36 -0500 |
| commit | 12df45442b37cb920bba96fa48edc9fda8b77f89 (patch) | |
| tree | ebcf18fc38db6c1bcb66955288f5ce22ff63e4a3 /README.nfo | |
| parent | a0b426147d99ecb146dc655378b7c563ea4f4769 (diff) | |
| download | php-blog-12df45442b37cb920bba96fa48edc9fda8b77f89.tar.gz php-blog-12df45442b37cb920bba96fa48edc9fda8b77f89.tar.bz2 php-blog-12df45442b37cb920bba96fa48edc9fda8b77f89.zip | |
Diffstat (limited to 'README.nfo')
| -rw-r--r-- | README.nfo | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/README.nfo b/README.nfo new file mode 100644 index 0000000..42b5164 --- /dev/null +++ b/README.nfo @@ -0,0 +1,69 @@ +┌──────────────────────────────────────────────────────────────┐ +│ P H P - B L O G [ KRZ ] krz.sh │ +└──────────────────────────────────────────────────────────────┘ + +WHAT + php-blog. database-free blogging app in php. articles in markdown, + metadata and comments in json. + +PHILOSOPHY + a blog should degrade gracefully over time. articles, metadata, and + comments live in the git repo, not a database. + +INSTALL + cd yourBlog.com + git clone <REPO_URL> + + set the globals at the top of index.php: + + $websiteProtocol = 'https://'; + $shortDomain = 'yourBlog.com'; + + clear the sample data and posts: + + cd _data/ && rm -rf * + touch comments.json && touch metadata.json + cd ../posts/ && rm -rf * + touch 001-your-first-post.md + + add a metadata object in _data/metadata.json for every post. enable + FallbackResource in apache .conf or .htaccess: + + FallbackResource /index.php + +STRUCTURE + index.php fallback resource; routes requests, calls + functions, fills the template + _classes/ Comment.php, Parsedown.php (erusev/parsedown, MIT), + Template.php + _data/ metadata.json (one object per post), comments.json + (written server-side as comments arrive) + _functions/ loadJSON.php, loadRSS.php, parseMarkdown.php, + submitComment.php + _templates/ template.html + posts/ markdown post bodies + static/ app.css, optional prism.css / prism.js for syntax + highlighting + + metadata object: + + { + "id": "001", + "title": "Title of Post", + "author": "Your Name", + "description": "...", + "tag": "my-category", + "created": "2018-12-08 00:00:00", + "modified": "2018-12-08 00:00:00", + "link": "https://www.example.com/post/name.html", + "published": "Yes" + } + + let the web user write comments.json (apache is usually www-data): + + chgrp -R www-data /path/to/website/ + chmod -R g+w _data/comments.json + +┌──────────────────────────────────────────────────────────────┐ +│ krz.sh │ +└──────────────────────────────────────────────────────────────┘ |
