Comments (3)
Hey David,
Hmm, this might take a bit of planning to implement. I have the slugs autogenerating in several places.
As a start, you would need to:
- Add the slug as markdown metadata. E.g.
path: "5-linqpad-tricks"
- In
gatsby-node.js
, this is where the slugs are autogenerated. Check if a slug was provided, and if it was, use that. If not, use autogenerated one.
Then, you'd need to ensure that when the links to articles are placed in the blog lists, the correct link is used. This might need to be changed in several places. Starting in src/components/Posts/Post.js
:
- Update GraphQL to include slug.
- Similar to point 2: Check if a slug was provided, and if it was, use that within links. If not, use autogenerated one.
I unfortunately am way too busy to try to fix this at the moment, but the least I can do is point you in the right direction!
from revista-gatsby-blog-magazine.
Thanks!
Would this approach make me lose the "/blog/" part?
from revista-gatsby-blog-magazine.
With the approach I described - depends.
Gatsby is very flexible in this regard so you can create the pages however you like.
My preference is to just include the slug, which allows you to also use the same Markdown metadata for multiple content types. E.g. if you want to also generate Portfolio links/pages based on Markdown files, you can re-use the slug: "..."
for different purposes.
However I think you can leave it, if you already have blog/...
in all of your files. Just ensure that the path in gatsby-node.js
is correctly generating. As long as your links are generating consistently throughout the project, you can set up your urls however you choose.
from revista-gatsby-blog-magazine.
Related Issues (6)
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 revista-gatsby-blog-magazine.