ci: migrate GitHub actions to Gitea actions
Deploy CV Site (andreknie.de) / deploy (push) Canceled after 0s
Deploy CV Site (andreknie.de) / deploy (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import matter from 'gray-matter'
|
||||
|
||||
const CONTENT_DIR = path.join(process.cwd(), 'content', 'posts')
|
||||
const mdFiles = fs.readdirSync(CONTENT_DIR).filter(f => f.endsWith('.md')).sort()
|
||||
|
||||
let yamlOutput = '```yaml\n'
|
||||
|
||||
mdFiles.forEach(file => {
|
||||
const p = path.join(CONTENT_DIR, file)
|
||||
const data = matter(fs.readFileSync(p, 'utf8'))
|
||||
let title = data.data.title || ''
|
||||
|
||||
// Escape quotes
|
||||
title = title.replace(/'/g, "''")
|
||||
|
||||
yamlOutput += `${file}: '${title}'\n`
|
||||
})
|
||||
|
||||
yamlOutput += '```\n'
|
||||
console.log(yamlOutput)
|
||||
Reference in New Issue
Block a user