{"id":21076116,"url":"https://github.com/shaack/reboot-cms","last_synced_at":"2025-05-16T06:32:03.597Z","repository":{"id":49785440,"uuid":"156346401","full_name":"shaack/reboot-cms","owner":"shaack","description":"A flat file, Markdown CMS in PHP with blocks structure.","archived":false,"fork":false,"pushed_at":"2024-05-08T11:32:59.000Z","size":4890,"stargazers_count":31,"open_issues_count":5,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-09T09:40:03.442Z","etag":null,"topics":["bootstrap","cms","flat-file-cms","markdown","markdown-cms","no-database","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shaack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-06T07:53:23.000Z","updated_at":"2024-05-08T11:33:02.000Z","dependencies_parsed_at":"2024-05-08T09:48:47.388Z","dependency_job_id":null,"html_url":"https://github.com/shaack/reboot-cms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Freboot-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Freboot-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Freboot-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaack%2Freboot-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaack","download_url":"https://codeload.github.com/shaack/reboot-cms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225412927,"owners_count":17470473,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","cms","flat-file-cms","markdown","markdown-cms","no-database","php"],"created_at":"2024-11-19T19:26:46.048Z","updated_at":"2025-05-16T06:32:03.588Z","avatar_url":"https://github.com/shaack.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reboot CMS\n\nA flat file, Markdown CMS in PHP, inspired by [Pico](http://picocms.org), [Redaxo](https://redaxo.org/)\nand [Craft CMS](https://craftcms.com/).\n\nReboot CMS is a minimal CMS without a database, but with the support of **blocks** 🚀.\n\n## Why another CMS?\n\nI developed Reboot CMS because I couldn't find a CMS that works with flat markdown files but allows easy use of blocks.\n\nReboot CMS is very small and the pages are delivered extremely fast. My website [shaack.com](https://shaack.com), built\nwith Reboot CMS, has\na [PageSpeed Insights performance score of 100](https://pagespeed.web.dev/report?url=https%3A%2F%2Fshaack.com%2F).\n\n## Websites using Reboot CMS\n\n- [The Reboot CMS demo page](https://shaack.com/projekte/reboot-cms/)\n- [shaack.com](https://shaack.com)\n- [wukies.de](https://wukies.de)\n- [chesscoin032.com](https://chesscoin032.com)\n\n## Install\n\nDownload the [Reboot CMS repository](https://github.com/shaack/reboot-cms) and install it in your web root.\n\nThis should work out of the box.\n\nThen (**important**), **set the Admin password in `/local/.htpasswd`**\n\n## Documentation\n\n### Page\n\nFolder: `/site/pages`\n\nA `Page` can be a **flat Markdown** file, can contain **Blocks** or also can be a **PHP** file.\n\nPages are auto-routed on web-requests:\n\n- `index.md` or `index.php` will be shown on requesting `/`\n- `NAME.md` or `NAME.php` will be shown on requesting `/NAME`\n- `FOLDER/index.md` (or .php) will be shown on requesting `/FOLDER`\n- `FOLDER/NAME.md` (or .php) will be shown on requesting `/FOLDER/NAME`\n\nExample for a Markdown `Page` with `Blocks`:\n\n```markdown\n---\ntitle: Reboot CMS \ndescription: Reboot CMS is a flat file CMS, with the support of blocks. \nauthor: Stefan Haack (shaack.com)\n\n---\n\n\u003c!-- hero --\u003e\n\n# Reboot CMS\n\nA flat file, markdown CMS with blocks\n\n---\nThe main idea is, to have a **minimal CMS** without needing a database, but with the support of blocks.\n\n---\n[Learn more](documentation)\n\n\u003c!-- text-image --\u003e\n\n## The text-image block\n\nThe gray block above was a hero block. This one is a text-image block, it contains two parts. Parts are separated by\n`---`.\n\n---\n![alt text](dummy.svg \"Title Text\")\n\n\u003c!-- \ntext-image:\n    image-position: left\n--\u003e\n\n## Configure blocks in the block comment\n\nThe text-image block can also display the image to the left.\n\n---\n![alt text](dummy.svg \"Title Text\")\u003e\n\n\u003c!-- three-columns --\u003e\n\n### the\n\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\noccaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est.\n\n---\n\n### three-colums\n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute\niure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n\n---\n\n### block\n\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna\naliqua.\n\n```\n\nThis `Page` contains 3 `Block` types, \"hero\", \"text-image\" and \"three-columns\". It will render to this:\n\n![A rendered page](https://shaack.com/projekte/assets/img/reboot-cms-index-2_8_1.png)\n\nBlocks can be configured in the block comment. With this configuration, the `text-image`\nblock allows to display the image to the left side in desktop view.\n\nMarkdown files without blocks will render to a flat Markdown page like in every other flat file CMS.\n\nYou can define metadata for the page on top of the file in `YAML Front Matter` syntax.\n\n### Block\n\nFolder: `/site/blocks`\n\nA `Block` describes how a block is rendered. Blocks are written in PHP.\n\nThe code for the \"text-image\" `Block` which was used in the page above, looks like this:\n\n```php\n\u003c?php\n// read the configuration\n$imagePosition = @$block-\u003egetConfig()[\"image-position\"];\n?\u003e\n\u003csection class=\"block block-text-image\"\u003e\n    \u003cdiv class=\"container\"\u003e\n        \u003cdiv class=\"row\"\u003e\n            \u003cdiv class=\"col-md-7 \u003c?= $imagePosition === \"left\" ? \"order-md-1\" : \"\" ?\u003e\"\u003e\n                \u003c!-- all text from part 1 (xpath statement) --\u003e\n                \u003c?= $block-\u003expath(\"/*[part(1)]\") ?\u003e\n            \u003c/div\u003e\n            \u003cdiv class=\"col-md-5\"\u003e\n                \u003c!-- using attributes of the image in part 2 --\u003e\n                \u003cimg class=\"img-fluid\" src=\"/media/\u003c?= $block-\u003expath(\"//img[part(2)]/@src\") ?\u003e\"\n                     alt=\"\u003c?= $block-\u003expath(\"//img[part(2)]/@alt\") ?\u003e\"\n                     title=\"\u003c?= $block-\u003expath(\"//img[part(2)]/@title\") ?\u003e\"/\u003e\n            \u003c/div\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n\u003c/section\u003e\n```\n\nElements in the markdown are queried and used as values for the block. The query syntax\nis [Xpath](https://devhints.io/xpath) with the addition of the `part(n)` function.\n\nAnother example, the \"hero\" `Block`:\n\n```php\n\u003c?php /* hero */ ?\u003e\n\u003csection class=\"block block-hero\"\u003e\n    \u003cdiv class=\"container-fluid\"\u003e\n        \u003cdiv class=\"card border-0 bg-gradient\"\u003e\n            \u003cdiv class=\"card-body\"\u003e\n                \u003cdiv class=\"p-xl-5 p-md-4 p-3\"\u003e\n                    \u003c!-- use the text of the \u003ch1\u003e in part 1 for the display-4 --\u003e\n                    \u003ch1 class=\"display-4\"\u003e\u003c?= $block-\u003enodeHtml($block-\u003expath(\"/h1[part(1)]/text()\")) ?\u003e\u003c/h1\u003e\n                    \u003c!-- the lead will be the text of the \u003cp\u003e in part 1 --\u003e\n                    \u003cp class=\"lead\"\u003e\u003c?= $block-\u003enodeHtml($block-\u003expath(\"/p[part(1)]/text()\")) ?\u003e\u003c/p\u003e\n                    \u003chr class=\"my-4\"\u003e\n                    \u003c!-- print everything from part 2 --\u003e\n                    \u003cdiv class=\"mb-4\"\u003e\n                        \u003c?= $block-\u003enodeHtml($block-\u003expath(\"/*[part(2)]\")) ?\u003e\n                    \u003c/div\u003e\n                    \u003cp\u003e\n                        \u003c!-- the link in part 3 will be used as the primary button --\u003e\n                        \u003ca class=\"btn btn-primary btn-lg\"\n                           href=\"\u003c?= $block-\u003enodeHtml($block-\u003expath(\"//a[part(3)]/@href\")) ?\u003e\"\n                           role=\"button\"\u003e\u003c?= $block-\u003enodeHtml($block-\u003expath(\"//a[part(3)]/text()\")) ?\u003e\u003c/a\u003e\n                    \u003c/p\u003e\n                \u003c/div\u003e\n            \u003c/div\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n\u003c/section\u003e\n```\n\n## Admin interface\n\nYou find the admin interface unter `/admin`. The default login is\n\n- user: admin\n- pwd: change_me\n\nYou can and should change the admin password in `local/.htpasswd` with\n\n```sh \ncd local\nhtpasswd .htpasswd admin\n```\n\nIn the admin interface you can edit markdown pages and set the site configuration in which the navigation structure is\ndefined.\n\n### Edit the startpage\n\n![Edit the startpage](https://shaack.com/projekte/assets/img/reboot-cms-admin-edit-index.png)\n\n### Edit a flat markdown page\n\n![Edit a markdown page](https://shaack.com/projekte/assets/img/reboot-cms-admin-page-edit.png)\n\n### Edit the site configuration\n\nIn the site configuration, you can store global values of the site, like the navigation structure or the content of\nheader elements. The site configuration is written in YAML.\n\n![Edit a markdown page](https://shaack.com/projekte/assets/img/reboot-cms-admin-site-configration.png)\n\n## AddOns\n\nIn Reboot CMS you can extend the functionality of your site with **AddOns**.\n\nAddOns are classes which extend the class [AddOn](core/src/Shaack/Reboot/AddOn.php).\n\nAdd AddOns to your site in the `site/config.yml`:\n\n```yml\naddons: [ ExampleAddOn, AnotherAddOn ]\n```\n\nSee also the [ExampleAddOn.php](site/addons/ExampleAddOn.php) which is part of the test site.\n\nThe admin, which is itself a Reboot CMS site, uses an [AddOn for Authentication](core/admin/addons/Authentication.php)\nto handle the login session.\n\nIn your AddOn you can overwrite the functions `init()`, `preRender(Request $request)` or/and\n`postRender(Request $request, string $content)` to modify the behaviour or content of pages.\n\n### `init(): void`\n\nCalled after construction of the AddOn. Use this to initialize data and read configurations.\n\n### `preRender(Request $request): bool`\n\nCalled on every request before rendering the page. Return `true`, if you want to render the page or false if you do a\nredirect or deny access.\n\n### `postRender(Request $request, string $content): string`\n\nCalled after the page is rendered before displaying it. Use it to modify content after rendering. Returns the modified\ncontent of the page.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaack%2Freboot-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaack%2Freboot-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaack%2Freboot-cms/lists"}