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
Bot releases are visible (Hide)
contentful-hugo --init
now creates a .ts
config file instead of a .js
config filePublished by joshmossas 6 months ago
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
require()
via CommonJS should still work, but testing will primarily be done against ESM)unbuild
from the unjs ecosystem to simplify outputting files for ESM and CommonJSjiti
to run generic ts scriptsFull Changelog: https://github.com/modiimedia/contentful-hugo/compare/v3.1.0...v4.0.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
Published by joshmossas over 1 year ago
^10
^11
14.14
Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.2.2...v3.0.0
Published by joshmossas about 2 years ago
Update dependencies
Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.2.0...v2.2.2
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
Published by joshmossas about 2 years ago
Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.1.7...v2.1.9
Update dependencies
Published by joshmossas over 2 years ago
Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.1.4...v2.1.7
Published by joshmossas over 2 years ago
Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.1.3...v2.1.4
Published by joshmossas over 2 years ago
dotenv
to v16.0.0Full Changelog: https://github.com/ModiiMedia/contentful-hugo/compare/v2.1.0...v2.1.3
Published by joshmossas almost 3 years ago
This release adds a --quiet
flag which hides all log outputs
Published by joshmossas almost 3 years ago
fs-extra
, yargs
, and dotenv
to latest version dropping support for old NodeJS versions. Minimum supported NodeJS version is now Node v12
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'
}
]
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
}
}
}
]
isTaxonomy
option is no longer marked as experimentalPublished by joshmossas about 3 years ago
@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.3contentful
updated to 8.5.7@babel/cli
removed@typescript-eslint/eslint-plugin
updated to 4.31.0@typescript-eslint/parser
updated to 4.31.0jest
updated to 27.1.1prettier
updated to 2.4.0typescript
updated to 4.4.2Added recommended vscode extensions to .vscode/extensions.json
making it easier for contributors to work in the same environment
Published by joshmossas about 3 years ago
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
Published by joshmossas about 3 years ago
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.
module.exports = {
// rest of config
repeatableTypes: [
{
id: "post",
directory: "content/posts",
customFields: {
myCustomField: "myCustomFieldVal",
myOtherCustomField: (entry) => {
// do something with entry
return entry.fields.whatever;
}
}
]
}
Published by joshmossas over 3 years ago
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.
Published by joshmossas over 3 years ago
Fixes bug where YAML config files were not being loaded properly (related to https://github.com/ModiiMedia/contentful-hugo/issues/53)
Published by joshmossas over 3 years ago
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.
Published by joshmossas over 3 years ago
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
Published by joshmossas over 3 years ago
resolveEntries
field/_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.