{"_id":"sourcebit-target-hugo","_rev":"51-17cbba3cd8489c321ef625d86e162a99","name":"sourcebit-target-hugo","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"sourcebit-target-hugo","version":"0.1.0","keywords":["headless","headless-cms","jamstack","ssg","jekyll"],"author":{"name":"Stackbit"},"license":"MIT","_id":"sourcebit-target-hugo@0.1.0","maintainers":[{"name":"eduardoboucas","email":"mail@eduardoboucas.com"}],"homepage":"https://github.com/stackbithq/sourcebit-target-hugo#readme","bugs":{"url":"https://github.com/stackbithq/sourcebit-target-hugo/issues"},"dist":{"shasum":"d8bc5744de70d0eb402faee7045132e8465b280b","tarball":"https://registry.npmjs.org/sourcebit-target-hugo/-/sourcebit-target-hugo-0.1.0.tgz","fileCount":7,"integrity":"sha512-f0p+D+oAfW3T1OAqwHOtue0tfICnLuZ+lATsaEtU78mkLpeDRrqHoIgQU0KXC5zWxTZy/Og4q0+cHTd9emM/Ew==","signatures":[{"sig":"MEUCIQDolUh+ydiCGepl630/JIWdMJOEcG3xuxaCG8s9p1orkgIgP418cbE5LPUpMXOSzsmTEG/P4wUM2BiejiB1d5Yqp7g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeQ9cvCRA9TVsSAnZWagAA54cP/3bWukK0hvS2xvGzWQbB\nDm1BeuvApKE4+4Eg+GWdalGVNZ9E63t6N+Gt3PNid2ZiQh4b8dqQOAtZqudY\nu1/drLtF4EkgnNu5sOipMognVQ9Zt6cHMTyk0xK9HjHPZE9+PBSx76+EnyH2\nEG61/nC8vNMHDYKxNnKSPJK/6RK1Y+J6fJKqIQz9cwZVRoSIVCMXcva5vZUZ\nbG/nShOM/KaBuB06O54AvVCozGSm3yVxvVEmQIMl0rrlY+dP+Ar/wqiF6R2l\nwbGFcvAdVFgEyNpE4Nvu7WDeWgVS6kZtNsj40m6Ui57PqvktKZaw1nqO3zXC\njZL2fldEY5h/WHysT6T4YUFUPUh5ak5dLpt4d4kWwYo+L8Pe7K6TSPLYbLBe\n9tGyq/jBEc0znjnfFz2KFaTSIWlp0BBOknlwXK1kI0vptp3liVPZTr+upwJh\nOH9ZPyOlILwfWm/CVqrNxC9jkz+guWnbzdEp+UCa4YYnnUZKoE/9q92aojur\n3N1bcqnLyy20SlOzy0Y9XJTUcSTpcQK6tBBQB1Ve78PzOg/hA+hhzym7eBwX\nnf4A5evItzoiBhykv2RiY6TireG50D+Fkgylc0tMw/HhH7995CcmC4eziId8\nH3mbCej1ycGdGQ+4BHCrzL/j/9Bqfi7wrYbWpvgEGNxaoY+h8lfO7TRKBefI\nSDWA\r\n=1NKv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"gitHead":"d3ae33be183c3ab52db34decc7beb68cef4f7a34","scripts":{"test":"npm run format","format":"prettier --write \"./**/*.{js,jsx,md,html}\""},"_npmUser":{"name":"eduardoboucas","email":"mail@eduardoboucas.com"},"repository":{"url":"git+https://github.com/stackbithq/sourcebit-target-hugo.git","type":"git"},"_npmVersion":"6.9.0","description":"A Sourcebit plugin for Hugo","directories":{},"lint-staged":{"*.{js,jsx,md,html}":["npm run format","git add"]},"_nodeVersion":"10.16.3","dependencies":{"@sindresorhus/slugify":"^0.9.1","inquirer-table-prompt":"^0.2.1"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.2.0","prettier":"^1.19.1","lint-staged":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sourcebit-target-hugo_0.1.0_1581504302461_0.8110809448349003","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"sourcebit-target-hugo","version":"0.1.1","keywords":["headless","headless-cms","jamstack","ssg","jekyll"],"author":{"name":"Stackbit"},"license":"MIT","_id":"sourcebit-target-hugo@0.1.1","maintainers":[{"name":"eduardoboucas","email":"mail@eduardoboucas.com"}],"homepage":"https://github.com/stackbithq/sourcebit-target-hugo#readme","bugs":{"url":"https://github.com/stackbithq/sourcebit-target-hugo/issues"},"dist":{"shasum":"ac49ab84ee5522df3d4f35882fafe2ba6c75d7c8","tarball":"https://registry.npmjs.org/sourcebit-target-hugo/-/sourcebit-target-hugo-0.1.1.tgz","fileCount":7,"integrity":"sha512-WAw7rB84hoM1qfM0KFtkslT3ONYz0tvNc5/0zSALYCFEqj9ODyYHp3f6DACoke/Czy0vyH++4aWRU98SBB0YRA==","signatures":[{"sig":"MEUCIQCXmLCowG4tyGJHgPUUl4398FAbxVQ2qlb8zyoboOgKnAIgJ44LU8W2PSSHwbNC0NxhMGmILYAbdBP8YZ9MuGNihX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25621,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTqE+CRA9TVsSAnZWagAA4QoP/3UESI58ESzdtR975+74\nTyDN1Z8iwvQnSXdZYHpaOzV98l09AtivdiqWOnLIDXAq6ISni378cS78lJ3U\nCu9ltb2qBCrSqi8IMTzBdRaKKvCYXEdVLChq8U5aji/v5hgybkiBLCo4HwtV\nVe94afXPPl3aRMxEIPx4uf/03Bgv/jrBmPsoX1dqJKLylR12O/KnyXPlSpqJ\nlZ5i+vwmkzHC/BAFpsMc4GIIqRm9OhWrvLJ7AJo+UGtkrQ/SBp3s9SNsDW+4\ndE8rASmEX6x5rwjG6UUC2IKfQCE74LoyFZVeSEQmF4EvHFURjN0w/9jwVmZd\nkJ/4z5HNXRx/Da7FkDD+zk1cfmLop3lEfgHNFzOEdNfWLiyg3eBV32zvbaHT\nldFOpRv2+TtYEkPoJzAm9POt8h/qkxocfAUWIBrO4jkVApcFTcrsyDdXXt/8\n99GMucrPjqfTMTtX+c/4P0hclFknPk4mutKFGgL0da2CRexzlwhapFrtZ8ux\n0iupGtYqf7/JAC0+NqKipTj8fxw8ge8UqFuS61Y+k3U9EuHA04btHE4Zs4N3\nCgFGYOvYm4flGy7xcvs5qEBKRc+QXRH2Rxtu/O8qgi6+nLzZ5ToJP8Z0SrP1\njhNb/McAAddMl3wQJ7GAl/+2kZC02x5yGR+dBprULlX/O9VKTbIY9/fW6jMV\njtry\r\n=FOyq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"gitHead":"d0bf6f40efd4a970004cd44cd886b6793fb418cc","scripts":{"test":"npm run format","format":"prettier --write \"./**/*.{js,jsx,md,html}\""},"_npmUser":{"name":"eduardoboucas","email":"mail@eduardoboucas.com"},"repository":{"url":"git+https://github.com/stackbithq/sourcebit-target-hugo.git","type":"git"},"_npmVersion":"6.9.0","description":"A Sourcebit plugin for Hugo","directories":{},"lint-staged":{"*.{js,jsx,md,html}":["npm run format","git add"]},"_nodeVersion":"10.16.3","dependencies":{"@sindresorhus/slugify":"^0.9.1","inquirer-table-prompt":"^0.2.1"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.2.0","prettier":"^1.19.1","lint-staged":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sourcebit-target-hugo_0.1.1_1582211389966_0.7087329897009882","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"sourcebit-target-hugo","version":"0.2.0","keywords":["headless","headless-cms","jamstack","ssg","jekyll"],"author":{"name":"Stackbit"},"license":"MIT","_id":"sourcebit-target-hugo@0.2.0","maintainers":[{"name":"eduardoboucas","email":"mail@eduardoboucas.com"}],"homepage":"https://github.com/stackbithq/sourcebit-target-hugo#readme","bugs":{"url":"https://github.com/stackbithq/sourcebit-target-hugo/issues"},"dist":{"shasum":"d9a7c25d075fe757da9783c2d5486051c091d603","tarball":"https://registry.npmjs.org/sourcebit-target-hugo/-/sourcebit-target-hugo-0.2.0.tgz","fileCount":7,"integrity":"sha512-CmaQznWJL52isz2Ws3b/6APTbNwaGWM2xsZaDK+6XkMD+PhEVjiTh4OYrYS16OZymAexU1r9vkEh4wEPbwDAzQ==","signatures":[{"sig":"MEUCIQDcIca3i4Y/5rIFDuI8TLezJNBZNqlGj99tfNFgVTSSjAIgXBIwRFPGEjaDYcByTGKGZIYr+1Un8lQEQ2E/Kv5O76U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeT80WCRA9TVsSAnZWagAAoHMP/j95uMC0+tK/rUpxO0db\nCTnl5e9Tm8YUa1FKc3JK2XsJWsPkc2NjqR7UWsazRDJfI5HNx4O4bBSEtRGB\n+y/WhJ8YOQm7Kr74h7xoUgUhIayNBfE6kurcWgM6DfJNk+/mOKEg/jX3jJuT\nyq0su4ZUXFnc0HVbPDhRPGHrvIAMN39cp9qxt3nm8Lq7QqJNkgy0AugkA0vW\n70eT/kvgCHZX4drHnYhf3EMQQJoyTxvNtqPg/Al1mYiDA0Zsa4fkvizfqGB4\nXyBCkF2JOFXq/3yRtfjG9Dlg7BvyBDjqndiB6oQBYN9EJldpDCBhJxxQ0htz\nqKn4dKhEg0idKCHyL/PNRQzXbted5uAmbcy7WFAJEVmYenLbNcFiSEgl/9EU\nVWja50zWGH2GsW9RN7k6vPy4ThEKlMcgJQxwl+JDf+Cw4SOqsvFoe6AjTzCv\nZEePT43jWG6pDD3Vt13sB8phSP9TlpWpU4nD0iZ+gOIoiLev8U3yyk4+Sxot\nbEiHTWWcbrPcX9hMtteALPbVK8dFNDBeBX5c3vVGQBQYUt0rduD8YeNgwp33\nUl7erWO9wTGy4PjNQ5O7OxvAhKlBQawHeRYo6p4/yr4xJBNe6vly6Nxov09Y\nmcghxiJCArKjcEtvV1Fiw+TM3anMP7fTL4/7KQ4dD2l+YmsrJ2t3Kfqf2JRr\nWrz9\r\n=hx5F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"gitHead":"2ceafcb4f61308e09e046d12629c456721262234","scripts":{"test":"npm run format","format":"prettier --write \"./**/*.{js,jsx,md,html}\""},"_npmUser":{"name":"eduardoboucas","email":"mail@eduardoboucas.com"},"repository":{"url":"git+https://github.com/stackbithq/sourcebit-target-hugo.git","type":"git"},"_npmVersion":"6.9.0","description":"A Sourcebit plugin for Hugo","directories":{},"lint-staged":{"*.{js,jsx,md,html}":["npm run format","git add"]},"_nodeVersion":"10.16.3","dependencies":{"@sindresorhus/slugify":"^0.9.1","inquirer-table-prompt":"^0.2.1"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.2.0","prettier":"^1.19.1","lint-staged":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sourcebit-target-hugo_0.2.0_1582288150309_0.940443273656302","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"sourcebit-target-hugo","version":"0.2.1","keywords":["headless","headless-cms","jamstack","ssg","jekyll"],"author":{"name":"Stackbit"},"license":"MIT","_id":"sourcebit-target-hugo@0.2.1","maintainers":[{"name":"eduardoboucas","email":"mail@eduardoboucas.com"}],"homepage":"https://github.com/stackbithq/sourcebit-target-hugo#readme","bugs":{"url":"https://github.com/stackbithq/sourcebit-target-hugo/issues"},"dist":{"shasum":"62b27bb894b6dba32925b0ca9d1a23601b1196d4","tarball":"https://registry.npmjs.org/sourcebit-target-hugo/-/sourcebit-target-hugo-0.2.1.tgz","fileCount":7,"integrity":"sha512-VWC4hHWi5JVR4M81CjrAUEuRRX+DNHNOWQuqUxhvo+D+gw416w3Obs2u+1u6ca4pUH+MjCYAALs4ch88zS/N2w==","signatures":[{"sig":"MEUCIQCgnP82webi5JBZXId9re5yyxGjCvhEOzvExt51MC34PgIgdEVbPdv/9nNfccFX3EwWcbXlILO82kLAwRcp8FutfYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26490,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedI4hCRA9TVsSAnZWagAA7MoP/2MsQgsb1e+5AcAyk0Ef\n34KJyhA3mqnS1BPsrAYNmnk9TjEU3M2Qqm/LymrJBjXjIJggyJwYm39VLUPd\n1h+qtH6CKMBkkH3EFscmiXw7OW0I17qSjzlasUWcRixsSqI4W36+Z2WkMw1/\ndFXOHhFVDKZcH3iPXrdVISqSp0QjCafygJlMbc7GC3J/BBAbem2/q8e9WuDX\nD3TR0aI6T+CkuQKv/Pfe8zKAgIJQTytMKBXal8+j6DAdlHQUSMk5zhDxGDzR\n5CEt4NgCtTdkdlT648qsbpwiP6UhMiXuJHKzCZO08i3zQOgF0aqh5CsNoZsn\n7DqgFHr8M354KbBIz77/MD1GMkYTnqdrztv3Y+5DltX1XS7qoPa/n/QCS5uH\no+ZpEmE5pbOCQntBhfcifBCtyzzWL04p8nBniaX6nGL+QI1gVz94yMVtjs8J\nr+lNdgL2tzKXh+Lsw978SZ7tKd1gman9f1CM4QsnqlGsMVCNmz0CzEjDix+W\nyKJCizhKEFyNtTZcyx3XjcU5E2P0nie5zjxeIFGnFV7QEe0vGQhPQumZDf8x\nFoVtuLnULYtwC08CUyPyC4VkebQ/4d/k0wZgYbqUmisHaHNMXmdNxAC5OD5F\nHiBjMURo1IGcdScgUhEmAEaTLLJgpnM07bTsK9tLawwZNW5gph7vIGeCR/oW\nMqsl\r\n=8fia\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"gitHead":"2f896e63c7f0850e9dc9d65e776da420e8b12462","scripts":{"test":"npm run format","format":"prettier --write \"./**/*.{js,jsx,md,html}\""},"_npmUser":{"name":"eduardoboucas","email":"mail@eduardoboucas.com"},"repository":{"url":"git+https://github.com/stackbithq/sourcebit-target-hugo.git","type":"git"},"_npmVersion":"6.9.0","description":"A Sourcebit plugin for Hugo","directories":{},"lint-staged":{"*.{js,jsx,md,html}":["npm run format","git add"]},"_nodeVersion":"10.16.3","dependencies":{"@sindresorhus/slugify":"^0.9.1","inquirer-table-prompt":"^0.2.1"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.2.0","prettier":"^1.19.1","lint-staged":"^9.5.0"},"_npmOperationalInternal":{"tmp":"tmp/sourcebit-target-hugo_0.2.1_1584696864987_0.49847555092326323","host":"s3://npm-registry-packages"}}},"time":{"created":"2020-02-12T10:45:02.461Z","modified":"2025-12-19T16:50:19.619Z","0.1.0":"2020-02-12T10:45:02.603Z","0.1.1":"2020-02-20T15:09:50.142Z","0.2.0":"2020-02-21T12:29:10.418Z","0.2.1":"2020-03-20T09:34:25.183Z"},"bugs":{"url":"https://github.com/stackbithq/sourcebit-target-hugo/issues"},"author":{"name":"Stackbit"},"license":"MIT","homepage":"https://github.com/stackbithq/sourcebit-target-hugo#readme","keywords":["headless","headless-cms","jamstack","ssg","jekyll"],"repository":{"url":"git+https://github.com/stackbithq/sourcebit-target-hugo.git","type":"git"},"description":"A Sourcebit plugin for Hugo","maintainers":[{"email":"david@stackbit.com","name":"berdav"},{"email":"admin@stackbit.com","name":"stackbit-admin"},{"email":"youval.vaknin@gmail.com","name":"youvalv"},{"email":"vit@ribachenko.com","name":"vitaliyr"},{"email":"bot@netlify.com","name":"netlify-bot"},{"email":"semenh@gmail.com","name":"smnh"}],"readme":"# sourcebit-target-hugo\n\n[![npm version](https://badge.fury.io/js/sourcebit-target-hugo.svg)](https://badge.fury.io/js/sourcebit-target-hugo)\n\n> A Sourcebit plugin for the [Hugo](https://gohugo.io/) static site generator\n\n## 👩‍🏫 Introduction\n\nThis plugin writes content from any Sourcebit data source into files compatible with the Jekyll static site generator.\n\n## 🏗 Installation\n\nTo install the plugin and add it to your project, run:\n\n```\nnpm install sourcebit-target-hugo --save\n```\n\n> 💡 You don't need to run this command if you start Sourcebit using the [interactive setup process](#%EF%B8%8F-interactive-setup-process), as the CLI will install the plugin for you and add it as a dependency to your project.\n\n## ⚙️ Configuration\n\nThe plugin accepts the following configuration parameters. They can be supplied in any of the following ways:\n\n- In the `options` object of the plugin configuration block inside `sourcebit.js`, with the value of the _Property_ column as a key;\n- As an environment variable named after the _Env variable_ column, when running the `sourcebit fetch` command;\n- As part of a `.env` file, with the value of the _Env variable_ column separated by the value with an equals sign (e.g. `MY_VARIABLE=my-value`);\n- As a CLI parameter, when running the `sourcebit fetch` command, using the value of the _Parameter_ column as the name of the parameter (e.g. `sourcebit fetch --my-parameter`).\n\n| Property           | Type     | Visibility | Default value | Env variable | Parameter | Description                                                                                                                                                                                                                                                   |\n| ------------------ | -------- | ---------- | ------------- | ------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `fullAssetObjects` | Boolean  | Public     | `false`       |              |           | By default, values of fields that reference assets will be written as a string containing just the asset URL. To get a full [asset object](https://github.com/stackbithq/sourcebit/wiki/Data-normalization#assets) instead, set `fullAssetObjects` to `true`. |\n| `writeFile`        | Function | Public     |               |              |           | A function that computes the files to be created, as well as their location, format and contents (see below for more details).                                                                                                                                |\n\nThe `writeFile` function is invoked on each entry from the `objects` data bucket, with the following parameters:\n\n- `entry` (Object): An entry from the `objects` data bucket\n- `utils` (Object): An object containing utility methods:\n  - `slugify` (Function): Creates a filename-friendly version of any string (e.g. `utils.slugify('Hello, Sourcebit friends!') === 'hello-sourcebit-friends'`)\n\nThe return value of this function determines whether the entry being evaluated will be written to a file and, if so, defines the path, the format and the contents of the file.\n\nTo write a file for an entry, the return value should be an object with a `content`, `format` and `path` properties. The nature of these properties may vary slightly based on the value of `format`, as shown in the table below.\n\n| `format`         | `content`                                                                                                                               | `path`                                                         | Description                                     |\n| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ----------------------------------------------- |\n| `frontmatter-md` | Object containing a `frontmatter` and `body` properties, which will be written to the file's frontmatter and content body, respectively | The absolute path to the file. Must end with `.md`.            | Writes a Markdown file with a YAML frontmatter. |\n| `yml`            | Object to be written as YAML                                                                                                            | The absolute path to the file. Must end with `.yaml` or `.yml` | Writes a YAML file.                             |\n| `json`           | Object to be written as JSON                                                                                                            | The absolute path to the file. Must end with `.json`.          | Writes a JSON file                              |\n\n> 💡 If you wish to create multiple files for an entry, set the return value to an array of objects, each containing a `content`, `format` and `path` properties.\n\n### 👀 Example configuration\n\n_sourcebit.js_\n\n```js\nmodule.exports = {\n  plugins: [\n    {\n      module: require(\"sourcebit-target-hugo\"),\n      options: {\n        writeFile: function(entry, utils) {\n          const { __metadata: meta, ...fields } = entry;\n\n          if (!meta) return;\n\n          const { createdAt = \"\", modelName, projectId, source } = meta;\n\n          if (\n            modelName === \"post\" &&\n            projectId === \"123456789\" &&\n            source === \"sourcebit-source-contentful\"\n          ) {\n            const { __metadata, content, layout, ...frontmatterFields } = entry;\n\n            return {\n              content: {\n                body: fields[\"content\"],\n                frontmatter: { ...frontmatterFields, layout: fields[\"layout\"] }\n              },\n              format: \"frontmatter-md\",\n              path:\n                \"content/posts/\" +\n                createdAt.substring(0, 10) +\n                \"-\" +\n                utils.slugify(fields[\"title\"]) +\n                \".md\"\n            };\n          }\n        }\n      }\n    }\n  ]\n};\n```\n\n### 🧞‍♂️ Interactive setup process\n\nThis plugin offers an interactive setup process via the `npx create-sourcebit` command. It asks users to categorize each of the content models present in the `models` data bucket as a page or data object. For each model selected, the user is asked to define the location and the source of different frontmatter values.\n\n## 📥 Input\n\nThis plugin expects the following data buckets to exist:\n\n- `models`: An array of content models\n- `objects`: An array of content entries\n\n## 📤 Output\n\nThis plugin creates files on disk, in locations and with formats defined by the `writeFile` function.\n","readmeFilename":"README.md"}