Skip to content
Discussion options

You must be logged in to vote

If you want to support a site in English and French, you have 2 strategies common:

  • Subdomains: example.com + fr.example.com
  • Subpaths: / + /fr/ baseUrl

Ann URL will break only if you use the subpath strategy because your pathnames will eventually have a locale /fr/ prefix so the path is not correct anymore

The solution is explained in the doc link I provided:

import React from 'react';
import useBaseUrl from '@docusaurus/useBaseUrl';

const SomeImage = () => {
  const imgSrc = useBaseUrl('/img/myImage.png');
  return <img src={imgSrc} />;
};

Our <Link> component is something we provide, and we enhanced it to automatically add that base URL prefix for you. This ensures that most links do …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@RemiLacroix-IDRIS
Comment options

@slorber
Comment options

slorber Apr 3, 2026
Collaborator

Answer selected by RemiLacroix-IDRIS
@RemiLacroix-IDRIS
Comment options

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