Просмотр файла hentaicms/README.md

Размер файла: 4.18Kb
# Hentai CMS
Flat-file PHP engine that using .md files to show them as pages. Fork of [grootcms](https://github.com/kdqed/grootcms).

## Features
- Plugins support.
- Built-in blog.
- Themes support. Full support of .css out of box.
- Default theme support dark mode. To check this out, enable dark mode in your system (Android), switch to dark theme (Windows 10/11, Linux) and etc.
- Theme switcher. Open settings to select your favourite theme that would work on all pages.
- Maintenance mode. In hentaicms.php code you can adjust flag to "true" to enable maintenance. And "false" to disable. Maintenance mode also using .md file for it's page.
- Built-in ability to mark certain pages as NSFW.
- Nginx-friendly. All pages is being opened through index.php, so it's suitable for absolutely every nginx server, including the most capricious nginx servers where you cannot use permalinks like yourwebsite.com/mypage.
- Perfect and lightweight. Engine has been tested on PHP 8.2 and works perfect here! It work even on ancient versions of Google Chrome. (tested in Chrome ~80 on Android)
- Gently vibe-coded. Main goal was to create "something cool that just works" **in collaboration between human and AIs**. I believe what this is different from what people can call as "AI slop", where AI can be used absolutely mindlessly. While in Hentai CMS almost every change has been tested at least several times manually. So, what you can see here is an efforts done by me with ChatGPT, Grok, DeepSeek and other powerful AI models.

## Demo page
Yes, it's available now! At least should be - [right here](https://hcmsdemo.zya.me/index.php).

## How to add content?
Write your content as markdown files in the 'content' folder.
Sample URLs and corresponding files loaded shown below:
* 'example.com/' : content/index.md
* 'example.com/index.php?page=info': content/info.md
* 'example.com/index.php?page=aboutme/games': content/aboutme/games.md

## How to mark pages as NSFW?
Open hentaicms.php, find a line with mentioned NSFW pages and add names of your own pages that you would like to mark. Then save and just open them as usually like that:
* 'example.com/index.php?page=nsfw': content/nsfw.md
* 'example.com/index.php?page=arts/hentai': content/arts/hentai.md

## How to put my website into maintenance?
Find a line in hentaicms.php that says '$maintenanceEnabled = false;' and instead of "false" put here "true". To edit maintenance page, open maintenance.md in folder "content". Yes, it's very simple.

## How to make plugin?
Create a new .php file in "plugins" folder:

```
<?php
// Your plugin for HentaiCMS
// Located in plugins/plugin_name.php

// Prevent direct access
if (!defined('HENTAI_CMS_PLUGIN')) {
    header('Location: /index.php');
    exit();
}

// Optional: display errors during development
// error_reporting(E_ALL);
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);

displayHentaiHeader();
?>

The rest of your code can be here

<?php
displayHentaiFooter();
?>
```

and... Yes, this should work for you. After that open your website and try to go to URL like **/index.php?pluginname** to test your plugin.

Also don't forget about making your own custom CSS code if it's necessary and use default one as well, wrapping everything around ```<div class="markdown-content">``` for better result.

Parameters **displayHentaiHeader();** and **displayHentaiFooter();** is necessary (as their name says) for parsing header and footers from engine itself. Header of engine already contains theme and all necessary stuff.

## Installation
To get all latest updates, just download code as .zip archive from GitHub, unpack in folder of your website and done!

# Requirements
- PHP.
- Nginx. You may try Apache or anything else, but 100% work here is not guaranteed.

# Additional - 404 page setup
If you're going to run HentaiCMS on not nginx server, you might need to add this in .htaccess

```
#Default 404 error 
ErrorDocument 404 /index.php?page=404
```

Just make sure what there is no 404.md file in "content" folder. But if it exist, replace "404" in URL with anything else.

---

**You can support development, if you like it!** It's not necessary but will give a huge motivation to continue <3
- [Boosty](https://boosty.to/felixfester/about)