{"id":18584293,"url":"https://github.com/brob/eleventy-plugin-sanity-data","last_synced_at":"2025-05-16T05:33:02.560Z","repository":{"id":54178198,"uuid":"344664343","full_name":"brob/eleventy-plugin-sanity-data","owner":"brob","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-15T11:38:05.000Z","size":201,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T16:51:58.026Z","etag":null,"topics":[],"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/brob.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":"2021-03-05T01:56:27.000Z","updated_at":"2021-03-05T14:40:43.000Z","dependencies_parsed_at":"2024-11-07T00:42:18.087Z","dependency_job_id":null,"html_url":"https://github.com/brob/eleventy-plugin-sanity-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brob%2Feleventy-plugin-sanity-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brob%2Feleventy-plugin-sanity-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brob%2Feleventy-plugin-sanity-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brob%2Feleventy-plugin-sanity-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brob","download_url":"https://codeload.github.com/brob/eleventy-plugin-sanity-data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254473755,"owners_count":22077162,"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":[],"created_at":"2024-11-07T00:27:01.757Z","updated_at":"2025-05-16T05:33:02.524Z","avatar_url":"https://github.com/brob.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 11ty Sanity Data Source\n\n*This currently only works in 11ty v1.0.0 (canary). It uses [addGlobalData](https://www.11ty.dev/docs/data-global-custom/) which allows for data plugins like this*\n\n## Installation\n\nInstall the NPM package\n\n```sh\nnpm install eleventy-plugin-sanity-data\n```\n\nAdd the plugin to your .eleventy.js config file. *Make sure you're running Eleventy v1.0.0+*\n\n```js\nmodule.exports = function(config) {\n    config.addPlugin(sanityData, {\n        projectId: 'YOUR_SANITY_PROJECT_ID'\n    });\n}\n```\n\nThis will return all the data from the project specified.\n\n## Configuration\n\nThere are configuration options you can use to return different sets of data, different projections, different datasets, and more.\n\n| property | type | description |\n| -------- | ---- | ----------- |\n| projectId | string | Your Sanity.io project ID |\n| cdn | boolean | Whether or not to use the Sanity CDN for data |\n| dataset | string | The dataset name for your Sanity data |\n| queries | array | *default returns allData variable with a query of `*[]`* An array of objects providing GROQ queries to return specific queries to specific variables. *Optional*. Each object requires a `varName` and `query` and has an optional `cacheDuration` to override global cache timing. `{ varName: 'NameForTemplate', query: '*[_type == 'something']'` |\n| globalCacheDuration | string | *default: 1d*. This is a time string that corresponds to [11ty asset cache plugin times](https://www.11ty.dev/docs/plugins/cache/#change-the-cache-duration). |\n\n\n\n## Caching\n\nBy default, the plugin will cache the data locally in a `.cache` directory in your project (using 11ty's Asset Cache plugin). It has a global cache timeout of `1d` but can be modified to shorter or longer periods with the `globalCacheDuration` config property or on a specific query with a query optional parameter `cacheDuration`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrob%2Feleventy-plugin-sanity-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrob%2Feleventy-plugin-sanity-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrob%2Feleventy-plugin-sanity-data/lists"}