ci: migrate GitHub actions to Gitea actions
Deploy CV Site (andreknie.de) / deploy (push) Canceled after 0s

This commit is contained in:
2026-07-22 15:42:06 +02:00
parent e1cf49b0a2
commit b46de6dc7d
649 changed files with 127224 additions and 2786 deletions
@@ -0,0 +1,52 @@
import fs from 'fs'
import path from 'path'
import matter from 'gray-matter'
const CONTENT_DIR = path.join(process.cwd(), 'content')
const KNIEPUNKT_DIR = path.join(CONTENT_DIR, 'kniepunkt')
const POSTS_DIR = path.join(CONTENT_DIR, 'posts')
function getFiles(dir) {
return fs.readdirSync(dir).map(f => path.join(dir, f)).filter(f => f.endsWith('.md'))
}
const allFiles = [...getFiles(KNIEPUNKT_DIR), ...getFiles(POSTS_DIR)]
function decodeEntities(str) {
if (!str) return str
return str
.replace(/&/g, '&')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&quot;/g, '"')
.replace(/&#39;/g, "'")
.replace(/&#039;/g, "'")
.replace(/&nbsp;/g, ' ')
}
allFiles.forEach(file => {
if (fs.existsSync(file)) {
const raw = fs.readFileSync(file, 'utf8')
// Fast check
if (raw.includes('&#') || raw.includes('&quot;') || raw.includes('&amp;')) {
const data = matter(raw)
let changed = false
if (data.data.title && (data.data.title.includes('&#') || data.data.title.includes('&quot;'))) {
data.data.title = decodeEntities(data.data.title)
changed = true
}
const newContent = decodeEntities(data.content)
if (newContent !== data.content) {
data.content = newContent
changed = true
}
if (changed) {
fs.writeFileSync(file, matter.stringify(data.content, data.data))
console.log(`📝 Fixed entities in ${path.basename(file)}`)
}
}
}
})