contentful-hugo

A CLI tool that pulls data from Contentful and turns it into markdown files for Hugo and other static site generators. It also includes an express server that can be used for local development and content previews

Downloads
1.8K
Stars
38
Committers
9

Bot releases are hidden (Show)

contentful-hugo - v4.0.1 Latest Release

Published by joshmossas 5 months ago

Bug Fixes and Improvements

  • contentful-hugo --init now creates a .ts config file instead of a .js config file
  • fix bug where config priority order was not being respected

Development Changes

  • Migrate to eslint flat file config
  • Remove deprecated eslint configs and plugins (replace with new rules)
contentful-hugo - v4.0.0

Published by joshmossas 6 months ago

New Features

Support for typescript config files

You can now specify a Contentful Hugo config like like this:

// contentful-hugo.config.ts
import { defineConfig } from 'contentful-hugo';

export default defineConfig({
  // stuff goes here
});

contenful-hugo.config.ts has been added to list of default config file names. The list of default config locations now looks like the following in order of priority:

  • contentful-hugo.config.ts
  • contentful-hugo.config.js
  • contentful-hugo.config.yaml
  • contentful-hugo.yaml
  • contentful-settings.yaml

Breaking Changes

  • Drop support for Node v16
  • Migrate to ESM. (using require() via CommonJS should still work, but testing will primarily be done against ESM)

Other Changes

  • Refactor dev tooling to make us of unbuild from the unjs ecosystem to simplify outputting files for ESM and CommonJS
  • Migrate from yargs to citty for CLI commands
  • Make use of jiti to run generic ts scripts

Full Changelog: https://github.com/modiimedia/contentful-hugo/compare/v3.1.0...v4.0.0

contentful-hugo - v3.1.0

Published by joshmossas 9 months ago

Update all dependencies to latest

Full Changelog: https://github.com/modiimedia/contentful-hugo/compare/v3.0.0...v3.1.0

contentful-hugo - v3.0.0

Published by joshmossas over 1 year ago

Breaking Changes

  • upgrade to contentful ^10
  • upgrade to fs-extra ^11
  • minimum support Node version is now 14.14

Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.2.2...v3.0.0

contentful-hugo - v2.2.2

Published by joshmossas about 2 years ago

contentful-hugo - v2.2.0

Published by joshmossas about 2 years ago

Add a function called defineConfig that provides a type safe way of writing configuration files. This is a precursor to adding typescript config support https://github.com/ModiiMedia/contentful-hugo/issues/62

With this new function you can do the following to get intellisense depending on your code editor. When typescript config support comes intellisense will perform better all around.

const { defineConfig } = require('contentful-hugo')

module.exports = defineConfig({
  // config goes here 
})

Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.1.9...v2.2.0

contentful-hugo - v2.1.9

Published by joshmossas about 2 years ago

contentful-hugo - v2.1.7

Published by joshmossas over 2 years ago

Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.1.4...v2.1.7

Update Dependences:

  • contentful updated to latest
  • yargs updated to latest
contentful-hugo - v2.1.4

Published by joshmossas over 2 years ago

Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.1.3...v2.1.4

Update Dependencies

  • update @contentful/rich-text-html-renderer to v15.12.0
  • update @contentful/rich-text-plain-text-renderer to v15.12.0
  • update @contentful/rich-text-types to v15.12.0
  • update chokidar to v3.5.3
  • update contentful to v9.1.19
  • update express to v4.17.3
  • update fs-extra to v10.0.1
  • update yargs to v17.4.0

Update Dev Dependencies

  • update @modii/tscpaths to v0.2.2
  • update @types/jest to v27.4.1
  • update @types/js-yaml to v4.0.5
  • update @typescript-eslint/eslint-plugin to v5.18.0
  • update @typescript-eslint/parser to v5.18.0
  • update eslint to v8.12.0
  • update eslint-config-prettier to v8.5.0
  • update eslint-plugin-import to v2.26.0
  • update jest to v27.5.1
  • update prettier to v2.6.2
  • update ts-jest to v27.1.4
  • update typescript to v4.6.3
contentful-hugo - v2.1.3

Published by joshmossas over 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.1.0...v2.1.3

contentful-hugo - v2.1.0

Published by joshmossas almost 3 years ago

Add Quiet Mode

This release adds a --quiet flag which hides all log outputs

contentful-hugo - v2.0.0

Published by joshmossas almost 3 years ago

Major Release

Breaking Changes

  • update fs-extra, yargs, and dotenv to latest version dropping support for old NodeJS versions. Minimum supported NodeJS version is now Node v12
  • drop default frontmatter fields that were marked as depreciated in previous versions
    • createdAt
    • updated

Non-Breaking Changes

New Syntax For Entry Resolution

This version adds a more concise syntax for the resolveEntries option. The old syntax is still supported.

// new syntax
resolveEntries: {
  myField: 'sys.id',
  myOtherField: 'fields.whatever'
}

// old syntax
resolveEntries: [
  {
    field: 'myField',
    resolveTo: 'sys.id'
  },
  {
    field: 'myOtherField',
    resolveTo: 'fields.whatever'
  }
]

New Syntax for Overrides

This version also adds a more concise syntax for overrides option. The old syntax is still supported.

// new syntax
overrides: {
  myField: {
    fieldName: 'myNewFieldName',
    valueTransformer: (val) => {
      // return a transformed value
    }
  }
}

// old syntax
overrides: [
  {
    field: 'myField',
    options: {
      fieldName: 'myNewFieldName',
      valueTransformer: (val) => {
        // return a transformed value
      }
    }
  }
]

Other Changes

  • server mode is now out of beta
  • the isTaxonomy option is no longer marked as experimental
contentful-hugo - v1.18.4

Published by joshmossas about 3 years ago

Update Dependencies

Dependencies

  • @contentful/rich-text-html-renderer updated to 15.3.4 (previous typescript bug was fixed by contentful https://github.com/contentful/rich-text/issues/259)
  • @contentful/rich-text-plain-text-renderer updated to 15.3.3
  • @contentful/rich-text-types updated to 15.3.3
  • contentful updated to 8.5.7

Dev Dependencies

  • @babel/cli removed
  • @typescript-eslint/eslint-plugin updated to 4.31.0
  • @typescript-eslint/parser updated to 4.31.0
  • jest updated to 27.1.1
  • prettier updated to 2.4.0
  • typescript updated to 4.4.2

Additional Changes

Added recommended vscode extensions to .vscode/extensions.json making it easier for contributors to work in the same environment

contentful-hugo - v1.18.2

Published by joshmossas about 3 years ago

Bugfix

Lock @contentful/rich-text-html-renderer to version 15.0.0 and move it back to dependencies vs DevDependencies

This lib will stay version locked until the following issue is resolved by Contentful https://github.com/contentful/rich-text/issues/252

contentful-hugo - v1.18.0

Published by joshmossas about 3 years ago

New Feature: Custom Fields

Content types now have an optional field called customFields. When specified, additional fields will be added to the frontmatter for that type. Further explanation can be found here.

Example

module.exports = {
  // rest of config
  repeatableTypes: [
    {
      id: "post",
      directory: "content/posts",
      customFields: {
        myCustomField: "myCustomFieldVal",
        myOtherCustomField: (entry) => {
          // do something with entry
          return entry.fields.whatever;
        }
    }
  ]
}
contentful-hugo - v1.17.4

Published by joshmossas over 3 years ago

Bugfix

Merge https://github.com/ModiiMedia/contentful-hugo/pull/54 from @panzacoder

Fixes a bug where an array of objects in a JSON field will fail.

contentful-hugo - v1.17.2

Published by joshmossas over 3 years ago

Bugfix

Fixes bug where YAML config files were not being loaded properly (related to https://github.com/ModiiMedia/contentful-hugo/issues/53)

contentful-hugo - v1.17.1

Published by joshmossas over 3 years ago

Asset Webhook Support

Then following change applies to the --server flag only. Now when contentful-hugo receives a webhook about an asset being modified it'll find all the entries that reference that asset and update them.

contentful-hugo - v1.17.0

Published by joshmossas over 3 years ago

Add JSON file extension support

the fileExtension parameter will now accept json as a value and will output JSON files accordingly.

Note: JSON and YAML files do not support the "mainContent" parameter and will render nothing for that field

contentful-hugo - v1.16.4

Published by joshmossas over 3 years ago

@1.16.4 Bug Fix

  • fix bug where server mode was ignoring the resolveEntries field

@1.16.3

  • Add get /_status route to server mode that sends a simple "ok" when requested, indicated that the server is running. The final endpoint might change in a future release.
  • Update dependencies