mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-11 18:32:50 +00:00
too many changes - load posts now
This commit is contained in:
@@ -36,13 +36,12 @@ function parse_dir(dir, folder_name){
|
||||
} else {
|
||||
const file = fs.readFileSync(dir+post, 'utf8');
|
||||
const tokens = marked.lexer(file, null);
|
||||
const path = dir + post;
|
||||
const temp = {
|
||||
path: path.slice(1, path.length),
|
||||
filename: post.slice(0, post.length - 3),
|
||||
category: folder_name,
|
||||
date: post.slice(0, 10),
|
||||
title: marked('<h2>' + tokens[0].text + '</h2>'),
|
||||
intro: marked(tokens[1].text)
|
||||
title: tokens[0].text,
|
||||
intro: tokens[1].text
|
||||
}
|
||||
json.posts.push(temp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user