hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
1.03k stars 586 forks source link

Add custom name in Navbar #921

Closed BernatBC closed 5 months ago

BernatBC commented 6 months ago

Issue

Fixes #917

Description

If specified in site.Params.navBarTitle, that will be the name appearing in the navbar. If the parameter is not given, the value will be site.Title. Update: In order to have a different value for each language, the variable has been moved to data/<language-code>/site.yaml.

Example config in data/en/site.yaml:

navBarTitle: "Custom Name"

Test Evidence

navBarTitle: "Custom name"

image

netlify[bot] commented 6 months ago

Deploy Preview for toha-ci ready!

Name Link
Latest commit bb54968d38a371491b1f6e393fa2e4c9bd7ea68f
Latest deploy log https://app.netlify.com/sites/toha-ci/deploys/6624001ddc2b220008aa6c80
Deploy Preview https://deploy-preview-921--toha-ci.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

klugier commented 6 months ago

Looks good to me! Thanks for the fix! Any chances to merge it to the main branch? How should approve it? Moreover, I have one question related to code can navBarTitle be multi-language variable or it is one global variable per project.

BernatBC commented 6 months ago

Hi @klugier, we'll have to wait for @hossainemruz. I'm just a user of this theme that sometimes contributes to it.

Regarding to your question, right now it's a global variable located in config.yaml file. In order to be a per-language variable, we can put it in data/<language-code>/site.yaml.

klugier commented 6 months ago

I think we should, it should be per language string not the global one. I can imagine I have different title per language. For example I just want to have "My space", but in my origin language (Polish) I would like to have "Moja przestrzeń".

BernatBC commented 6 months ago

Good point @klugier. I'll change it soon.

BernatBC commented 6 months ago

I've just moved the variable to data/<language-code>/site.yaml. You can change the name by adding:

navBarTitle: "Name"
klugier commented 5 months ago

Hello @hossainemruz, Any changes to merge this change and create new release?

hossainemruz commented 5 months ago

Hi @klugier! Sorry, for the delay. I was pretty busy last month. I am already in the process of reviewing the pending PRs. Hopefully, a new release in next week.

klugier commented 5 months ago

Thanks! That's good news! Glad that you merged this change.