Hello, World!

Category: Tech
2024-01-01
thumbnail

Header1

body text

Header2

body text

Header3

body text

LOOOOOOOOONG HEADERrrrrrrrrrrrrrrrrr

body text
body text
body text
body text
body text
body textinline codebody text
BOLD TEXT
打ち消し線

引用ですううううううううううううううううううううううううう

code block

function readmd(postid:string){
    const postfile = readFileSync(`${process.cwd()}/src/lib/posts/${postid}.md`, 'utf8');

    let fm_line = postfile.split('\n')

    let line_no:number[] = []
    fm_line.forEach((i,n)=>{
        if(i=='---'){line_no.push(n)}
    })

    let md_text = fm_line.slice(line_no[1]+1).join('\n')
    let fm_list = fm_line.slice(line_no[0]+1, line_no[1]).join('\n')

    let metadata = meta(fm_list)

    return {"metadata": metadata, 'post': md_text}
}