{"id":18929629,"url":"https://github.com/thecodingmachine/cms-static-registry","last_synced_at":"2026-03-16T15:30:17.661Z","repository":{"id":57067853,"uuid":"110693203","full_name":"thecodingmachine/cms-static-registry","owner":"thecodingmachine","description":"A static registry (loads pages from static files) for thecodingmachine/cms-interfaces.","archived":false,"fork":false,"pushed_at":"2018-01-04T11:15:25.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-02-16T12:30:25.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-14T13:22:49.000Z","updated_at":"2017-11-14T13:23:58.000Z","dependencies_parsed_at":"2022-08-24T10:20:13.514Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/cms-static-registry","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/thecodingmachine%2Fcms-static-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fcms-static-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fcms-static-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fcms-static-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/cms-static-registry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239927825,"owners_count":19719835,"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":[],"created_at":"2024-11-08T11:34:01.383Z","updated_at":"2026-03-16T15:30:17.577Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/thecodingmachine/cms-static-registry/v/stable)](https://packagist.org/packages/thecodingmachine/cms-static-registry)\n[![Total Downloads](https://poser.pugx.org/thecodingmachine/cms-static-registry/downloads)](https://packagist.org/packages/thecodingmachine/cms-static-registry)\n[![Latest Unstable Version](https://poser.pugx.org/thecodingmachine/cms-static-registry/v/unstable)](https://packagist.org/packages/thecodingmachine/cms-static-registry)\n[![License](https://poser.pugx.org/thecodingmachine/cms-static-registry/license)](https://packagist.org/packages/thecodingmachine/cms-static-registry)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/cms-static-registry/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/thecodingmachine/cms-static-registry/?branch=master)\n[![Build Status](https://travis-ci.org/thecodingmachine/cms-static-registry.svg?branch=master)](https://travis-ci.org/thecodingmachine/cms-static-registry)\n[![Coverage Status](https://coveralls.io/repos/thecodingmachine/cms-static-registry/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/thecodingmachine/cms-static-registry?branch=master)\n\n\nCMS static registry\n===================\n\nLoad pages/blocks/themes from static files in your repository.\n\nThis package can ban used with the [CMS interfaces](https://github.com/thecodingmachine/cms-interfaces) to build a full-featured PSR-7 CMS.\n\nWhy?\n----\n\nMost CMSes out there store content of HTML pages in databases. While there are a number of advantages to do so, this also comes with some drawbacks:\n\nThis package is a \"file store\". It proposes to store files, blocks, themes, etc... into static files instead.\n\nFiles have a number of advantages over databases:\n\n- They can be committed in your code repository\n- Therefore, it is easy to migrate content from a test environment to a production environment (content is part of your code)\n- It is also easy to keep track of history (using your favorite VCS like GIT)\n- You can easily work as a team on some content and use branching and merging capability of your VCS to manage content\n\nOf course, this is no silver bullet and using a database to store content can make a great deal of sense.\nBut for content that is mostly administered by a technical team, storing content in files instead of a database is a breeze of fresh air.\n\n\nDirectory structure\n-------------------\n\nYour website will typically be stored in directory of your project.\n\nThe default proposed directory structure is:\n\n- cms_root\n    - pages\n        - a_page.html\n        - another_page.md\n    - blocks\n        - a_block.html\n        - another_block.md\n    - themes\n        - my_theme\n            - index.twig\n            - config.yml\n            - css/\n            - js/\n            - ...\n    - sub_themes\n        - a_subtheme.yml\n        - another_subtheme.yml\n        \n\n### Pages\n\nA page is... well... it's a page of your website!\nPages can be:\n\n- in HTML (if the extension is `.html`)\n- in Markdown (if the extension is `.md`)\n\nPages come with a *YAML frontmatter*.\n\nHere is a sample page:\n\n```html\n---\nurl: hello/world\nwebsite : example.com\nlang : fr\ntitle : foo\ntheme : foo_theme\nmeta_title : bar\nmeta_description : baz\nmenu : menu 1 / menu 2 / menu 3\nmenu_order : 1\n---\n\n\u003ch1\u003eHello world!\u003c/h1\u003e\n```\n\nThe YAML frontmatter MUST be surrounded by `---`.\n\nParameters of the YAML Frontmatter:\n\nName            | Compulsory | Description\n----------------|------------|------------------------\nurl             | *Yes*      | The URL of the page. It contains only the *path*. For instance: `/foo/bar` \nwebsite         | *No*       | The domain name of the page. For instance: *example.com*\nlang            | *Yes*      | The language of the page, on 2 characters. For instance: \"en\", \"fr\"...\ntitle           | *Yes*      | The title of the page (goes into the \u0026lt;title\u003e HTML tag\ntheme           | *No*       | The theme (or sub-theme) of the page (more about themes below)\nid              | *No*       | A unique ID for the page\nmenu            | *No*       | The menu item. The path to the menu item is separated by '/'. For instance: 'Products / Food / Bananas'\nmenu_order      | *No*       | The priority of the menu item\nmenu_css_class  | *No*       | An optional CSS class to be applied to the menu item\nmeta_title      | *No*       | The title \u0026lt;meta\u0026gt; tag\nmeta_description | *No*       | The description \u0026lt;meta\u0026gt; tag\ntheme           | *No*       | The theme to be used for this page\ntemplate        | *No*       | The path to the Twig template applied for this page. Relative to the theme root directory. For instance: \"blog.twig\"\ncontext         | *No*       | An array of values passed to fill the Twig template.\ninherits        | *No*       | A reference to a YAML file that contains default values for the page. For instance: \"../page_defaults.yml\"\n\n\n\nTODO: continue documentation \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fcms-static-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fcms-static-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fcms-static-registry/lists"}