Comments (4)
Hey there @DivMode you're only changing the path for links in your example code, which is not where product page routes live. This is why you are seeing a 404 error page when clicking those links, the routes simply do not exist there for products.
I'd highly recommend reading up on how dynamic routes work within Next.js
In HULL, the product routes are determined by the folder structure: /pages/products/[slug].js
, while general page routes are determined by /pages/[...slug].js
.
It's much easier to separate out product specific routes to their own sub-path than it is to coalesce them with the regular page routes.
I hope that helps 🤘
from hull.
Ok from what I understand it currently isnt possible to move the products slug to root because of […slug].
Otherwise I could just move the products slug to root and it would work.
Thanks for the help, love this repo, learning a lot just from reading the code.
from hull.
Exactly. You could in theory do this, but it would require a lot more work to avoid slug collisions between regular pages and product pages, and you'd have to do additional checks to know what to render.
It's fairly standard to have products exist at a sub-path like /products
(even with Shopify native) so I'd suggest sticking with the default.
Glad you're enjoying the repo! cheers 🤘
from hull.
Actually your amazing repo has inspired me to build out a full blogging system and to start using nextjs/sanity and move away from Wordpress.
I was getting tired of Wordpress shenanigans and took some courses on react to help me get going with Nextjs and Sanity and then I came across this repo which helped me so much.
Love the whole collections and filters system which I am going to use to convert into a full blogging system with categories and tags.
I have a lot of work and learning ahead of me but am very excited for the future.
As for the reason why I wanted to the slug closer to root domain is because for SEO it is better to have the targeted keywords closer to the root domain as much as possible.
Its a small seo factor and isnt such a huge deal so Ill just stick with blog/[slug].
from hull.
Related Issues (20)
- Is it true that you have to redeploy every time a product is added? HOT 4
- Sanity CLI v3 causes project to not work correctly HOT 1
- GBP Cart Subtotals
- Sanity not connecting to Storefront HOT 2
- Products not appearing in Sanity—how to bring them over? HOT 1
- Bundles created with the Shopify App (Summer 2023) can't be added to cart HOT 11
- Mobile Crashes When Interacting On Page HOT 6
- marketing starter upgrade packages HOT 1
- Client-side exception HOT 7
- unknown field found
- Sync seems inconsistent HOT 1
- Can't locate Sanity Starter HOT 1
- Not able to Import Shopify Products into sanity Studio
- Application error: a client-side exception has occurred (see the browser console for more information). HOT 2
- Issue cloning project from Vercel HOT 1
- TypeError: Cannot read properties of undefined (reading 'replace') HOT 2
- I got the same error after following the directions. I cloned the repository with git clonee and followed the instructions in the ReadMe.md file in the root. Localhost:3333 and localhost:3000 are running, I don't see any errors. HOT 2
- Tried deploying Hull from Vercel Interface. HOT 1
- Sanity Create Project is not working HOT 1
- @reach/rect error HOT 1
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 hull.