New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

static-markdown

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

static-markdown - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

30

index.js

@@ -12,3 +12,3 @@ const Handlebars = require('handlebars')

async function renderArticle(dir, articlePath, template, constants) {
async function renderArticle(dir, articlePath, constants) {
// each line

@@ -22,3 +22,16 @@ let articleLines = fs.readFileSync(articlePath, {

// others are the content
// {"template": "template"} by default
let templateToUse = articleMetadata.template || 'template'
// load template
let templateFile
try {
templateFile = await fs.readFile(path.join(dir, `source/${templateToUse}.html`), {
encoding: 'utf8'
})
} catch (e) {
return error(`Could not find source/${templateToUse}.html`)
}
let template = Handlebars.compile(templateFile)
// most lines are the content
let articleFile = articleLines.join('\n')

@@ -95,13 +108,2 @@

// load template
let templateFile
try {
templateFile = await fs.readFile(path.join(dir, 'source/template.html'), {
encoding: 'utf8'
})
} catch (e) {
return error('Could not find source/template.html')
}
let template = Handlebars.compile(templateFile)
let articlePaths

@@ -134,3 +136,3 @@ // find all articles

for (let articleFileNumber in articlePaths) {
renderArticle(dir, articlePaths[articleFileNumber], template, constants)
renderArticle(dir, articlePaths[articleFileNumber], constants)
}

@@ -137,0 +139,0 @@ }

{
"name": "static-markdown",
"version": "1.1.0",
"version": "1.2.0",
"description": "Generate static sites using markdown",

@@ -5,0 +5,0 @@ "main": "index.js",

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