Convert Hugo articles to Embendding for Cloudflare Vectorize Store
The single.json
is a example to add JSON outptu for your theme.
Setup a new config ai.toml
to extend output
[outputs]
# Enable HTML to support Permalink to original content
page = ["HTML", "JSON"]
hugo --config config.toml,ai.toml
Download embedding.rb
and run it with environment config
OPENAI_ACCESS_TOKEN=xxx CONCURRENCY=10 SOURCE=public/posts/**/index.json OUTPUT=embenddings.ndjson ruby embedding.rb
npx wrangler vectorize insert [INDEX_NAME] --file embeddings.ndjson