{"id":21328223,"url":"https://github.com/kaliop/twig-express","last_synced_at":"2025-07-12T07:31:46.156Z","repository":{"id":151486606,"uuid":"61750601","full_name":"kaliop/twig-express","owner":"kaliop","description":"Getting started with Twig templates thanks to a simple PHP script","archived":false,"fork":false,"pushed_at":"2018-05-03T18:53:18.000Z","size":1506,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-03-26T23:34:35.216Z","etag":null,"topics":["html","prototyping","static-server","twig","twig-templates"],"latest_commit_sha":null,"homepage":"","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/kaliop.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}},"created_at":"2016-06-22T20:49:52.000Z","updated_at":"2024-03-06T10:43:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"808a2daa-cf5a-4c42-a40e-f729600b1541","html_url":"https://github.com/kaliop/twig-express","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kaliop/twig-express","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliop%2Ftwig-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliop%2Ftwig-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliop%2Ftwig-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliop%2Ftwig-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaliop","download_url":"https://codeload.github.com/kaliop/twig-express/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliop%2Ftwig-express/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958135,"owners_count":23689006,"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":["html","prototyping","static-server","twig","twig-templates"],"created_at":"2024-11-21T21:25:34.249Z","updated_at":"2025-07-12T07:31:45.881Z","avatar_url":"https://github.com/kaliop.png","language":"PHP","funding_links":[],"categories":["Twig"],"sub_categories":["Tools"],"readme":"TwigExpress\n===========\n\nTwigExpress packages the [Twig templating engine][TWIG_HOME], and a few other tools, in a single file.\n\nOur goal is to make it easy to get started with Twig if you’re a designer or a front-end developer, without having to install a heavy PHP framework or CMS.\n\nMain features:\n\n-   Browse and serve files (⚠ only for development!)\n-   Render Twig templates\n-   Error pages with code excerpt, source view\n-   And a few extra tools for prototyping (dummy text, Markdown to HTML…):\n\nTable of contents\n-----------------\n\n1.  [Running TwigExpress](#running-twigexpress)\n2.  [Adding content](#adding-content)\n3.  [Writing Twig templates](#writing-twig-templates)\u003cbr\u003e\n    ↪ [Getting Started with Twig][DOC_INTRO]\u003cbr\u003e\n    ↪ [TwigExpress-specific features][DOC_EXTRAS]\n4.  [Configuration](#configuration)\u003cbr\u003e\n    ↪ [TwigExpress configuration reference][DOC_CONFIG]\u003cbr\u003e\n    ↪ [Using TwigExpress with Apache][DOC_APACHE]\n5.  [Library and license info](#library-and-license-info)\n\nRunning TwigExpress\n-------------------\n\n### Requirements\n\nPHP 5.4+ available on the command line.\n\n-   On macOS, you should have PHP installed already.\n-   On Windows, one easy way to install PHP (and other tools) is [XAMPP](https://www.apachefriends.org/download.html).\n\n### Download TwigExpress\n\n-   [Download a ZIP of this repo][DOWNLOAD] and unzip.\n-   Recommended: rename `twig-express-master` to your project’s name.\n\n### Usage\n\nOpen your project folder in a Terminal or Command Prompt and run this command:\n\n```sh\nphp --server localhost:8000 twigexpress.phar\n```\n\nNow load [http://localhost:8000/](http://localhost:8000/) in a web browser to browse your files.\n\nAny file ending in `.twig` will be interpreted as a Twig template. You can check out the example pages in the `demo` directory.\n\nAdding content\n--------------\n\nAfter installing TwigExpress, you should have a folder whose content looks like this:\n\n```\nmyproject/\n    demo/\n    LICENSE\n    README.md\n    twigexpress.json\n    twigexpress.phar\n```\n\nIf you don’t care about the demo and read-me, you can keep these only:\n\n```\nmyproject/\n    twigexpress.json\n    twigexpress.phar\n```\n\nYou can add your own content anywhere. This content can be Twig templates (which must have the `.twig` extension), CSS, scripts, images, etc.\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth scope=\"col\"\u003eExample file path\u003c/th\u003e\n    \u003cth scope=\"col\"\u003eCorresponding URL\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003emyproject/index.twig\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003ehttp://localhost:8000/\u003c/code\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003emyproject/some/page.twig\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003ehttp://localhost:8000/some/page\u003c/code\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ccode\u003emyproject/css/styles.css\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003ehttp://localhost:8000/css/styles.css\u003c/code\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\nWriting Twig templates\n----------------------\n\nThere are two sets of features available in templates:\n\n-   **Syntax and features native to the Twig language**\u003cbr\u003e\n    See our short guide [“Getting started with Twig”][DOC_INTRO], and the official [“Twig for Template Designers”][TWIG_INTRO] guide.\n\n-   **Features specific to TwigExpress**\u003cbr\u003e\n    We’re added [a few extra features][DOC_EXTRAS] to help you write HTML prototypes, such as a dummy text generator and a Markdown parser.\n\nConfiguration\n-------------\n\nConfiguration goes in a `twigexpress.json` file at the root of your project. This file should follow the JSON format ([here’s a good introduction](https://www.digitalocean.com/community/tutorials/an-introduction-to-json)).\n\nMore information:\n\n- [TwigExpress configuration reference][DOC_CONFIG]\n- [Using TwigExpress with Apache][DOC_APACHE]\n\nLibrary and license info\n------------------------\n\n[TwigExpress][] is licensed under the MIT License.\n\nWe are using the following libraries:\n\n- [Twig library][TWIG_LIB] (BSD License)\n- [Karwana\\Mime][MIME_LIB] (MIT License)\n- [Parsedown][] (MIT License)\n- [php-loremipsum][] (MIT License)\n- [highlight.js][] (BSD License)\n\n\n[TwigExpress]: https://github.com/kaliop/twig-express\n[DOWNLOAD]: https://github.com/kaliop/twig-express/archive/master.zip\n[DOC_INTRO]: https://github.com/kaliop/twig-express/blob/master/doc/intro.md\n[DOC_EXTRAS]: https://github.com/kaliop/twig-express/blob/master/doc/extras.md\n[DOC_CONFIG]: https://github.com/kaliop/twig-express/blob/master/doc/config.md\n[DOC_APACHE]: https://github.com/kaliop/twig-express/blob/master/doc/apache.md\n\n[TWIG_HOME]: https://twig.sensiolabs.org/\n[TWIG_LIB]: https://github.com/twigphp/Twig\n[MIME_LIB]: https://github.com/karwana/php-mime\n[TWIG_INTRO]: https://twig.sensiolabs.org/doc/1.x/templates.html\n[Parsedown]: http://parsedown.org/\n[php-loremipsum]: https://github.com/joshtronic/php-loremipsum/\n[highlight.js]: https://github.com/isagalaev/highlight.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliop%2Ftwig-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaliop%2Ftwig-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliop%2Ftwig-express/lists"}