hexo-theme-hiker icon indicating copy to clipboard operation
hexo-theme-hiker copied to clipboard

New item in Menu shows first character lower case

Open MayankTahil opened this issue 7 years ago • 1 comments

If I add an item to the menu in _config.yaml, visually the item shows up all in lowercase. Archive, Tags, Categories, etc. all show up with the first letter Uppercase but anything else shows up lowercase. No idea why and I've been trying to find out where in the code it's causing this issue but I cannot find it.

MayankTahil avatar Dec 14 '17 04:12 MayankTahil

Hi, @MayankTahil

Thanks for your interesting, Custom menu item showing up lowercase caused by this code, in file layout/_partial/header.ejs:

222  <div class="intro-navigate">
223      <p class="navigater-list">
224        <% for (var i in theme.menu){ %>
225          <a id="beautifont" class="main-nav-link" href="<%- url_for(theme.menu[i]) %>"><%= __(i.toLowerCase()) %></a>
226        <% } %>
227      </p>
228  </div>

In the line 225, in order to support multiple languages, we have to use every menu item's lowercase to match various languages' relevant string in those .yml files in the languages/ directory.

So you could change these line of code according to your needs. :smile: And I will be grateful if you create a Pull Request after your optimization.

iTimeTraveler avatar Dec 14 '17 07:12 iTimeTraveler