Skip to content

Commit

Permalink
add unstaged file
Browse files Browse the repository at this point in the history
  • Loading branch information
stjet committed Aug 19, 2023
1 parent 64889b8 commit 2a1ca73
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions index.ts
Expand Up @@ -111,19 +111,6 @@ let first_posts: PostMetadata[] = posts_metadata.slice(0, 5); //not truly the re

const site_info: SiteInfo = _site_info;

function html_entity_convert(html: string) {
const entity_table = {
"&nbsp": "&#160",
"<": "<",
">": ">",
};
for (let i=0; i < Object.keys(entity_table).length; i++) {
let entity_name = Object.keys(entity_table)[i];
html = html.replaceAll(entity_name, entity_table[entity_name]);
}
return html;
}

let posts_rss: RSSPost[] = first_posts.map((post) => {
//get url
let url: string = `${site_info.url}/posts/${post.slug}`;
Expand All @@ -138,7 +125,7 @@ let posts_rss: RSSPost[] = first_posts.map((post) => {
//get html
let post_md_path: string = path.join(__dirname, `/posts/${post.filename}.md`);
let md: string = readFileSync(post_md_path, "utf-8").replaceAll("\r", "");
let html: string = html_entity_convert(parse_md_to_html(md));
let html: string = parse_md_to_html(md);
//turn into rsspost
return {
...post,
Expand Down

0 comments on commit 2a1ca73

Please sign in to comment.