Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

no-css-blog

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

no-css-blog - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

42

index.js

@@ -74,12 +74,8 @@ #!/usr/bin/env node

const tags = ls('posts');
const posts = ls('posts')
.map((tag) =>
ls(`posts/${tag}`).map((post) => ({
tag,
post,
createdAt: new Date(post.substring(0, 10)),
markdown: cat(`posts/${tag}/${post}/post.md`),
})),
)
.map((post) => ({
post: post.replace('.md', ''),
createdAt: new Date(post.substring(0, 10)),
markdown: cat(`posts/${post}`),
}))
.flat();

@@ -91,11 +87,7 @@

'<!-- INDEX -->',
tags
.map((tag) => {
let item = `<h3>${tag}</h3><ul>`;
for (const post of posts.filter((post) => post.tag === tag).sort((a, b) => b.createdAt - a.createdAt)) {
item += `<li><pre>${post.createdAt.toISOString().substring(0, 10)} <a href="/${tag}/${post.post.substring(11)}.html">${post.post.substring(11)}</a></pre></li>`;
}
item += '</ul>';
return item;
})
posts
.map(
(post) =>
`<li><pre>${post.createdAt.toISOString().substring(0, 10)} <a href="/${post.post.substring(11)}.html">${post.post.substring(11)}</a></pre></li>`,
)
.join(''),

@@ -108,12 +100,5 @@ );

for (const post of posts.sort((a, b) => b.createdAt - a.createdAt)) {
mkdir(`build/${post.tag}`);
mkdir(`build/${post.tag}/images`);
const html = convertMarkdownToHTML(post.markdown);
const minifiedHTML = minifyHTML(postLayout.replace('<!-- TITLE -->', post.post.substring(11)).replace('<!-- BODY -->', html));
write(`build/${post.tag}/${post.post.substring(11)}.html`, minifiedHTML);
for (const image of ls(`./posts/${post.tag}/${post.post}/images`)) {
cp(`./posts/${post.tag}/${post.post}/images/${image}`, `./build/${post.tag}/images/${image}`);
}
write(`build/${post.post.substring(11)}.html`, minifiedHTML);
}

@@ -130,6 +115,3 @@

`<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">${posts
.map(
(post) =>
`<url><loc>https://blog.yuru.cam/${post.tag}/${post.post.substring(11)}.html</loc><lastmod>${post.post.substring(0, 10)}</lastmod></url>`,
)
.map((post) => `<url><loc>https://blog.yuru.cam/${post.post.substring(11)}.html</loc><lastmod>${post.post.substring(0, 10)}</lastmod></url>`)
.join('')}</urlset>`,

@@ -136,0 +118,0 @@ );

{
"name": "no-css-blog",
"version": "0.1.5",
"version": "0.1.6",
"description": "A tool to generate a blog without CSS",

@@ -5,0 +5,0 @@ "author": "rhea-so",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc