{"id":17164281,"url":"https://github.com/norberttech/static-content-generator-bundle","last_synced_at":"2025-04-09T16:10:34.529Z","repository":{"id":36971394,"uuid":"279036193","full_name":"norberttech/static-content-generator-bundle","owner":"norberttech","description":"Generate static html pages from your symfony application","archived":false,"fork":false,"pushed_at":"2025-03-25T05:38:35.000Z","size":8091,"stargazers_count":33,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"1.x","last_synced_at":"2025-04-02T10:45:00.035Z","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/norberttech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-07-12T09:55:18.000Z","updated_at":"2025-01-14T05:42:24.000Z","dependencies_parsed_at":"2023-11-19T20:25:56.190Z","dependency_job_id":"79c1ac37-6dba-408d-813b-42e167a57ade","html_url":"https://github.com/norberttech/static-content-generator-bundle","commit_stats":{"total_commits":361,"total_committers":4,"mean_commits":90.25,"dds":0.1634349030470914,"last_synced_commit":"b42d6da202e25a4f5990062a21d01471ca1ac227"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norberttech%2Fstatic-content-generator-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norberttech%2Fstatic-content-generator-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norberttech%2Fstatic-content-generator-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/norberttech%2Fstatic-content-generator-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/norberttech","download_url":"https://codeload.github.com/norberttech/static-content-generator-bundle/tar.gz/refs/heads/1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065283,"owners_count":21041871,"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-10-14T22:51:29.276Z","updated_at":"2025-04-09T16:10:34.511Z","avatar_url":"https://github.com/norberttech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony Static Content Generator Bundle\n\n![Tests](https://github.com/norberttech/static-content-generator-bundle/workflows/Tests/badge.svg?branch=1.x)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/)\n[![Minimum Symfony Version](https://img.shields.io/badge/Symfony-%3E%3D%204.4-f5c542.svg)](https://php.net/)\n\nGenerate static html pages from all Symfony routes available in your system. \n\n### Installation\n\n```bash\ncomposer require norberttech/static-content-generator-bundle\n```\n\n### Configuration\n\n```php\n\u003c?php\n// bundles.php\n\nreturn [\n    NorbertTech\\StaticContentGeneratorBundle\\StaticContentGeneratorBundle::class =\u003e ['all' =\u003e true],\n];\n```\n\n```yaml\n# static_content_generator.yaml\n\nstatic_content_generator:\n  output_directory: \"%kernel.project_dir%/output\"\n```\n\n### Usage\n\nTransform all routes into static html pages. \n\n```bash\nbin/console static-content-generator:generate:routes\n```\n\nOptions: \n\n* `--parallel=4` - generate static content in parallel using 4 sub processes at once\n* `--clean` - clean output path before start\n* `--filter-route` - generate content only for given routes\n* `--filter-route-prefix` - generate content for routes with given prefix\n* `--exclude-route` - generate content for all routes except given\n* `--exclude-route-prefix` - generate content for all routes except those with given prefix\n\nCopy all assets from `public` directory into output directory\n\n```bash\nbin/console static-content-generator:copy:assets\n```\n\n#### Parametrized Routes\n\nIn order to dump parametrized routes you need to register service that implements `SourceProvider` interface\nwhich will return all possible combinations of parameters for given route you would like to dump.\n\nDon't forget that this services must have `static_content_generator.source_provider` tag. \n\n```yaml\n# service.yaml \n\nservices:\n\n    FixtureProject\\Source\\ParametrizedSourceProvider:\n        tags: ['static_content_generator.source_provider']\n\n``` \n\nController: \n```php\n\u003c?php declare(strict_types=1);\n\nnamespace FixtureProject\\Controller;\n\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController;\nuse Symfony\\Component\\HttpFoundation\\Response;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\n\nclass StaticRoutesController extends AbstractController\n{\n    /**\n     * @Route(\"/parametrized/{param1}/{param2}\", name=\"parametrized_route\")\n     */\n    public function withParameters(string $param1, string $param2) : Response\n    {\n        return $this-\u003erender('parametrized.html.twig', ['param1' =\u003e $param1, 'param2' =\u003e $param2]);\n    }\n}\n```\n\nProvider: \n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace FixtureProject\\Source;\n\nuse NorbertTech\\StaticContentGeneratorBundle\\Content\\Source;\nuse NorbertTech\\StaticContentGeneratorBundle\\Content\\SourceProvider;\n\nfinal class ParametrizedSourceProvider implements SourceProvider\n{\n    public function all() : array\n    {\n        return [\n            new Source('parametrized_route', ['param1' =\u003e 'first-param', 'param2' =\u003e 'second-param']),\n        ];\n    }\n}\n```\n\nThis will generate `/output/parametrized/first-param/second-param/index.hmtml`\n\n### Testing\n\n```php\nphp -S localhost:8000 -t output\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorberttech%2Fstatic-content-generator-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnorberttech%2Fstatic-content-generator-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnorberttech%2Fstatic-content-generator-bundle/lists"}