{"id":15130830,"url":"https://github.com/reactivematter/tunnelcms","last_synced_at":"2025-07-16T12:10:20.532Z","repository":{"id":255934348,"uuid":"853920001","full_name":"ReactiveMatter/tunnelcms","owner":"ReactiveMatter","description":"Simplest markdown cms","archived":false,"fork":false,"pushed_at":"2024-09-10T14:27:34.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-16T18:59:52.985Z","etag":null,"topics":["cms","markdown","php"],"latest_commit_sha":null,"homepage":"https://reactivematter.github.io/tunnel-cms","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/ReactiveMatter.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":"2024-09-07T22:46:44.000Z","updated_at":"2024-09-10T14:41:02.000Z","dependencies_parsed_at":"2024-09-08T00:19:14.018Z","dependency_job_id":"7e392c84-166e-49d9-8d6e-26700012d0f3","html_url":"https://github.com/ReactiveMatter/tunnelcms","commit_stats":null,"previous_names":["reactivematter/tunnelcms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveMatter%2Ftunnelcms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveMatter%2Ftunnelcms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveMatter%2Ftunnelcms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveMatter%2Ftunnelcms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReactiveMatter","download_url":"https://codeload.github.com/ReactiveMatter/tunnelcms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222399760,"owners_count":16978087,"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":["cms","markdown","php"],"created_at":"2024-09-26T03:06:59.113Z","updated_at":"2025-07-16T12:10:20.493Z","avatar_url":"https://github.com/ReactiveMatter.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tunnel CMS\n\nv2.0.0 (Updated on 15.03.25)\n\nTunnel CMS is the simplest markdown CMS. It parses markdown files and outputs html in real time whenever necessary. However, not every request requires parsing, as Tunnel CMS builds the HTML files and store in cache. Until, the underlying content of the markdown files is changes, the cached HTML is served.\n\n## 🛠️ Installation\n\nDownload the `tunnel` folder along with the `.htaccess` file from the [Github directory](https://github.com/ReactiveMatter/tunnelcms) `https://github.com/ReactiveMatter/tunnelcms`. Place them in the root of your website, and that's it!\n\nTunnel CMS will render your markdown files dynamically, so that you can focus on writing.\n\nRequirements: PHP 8 or higher.\n\n## 📝 YAML frontmatter\n\nTunnel CMS parses YAML front matter from the markdown files and serializes them in the `$page` variable. This can be used by the layout to display content.\n\nSome useful page properties:\n\n| Property | Description |\n| --- | --- |\n| `layout` | Sets the layout for the file which will be used for rendering HTML. |\n| `category` | Sets the category for the file. One page can have only one category.|\n| `tags` | Tags for the file |\n\n\n## 🖥️ Template and layout\n\nThe layout files from `template` folder are used to render html content. The layout can be set in YAML front matter in `layout` property. `default.php` is used when no layout is set.\n\nThe `title` property can be set for the page title. If not set, the first heading in the markdown file is set as title.\n\nIf a layout requires the list of all parsed files, the function `get_all_pages()` can be called. It returns an array of pages. Each element will have properties set for that page.\n\n## 🏷️ Tags\n\nFiles can be assigned tags using the front matter property `tags`. In addition to this, Tunnel CMS assigns tags if hash tags are given in the file (e.g. `#tag1`).\n\n## 💾 Cache\n\nTunnel CMS stores the rendered HTML files and associated metadata in `cache` folder. Whenever a file is requested for the first time, a build processes in initiated. In the build process, front matter is processed, the HTML content is generated and saved as HTML files in `cache`. \n\nThe file `content` and `template` directory hashes, and file _mtime_ are saved in metadata (a json file).\n\nAs and when the file modified time changes, the build process is again initiated.\n\n## ⚙️ Config\n\nConfig variable are stored in `config.php`. They are site wide variables used for the build process, and can also be used by the templates.\n\n| Config variable | Description |\n| --- | --- |\n| `$site['title']` | Site title |\n| `$site['ext']` | The file extensions which will be parsed |\n| `$site['default_layout']` | The default layout for parsing. If set to `page`, `template/page.php` will be used.|\n| `$site['date_format']` | The PHP date display format. To be used in layouts.|\n| `$site['cache']` | Whether to enable caching.|\n| `$site['plugins']` | The list of enabled plugins (filenames are to be added to this array.|\n\nCustom variable can be defined in config file, which can be used in the template files.\n\n## 🔗 Links\n\nBy default markdown links are relative to http root (`/about`). However, to make it relative to Tunnel CMS directory use `$/about`. \n\n## 🛠️ Workings\n\nThe detailed process and control flow is provided in [workings](workings).\n\n## 🔌 Plugins\n\nStarting from version 2, Tunnel CMS can be extended or improved by plugins.\n\nPlugins are php files in `core/plugins` directory. To enable a plugin, the name of the plugin file must be added to `$site['plugins']` array in `config.php`.\n\nPlugins file are included autmatically at the start of the process, by `plugin_manager.php`. Plugins can hook functions at 4 places:\n\n - start: It is called before the render process is initiated. The $site and $requests parameters are available.\n - before_render: It is called before HTML is being rendered but after $page is build.\n - after_render: It is called after HTML is rendered but before caching.\n - end: It is called after the render process is complete.\n\n Example of adding hook:\n\n ```\n add_hook('start','remove_old_cache');\n ```\n\n## 📑 Content\n\nAll markdown content is to be put in `content` folder with desired directory structure. The directory structre and file names are used as url.\n\nThe content can be managed by FTP, SFTP, SSH or by PHP based filemanagers (like [tinyfilemanager](https://tinyfilemanager.github.io/).)\n\n## 📜 License\n\nThis project is licensed under the MIT License.\n\n## Credits\n\nTunnel CMS is developed by ReactiveMatter.\n\nGithub repo: https://github.com/ReactiveMatter/\n\nGithub blog: https://reactivematter.github.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactivematter%2Ftunnelcms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactivematter%2Ftunnelcms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactivematter%2Ftunnelcms/lists"}