ClickPress

A couple of things to mention today.

Firstly - I rewrote my PHP site generator. Well, I say I rewrote it. Really, I asked Claude to rewrite it. It's basically gone from about 150 files to 15, not including the content. Which suggests maybe I didn't do that well the first time round.

This one just generates it to a flat file though, so I didn't need to bother with a router and that kind of thing, instead of running it within the workspace I build it every time and then I have a flat file. It still goes over to GitLab Page. Also, the Markdown has proper frontmatter which makes my life a bit easier.

Secondly - I've been playing with more API stuff. This time to link WordPress site builds to our work project management set up. We use ClickUp so I've been getting to grips with quite a nice API.

I now have a set up where each WordPress page has an associated ClickUp Task ID. This can be picked from a dropdown in the post edit screen generated using this call:

curl --request GET \
     --url "https://api.clickup.com/api/v2/list/{LIST_ID}/task?fields=id,name" \
     --header "Authorization: THE_API_TOKEN" \
     --header "accept: application/json"

I created a custom taxonomy that matches the available statuses for the list (eg To Do, In Progress, For Review, Done). I call these "Project Status". When the Project Status is updated in the WordPress it triggers an API PUT instruction to ClickUp. Something based around this:

curl --request PUT \
     --url https://api.clickup.com/api/v2/task/{TASK_ID} \
     --header "Authorization: THE_API_TOKEN" \
     --header "accept: application/json" \
     --header "content-type: application/json" \
     --data '{"status": "to review"}'

I created a little settings page, where you give the API key (or do this through wp-config or whatever), the List ID and a few other bits and pieces but it's very early stages. I'm going to investigate Webhooks so that I can work the other way too. For example, when we create a project board in ClickUp, the ideal would be to make a task per page, and there's no reason this action couldn't create a page in WordPress.