Run python script on public directory - post Hugo build

Hi all,

I have a Hugo website for myself which works perfectly fine.

I have been wondering if it is possible to run a python script on the public directory to conditionally inject some script and modify the HTML.

On local, I run the python script after the Hugo build and get the results.

Questions:

  1. How would I run this python script after Hugo build?

I haven’t tried this, but you can probably use build plugins: Create Build Plugins | Netlify Docs. Not sure if it supports Python, but since it’s installed on Netlify, maybe it would work.