gatsby-advanced-starter | gatsby-advanced-starter for creating blog | Blog library
kandi X-RAY | gatsby-advanced-starter Summary
kandi X-RAY | gatsby-advanced-starter Summary
gatsby-advanced-starter for creating blog
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gatsby-advanced-starter
gatsby-advanced-starter Key Features
gatsby-advanced-starter Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-advanced-starter
QUESTION
Trying to learn Gatsby I'm confused what I'm doing wrong when it comes to building a paginated page for a category. If a post has a category created from the frontmatter of:
...ANSWER
Answered 2021-Mar-12 at 06:06There are a few things that may cause issues:
Your
templates/category
component must be capitalized:
QUESTION
I have a basic blog setup with Gatsby and at the time of posting this question there lacks good documentation for SEO components. There are examples of basic SEO components but what I am wanting is a little more in-depth. Maybe, if a solution is reached here it could be contributed to the Gatsby docs for others to benefit.
On top of the usual title and description meta tags and the facebook/twitter open graph meta (which I have done already), I want to add structured data for rich snippets which will vary depending on what the blog post type is. For example, I might have a regular post which would print Article schema, some posts might be How-to, in which case I'd like to print HowTo schema instead of Article. At some point I might write a post with would suit FAQ schema.
I don't know if this is the best approach but here's what I'm thinking:
1. In frontmatter set the schema type I want to true, leave the rest false.I am also thinking of storing the schema data in the frontmatter but as this data is quite complex and will vary from post type to post type (Article, HowTo etc.) I'm not sure if this is yet a good idea?
...ANSWER
Answered 2019-Nov-22 at 05:53In frontmatter:
QUESTION
Is it possible to use Gatsby to generate static sites that can be viewed with Javascript disabled in the browser?
I heard that Gatsby sites could be accessed in this way but I've tried various Gatsby starters including gatsby-starter-default and gatsby-advanced-starter and all of them will only show the index page when Javascript is disabled. Link clicks return white screens.
I'm just looking for some graceful degradation here - I only need the basic pages and images to render, nothing more.
...ANSWER
Answered 2019-Feb-08 at 15:45Gatsby is generating critical portions of the app that are shown on page load and then "hydrates" the page with React, meaning that it first shows critical HTML and CSS and only after that load dynamic parts of the site. So if you use some additional react components which could not be prerendered they will not work but the site as a whole should work.
If you are using service workers and disabled JS from devtools than it could be a cache issue. Try to disable javascript from the browser preferences and run the website from the incognito window without devtools open. GatsbyJS based website should work.
But, your website will be faster and use less data with PWA and service workers enabled, which do need javascript.
QUESTION
It looks as though if you put your jsx files in the 'pages' folder of most gatsby starters, the urls follow the directory structure out of the box, so you can implement whatever urls you need (http://blah.com/foo/post1, http://blah.com/bar/post2) just by nesting folders in the source tree (pages/foo/post.jsx
, pages/bar/post2.jsx
).
I used the gatsby advanced starter (https://github.com/Vagr9K/gatsby-advanced-starter). It puts all content files not in pages/
, but in a top-level content/
folder and I can't figure out the wiring to replicate foo/xxx, bar/xxx urls even after creating content/foo/post1.md
, content/bar/post2.md
folders.
It does have a siteconfig.js that sets a single path prefix, but I want two different prefixes for the 2 different sections of the site, so I just set it to "/" for now (builds seem to ignore whatever value I set for this config param anyway, so... shrug).
What I tried- I tried adding
path
to the frontmatter of the .md files and set it to the parent foldername. This was completely ignored (in any case I don't think that's what I want... I'd like to keep the generated slug as part of the url). - Separated use of
gatsby-source-filesystem
one for each subfolder hoping it would change graphql graph to recognize 2 separate data sources but it made no difference.
What am I doing wrong?
...ANSWER
Answered 2018-Sep-27 at 13:35It looks as though if you put your jsx files in the 'pages' folder of most gatsby starters, the urls follow the directory structure out of the box [...]
That's not specific to Gatsby starters, that's Gatsby's default behaviour. Every js/jsx file in src/pages
will be a page.
but in a top-level
content/
folder
It still has the src/pages
folder for normal pages. But the content
folder holds the files will be transformed with the src/templates
in gatsby-node.js
to pages. Or in other words: The contents of the content
folder get programmatically created with the defined template in gatsby-node.js
(and the template lies in src/templates
).
The path/url get's defined in the createPage
function here: gatsby-nodeL144. This line is referencing the edge.node.fields.slug
which gets queried in the GraphQL above here. The field gets added in the onCreateNode function. More specificially the slug
field in the onCreateNodeField function. There you see that it gets passed a slug
that gets defined above.
Create two folders in your src/content
folder, e.g. blog
and projects
. Make sure that you have both of them defined in your gatsby-config.js
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-advanced-starter
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