94aea8501f
Changed: [app/View.php](/Users/tyemeclifford/Documents/GH/blog/app/View.php): generated URLs now honor a base path like /blog. [app/Config.php](/Users/tyemeclifford/Documents/GH/blog/app/Config.php): added base_path support and derives it from base_url or SCRIPT_NAME. [app/App.php](/Users/tyemeclifford/Documents/GH/blog/app/App.php): route parsing strips the base path, and PHP can safely serve theme/upload assets for virtual subdirectory previews. [.htaccess](/Users/tyemeclifford/Documents/GH/blog/.htaccess): removed hardcoded RewriteBase /. [themes/neon/layout.php](/Users/tyemeclifford/Documents/GH/blog/themes/neon/layout.php): root-relative social links like /feed.xml now become /blog/feed.xml. [README.md](/Users/tyemeclifford/Documents/GH/blog/README.md): documented subdirectory setup.
67 lines
1.7 KiB
Markdown
67 lines
1.7 KiB
Markdown
# Neon Notes CMS
|
|
|
|
Neon Notes is a small PHP blog CMS with a Bludit-style content layout:
|
|
|
|
```text
|
|
bl-content/pages/<slug>/index.txt
|
|
```
|
|
|
|
Posts and static pages are Markdown `.txt` files with front matter. Comments are stored in SQLite, site configuration and generated indexes are JSON, and visit stats are CSV for easy Excel import.
|
|
|
|
## Requirements
|
|
|
|
- PHP 8.1 or newer
|
|
- PDO SQLite enabled
|
|
- Apache with `mod_rewrite` for `.htaccess` pretty URLs, or the PHP built-in server for local testing
|
|
|
|
## Local Server
|
|
|
|
```bash
|
|
php -S 127.0.0.1:8080 router.php
|
|
```
|
|
|
|
## CLI
|
|
|
|
```bash
|
|
php cli/blog.php help
|
|
php cli/blog.php list --all
|
|
php cli/blog.php create "New Post" --status=published --category=Notes --tags=php,markdown
|
|
php cli/blog.php update hello-neon --title="Hello Neon"
|
|
php cli/blog.php delete old-slug
|
|
php cli/blog.php rebuild
|
|
```
|
|
|
|
## Comments
|
|
|
|
Comments are moderated by default and protected by captcha plus a honeypot field.
|
|
|
|
```bash
|
|
php cli/blog.php comments:list --status=pending
|
|
php cli/blog.php comments:approve 1
|
|
php cli/blog.php comments:spam 2
|
|
php cli/blog.php comments:delete 3
|
|
```
|
|
|
|
## Stats
|
|
|
|
Visits are appended to `storage/stats/visits.csv` with a header row suitable for spreadsheet import.
|
|
|
|
```bash
|
|
php cli/blog.php stats:summary
|
|
```
|
|
|
|
## Apache
|
|
|
|
The included `.htaccess` enables pretty URLs and blocks direct access to app code, configuration, SQLite, CSV, JSON databases, and Markdown content files.
|
|
|
|
For a subdirectory install such as `https://example.com/blog`, either place the app in that folder and let the CMS auto-detect the path, or set:
|
|
|
|
```json
|
|
{
|
|
"base_url": "https://example.com/blog",
|
|
"base_path": "/blog"
|
|
}
|
|
```
|
|
|
|
`base_path` controls generated links, assets, forms, RSS, and sitemap paths.
|