Directory Tree Problem with config.yml and menu.yml - how to fix?

I almost have my hugo page working. I am using the Academic Theme template, but I am noticing a few issues:

When I run hugo server it tells me that my files are created in http://localhost:1313/kaeppler/ however, when I click on one of my menus the actual link goes to: http://localhost:1313/kaeppler/kaeppler/group for example.

I think I am not understanding how to configure something. Is there some sort of parsing of the baseurl? I have posted this on the hugo Academic template forum and have not gotten any responses suggesting a fix. I have also considered hardcoding in the html some fixes… anyway, you are welcome to look at the live website which shows some of the buttons aren’t working right, presumably because the paths are wrong: Kaeppler Lab

I hard coded in the tab links, but if you click on group for example, some of the icons don’t appear and I expect that has to do with some sort of parsing of the base url. I am hoping there is an option I need to enable and it will fix everything.

Here is my config.yaml

# Configuration of Hugo
# Guide: https://wowchemy.com/docs/getting-started/
# Hugo Documentation: https://gohugo.io/getting-started/configuration/#all-configuration-settings
# This file is formatted using YAML syntax - learn more at https://learnxinyminutes.com/docs/yaml/

title: Kaeppler Lab # Website name
baseURL: 'http://science.clemson.edu/kaeppler' # Website URL

############################
## LANGUAGE
############################

defaultContentLanguage: en
hasCJKLanguage: false
defaultContentLanguageInSubdir: false
removePathAccents: true

############################
## MODULES
############################

module:
  imports:
    - path: github.com/wowchemy/wowchemy-hugo-modules/wowchemy-cms/v5
    - path: github.com/wowchemy/wowchemy-hugo-modules/wowchemy/v5

############################
## ADVANCED
############################

enableGitInfo: false
summaryLength: 30
paginate: 10
enableEmoji: true
enableRobotsTXT: true
footnotereturnlinkcontents: <sup>^</sup>
ignoreFiles: [\.ipynb$, .ipynb_checkpoints$, \.Rmd$, \.Rmarkdown$, _cache$]
permalinks:
  event: '/talk/:slug/'
  tags: '/tag/:slug/'
  categories: '/category/:slug/'
  publication_types: '/publication-type/:slug/'
disableAliases: true
outputs:
  home: [HTML, RSS, JSON, WebAppManifest, headers, redirects]
  section: [HTML, RSS]
imaging:
  resampleFilter: lanczos
  quality: 75
  anchor: smart
timeout: 600000
taxonomies:
  tag: tags
  category: categories
  publication_type: publication_types
  author: authors
markup:
  _merge: deep
related:
  threshold: 80
  includeNewer: true
  toLower: true
  indices:
    - name: tags
      weight: 100
    - name: categories
      weight: 70
security:
  _merge: deep
sitemap:
  _merge: deep

Here is my menus.yaml

# Navigation Links
#   To link a homepage widget, specify the URL as a hash `#` followed by the filename of the
#     desired widget in your `content/home/` folder.
#   The weight parameter defines the order that the links will appear in.

main:

  - name: Group
    url: '/group'
    weight: 20
  - name: Publications
    url: '/publications'
    weight: 30
  - name: Join/CI
    url: '/join'
    weight: 40


# Link to a PDF of your resume/CV from the menu.
# To enable, copy your resume/CV to `static/uploads/resume.pdf` and uncomment the lines below.
#  - name: CV
#    url: uploads/resume.pdf
#    weight: 70

I don’t know what’s going on with your menu but those icons at the bottom are not found because it can’t find the fonts to load to render them:
https://science.clemson.edu/kaeppler/webfonts/fa-brands-400.woff2 the DevTools console says this and the other fa- font files are not found at that location.

cc: @alcarazr

Unanswered:
https://github.com/wowchemy/wowchemy-hugo-themes/discussions/2784

Try adding an ending slash in your baseURL

Thanks for the response. I attempted this, so I changed:
baseURL: 'http://science.clemson.edu/kaeppler/' # Website URL
then I ran hugo server and I am getting the same response as before, i.e., when I click on the top menu for Group, for example, the actual url is http://localhost:1313/kaeppler/kaeppler/group The actual location of the data is http://localhost:1313/kaeppler/group

I am not sure if there is some sort of parsing happening during the generation process.

I don’t know either what is going on. All I know is that if I run hugo server everything looks great. I then run hugo and move the contents of the public directory onto the web server and some of these things do not work. Again this is the academic template, so maybe it is an issue with what they did?

When I visit your live site (https://science.clemson.edu/kaeppler/) the menu items have the correct URL.

To clarify, I hard coded the links in to the menu. It would be better if I didn’t have to do that and also as I mentioned, some of the icons aren’t working correctly/linked properly.

You stated that hugo server generates the wrong URL:

Then you implied that hugo server generates the correct URL:

Which of the above is true?

It would be helpful if you were to share your project repository with us.

See https://discourse.gohugo.io/t/requesting-help/9132.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

If you’re seeing different behaviors with hugo server and your production site make sure you’re using the same Hugo version in your host and locally

@jmooring @alcarazr: Please find the attached link which contains the full tree for the website: Dropbox - LabWebsite_08082022.zip - Simplify your life

I hope that this can help in debugging the issue. I really appreciate all of the help. Keep in mind though that I am just an idiot physicist who doesn’t really have time to debug other people’s code, particularly, if the problem has to do with how the template was made. I just want to use these items out of the box so to speak. I am using the hugo academic template with this philosophy in mind: GitHub - wowchemy/starter-hugo-academic: 🎓 Hugo Academic Theme 创建一个学术网站. Easily create a beautiful academic résumé or educational website using Hugo, GitHub, and Netlify.

See previous comment from @alcarazr.

To ensure the same behavior locally when compared to your Netlify build, run the same version in both places. If you are running Hugo v0.101.0 locally (and you should be), change your netlify.toml file from:

HUGO_VERSION = "0.97.3"

To:

HUGO_VERSION = "0.101.0"

Your menu items will now have the correct URL.

You ran into this issue with v0.97.3, which was fixed with this PR in v0.101.0.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.