You've already forked AstralRinth
forked from didirus/AstralRinth
Moderation Checklist V1.5 (#3980)
* starting on new checklist implementation Change default shouldShow behavior for stages. add new messages and stages. Change some existing stage logic. Add placeholder var for the rules. Co-Authored-By: @coolbot100s * misc fixes + corrections * Add clickable link previews to links stage * Correct mislabeled title message and add new title messages * Change message formatting, use rules variable, correct wip desc and title 1.8 messages, add tags buttons * More applications of rules placeholder * Add new status alerts stage * change order of statusAlerts * Update title related messages, add navigation based vars * Overhaul Links stage and add new messages. * Set message weights, add some disables * message.mds now obey lint >:( * fixed links text message formatting and changed an icon * Combine title and slug stages * Add more info to some stages and properly case stage ids * tweak summary text formatting * Improved tags stage info and more navigation placeholders * redo reupload stage, more navigation placeholders, licensing stage improvements, versions stage improvements, status alerts stage improvements * Allow modpack permissions stage to appear again by adding a dummy button. * Update modpack permissions guidance * fix: blog path issues * fix: lint issues * fix license stage text formatting * Improve license stage * feat: move links into one md file to be cleaner * Update packages/moderation/data/stages/links.ts Signed-off-by: IMB11 <hendersoncal117@gmail.com> --------- Signed-off-by: IMB11 <hendersoncal117@gmail.com> Co-authored-by: IMB11 <hendersoncal117@gmail.com> Co-authored-by: IMB11 <calum@modrinth.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { promises as fs } from 'fs'
|
||||
import * as path from 'path'
|
||||
import fg from 'fast-glob'
|
||||
import matter from 'gray-matter'
|
||||
import { md } from '@modrinth/utils'
|
||||
import { minify } from 'html-minifier-terser'
|
||||
import { copyDir, toVarName } from './utils'
|
||||
import RSS from 'rss'
|
||||
import { parseStringPromise } from 'xml2js'
|
||||
import { glob } from 'glob'
|
||||
|
||||
import {
|
||||
ARTICLES_GLOB,
|
||||
@@ -24,7 +24,7 @@ async function ensureCompiledDir() {
|
||||
}
|
||||
|
||||
async function hasThumbnail(slug: string): Promise<boolean> {
|
||||
const thumbnailPath = path.join(PUBLIC_SRC, slug, 'thumbnail.webp')
|
||||
const thumbnailPath = path.posix.join(PUBLIC_SRC, slug, 'thumbnail.webp')
|
||||
try {
|
||||
await fs.access(thumbnailPath)
|
||||
return true
|
||||
@@ -48,7 +48,7 @@ function getThumbnailUrl(slug: string, hasThumb: boolean): string {
|
||||
async function compileArticles() {
|
||||
await ensureCompiledDir()
|
||||
|
||||
const files = await fg([ARTICLES_GLOB])
|
||||
const files = await glob(ARTICLES_GLOB)
|
||||
console.log(`🔎 Found ${files.length} markdown articles!`)
|
||||
const articleExports: string[] = []
|
||||
const articlesArray: string[] = []
|
||||
@@ -75,8 +75,8 @@ async function compileArticles() {
|
||||
|
||||
const slug = frontSlug || path.basename(file, '.md')
|
||||
const varName = toVarName(slug)
|
||||
const exportFile = path.join(COMPILED_DIR, `${varName}.ts`)
|
||||
const contentFile = path.join(COMPILED_DIR, `${varName}.content.ts`)
|
||||
const exportFile = path.posix.join(COMPILED_DIR, `${varName}.ts`)
|
||||
const contentFile = path.posix.join(COMPILED_DIR, `${varName}.content.ts`)
|
||||
const thumbnailPresent = await hasThumbnail(slug)
|
||||
|
||||
const contentTs = `
|
||||
@@ -221,7 +221,7 @@ async function deleteDirContents(dir: string) {
|
||||
const entries = await fs.readdir(dir, { withFileTypes: true })
|
||||
await Promise.all(
|
||||
entries.map(async (entry) => {
|
||||
const fullPath = path.join(dir, entry.name)
|
||||
const fullPath = path.posix.join(dir, entry.name)
|
||||
if (entry.isDirectory()) {
|
||||
await fs.rm(fullPath, { recursive: true, force: true })
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user