whoevencares

Mambaul Hisam

Thu Jun 26 2025

This Platform

WEC, previously i named it as whoevencares, is a Static Site Generator written in TypeScript. It's simple, around ~800 lines of code with minimal runtime library. The fact, all content in this blog were fully generated by WEC. Before we go into any further, let's talk about the background of this project.

How it Begun

First, i was collage student at the time. And i was too broke (even now) to rent a VPS or hosting service. Second, that is i need to take a notes of my work and share it to you (and other entity maybe?). Third, we live in a world, we need to work to live in and as far as i know, to work as fresh graduate, that lacks of experience, we need to make a portfolio to growing up our value in the glasses of company.

To resolve all of my problems, i started this project. Apart from the above, i started this project in December 2023. I used to write my own SSG to meet my need instead of using another feature rich SSG like Hugo. I think it's give me more benefit as an Informatics student than use production ready SSG.

The Objective

  • Ez to deploy and the deployment is free as in free drink
  • Just do one task, generating page. Serving it's content is different task. That's why this project was quite simple.

Features

The WEC main branch have such features that meets:

Configable

This placed on the root project dir as wec.json, but you can set anywhere you want as long as you assign configPath variable in src/parser/config.ts. We employ built-in JSON interface to parsing it's content and it's fast.

Tagging support

We need it, to group a content. The architecture allows you to render each tag as rendering the index page. Behind the scene, tagging and indexing are the same thing, just need the different context to work with. While index scopes all the content no matter what the tag is. As opposite to indexing, src/render/tagging.ts do cares by using Map to group the tags.

Backed by Nunjuck and Markdown-it

I use nunjuck and markdown-it personally, a ready to go library as core in this project. I don't hava a plan to drop these two library. Nunjucks as templating engine gives more user opinion how they define the templates. An other hand, markdown-it also gives user a freedom to use rich-available plugins. Internally, it's only one plugin already set, markdown-it-attr to embed attributes into generated html.

Custom template

You can write your own theme by modify files in the templates directory and using nunjuck as templating engine. See How do I do My Own

Thumbnail generator

I employ the sharp library. Placing components, you need do hard code under src/render/thumbnail.ts file to fit the image template in the templates directory. Thanks to sharp contributor, you able to custom fonts in applied to thumbnail template.

RSS generator

Thanks again to feed author. The author field in the config were used. This generates automatically while rendering the content.

The Why Not to Use WEC

It's lack of documentation (may just this post?), or maybe you can debug your self to understand what's going on under the hood (think of you learn to debug). Sometimes i also ask my self like "what the f this pieces of shi- code do?"

As a Maintainer

I actively maintain it to fix the bug or changes for improvement. For those want to contribute or add more features, are welcome. Another fact is, i rewrite this project three times. Due to knowledge update. Of course, it's affecting it's architecture.

How do I do My Own?

Just fork it, and change the templates under templates in root directory to your prefered style. For available context API, look at the interface ContentContext, IndexContext.

What's Next?

User defined context API

To utilize it's dynamics of TypeScript/JavaScript language, allowing user to define their own context API it's a features. But, not as free as freedom, WEC need neccessery metadata like publishedDate, draft and other required API to system generate code smoothly.

Using JSON as front matter

Yes, JSON. It's may felt little clumsy, but to minimaze runtime external dependency or library. We could.

NPM package

To be clear, it's a app, i mean you can't act this project as library but by forking and edit it's source. In the future, it's possible to separate app and library as major changes.

A bit of documentation maybe?

We need it.

Modularity

Gives user freedom how they compose a component. Example, using user's defined implementation to how should it render the thumbnail.