{"id":15002283,"url":"https://github.com/terdelyi/phanstatic","last_synced_at":"2026-02-28T22:01:05.053Z","repository":{"id":229192039,"uuid":"773956575","full_name":"terdelyi/phanstatic","owner":"terdelyi","description":"A simple, lightweight and CLI based static site generator written in PHP","archived":false,"fork":false,"pushed_at":"2025-11-16T15:10:47.000Z","size":101,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-16T16:14:55.439Z","etag":null,"topics":["cli","jamstack","php","static-site-generators"],"latest_commit_sha":null,"homepage":"https://phanstatic.com","language":"PHP","has_issues":false,"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/terdelyi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-18T17:34:24.000Z","updated_at":"2025-11-16T15:09:29.000Z","dependencies_parsed_at":"2024-03-25T19:03:03.815Z","dependency_job_id":"96e195a1-1a32-4a61-82ad-d137b5a1ac23","html_url":"https://github.com/terdelyi/phanstatic","commit_stats":null,"previous_names":["terdelyi/phanstatic"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/terdelyi/phanstatic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terdelyi%2Fphanstatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terdelyi%2Fphanstatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terdelyi%2Fphanstatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terdelyi%2Fphanstatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terdelyi","download_url":"https://codeload.github.com/terdelyi/phanstatic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terdelyi%2Fphanstatic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29953212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","jamstack","php","static-site-generators"],"created_at":"2024-09-24T18:49:26.519Z","updated_at":"2026-02-28T22:01:05.045Z","avatar_url":"https://github.com/terdelyi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://phanstatic.com\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/terdelyi/phanstatic/blob/main/art/logo.png\" alt=\"Phanstatic\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://packagist.org/packages/terdelyi/phanstatic\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/terdelyi/phanstatic\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/terdelyi/phanstatic\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/terdelyi/phanstatic\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/terdelyi/phanstatic\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/terdelyi/phanstatic\" alt=\"License\"\u003e\u003c/a\u003e\n\nPhanstatic is a simple, lightweight, CLI-based static site generator written in PHP, without additional frameworks or template engines.\n\nYou don't need to learn any new APIs or syntax: it's just basic PHP pages and Markdown files placed in a `content` directory, which will then be compiled into fast, portable HTML files, ready to deploy on any web server with minimal effort.\n\n## Install\n\nTo create a new project, run:\n\n```\ncomposer create-project terdelyi/phanstatic\n```\n\nIf you already have a project with a `content` folder, install Phanstatic with:\n\n```\ncomposer require terdelyi/phanstatic\n```\n\n## Build\n\nTo generate static files from the content in your `content` directory, run the following command from your project\nroot:\n\n```\nphp ./vendor/bin/phanstatic build\n```\n\nThe generated files will be placed in the `dist` folder.\n\n## Preview\n\nTo preview your site directly from the `content` folder in a browser, run:\n\n```\nphp ./vendor/bin/phanstatic preview\n```\n\nIn this mode, you can edit your PHP files, and changes will appear in the browser after refreshing the page.\n\nTo preview the built files from the `dist` folder, use:\n\n```\nphp ./vendor/bin/phanstatic preview --dist\n```\n\nYou can also customise the host and port with the `--host` and `--port` options. The default values are _localhost_\nand _8080_.\n\n## Configuration\n\nConfiguration is optional. You can create a configuration file at `content/config.php`, which must return a\n`ConfigBuilder` object, for example:\n\n```php\nuse Terdelyi\\Phanstatic\\Models\\Config;\nuse Terdelyi\\Phanstatic\\Models\\CollectionConfig;\n\nreturn new Config(\n    baseUrl: (string) getenv('BASE_URL'),\n    title: 'My super-fast static site',\n    collections: [\n        'posts' =\u003e new CollectionConfig(\n            title: 'Posts',\n            slug: 'posts',\n            pageSize: 10\n        ),\n    ],\n);\n```\nIf no `config.php` file exists, Phanstatic will use the default settings. Your IDE can help you explore the available\nconfiguration options, showing the properties and their types.\n\n## Content basics\n\nOrganizing your content is simple. The content folder contains your pages, collections, and assets:\n\n- `content/pages`: Place your page templates here using the `.php` extension.\n- `content/collections`: Store collections in subdirectories, with individual items as `.md` files.\n- `content/assets`: Any files here will be published to `dist/assets`.\n\nYou can also use partials: any folder or file starting with an underscore `_` will be ignored during the build.\nInclude these partials in your pages using PHP's `include()` function.\n\n### Example project structure\n\n```\n├── content\n│   ├── assets\n│   │   ├── images\n│   │   ├── css\n│   │   ├── js\n│   ├── collections\n│   │   ├── posts\n│   │   │   ├── my-first-blog-post.md\n│   ├── pages\n│   │   ├── _partials\n│   │   │   ├── header.php\n│   │   │   ├── footer.php\n│   │   ├── about.php\n│   │   ├── index.php\n│   ├── config.php\n├── composer.json\n├── composer.lock\n```\n\nIf you create a folder under collections, **you must register it in your configuration file**. Otherwise, you will\nget a \"Configuration for collection 'Collection' is missing\" error.\n\n## Frontend\n\nPhanstatic does not include frontend or theme support. You can add your CSS and other assets freely under the assets/ folder, and reference them in your pages using:\n\n```php\n\u003clink rel=\"stylesheet\" href=\"\u003c?php echo asset('css/site.css'); ?\u003e\"\u003e\n```\n\n\n## Available helpers\n\n| Function       | Description                                                                                    |\n|:---------------|:-----------------------------------------------------------------------------------------------|\n| `assets()`     | Link files from the `assets` folder. The base URL from the config is added automatically.      |\n| `url()`        | Generate links to any page on the site. . The base URL from the config is added automatically. |\n| `dd()`         | Dump variables and stop execution during runtime or build.                                     |\n| `source_dir()` | Link files from the source directory (default: _content_).                                     |\n| `build_dir()`  | Link files from the distribution directory (default: _dist_).                                  |\n\n\n## Contributions\n\nThe main goal of Phanstatic is to keep simple and fast for common use cases, such as simple sites and blogs.\n\nIf you\nfind a bug, have a feature request, or want to suggest improvements, please\n[contact me directly](https://github.com/terdelyi) or\n[start a discussion on GitHub](https://github.com/terdelyi/phanstatic/discussions). Contributions in the form of\ncode,  documentation, or examples are very welcome and  greatly appreciated.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterdelyi%2Fphanstatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterdelyi%2Fphanstatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterdelyi%2Fphanstatic/lists"}