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

cloudcannon-hugo

Package Overview
Dependencies
Maintainers
7
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudcannon-hugo - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

package.json
{
"name": "cloudcannon-hugo",
"type": "module",
"version": "1.0.9",
"version": "1.0.10",
"description": "Generates the files necessary for a hugo site to integrate with CloudCannon CMS",

@@ -6,0 +6,0 @@ "main": "src/index.js",

import { mergeDeep, runProcess } from '../helpers/helpers.js';
import { markdownMeta } from '../helpers/metadata.js';
export function getGeneratorMetadata(hugoConfig) {
export function getGeneratorMetadata(hugoConfig, config) {
const markup = hugoConfig.markup ?? {};
const markdownHandler = markup.defaultMarkdownHandler ?? 'goldmark';
const defaultMeta = markdownMeta[markdownHandler] ?? {};
const markdownHandler = config.generator?.metadata?.markdown || markup.defaultMarkdownHandler || 'goldmark';
const defaultMeta = markdownMeta[markdownHandler] || {};
const ccMarkdownSettings = config.generator?.metadata?.[markdownHandler] || {};
const markdownSettings = mergeDeep({}, defaultMeta, markup[markdownHandler], ccMarkdownSettings);
markdownSettings.renderer ||= {};
markdownSettings.renderer.hardWraps = !!(markdownSettings.hardWraps ?? markdownSettings.renderer.hardWraps ?? false);
return {
markdown: markdownHandler,
[markdownHandler]: mergeDeep(defaultMeta, markup[markdownHandler])
[markdownHandler]: markdownSettings
};
}
export async function getGenerator(hugoConfig) {
export async function getGenerator(hugoConfig, config) {
const hugoVersion = await runProcess('hugo', ['version']);

@@ -21,4 +27,4 @@

version: hugoVersion.match(/[0-9]+\.[0-9]+\.[0-9]+/g)?.[0] ?? '0.0.0',
metadata: getGeneratorMetadata(hugoConfig)
metadata: getGeneratorMetadata(hugoConfig, config)
};
}

@@ -53,3 +53,3 @@ import Papa from 'papaparse';

const data = await getData(config);
const generator = await getGenerator(hugoConfig);
const generator = await getGenerator(hugoConfig, config);

@@ -56,0 +56,0 @@ // multlingual not needed in info.json

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