This should be a README.md
I think I've cracked the basic open graph meta data which was sort one of the first experiments on this site but which needs more documenting.
This thought is the effort to document the generation of the hero/og art and prompt an improvement for the build and efficiency.
The current process is to:
- start a development server with a "glitch" config"
npm run start:glitch
- execute a command
npx playwright test -c _glitch
The first step includes a different eleventy config that skips a bunch of plugins (probably rss) and adds a global theme glitch
that modifes the CSS to render the pages glitched.
The second step runs a set of tests that screenshot the glitched thoughts/posts and feeds those into a paper js page/script to generate a unique SVG based on the content screenshot, these are exported as annotated pngs and svgs.
The pngs and svgs are stored back in the website content folder using slugified filenames so they can be resolved by the main website content build.
This works.
It's automattic in the sense of generative art. But from a dev build perspective it still needs an intermediary step to generate the art after the content has been completed.
And as it needs a dev server and a test script, it runs in two terminals often in addition to running a dev server and another terminal for git, etc.
How could I improve this so I had an npm run generate
command that did the setup and teardown for the art generation.
Oh another point ... It re-generates all art by default. How might I test and skip content that has existing art and use a --force
if I wanted to rebuild it (or just delete the file).
This post isn't the solution. I'm thinking a build script that:
- includes no-huping or backgrounding hte glitch dev server
- adding an initial timeout check to playwright test to wait for hte server to spin up.
- add some dev server teardown to be all tidy after.
- modify the tests to stat the slugified content name to check if it has already been generated before generating.
✌️🤠
PS: This content has been written sans content dev server to also try and sequence the order and the dependency.