{"id":15606343,"url":"https://github.com/tb/netlify-cms-reader","last_synced_at":"2026-01-08T02:07:14.439Z","repository":{"id":38279004,"uuid":"183964958","full_name":"tb/netlify-cms-reader","owner":"tb","description":"Read NetlifyCMS config and data","archived":false,"fork":false,"pushed_at":"2023-03-04T03:39:00.000Z","size":833,"stargazers_count":0,"open_issues_count":12,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-04T14:49:25.858Z","etag":null,"topics":["gatsby","gatsby-plugin","markdown","netlify-cms","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-28T22:23:41.000Z","updated_at":"2020-12-14T17:28:39.000Z","dependencies_parsed_at":"2024-12-09T19:42:22.423Z","dependency_job_id":"8dea5978-440c-4b09-9cc1-1edd1acfe028","html_url":"https://github.com/tb/netlify-cms-reader","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tb%2Fnetlify-cms-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tb%2Fnetlify-cms-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tb%2Fnetlify-cms-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tb%2Fnetlify-cms-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tb","download_url":"https://codeload.github.com/tb/netlify-cms-reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246193255,"owners_count":20738452,"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":["gatsby","gatsby-plugin","markdown","netlify-cms","yaml"],"created_at":"2024-10-03T04:22:03.273Z","updated_at":"2026-01-08T02:07:14.414Z","avatar_url":"https://github.com/tb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Netlify CMS Reader\n\nRead NetlifyCMS config and data.\n\n## Basic usage\n\n```js\nconst { getConfig, getData } = require('netlify-cms-reader')\n\nconst data = await getData(getConfig('static/admin/config.yml'))\n```\n\n### Filtered Folder Collections\n\n*Note: For filtered folder collections in `Netlify CMS`, see:\n[Filtered folder collections](https://www.netlifycms.org/docs/collection-types/#filtered-folder-collections)*\n\nIf a folder collection is filtered, then that collection is returned\nby applying the criteria configured in its `filter` property.\n\nAs the supported types for the filter value is *not* documented,\nthis implementation accepts all possible types, so a filter\nwith the setting `{field: tags, value: ['latest', 'most popular']}`\n*is handled,* despite the fact that the UI of `Netlify CMS` (at least\nwith version `2.10.48`) does *not handle* it despite configuration\nfor it *is accepted*.\n\n\n### Collections with Sortable Fields\n\n*Note: For collections with sortable fields in `Netlify CMS`, see\n[Sortable fields](https://www.netlifycms.org/docs/configuration-options/#sortable_fields)*\n\nIf a folder collection has a `sortableFields` setting, then that\ncollection is returned by sorting it in increasing order based on\n*the first element* in the `sortableFields` array.\n\nE.g. if a collection have a `sortableFields` setting such as `['latest', 'most popular']` then the collection will be returned with the items sorted by the\nvalues of their `latest` field in increasing order.\n\n\n\n## Usage with GatsbyJS\n\n```js\n\nconst path = require('path')\nconst { getConfig, getData } = require('netlify-cms-reader')\n\nexports.createPages = async ({ actions, graphql }) =\u003e {\n  const { createPage } = actions\n\n  const { pages } = await getData(getConfig('static/admin/config.yml'))\n\n  pages.forEach(page =\u003e {\n    createPage({\n      path: page.path,\n      component: path.resolve('src/templates/page.js'),\n      context: { page },\n    })\n  })\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftb%2Fnetlify-cms-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftb%2Fnetlify-cms-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftb%2Fnetlify-cms-reader/lists"}