jhu247 / minimal-academic

A two-column Hugo theme for personal sites.
MIT License
89 stars 28 forks source link

How to edit main menu? #11

Open JBGruber opened 5 years ago

JBGruber commented 5 years ago

Thanks for the really nice minimal theme!

I was trying to edit the main menu (Home • Projects • Blog • About) but I couldn't find out how to do so. I'm using hugo-academic by gcushen on another site and there I can do this in the config.toml:

[[menu.main]]
  name = "Home"
  url = "#about"
  weight = 1

#[[menu.main]]
#  name = "Publications"
#  url = "#publications_selected"
#  weight = 2

The commented "Publications" pane just disappers, menu entries change when I change url or name

But I guess that is just controlling something deeper in the theme (I don't fully understand how theming works unfortunatly). So how does one change the menu if

Home • Projects • Blog • About

is not what is needed?

theorangepotato commented 5 years ago

Moving this functionality to config.toml is probably a good idea, but currently those values are hard-coded in. To change them, edit the following file: themes/minimal-academic/layouts/partials/masthead_nav.html. Add, remove, or edit the existing links as desired. You will have to use HTML instead of Markdown or TOML, but the file is short and should be very straight forward.

Good luck!

JBGruber commented 5 years ago

Thank you! Not quite sure how I missed that. But I also learned a bit more about hugo themes which is always nice.

Editing this file was no problem at all and it works nicely now.

You can close this if you want or leave it open as a reminder if you intend to move the functionality to the .toml in the future.

rohitbommisetti commented 4 years ago

@theorangepotato Hi! So I'm currently trying to implement this theme. I've been having trouble with the homepage. I want it to show my latest blog posts like https://www.joshuahu.io/.

How can I change the main homepage? Currently, I see Projects and About but I want it to display my latest blog posts. image

Thank you!

theorangepotato commented 4 years ago

@rohitbommisetti You might want to open a new issue for this if it is still a problem, as your issue seems to be different.

Also, without seeing your code, it is a little hard to see where you went wrong. Nevertheless, I recommend looking at the example site (particularly the content/ folder) to see a working example. I assume you messed up your folder hierarchy or something. If you copy that exactly, it should show up as you intend, and you can tweak it from there.

Good luck!

(@JBGruber or @jhu247 Feel free to close this issue since it was fixed by PR #12 )