How put the URL base?


I make my firest theme.
On my file hugo-blank-theme-v3\hugo-blank-theme-v3\themes\sandbox\layouts\partials\header.html
I got the line of code of my “logo navabar”
<a href="/" title="home" class="navbar-item">
But if i want to see something i have to get
<a href="/hugo-blank-theme-v3" title="home" class="navbar-item">

And i would like to know if i can use a variable to replace hugo-blank-theme-v3


Check out the baseURL parameter in the config file. Remember that this URL will not be used when running hugo server, as it would be non-sensical then.

And why do you want to link to your theme?

my baseURL on my config file is baseURL = ''

I learn HUGO and Github.

I open another post to know how i have to set and use my “main” branch and my “gh-pages” branch.

I want to link to my homePage when i click on the “navbar logo”

and how can i cal the value of baseURL in my .html template ?

If that baseURL points to your home page, you’re all set (though I still find the name not very helpful).

As baseURL is a Site parameter …

Do not. There is never a good reason to use baseURL within a template. At some point I hope we can remove it from the API.

If you need to insert a link to the home page, use site.Home.Permalink or site.Home.RelPermalink.

1 Like