Skip to content

Commit 05682d4

Browse files
committed
change product detail slug to /store from /products
1 parent 938f5fc commit 05682d4

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

gatsby-config.js

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ module.exports = {
2323
link: `/#mixer`
2424
},
2525
{
26-
name: `Subscribe`,
27-
link: `/#subscribe`
28-
},
29-
{
3026
name: `Shop Now`,
3127
link: `/store`
3228
}

gatsby-node.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
3838

3939
collection.node.products.forEach(product => {
4040
createPage({
41-
path: `/products/${product.sku}`,
41+
path: `/store/${product.sku}`,
4242
component: productTemplate,
4343
context: {
4444
sku: product.sku

src/components/product-list-item/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const ProductListItem = ({ product, compact }) => {
2121
return (
2222
<div className={`column ${size}`} key={`product-${product.name}-sku-${product.sku}`}>
2323
<div className="card">
24-
<Link to={`/products/${product.sku}`} title={product.name}>
24+
<Link to={`/store/${product.sku}`} title={product.name}>
2525
<Img fluid={product.images[0].fluid} fadeIn={true} />
2626
</Link>
2727
<div className="card-content">
@@ -32,7 +32,7 @@ const ProductListItem = ({ product, compact }) => {
3232
</div>
3333
</div>
3434
<div className="card-footer">
35-
<Link className="card-footer-item is-outlined list-item-details" to={`/products/${product.sku}`} title={product.name}>
35+
<Link className="card-footer-item is-outlined list-item-details" to={`/store/${product.sku}`} title={product.name}>
3636
<span>Learn More</span>
3737
</Link>
3838
<a className="card-footer-item is-primary bold list-item-cta" onClick={(evt) => addToCart(evt)}>

src/templates/collection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default ({ data }) => {
2020
return {
2121
"@type": "ListItem",
2222
"position": index + 1,
23-
"url": `${siteUrl}/products/${product.sku}`
23+
"url": `${siteUrl}/store/${product.sku}`
2424
}
2525
})
2626
}

src/templates/product.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default ({ data }) => {
2323
"description": description,
2424
"url": siteUrl
2525
},
26-
"url": `${siteUrl}/products/${product.name}`,
26+
"url": `${siteUrl}/store/${product.name}`,
2727
"name": product.name,
2828
"description": product.shortDescription,
2929
"sku": product.sku,
@@ -35,7 +35,7 @@ export default ({ data }) => {
3535
"image": product.images.map(i => i.file.url),
3636
"offers": {
3737
"@type": "Offer",
38-
"url": `${siteUrl}/products/${product.name}`,
38+
"url": `${siteUrl}/store/${product.name}`,
3939
"priceCurrency": "USD",
4040
"price": product.price,
4141
"itemCondition": "https://schema.org/NewCondition",
@@ -76,7 +76,7 @@ export default ({ data }) => {
7676
{/* Open Graph */}
7777
<meta property="og:title" content={`${product.name} | ${title}`} />
7878
<meta property="og:type" content="website" />
79-
<meta property="og:url" content={`${siteUrl}/products/${product.sku}`} />
79+
<meta property="og:url" content={`${siteUrl}/store/${product.sku}`} />
8080
<meta property="og:image" content={`https:${product.images[0].file.url}`} />
8181
<meta property="og:description" content={product.shortDescription} />
8282
<meta property="og:site_name" content={title} />

0 commit comments

Comments
 (0)