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

cloudcannon-hugo

Package Overview
Dependencies
Maintainers
6
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 0.13.3 to 0.13.4

2

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

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

@@ -44,2 +44,14 @@ import { basename, dirname, extname } from 'path';

export function getDefinedCollectionName(itemPath, definedCollections) {
let collectionKey, prevDirectory;
let itemDirectory = itemPath;
do {
prevDirectory = itemDirectory;
itemDirectory = dirname(prevDirectory);
collectionKey = definedCollections[itemDirectory];
} while (!collectionKey && itemDirectory !== prevDirectory);
return collectionKey;
}
export function getPageUrl(path, hugoUrls = {}, contentDir) {

@@ -154,3 +166,5 @@ if (hugoUrls[path]) {

if (initialCollectionsConfig[collectionKey].path) {
definedCollections[initialCollectionsConfig[collectionKey].path] = collectionKey;
// remove trailing slash
const collectionPath = initialCollectionsConfig[collectionKey].path.replace(/\/$/, '');
definedCollections[collectionPath] = collectionKey;
}

@@ -183,3 +197,3 @@ });

await Promise.all(slice.map(async (itemPath) => {
const collectionKey = definedCollections[dirname(itemPath)]
const collectionKey = getDefinedCollectionName(itemPath, definedCollections)
|| getCollectionKey(itemPath, paths.content, paths.archetypes);

@@ -186,0 +200,0 @@

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