question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Named routes for Gridsome

See original GitHub issue

Description

For every page inside src/pages/ I specifically added the name (please see the image No.1) property with the names I would like to call my pages inside the website. But after inspecting the .temp/routes.js I could only see the following (please see the image No.2), only Index.vue and 404.vue has name property.

Image No.1 pages file

Image No.2 routes files

Expected result

All the routes should have the name properties

Environment


Libs:
- gridsome version: 0.6.6
- @gridsome/cli version: 0.2.1

Browser:
- [x] Chrome (desktop) version 75
 
For Tooling issues:
- Node version: 10.15.0 
- Platform:  Windows

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
FistMeNarutocommented, Dec 26, 2019

What about inferring the route name from the filename, like Nuxt does?

2reactions
silasabbottcommented, Apr 17, 2021

This is an issue I’m still experiencing with v0.7.23

Route names are only generated for index.vue as home and for ‘404.vue’ as *. When using gridsome-plugin-gtm, page view events are only sent to Google Tag Manager for routes that have names. I can manually send the event on page/component mount, but it would be a huge time-saver to have auto-generated, filename-inferred routes like Nuxt does.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamic Routing - Gridsome
Dynamic pages are used for client-side routing. Route parameters can be placed in file and directory names by wrapping the name in square...
Read more >
Gridsome page routes are now lower case - Stack Overflow
Gridsome changes the uppercase path of /Clients to the lowercase path ... Sorry Wally, looks like you can't use named routes in Gridsome....
Read more >
The Answers to All Your Questions About Gridsome Localization
From number, named, as well as date and time formating, this guide brings everything you need to know about Gridsome localization.
Read more >
Getting started with Gridsome - LogRocket Blog
Gridsome also provides automatic routing. ... To add a template create a .vue file with the same name as a GraphQL collection to ......
Read more >
Build A Custom Publication With Headless Ghost + Gridsome
Templates in Gridsome follow a specific naming convention which uses the type names as defined in the GraphQL schema, so the existing Post.vue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found