{"id":15459187,"url":"https://github.com/dsferruzza/contentful2md","last_synced_at":"2025-04-10T04:15:12.402Z","repository":{"id":57206479,"uuid":"154688393","full_name":"dsferruzza/contentful2md","owner":"dsferruzza","description":"Fetch entries from a Contentful space and write them as Markdown files","archived":false,"fork":false,"pushed_at":"2021-04-23T11:00:58.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T19:32:37.263Z","etag":null,"topics":["contentful","jekyll","markdown","yaml"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsferruzza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-25T14:47:19.000Z","updated_at":"2023-08-30T05:15:31.000Z","dependencies_parsed_at":"2022-09-04T03:23:19.770Z","dependency_job_id":null,"html_url":"https://github.com/dsferruzza/contentful2md","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsferruzza%2Fcontentful2md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsferruzza%2Fcontentful2md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsferruzza%2Fcontentful2md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsferruzza%2Fcontentful2md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsferruzza","download_url":"https://codeload.github.com/dsferruzza/contentful2md/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247974714,"owners_count":21026742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contentful","jekyll","markdown","yaml"],"created_at":"2024-10-01T23:05:19.958Z","updated_at":"2025-04-10T04:15:12.295Z","avatar_url":"https://github.com/dsferruzza.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# contentful2md\n\n[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![npm](https://img.shields.io/npm/v/contentful2md.svg)](https://www.npmjs.com/package/contentful2md)\n[![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/dsferruzza?utm_source=github\u0026utm_medium=button\u0026utm_term=dsferruzza\u0026utm_campaign=github)\n\nFetch entries from a [Contentful](https://www.contentful.com/) space and write them as Markdown files.\n\n## Motivation\n\n\u003e Use Contentful as a GUI to edit content for a static website made with [Jekyll](https://jekyllrb.com/).\n\n**contentful2md** can help you if you are in the following context:\n\n- you have a static website, built by _developers_ using [Jekyll](https://jekyllrb.com/)\n- you want to enable _writers_ to edit some of the website content (for example: a blog)\n\nIn this situation, it is common to use a dynamic Content Management System (like WordPress, for example) to build the website because it provides a GUI and _writers_ find it easy to use.\n\nThough, we believe that in many cases static websites are a more suitable solution than dynamic CMS: they are very easy to host, easier to customize, faster and more secure.\n\nTo allow _writers_ to focus on **writing** and not on installing and keeping up-to-date the development environment, we provide a solution that makes it very easy to use the nice GUI of Contentful to write content that will end up in a Jekyll website.\n\n## The Solution\n\n### Development\n\n_Mostly at the beginning of the project:_\n\n- A space is created on [Contentful](https://www.contentful.com/)\n- _Developers_ configure one or several **content types** to define a model of the content that needs to be edited by _writers_, and create example content (that remains unpublished on Contentful)\n- _Developers_ create a [Jekyll](https://jekyllrb.com/) project and develop the website they want\n- _Developers_ use **contentful2md** to fetch the **preview API** of Contentful so that they can develop and test the parts of the website that display content from Contentful\n\n### Writing\n\n_On a regular basis:_\n\n- _Writers_ use Contentful to add or edit content, using the content types defined previously\n- _Writers_ or _developers_ use a CI/CD system (such as GitLab CI) to:\n  - fetch content from Contentful (using **contentful2md**)\n  - build the website (using Jekyll)\n  - deploy it\n\n## Usage\n\nIn your Jekyll project:\n\n- install via npm: `npm install contentful2md`\n- add the following script in `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"contentful2md\": \"contentful2md\"\n  }\n}\n```\n\n- configure using environment variables (see next section)\n- run: `npm run contentful2md`\n\n### Configuration\n\nConfiguration is done using environment variables.\nThe following variables can/must be configured:\n\n| Name | Default Value | Description |\n|---|---|---|\n| `CONTENTFUL_SPACE` |  | Space ID, as given by Contentful. |\n| `CONTENTFUL_ACCESS_TOKEN` |  | Access token, as given by Contentful. Depending on the value of `CONTENTFUL_PREVIEW`, this should be the _Content Delivery API_ or the _Content Preview API_. |\n| `CONTENTFUL_PREVIEW` | `false` | If the value if `true`, use the _Preview API_. Else use the _Delivery API_. |\n| `CONTENTFUL_CONTENT_TYPE_ID` |  | The ID of the _Content Type_ you want to fetch, as you defined in the _Content Model_ of your space on Contentful. |\n| `CONTENTFUL_LOCALE` |  | The locale to fetch. For example: `fr-FR`. |\n| `CONTENTFUL_CONTENT_FIELD` | `content` | The field of your _Content Type_ that should be considered as the main content and put in the body of the Markdown file. |\n| `CONTENTFUL_SLUG_FIELD` | `slug` | The field of your _Content Type_ that correspond to the URL your content should take. It will be used to name the Markdown file, so **it must be unique**. |\n| `OUTPUT_DIR` |  | The path to a directory where Markdown files should be created. If the directory does not exist, it will be created. If it exists, its files might be overridden. |\n\n**Every variable must be defined**, except those which have a default value.\n\nThere are several ways to define them (which can be mixed):\n- in your environment (Continous Integration often allow that)\n- in a shell script:\n\n```bash\nexport CONTENTFUL_SPACE=\"...\"\n# ...\n\nnpm run contentful2md\n```\n\n- directly in the command line: `CONTENTFUL_SPACE=\"...\" npm run contentful2md`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsferruzza%2Fcontentful2md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsferruzza%2Fcontentful2md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsferruzza%2Fcontentful2md/lists"}