
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@netlify/demo-restaurant-sites-data
Advanced tools
A Set of Netlify plugins to get data from different sources for an example restaurant site
This repo holds and documents data source plugins for a set of example sites.
In order to maximise the opportunity for re-use, each data source will present its data to the build in an agreed JSON structure. In this way, any SSG or framework will be able to present the content from any data source we add in future as long as it conforms to this spec.
Find each of these in this repo:
The following example sites which use these data sources are available. Each site is intended to be functionally identical but implemented with a variety of frameworks and data sources.
Contentful | Sanity | Airtable | |
---|---|---|---|
Nuxt | repo, demo | repo, demo | repo, demo |
Next | repo, demo | repo, demo | repo, demo |
11ty | repo, demo | repo, demo | repo, demo |
Astro | repo, demo | repo, demo | repo, demo |
These plugins are collected and packaged as an NPM package for convenience. Install and save to your site's config with:
npm install -s @netlify/demo-restaurant-sites-data`
Then specify in your site's netlify.toml
file which data source plugin you wish to use:
[[plugins]]
# package = "./node_modules/@netlify/demo-restaurant-sites-data/plugins/{PLUGIN_DIRECTORY}"
package = "./node_modules/@netlify/demo-restaurant-sites-data/plugins/contentful"
[plugins.inputs]
# Directory for the generated JSON data files to reside in
dataDir = "data"
Each Build Plugin provides a data abstraction to a different content source. When the build runs, the specified plugin will request the data from the content source and save it to the build cache ready for the SSG to use, according to the structure described below.
A set of menu items with descriptions and metadata
Resource location: /data/menu.json
[
{
"title": "Teetering Taco Tower",
"description": "A massive and frankly distressingly large tower of tacos with every filling you can imagine, and far more tacos than you need",
"price": INTEGER,
"currency": "$",
"active": BOOLEAN,
"category": [
STRING,
...
], // for grouping by "dinner", "breakfast", "sides", "drinks" etc
"dietary": {
"vegan": BOOLEAN,
"vegetarian": BOOLEAN,
"glutenFree": BOOLEAN
},
"photo:": {
"imageUrl": STRING,
"attribution": {
"text": STRING,
"url": STRING
}
}
},
...
]
General information about the restaurant
Resource location: /data/info.json
{
"name": "The DX Deli and Grill",
"strapline": "Too much of a good thing",
"contact": {
"streetAddress": [
STRING,
STRING,
...
],
"coords": {
"lat": STRING,
"long": STRING
},
"email": STRING,
"social": [
{
"channel": STRING,
"displayName": STRING,
"url": STRING
},
...
],
"phone": STRING
},
"hours": {
"Monday": {
"open": TIME,
"close": TIME,
},
"Tuesday": {
"open": TIME,
"close": TIME,
},
...
}
}
Testimonial content collected from happy patrons.
Resource location: /data/testimonials.json
[
{
"displayName": "Hungry Horace",
"date": TIMESTAMP,
"title": "Testimonial title",
"body": "Testimonial text which may contain markdown"
},
...
]
A set of image assets for display in a gallery page or section
Resource location: /data/gallery.json
[
{
"caption": "A tasty thing that you can eat here",
"imageUrl": STRING,
"attribution": {
"text": STRING,
"url": STRING
}
},
...
]
The pages data provides simple descriptive copy for display on any of the given pages.
Resource location: /data/pages.json
{
"home": {
"title": STRING,
"description": STRING,
"body": STRING, // markdown supported
"heroImage": {
"imageUrl": STRING,
"attribution": {
"text": STRING,
"url": STRING
}
}
},
"menu": {
...
},
...
}
TODO
/plugins
package.json
"demo-restaurant-sites-data": "file:../demo-restaurant-sites-data",
FAQs
A Set of Netlify plugins to get data from different sources for an example restaurant site
We found that @netlify/demo-restaurant-sites-data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.