oliverdavies.uk/content/node.e3d951af-bba8-45f4-b249-c7e0f73e2a47.json

100 lines
No EOL
6.9 KiB
JSON

{
"uuid": [
{
"value": "e3d951af-bba8-45f4-b249-c7e0f73e2a47"
}
],
"langcode": [
{
"value": "en"
}
],
"type": [
{
"target_id": "daily_email",
"target_type": "node_type",
"target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7"
}
],
"revision_timestamp": [
{
"value": "2025-05-01T23:43:32+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": "An example of feature flagging"
}
],
"created": [
{
"value": "2025-03-17T00:00:00+00:00"
}
],
"changed": [
{
"value": "2025-05-01T23:43:32+00:00"
}
],
"promote": [
{
"value": false
}
],
"sticky": [
{
"value": false
}
],
"default_langcode": [
{
"value": true
}
],
"revision_translation_affected": [
{
"value": true
}
],
"path": [
{
"alias": "\/daily\/2025\/03\/17\/feature-flags",
"langcode": "en"
}
],
"body": [
{
"value": "\n <p>I've written a number of emails about feature flags, or feature toggles, and am a strong advocate of using them whilst developing new features.<\/p>\n\n<p>I've used them a couple of times recently on my website so I wanted to share them as examples.<\/p>\n\n<h2 id=\"experimenting-with-presentation-layouts\">Experimenting with presentation layouts<\/h2>\n\n<p>Firstly, I wanted to experiment with a different layout for my presentation pages.<\/p>\n\n<p>They currently have a list of events, embedded slides and a video recording when there is one.<\/p>\n\n<p>Each event linked to its website, where applicable, and the slides and video were from one of the most recent versions of the presentation.<\/p>\n\n<p>I wanted to change this so each event would have links to its own slides, example code or demo.<\/p>\n\n<p>I didn't want to change this yet for all presentations, only <a href=\"https:\/\/www.oliverdavies.uk\/presentations\/sculpin\">my Sculpin talk<\/a> as it's the most recent and, if I like it, later apply it to the others.<\/p>\n\n<p>My website is built with Sculpin, so adding a feature flag was as simple as adding <code>new: true<\/code> to the YAML front matter at the top of the file for that presentation.<\/p>\n\n<p>This is available as <code>page.new<\/code> in the layout file and I can use this <a href=\"https:\/\/code.oliverdavies.uk\/opdavies\/oliverdavies.uk\/commit\/8b721e63fb64f3c98b81353ca9cec7545d72a595\">to load different markup<\/a>.<\/p>\n\n<h2 id=\"rewriting-my-css\">Rewriting my CSS<\/h2>\n\n<p>Secondly, I've been wanting to re-style my website with Tailwind CSS 4 and refactor some of the templating.<\/p>\n\n<p>As this is a change I wanted to be site-wide, I added <code>new_css: true<\/code> to my sculpin_site.yml file.<\/p>\n\n<p>This time, I was able to use <code>site.new_css<\/code> to <a href=\"https:\/\/code.oliverdavies.uk\/opdavies\/oliverdavies.uk\/commit\/fa884644cf5aa233ad22fb28b83c5a0b150b037d\">toggle the loaded stylesheet<\/a> and using Sculpin's environment files - e.g. sculpin_site_dev.yml and sculpin_site_prod.yml - I can be explicit about which stylesheets are used locally and for my live website.<\/p>\n\n<h2 id=\"summary\">Summary<\/h2>\n\n<p>Feature flags are a great approach to splitting up large changes into manageable, deployable pieces, and they don't need to be complicated.<\/p>\n\n<p>Essentially, they are a simple boolean value that you can use to execute different code based on whether it's false or true.<\/p>\n\n ",
"format": "full_html",
"processed": "\n <p>I've written a number of emails about feature flags, or feature toggles, and am a strong advocate of using them whilst developing new features.<\/p>\n\n<p>I've used them a couple of times recently on my website so I wanted to share them as examples.<\/p>\n\n<h2 id=\"experimenting-with-presentation-layouts\">Experimenting with presentation layouts<\/h2>\n\n<p>Firstly, I wanted to experiment with a different layout for my presentation pages.<\/p>\n\n<p>They currently have a list of events, embedded slides and a video recording when there is one.<\/p>\n\n<p>Each event linked to its website, where applicable, and the slides and video were from one of the most recent versions of the presentation.<\/p>\n\n<p>I wanted to change this so each event would have links to its own slides, example code or demo.<\/p>\n\n<p>I didn't want to change this yet for all presentations, only <a href=\"https:\/\/www.oliverdavies.uk\/presentations\/sculpin\">my Sculpin talk<\/a> as it's the most recent and, if I like it, later apply it to the others.<\/p>\n\n<p>My website is built with Sculpin, so adding a feature flag was as simple as adding <code>new: true<\/code> to the YAML front matter at the top of the file for that presentation.<\/p>\n\n<p>This is available as <code>page.new<\/code> in the layout file and I can use this <a href=\"https:\/\/code.oliverdavies.uk\/opdavies\/oliverdavies.uk\/commit\/8b721e63fb64f3c98b81353ca9cec7545d72a595\">to load different markup<\/a>.<\/p>\n\n<h2 id=\"rewriting-my-css\">Rewriting my CSS<\/h2>\n\n<p>Secondly, I've been wanting to re-style my website with Tailwind CSS 4 and refactor some of the templating.<\/p>\n\n<p>As this is a change I wanted to be site-wide, I added <code>new_css: true<\/code> to my sculpin_site.yml file.<\/p>\n\n<p>This time, I was able to use <code>site.new_css<\/code> to <a href=\"https:\/\/code.oliverdavies.uk\/opdavies\/oliverdavies.uk\/commit\/fa884644cf5aa233ad22fb28b83c5a0b150b037d\">toggle the loaded stylesheet<\/a> and using Sculpin's environment files - e.g. sculpin_site_dev.yml and sculpin_site_prod.yml - I can be explicit about which stylesheets are used locally and for my live website.<\/p>\n\n<h2 id=\"summary\">Summary<\/h2>\n\n<p>Feature flags are a great approach to splitting up large changes into manageable, deployable pieces, and they don't need to be complicated.<\/p>\n\n<p>Essentially, they are a simple boolean value that you can use to execute different code based on whether it's false or true.<\/p>\n\n ",
"summary": null
}
],
"feeds_item": [
{
"imported": "2025-05-01T23:43:32+00:00",
"guid": null,
"hash": "55f785f8b5b1bcd8bf8f2c8c09ee1e1e",
"target_type": "feeds_feed",
"target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76"
}
]
}