1
0
Fork 0

Mostly updates readme and fixes css tips for simple css on edit page

This commit is contained in:
sloum 2023-12-20 22:58:07 -08:00
parent d187b9587e
commit 2fe906ca25
3 changed files with 59 additions and 32 deletions

View File

@ -1,40 +1,66 @@
# chickadee
A small php-based blog system that uses markdown (which also supports regular html markup) for post editing and a flat file system rather than a database. It is a single user system. It, by design, does not support comments, social boost widgets, or other cruft. Just simple blogging and very basic media management.
A small php-based blog-system/cms that uses markdown (which also supports regular html markup) for post editing and a flat file system rather than a database. It is a single user system and, by design, does not support comments, social boost widgets, or other cruft. Just simple blogging and very basic media management. No javascript is used and there is no tracking.
## Who is this for?
Likely just me and a few friends. That said, anyone wanting a simple and lightweight blog system for their website that just uses basic html and css with no javascript might enjoy it.
## Current Capabilities
- Login (username/password)
- Admin area
- Create new post
- Use markdown in post
- Create a title for the post
- Tracks post date/time
- Upload media (images and documents)
- Edit posts
- Edit site CSS
- Delete posts/media
- View a list of posts
- View a list of media
- Index page showing posts
- Simple post pages
- `config.php` file allows for further customization
- Basic styling/css out of the box
- Login: `/blog.log.php`
- Admin area: `/admin.php`
- Post Actions
- Create (markdown is a first class citizen)
- Delete
- Edit
- Media Actions
- Upload images/documents
- Delete images/documents
- Site Actions
- Enable/Disable integrated [simple.css](https://simplecss.org/) css theme
- Editable custom css
- If _simple.css_ is enabled, the css edit page will also show a guide for modifying the variables that _simple.css_ has set up
- Post Index (`index.php`)
- Shows list of posts
- Customizable top blurb
- Customizable bottom blurb
- Site header
- Site footer
- Individual Post
- Post body (rendered from markdown)
- Site header
- Site footer
- Behavioral Customization (`config.php`)
- `SITE_NAME`, shown in site header and elsewhere
- `TOP_BLURB`, custom html that appears above post listing on `index.php`
- `FOOT_BLURB`, custom html that appears below post listing on `index.php`
- `SITE_HEADER`, custom html to override default site header
- `SITE_FOOTER`, custom html to override default site footer
- `SITE_LANG`, language declaration for blog content (default is `en`)
- `SHOW_DATES`, turn on or off dates next to post titles
- `DATE_STYLE`, php date format string for how dates should display
- `SIMPLE_CSS`, turn on or off including of _simple.css_ (can also be adjusted in the admin screen: `/admin.php`)
## Working On
- Editing posts
- Editing CSS from the admin pannel
- Media uploads/management
## Installation and usage
## Configuration
_chickadee_ requires php and a php capable web server (we use apache2, but whatever floats your boat and also runs php should be fine). There are no other requirements. _chickadee_ is a flat file blog system and no database is required.
To install on your web server, go to where you want the blog installed and clone the repository as whatever you want the directory called. This may look something like the following:
``` bash
cd /var/www/
git clone https://tildegit.org/sloum/chickadee myawesomeblog
cd myawesomeblog
vim config.php
```
Certainly replace `myawesomeblog` with the name of your folder. This may be `blog` if integrating into an existing site, or may be the name of the website. While I use `vim`, use whatever you like to edit `config.php`. It is a well commented file and should direct you to some good defaults for your use case.
Lastly, you need to set up your login information. This is easy, so long as your server is now exposing the paths and you can access the site: go to `/blog_log.php`. Enter a username and password of your choosing. Once you do so, you should see the admin area. The username and password you entered are now your username and password (the first ones entered are the ones used). If you ever need to reset your username/password you can go to the web root for the blog on your server and delete the file `blog_pass_hash.txt`. This will reset the password without deleting any other data. You can then set a new one by going to the login page and entering new credentials.
Cookies are required to use the system, but only one cookie is ever set and no tracking or phoning home are done. When you log in the system will keep you logged in for 30 days unless you explicitly log out (or clear your cookies). If you aren't on your own machine and want to log in we recommend a private browsing window/tab that will clear the cookies automatically when closed.
A file, `config.php` is provided. It has a number of `const`s defined. Updating these values allow you to update the look/content of your page(s).
- `SITE_NAME` is a string that appears at the top of your blog header and in the tab/window title
- `TOP_BLURB` is a string (that supports HTML) that will appear in the main body of the `index.php` page <em>above</em> the list of posts
- `FOOT_BLURB` is a string (that supports HTML) that will appear in the main body of the `index.php` page <em>below</em> the list of posts
- `SITE_HEADER` is a string. It will override the existing `header` element for all pages if it is set to a non-empty string. The content of the string will be placed within a `header` element, so you do not need to include that
- `SITE_FOOTER` is a string. It will override the existing `footer` element for all pages if it is set to a non-empty string. The content of the string will be placed within a `footer` element, so you do not need to include that
- `LANG` is a string. It should be the language code for the language your content is written in. It defaults to `en`

View File

@ -50,7 +50,7 @@ const SITE_LANG = "en";
* Choose whether or not to show dates next
* to post title on the index page
*/
const SHOW_DATES = false;
const SHOW_DATES = true;
/*
* Set the date format. For details see:

View File

@ -1,5 +1,6 @@
<?php
include_once "logcheck.php";
include_once "config.php";
include_once "common.php";
$update = $_POST["data"] ?? null;
@ -59,9 +60,9 @@
header ul.inline li::after{content:'' !important}
.post-list tbody tr:nth-child(odd){background-color: #DDD}
td{padding-left:1em}
details {border: 1px solid #aaa;border-radius: 4px;padding: 0.5em 0.5em 0;margin-top:2em}
details {border: 1px solid #aaa;padding: 0.5em 0.5em 0}
summary {font-weight: bold;margin: -0.5em -0.5em 0;padding: 0.5em}
details[open]{padding-bottom:1em}
details[open]{padding-bottom:1em;background:#F7F7F7}
details[open] summary {border-bottom: 1px solid #aaa;margin-bottom: 0.5em;background:#333;color:#DDD}
thead{background: #333;color:#EEE}
pre{background:#333;color:white;padding:1em;width:calc(90% - 2em);margin:1em auto;border-radius:5px}
@ -85,7 +86,7 @@
<input type="hidden" name="file" value="<?php echo $f; ?>">
<input type="submit" value="Submit">
</form>
<?php if ( $f == "css/style.css" ): ?>
<?php if ( $f == "css/style.css" && SIMPLE_CSS ): ?>
<details>
<summary>Guide to simple.css variables</summary>
<p>The following are the default variable values for the active <i>simple.css</i> css theming. You can override any of them you like.</p>