Greg Hilston
Greg Hilston

Reputation: 2424

Hugo Reference Error When Accessing Subfolder's File

Everything is working when I run locally, but when I deploy I'm getting this error.

I have a folder structure like this:

I am able to get my_post_markdown.md to render and link to [some_sub_folder]/[another_sub_folder]/index.html.

The problem is that index.html relies on Build/[some_file.js] and is unable to load it. I'm seeing the folowing in my console

The real errors I see are:

Loading failed for the with source “https://www.greghilston.com/project/global_game_jam_2019/web/Build/UnityLoader.js“. web:10:1

ReferenceError: UnityLoader is not defined[Learn More]

How can I get the sub folder's file accessible by my html file?

Upvotes: 1

Views: 222

Answers (1)

Greg Hilston
Greg Hilston

Reputation: 2424

I followed the steps outlined in this blog post:

https://medium.com/@aboutin/unity-github-pages-and-file-organization-575ce082b591

  1. Put index.html and all files in /Build and /TemplateData into the same directory.
  2. Modify index.html to remove “Build/” and “TemplateData/” from all file locations.

Upvotes: 1

Related Questions