A stupidly simple plain text-based blog engine. No HTML included.
A minimalistic, plain text-based blog engine written in PHP, inspired by the simplicity and structure of RFC format. It's designed to display content as plain text, keeping it simple, light, and easy to set up, with no need for a database.
See it in action here.
config.ini
file.git clone https://github.com/coignard/weblog.git
config.ini
and adjust the settings as needed (see Configuration section below)..txt
files in the weblog/your-category-name/
directory.It's that easy! Happy blogging!
Edit the config.ini
file in the root directory to setup your weblog:
line_width
: Maximum line width for content rendering (default: 72). This controls how text is wrapped in the output.prefix_length
: Length of the prefix used in formatted text output (default: 3). This is used to indent the text content slightly from the left margin.weblog_dir
: Directory path where blog posts are stored (default: /weblog/
). This specifies where your text files (representing blog posts) are located.domain
: The domain name where your blog is hosted (default: localhost
). This is used for generating full URLs in the sitemap and RSS feed, as well as for link generation if show_urls
is set to Full
.show_powered_by
: Toggle to show or hide the "Powered by Weblog" information in the footer (default: On
). Set this to Off
to remove the footer credit.show_urls
: Determines how URLs are displayed on the main page when listing posts (default: Full
). Options are:
Off
: Do not show any URLs next to the posts.Short
: Display only the relative path of the post.Full
: Display the full URL, including the domain, for each post.config.example.ini
.Here is a basic nginx configuration:
server {
listen 80;
root /var/www/weblog;
index index.php;
charset utf-8;
server_name example.com;
location = /favicon.ico { log_not_found off; access_log off; expires max; }
location = /robots.txt { log_not_found off; access_log off; allow all; }
error_page 404 = /index.php?go=404;
location /sitemap.xml {
rewrite ^/sitemap.xml$ /index.php?go=sitemap.xml last;
}
location ~* ^/config\.ini$ {
deny all;
return 404;
}
location ~* ^/weblog/.+ {
deny all;
return 404;
}
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.+)\.txt/$ $scheme://$host/$1.txt permanent;
rewrite ^/(.+)\.txt$ /index.php?go=$1 last;
rewrite ^/([^/]+)$ $scheme://$host/$1/ permanent;
rewrite "^/(\d{4})$" /$1/ permanent;
rewrite "^/(\d{4})/(\d{2})$" /$1/$2/ permanent;
rewrite "^/(\d{4})/(\d{2})/(\d{2})$" /$1/$2/$3/ permanent;
rewrite ^/rss/([\w-]+)$ /rss/$1/ permanent;
rewrite ^/(.*)/$ /index.php?go=$1 last;
}
location ~ \.php$ {
include fastcgi-php.conf;
fastcgi_pass php-fpm;
}
}
/your-post-name/
to the URL./YYYY/MM/DD/
./your-category-name/
.config.ini
and /weblog/
is not accessible via the Web.Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.
This project is open-sourced under the MIT License. See the LICENSE file for more details.