{ "uuid": [ { "value": "d344a28e-aa79-4533-8eac-f112926fe811" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T08:59:58+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Extending Sculpin with PHP" } ], "created": [ { "value": "2025-05-02T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T08:59:58+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2025\/05\/02\/extend", "langcode": "en" } ], "body": [ { "value": "\n

I like the Sculpin static site generator<\/a> - a tool I've used for various personal and client projects where a full content management system like Drupal isn't need.<\/p>\n\n

It's written in PHP and uses several Symfony components, including Twig for templating.<\/p>\n\n

These are the same as Drupal and, of course, the Symfony framework. Two tools I'm very familiar with.<\/p>\n\n

A big reason why I decided to learn Sculpin in 2015 was to learn Twig and other Drupal 8 concepts before it was released.<\/p>\n\n

You don't need to write PHP code to use Sculpin, but you can easily extend it with PHP code if you need to.<\/p>\n\n

You can write custom service classes - the same as in Drupal or Symfony - and move complex logic there and out of your template files.<\/p>\n\n

This also means you can write automated tests with PHPUnit.<\/p>\n\n

I've added src<\/code> and tests<\/code> directories to my website repository<\/a>, which contain my custom Twig extensions that add new functions for counting the number of presentations I've given and my years of experience.<\/p>\n\n

There are a lot of choices for static site generators, including several PHP-based ones, but the familiarity and customisability of Sculpin make it a good choice for me.<\/p>\n\n ", "format": "full_html", "processed": "\n

I like the Sculpin static site generator<\/a> - a tool I've used for various personal and client projects where a full content management system like Drupal isn't need.<\/p>\n\n

It's written in PHP and uses several Symfony components, including Twig for templating.<\/p>\n\n

These are the same as Drupal and, of course, the Symfony framework. Two tools I'm very familiar with.<\/p>\n\n

A big reason why I decided to learn Sculpin in 2015 was to learn Twig and other Drupal 8 concepts before it was released.<\/p>\n\n

You don't need to write PHP code to use Sculpin, but you can easily extend it with PHP code if you need to.<\/p>\n\n

You can write custom service classes - the same as in Drupal or Symfony - and move complex logic there and out of your template files.<\/p>\n\n

This also means you can write automated tests with PHPUnit.<\/p>\n\n

I've added src<\/code> and tests<\/code> directories to my website repository<\/a>, which contain my custom Twig extensions that add new functions for counting the number of presentations I've given and my years of experience.<\/p>\n\n

There are a lot of choices for static site generators, including several PHP-based ones, but the familiarity and customisability of Sculpin make it a good choice for me.<\/p>\n\n ", "summary": null } ], "feeds_item": [ { "imported": "1970-01-01T00:33:45+00:00", "guid": null, "hash": "cd05e2a441bf25694103bede108b3e8b", "target_type": "feeds_feed", "target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76" } ] }