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.8 to 1.0.9

2

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

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

@@ -116,3 +116,3 @@ import chalk from 'chalk';

const legacy = getLegacyConfig(hugoConfig);
const baseUrl = file.base_url || getUrlPathname(hugoConfig.baseURL) || '';
const baseURL = file.base_url || getUrlPathname(hugoConfig.baseURL) || '';

@@ -122,3 +122,3 @@ const config = {

...file,
base_url: baseUrl === '/' ? '' : baseUrl,
base_url: baseURL === '/' ? '' : baseURL,
source: file.source || paths.source || '',

@@ -125,0 +125,0 @@ multilingual: {

import Papa from 'papaparse';
import { runProcess } from '../helpers/helpers.js';
import { runProcess, getUrlPathname } from '../helpers/helpers.js';
import pathHelper from '../helpers/paths.js';

@@ -29,3 +29,14 @@ import chalk from 'chalk';

return fileList.data.reduce((memo, file) => {
memo[file.path] = ('/' + file.permalink.replace(hugoConfig.baseURL ?? '', '')).replace(/^\/\//, '/');
const baseURLPathname = getUrlPathname(hugoConfig.baseURL || '')
.replace(/^\/*/g, '')
.replace(/\/*$/g, '/');
let filePathname = getUrlPathname(file.permalink).replace(/^\/*/g, '');
if (filePathname.startsWith(baseURLPathname)) {
filePathname = filePathname.substring(baseURLPathname.length);
}
const url = ('/' + filePathname).replace(/^\/\//, '/');
memo[file.path] = url;
return memo;

@@ -32,0 +43,0 @@ }, {});

@@ -119,3 +119,3 @@ import { join, extname, basename } from 'path';

const configObject = await generateConfigObject(flags);
configObject.baseURL = flags.baseUrl || configObject.baseURL || '/';
configObject.baseURL = flags.baseURL || configObject.baseURL || '/';

@@ -122,0 +122,0 @@ if (flags.source) {

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