Chen Hui Jing Blogs About Web and Free Software
-
Chen HuiJing ☛ Customising content markdown via frontmatter in Astro
The use case I had for this was to have customisable bits of a content collection that was rendered from markdown. Basically, a newsletter template where every newsletter could potentially have a different top banner and highlight colour.
There are different ways to implement this but I went with this frontmatter approach because there might be situations where a non-technical person had to publish the newsletter, and asking them to pass variables into a component is more confusing for them than you’d think.
If you consult the Astro documentation on CSS variables, it is possible to to pass CSS variables from component frontmatter using the
define:vars
directive. If you think about it, isn’t frontend development all about passing data from one component to another? -
Chen HuiJing ☛ OMG, I'm doing Drupal again
I’ve not written proper blog posts for a while now but I have come nearly full circle back to the start of my web career (albeit with a decade more experience and not necessarily any much smarter) to once again build a Drupal site. This is more a testament to the longevity of Drupal than my own career but that’s beside the point.
It’s time for yet another “setting up Drupal from scratch” blog post, but this time for Drupal 10. Which means I completely skipped Drupal 9 but what hey. The backstory as to why I’m writing this blog post can be its own blog post itself, we’ll see. It’s Opinionated and mildly spicy IMHO and at my age, I’m too tired for conflict if I can avoid it.
-
Chen HuiJing ☛ Back from blogging hiatus? Maybe…
What is with a sudden publication of blog posts after a seemingly indefinite hiatus? I have no answer except that I do things when I feel like it. More specifically, I do things that are not mandatory (like my job) when I feel like it. That’s why I still have one.
Speaking of jobs, to be honest, ever since the pandemic started in 2020, I’ve been keeping a relatively low profile. Partly because I felt that a gazillion people were having a hard time because of it, but I was extremely lucky to retain gainful employment throughout that time.