Comments (8)
You need to pass in a slug
value for this plugin to work.
In your case, you can simply rename it as so:
slug: uid
or
slug:path
This should do the job. I will update the Readme to make sure, this is mentioned. Thanks for pointing it out!
from gatsby-plugin-advanced-sitemap.
Looks like it's an issue with
var slug = source === "allMarkdownRemark" || source === "allMdx" ? node.fields.slug.replace(/^\/|\/$/, "") : node.slug.replace(/^\/|\/$/, "");
I don't have slug in my query
from gatsby-plugin-advanced-sitemap.
How do we get round the issue of having sub elements?
allImageSharp { edges { node { id original { src } } } }
I'm trying to retrieve all images throughout the site. I can obviously alias original as
slug:original
but then the code will error as it's looking for node.slug.replace
from gatsby-plugin-advanced-sitemap.
HI, I can do this for other queries but for images it's another sub level
THis works
allSitePage {
edges {
node {
id
slug: path
}
}
}
but for images the query is
allImageSharp {
edges {
node {
fluid {
slug: src
}
}
}
}
or
allImageSharp {
edges {
node {
slug: fluid{
src
}
}
}
}
which means it's still an extra level
from gatsby-plugin-advanced-sitemap.
. I was under the impression the slug had to be the URL of the image or resource?
from gatsby-plugin-advanced-sitemap.
I've got a bit further with it by detecting allImageSharp query
var slug = source === "allMarkdownRemark" || source === "allMdx" || source === "allImageSharp" ? node.fluid.slug.replace(/^\/|\/$/, "")
which seems to generating the xml now but the buikld breaks
rror: TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
- gatsby-node.js:275
[WebApp]/[gatsby-plugin-advanced-sitemap]/gatsby-node.js:275:34
from gatsby-plugin-advanced-sitemap.
Okay. I've realised why i think. Images need to be in a different format
<url>
<loc>https://example.com/mens-hats</loc>
<lastmod>2018-10-12</lastmod>
<image:image>
…
</image:image>
</url>
Looks like you can't link directly to an image in the url element?
https://www.practicalecommerce.com/seo-include-images-and-videos-in-sitemaps
from gatsby-plugin-advanced-sitemap.
Anyway of supporting images used on a page?
from gatsby-plugin-advanced-sitemap.
Related Issues (20)
- Error querying gatsby-source-graphql plugin HOT 2
- Example of Serializer Output Needed HOT 3
- Make excludes more intuitive HOT 3
- V2: Ideas and Umbrella ☂ HOT 5
- warn Plugin gatsby-plugin-advanced-sitemap is not compatible with your gatsby version 3.1.0 HOT 4
- Serializer: more detailed docs / examples / confirmation it works HOT 3
- Some pages are missing in the sitemap
- Only one page logged in sitemap-pages.xml HOT 2
- Peformance Problems HOT 2
- Dependency Dashboard
- Peer dependency compatibility with Gatsby 4.0 HOT 10
- Setting `assetPrefix` prefixes xml files but not xsl (results in broken sitemap)
- Adding `addUncaughtPages` ignores `prefix` and `serializer` options
- Undefined URLs in sitemap with Ghost HOT 6
- Google can't parse this sitemap HOT 1
- Trailing slashes are being removed automatically HOT 6
- Gatsby v5 support HOT 1
- Incorrect link to sitemap.xsl when using custom output path HOT 1
- Trailing slash support (given it's now default on Gatsby). HOT 7
- Showing Undefined url path in sitemaps
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-advanced-sitemap.