Skip to main content

Links in Navbar

Adding href to our Github repo:

  1. Navigating to the themeConfig object in our Docusaurus configuration file.

  2. Locating the navbar object within the themeConfig object.

  3. Finding the items array within the navbar object.

  4. Locating the object within the items array that has the href property.

    docusaurus.config.js
    themeConfig: {
    navbar: {
    items: [
    {
    href: 'https://github.com/your-organization/your-repo',
    label: 'GitHub',
    position: 'right',
    },
    ],
    },
    },

  5. Replacing the value of the href property with the URL of our organization's GitHub repo.

    docusaurus.config.js
    themeConfig: {
    navbar: {
    items: [
    {
    href: 'https://github.com/tcet-opensource/documentation',
    label: 'GitHub',
    position: 'right',
    },
    ],
    },
    },
    info

    We added the position:'right' to our href object because we wanted the link to be displayed on the right side of the navbar.


With the links in place, we then move forward to create the search bar for our navbar.