netlify-cms | A Git-based CMS for Static Site Generators | Content Management System library
kandi X-RAY | netlify-cms Summary
kandi X-RAY | netlify-cms Summary
A CMS for static site generators. Give users a simple way to edit and add content to any site built with a static site generator.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a list plugin for ListItem .
- Generate schema for documentRules .
- Returns a config object with default schema .
- Convert a Slate Raw node to a Slate node .
- Reduce newly created state .
- Creates and commands that can be used in the commands .
- The layout page .
- Replaces a substring with the given text .
- Converts a raw plain text node to its equivalent representation .
- Validate user fields
netlify-cms Key Features
netlify-cms Examples and Code Snippets
Community Discussions
Trending Discussions on netlify-cms
QUESTION
I'm trying to get a single line of anything from passed by props to render.
If nothing is passed or needed, then the MDX render outs. If props are passed and tried to be used, failure.
The only thing left on this site is getting MDX to actually render on build.
Running [Gatsby Dev] works, and the MDX file renders can use all props passed to it. Any attempt to [Gatsby Build] and it fails saying that it can't read undefined.
I've tried wrapping the render in a MDX provider, in a conditional statement that checks for the specific props first, but nothing works. Gatsby Build pretends like there are no props being passed at all.
POST TEMPLATE
...ANSWER
Answered 2022-Mar-22 at 10:25try adding this line:
QUESTION
I have spent three hours trying to debug this Gatsby build error.
It says to use a non-minified command, but gatsby develop
doesn't throw any error so I'm a bit unsure on how to debug this.
Looking online reveals very little for the /styles/
folder.
My Netlify server also throws the same error as well as failing locally on Mac.
Any suggestions on where to start?
...ANSWER
Answered 2022-Feb-03 at 12:47After having access to the repo (which runs on Gatsby) I found that /styles/
folder when searched was inside the /public/
folder which is generated by gatsby, this pointed me to the same error that referenced the chunk error "componentChunkName": "component---src-pages-styles-js"
, I then searched for this file which existed in the .cache
, this file showed me the error was coming from @emotion trying to compile the src/pages/styles.js
file that is used by index-old.js
.
It seemed that Gatsby was interpreting /src/pages/styles.js
as a normal static page to build, but because it is returning a function that returned emotion JSX it couldn't build properly as Gatsby expects all .js
files to return React JSX code.
It turned out in this project, these files wasn't actually used anymore so simply deleting them fixed the issue. If it was used though, simply having styles.js somewhere other than the /src/pages
folder would fix this. I'd recommend having a views
folder where you store all pages and styling relative to it to avoid Gatsby trying to compile pages from styling.
QUESTION
I'm very new Gatsbyjs user. Currently I use this template
https://www.gatsbyjs.com/starters/netlify-templates/gatsby-starter-netlify-cms
My nodejs version is v16.13.2
I could "gatsby develop" but I think when I'm adjusting photo data in "page-data.json" which stored public\page-data\index I "gatsby develop" won't start
I'm not sure what is cause but I'm sure when I add some image data into public\img and changed lines "coffee.png" in "page-data.json" this happened...
Here is error message. Could someone teach me what part should I fix please ?
...ANSWER
Answered 2022-Feb-01 at 08:54I could "gatsby develop" but I think when I'm adjusting photo data in "page-data.json" which stored public\page-data\index I "gatsby develop" won't start
You should never edit manually the content or the code inside the /public
folder directly. Keep in mind how Gatsby works: when you run gatsby develop
or gatsby build
, webpack compiles and bundles everything under /src
folder to create the /public
one: this is autogenerated and it is rebuilt when you change anything on your /src
folder. If you change anything inside the public folder manually without changing the source, it will be lost in the next compilation because the source doesn't includes the changes. So, all changes must be done in the /src
folder.
In this case, the error is rising because you changed the public folder directly so the references of the assets page-data.json
have changed.
To change the coffee.png
image, you need to change the static folder. The static folder is a "special" folder that is cloned inside the public folder keeping the exact internal structure. As the name suggests, is very useful to use for static assets (the ones that rarely change).
Once you change the coffe.png
image for your desired one, you just need to change the references of coffee.png
to the new one (unless they are called the same).
That said, this kind of static change may force you to reload the gatsby develop
(stop and rerun) process to see the changes. If the image still without changing, clean the cache by running gatsby clean
before rerunning the gatsby develop
command.
QUESTION
We are using netlify-cms that unfortunately emits code that break CONTENT-SECURITY-POLICY 'unsafe-eval'
.
I have tried adding nonce
attributes to all the script tags using nginx sub_filter
:
ANSWER
Answered 2021-Dec-02 at 20:48By using 'nonce-value'
you can get rid of 'unsafe-inline'
only, but not of 'unsafe-eval'
.
'unsafe-eval'
in Netlify is required to compile JSON to JS code, but you can get rid of 'unsafe-eval'
too. Just update ajv-json-loader
to use AJV 7 and Standalone mode and configure webpack config to use the updated loader. See nitty-gritty here.
QUESTION
since today I am facing a problem and I don't know how I can solve it. I am kind of new in terms of React and Gatsby. What happened, currently I am working on a Website that runs with a Netlify CMS. In the last few days, everything just worked fine, but since today there is something strange going on. I am getting the following errormessage:
...ANSWER
Answered 2021-Jul-28 at 12:19This issue can have multiple solutions depending on what's causing it. Normally, what usually happens is that Gatsby can't create the thumbnail
node because has an unrelated type (String) where it should be an image node because the relativity between parent-children nodes is lost somehow.
Potential solutions:
Run
gatsby clean
: cleans the cache. Then,gatsby develop
the project again.Check the
media_folder
andpublic_folder
in yourconfig.yml
: in your case, to me, they both looks good.Use
gatsby-remark-relative-images-v2
plugin: Netlify CMS doesn't fully support relative paths (yet) so in the meantime, you may need the help of that plugin. This is because the image is outside the node folder.After installing it. Just add it as an option of the
QUESTION
this is my first question in stackoverflow, any advice on how to ask a well structured question will be welcomed.
So, I have a TimescaleDB database, which is time-series databases built over Postgres. It has most of its functionalities, so if any of you don't know about Timescale it won't be an issue. I have a select statement which returns:
...ANSWER
Answered 2021-May-11 at 07:49You could use a so-called "gaps-and-islands" approach
QUESTION
Hello i'm building a blog using Gatsby and Netlify CMS. I started off from the gatsby-starter-netlify-cms template.
I have the /blog
page where i currently display all posts and also a list of all the tags.
When user clicks on a tag, it is currently redirected to the tags/name-of-tag
page, where a list of all posts tagged like that is displayed.
What i want instead is to directly filter the list on the /blog
page.
This way i'll have only one page to display and filter blog posts by tag (and possibly by term search).
So the tag links should redirect to /blog?tag-name
or something like that.
I'm not sure how to tell Gatsby to create a single page with possibility to inject a filter
value in order to pass it to the page query..
This is how /tags/
pages are created currently:
ANSWER
Answered 2021-Feb-16 at 09:28I'm not sure how to tell Gatsby to create a single page with possibility to inject a
filter
value in order to pass it to the page query.
You can't. The only way to filter data in a page query is by passing data using the context. Like you are doing in with the tags page:
QUESTION
I am building a static website with Gatsby and Netlify CMS. The website is hosted on Netlify as well. I have a blog section and I generate a page per article from a markdown file. I have the following warning during build "query takes too long" for every article page I generate. The site builds eventually but the build time gets longer and longer the more pages I am generating so I'm afraid it will become too long when I start having too many articles in my site.
I am generating a page for each markdown file that is being created by netlify CMS.
Would you mind looking and the code I have in the gatsby-node file and the query I am using in my blog template file to see if I'm doing anything wrong that would explain the build time warning message ?
Thanks
Here is my development environment
...ANSWER
Answered 2021-Feb-01 at 16:49Gatsby's team is actually working on reducing the build time by adding some "cache" features. You can follow the stack trace in their releases notes, they are still in beta testing (some of them are focused mainly on gatsby develop
.
If you want to try it them to check if it improves the build-develop time, you just need to upgrade Gatsby to the latest version (^2.28
) and:
QUESTION
So ive just setup the one-click installer of Gatsby with Netlify CMS.
Im trying to figure out how to implement a way to add staff members to the default contact page.
in jekyllrb there was a simple collection content defined in the _config.yml
that you could fetch data from.
is there a similar way to use "custom" data collections with Gatsby? i dont want a separate page for each staff-member, just a way to loop all members to display on page and integrate with Netlify-CMS so i can ADD/UPDATE/DELETE staff-member. (i guess i want to do it in a react component called or something similar
ive tried to add a data folder that i thought could hold a md file to fetch collections from. but im getting an error that the src/data/collection.md
file needs a template (e.g templateKey: product-page
)
ANSWER
Answered 2021-Jan-20 at 14:37there a similar way to use "custom" data collections with Gatsby?
Sure there is. Create a /static
folder at the root of your project (if you don't haven't it created yet). There create another /admin
folder and place a config.yml there. The final structure is: /static/admin/config.yml
.
Basically, the config.yml
file is where your collections and the CMS will be configured based on the broad documentation from Netlify. It also exposes a localhost:8000/admin
(or yourDomain.com/admin
on production) URL to log into your private CMS and perform the CRUD actions to your collections.
The case you are describing may look something like:
QUESTION
I deployed an app with netlify + gatsby default options and then I cloned that repo, so I can edit the style. The problem is that it doesn't work on my machine, the following error persists:
...ANSWER
Answered 2021-Jan-17 at 18:09According to some threads about that starter, there's a bug about the Sass loaders that causes this issue. You have many solutions provided in this GitHub thread:
Add options to the
gatsby-plugin-sass
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install netlify-cms
A Quick and easy install, that requires you to create a single HTML file and a configuration file. All the CMS JavaScript and CSS are loaded from a CDN. To learn more about this installation method, refer to the Quick Start Guide
A complete, more complex install, that gives you more flexibility but requires that you use a static site builder with a build system that supports npm packages.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page