Links in Navbar
Adding href to our Github repo:
Navigating to the
themeConfig
object in our Docusaurus configuration file.Locating the
navbar
object within thethemeConfig
object.Finding the
items
array within thenavbar
object.Locating the object within the
items
array that has thehref
property.docusaurus.config.jsthemeConfig: {
navbar: {
items: [
{
href: 'https://github.com/your-organization/your-repo',
label: 'GitHub',
position: 'right',
},
],
},
},Replacing the value of the href property with the URL of our organization's GitHub repo.
docusaurus.config.jsthemeConfig: {
navbar: {
items: [
{
href: 'https://github.com/tcet-opensource/documentation',
label: 'GitHub',
position: 'right',
},
],
},
},infoWe added the
position:'right'
to ourhref
object because we wanted the link to be displayed on the right side of thenavbar
.
With the links in place, we then move forward to create the search bar for our navbar.