{"id":20727637,"url":"https://github.com/cwchentw/lightweight-cms","last_synced_at":"2025-04-23T19:26:02.180Z","repository":{"id":42490840,"uuid":"371359418","full_name":"cwchentw/lightweight-cms","owner":"cwchentw","description":"A Dual Mode, Flat-File CMS Powered by PHP","archived":false,"fork":false,"pushed_at":"2024-04-11T04:49:48.000Z","size":7882,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T19:25:55.416Z","etag":null,"topics":["asciidoc","blog-engine","blog-generator","blogging","blogging-system","cms","content-management-system","dynamic-site-generator","flat-file","flat-file-cms","markdown","php","restructured-text","restructuredtext","static-site-generator"],"latest_commit_sha":null,"homepage":"https://lightweightcms.netlify.app","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/cwchentw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-05-27T12:06:19.000Z","updated_at":"2024-04-26T02:45:01.000Z","dependencies_parsed_at":"2024-11-17T07:16:50.855Z","dependency_job_id":null,"html_url":"https://github.com/cwchentw/lightweight-cms","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Flightweight-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Flightweight-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Flightweight-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cwchentw%2Flightweight-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cwchentw","download_url":"https://codeload.github.com/cwchentw/lightweight-cms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250498428,"owners_count":21440463,"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":["asciidoc","blog-engine","blog-generator","blogging","blogging-system","cms","content-management-system","dynamic-site-generator","flat-file","flat-file-cms","markdown","php","restructured-text","restructuredtext","static-site-generator"],"created_at":"2024-11-17T04:33:03.656Z","updated_at":"2025-04-23T19:26:02.142Z","avatar_url":"https://github.com/cwchentw.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lightweight CMS\n\nDual-mode, flat-file CMS powered by PHP\n\n## Features\n\n* Cross-platform\n* Use vanilla PHP as its core and template language, which is well known by virtually all web developers\n* Switch between a static site and PHP dynamic website\n* Build a multilingual site\n* Write posts in either [Markdown](https://github.github.com/gfm/), [AsciiDoc](https://asciidoc.org/), [reStructuredText](https://docutils.sourceforge.io/rst.html) or vanilla HTML\n* Write dynamic pages in PHP\n* Draft posts\n* Nested sections\n* Breadcrumb\n* Pagination\n* Table of Contents\n* Interlinked tags\n* Image lazy loading\n* No following external links for SEO\n* Sitemap generator\n* RSS feed generator\n* Progressive Web Application\n* Asset compilation\n* Asset watching and hot change(s)\n\n## Synopsis\n\n### Windows\n\n```shell\n\u003e choco install php --version=8.1.21\n\u003e choco install composer\n\u003e choco install nodejs --version=18.17.0\n\u003e choco install rsync\n\u003e choco install sed\n```\n\n```shell\n\u003e git clone https://github.com/cwchentw/lightweight-cms.git mysite\n\u003e cd mysite\n\u003e git checkout master\n\u003e .\\tools\\bin\\serve.bat\n```\n\n```shell\n\u003e git remote set-url origin https://example.com/user/mysite.git\n\u003e .\\tools\\bin\\migrate.bat\n\u003e git add .\n\u003e git commit -m \"Migrate to a new site\"\n\u003e git push -u origin master\n```\n\n### macOS\n\n```shell\n$ brew install php@8.1\n$ brew install composer\n$ brew install node@18\n```\n\n```shell\n$ git clone https://github.com/cwchentw/lightweight-cms.git mysite\n$ cd mysite\n$ git checkout master\n$ ./tools/bin/serve\n```\n\n```shell\n$ git remote set-url origin https://example.com/user/mysite.git\n$ ./tools/bin/migrate\n$ git add .\n$ git commit -m \"Migrate to a new site\"\n$ git push -u origin master\n```\n\n### Ubuntu\n\n```shell\n$ sudo apt install php php-xml php-mbstring php-zip unzip\n```\n\n```shell\n$ curl -o composer-setup.php https://getcomposer.org/installer\n$ php composer-setup.php --install-dir=$HOME/bin --filename=composer\n```\n\nInstall [nvm](https://github.com/nvm-sh/nvm). Install Node.js with `nvm`:\n\n```shell\n$ nvm install 18.17.0\n$ nvm use 18.17.0\n```\n\n```shell\n$ git clone https://github.com/cwchentw/lightweight-cms.git mysite\n$ cd mysite\n$ git checkout master\n$ ./tools/bin/serve\n```\n\n```shell\n$ git remote set-url origin https://example.com/user/mysite.git\n$ ./tools/bin/migrate\n$ git add .\n$ git commit -m \"Migrate to a new site\"\n$ git push -u origin master\n```\n\n## Why not simply another Static Site Generator?\n\nThere have been more than enough static site generators currently. It is unbeneficial to reinvent one more wheel. Therefore, we create a flat-file CMS capable to switch between a static website and a dynamic one.\n\nWebsite owners prefer flat files over relational databases when feasible. Nonetheless, static sites are suboptimal for some sorts of websites, like a membership site or a mix of a content site and web application. Lightweight CMS combines the best of two worlds - PHP-powered dynamic websites with flat-file posts written in popular lightweight markup languages.\n\n## System Requirements\n\n### Back End\n\n* Production\n  * GNU/Linux is recommended\n  * A web server like Apache or Nginx\n  * PHP 8.0 or 8.1\n  * [FrontYAML](https://github.com/mnapoli/FrontYAML)\n  * (Optional) AsciiDoctor (for AsciiDoc support)\n  * (Optional) Docutils (for reStructuredText support). Pygments (code highlighting for reStructuredText)\n  * (Optional) Perl (for global replacement)\n* Development\n  * [Composer](https://getcomposer.org)\n  * [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) (for linting)\n  * [PHPMD](https://phpmd.org) (for linting)\n\n### Front End\n\n* Production\n  * A [modern browser](https://browsehappy.com) like Chrome or Firefox\n  * [Normalize.css](https://necolas.github.io/normalize.css/)\n  * [Bootstrap 5](https://getbootstrap.com)\n  * [Bootstrap.Native](https://thednp.github.io/bootstrap.native/)\n  * (Optional) [highlight.js](https://highlightjs.org)\n* Development\n  * Node.js 18.x\n  * [Gulp](https://gulpjs.com/)\n  * [Sass](https://sass-lang.com/)\n  * [Autoprefixer](https://github.com/postcss/autoprefixer)\n  * [stylelint](https://stylelint.io/)\n  * [Babel](https://babeljs.io/)\n  * [Flow](https://flow.org/en/)\n\nThe dependencies mentioned here are based on *default* and *multilingual* themes of Lightweight CMS. If you adapt another theme, your dependencies of the Web may vary.\n\n## Builtin Themes\n\n* *default* theme for documentation sites\n* *multilingual* theme for documentation sites with multiple locales\n* *blog* theme for blogs\n\nSet `SITE_STYLE` in *config/optionalFeatures.php* or its template to `blog` if you employ *blog* theme or its equivalent; to `documentation` otherwise.\n\n## Usage\n\nWe assume GNU/Linux as both development and production environments. If you use Windows, see [this article](https://lightweightcms.org/howto/run-lightweight-cms-on-windows/).\n\nClone the repo locally:\n\n```shell\n$ git clone https://github.com/cwchentw/lightweight-cms.git mysite\n```\n\nChange your working directory to root path of the cloned repo:\n\n```shell\n$ cd mysite\n```\n\n(Optional) Install Composer:\n\n```shell\n$ curl -o composer-setup.php https://getcomposer.org/installer\n$ php composer-setup.php --install-dir=$HOME/bin --filename=composer\n```\n\nInstall dependencies of Lightweight CMS with Composer:\n\n```shell\n$ composer install --no-dev\n```\n\nIf you don't want to update your Lightweight CMS snapshot, you may safely remove all sample posts in *content* directory but not the directory itself, adding your awesome ones.\n\nInstead, if you are going to update your Lightweight CMS copy, follow [this guide](https://lightweightcms.org/howto/upgrade-lightweight-cms/).\n\nYou can run a Lightweight CMS site locally with builtin web server of PHP:\n\n```shell\n$ ./tools/bin/serve\n```\n\n[Deploy](https://lightweightcms.org/deployment/) the cloned repo to a web hosting service supporting PHP 8.0 or 8.1:\n\n```shell\n$ sudo ./tools/bin/sync-to /path/to/www\n```\n\nIf you modify anything locally, repeat the above command to update your change(s) in a production environment.\n\nSet the configuration of a web server accordingly. [Here](/tools/etc/nginx.conf) is a sample Nginx configuration to run Lightweight CMS sites.\n\n(Optional) Save your local repo to a remote site:\n\n```\n$ git remote set-url origin https://example.com/user/mysite.git\n$ git push -u origin master\n```\n\n## Breaking Changes\n\nSee [here](/CHANGELOG.md)\n\n## Copyright\n\nCopyright (c) 2023 ByteBard. Licensed under MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwchentw%2Flightweight-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcwchentw%2Flightweight-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcwchentw%2Flightweight-cms/lists"}