generate-blog-metadata.mjs

_scripts/generate-blog-metadata.mjs
#!/usr/bin/env node
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const ROOT_DIR = path.resolve(__dirname, '..')
const OUTPUT_FILE = path.join(ROOT_DIR, '_data/_blog.json')
const TAX_FILE = path.join(ROOT_DIR, '_data/_taxonomies.json')
const PER_PAGE = 20
function loadEnvFile(file) {
if (!fs.existsSync(file)) return
const text = fs.readFileSync(file, 'utf8')
for (const line of text.split('\n')) {
const m = line.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*)\s*$/i)
if (!m) continue

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC