Skip to content

How to Rename a Menu and Change URL Structure in Astro Without Breaking the Site? #336

Answered by mearashadowfax
Daremonic asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Daremonic!

I'd recommend starting with Astro's official tutorial to get hands-on experience:
https://docs.astro.build/en/tutorial/0-introduction/

As for the template:

  1. In the navigation.ts file in your utils folder, update the links:
// An array of links for the navigation bar
const navBarLinks = [
  { name: "Home", url: "/" },
  { name: "Solutions", url: "/solutions" },
];

If using i18n, update both language versions, e.g. utils/fr/navigation.ts:

const navBarLinks = [
  { name: "Accueil", url: "/fr" },
  { name: "Solutions", url: "/fr/solutions" },
];
  1. In the pages directory, rename the products folder to solutions.
  2. Inside the newly renamed solutions folder, open index.astro and ch…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Daremonic
Comment options

Answer selected by Daremonic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants