Links in Navbar
Adding href to our Github repo:
Navigating to the
themeConfigobject in our Docusaurus configuration file.Locating the
navbarobject within thethemeConfigobject.Finding the
itemsarray within thenavbarobject.Locating the object within the
itemsarray that has thehrefproperty.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 ourhrefobject 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.