How to Include 3D files in Static

In my website, I’m trying to add an aframe scene on the footer. It works great! Except that my “3D” folder in theme > static is not getting published on public, so my scene can’t access the files to render.

How can I make Hugo include my 3d folder in the build of my site along with other static elements like my CSS folder and Scripts folder?

Here’s my repo.

Any insights would be tremendously appreciated :smiley:

Here’s what I did:

git clone --recurse-submodules https://github.com/KingScroll/juanlam.github.io
cd juanlam.github.io/
hugo
Here's what I got:
public/3d/
└── wizard-study/
    ├── objects/
    │   ├── materials/
    │   │   ├── Armor_Metal.mtl
    │   │   ├── Backpack.mtl
    │   │   ├── Bag_Coins.mtl
    │   │   ├── Banner_wall.mtl
    │   │   ├── Book2.mtl
    │   │   ├── Book3_Closed.mtl
    │   │   ├── Book3.mtl
    │   │   ├── Book4_Closed.mtl
    │   │   ├── Book_Open.mtl
    │   │   ├── Candelabrum.mtl
    │   │   ├── Candelabrum_tall.mtl
    │   │   ├── Carpet.mtl
    │   │   ├── Chair.mtl
    │   │   ├── Chalice.mtl
    │   │   ├── Chest_Ingots.mtl
    │   │   ├── Coin_Pile.mtl
    │   │   ├── Crystal1.mtl
    │   │   ├── Crystal2.mtl
    │   │   ├── Crystal3.mtl
    │   │   ├── Crystal4.mtl
    │   │   ├── Crystal5.mtl
    │   │   ├── Gems.mtl
    │   │   ├── IceStaff.mtl
    │   │   ├── Mineral.mtl
    │   │   ├── Pedestal.mtl
    │   │   ├── Potion2.mtl
    │   │   ├── Potion3.mtl
    │   │   ├── Potion4.mtl
    │   │   ├── Potion5.mtl
    │   │   ├── Potion6.mtl
    │   │   ├── Potion.mtl
    │   │   ├── rug.mtl
    │   │   ├── Scroll.mtl
    │   │   ├── Shield.mtl
    │   │   ├── Sword.mtl
    │   │   ├── Sword_WallMount.mtl
    │   │   ├── Table_Big.mtl
    │   │   ├── Table_Small.mtl
    │   │   ├── Torch.mtl
    │   │   └── Woodfire.mtl
    │   ├── Armor_Metal.obj
    │   ├── Backpack.obj
    │   ├── Bag_Coins.obj
    │   ├── Banner_wall.obj
    │   ├── Book2.obj
    │   ├── Book3_Closed.obj
    │   ├── Book3.obj
    │   ├── Book4_Closed.obj
    │   ├── Book_Open.obj
    │   ├── Candelabrum.obj
    │   ├── Candelabrum_tall.obj
    │   ├── Carpet.obj
    │   ├── Chair.obj
    │   ├── Chalice.obj
    │   ├── Chest_Ingots.obj
    │   ├── Coin_Pile.obj
    │   ├── Crystal1.obj
    │   ├── Crystal2.obj
    │   ├── Crystal3.obj
    │   ├── Crystal4.obj
    │   ├── Crystal5.obj
    │   ├── Gems.obj
    │   ├── IceStaff.glb
    │   ├── IceStaff.gltf
    │   ├── IceStaff.obj
    │   ├── Mineral.obj
    │   ├── Pedestal.obj
    │   ├── Potion2.obj
    │   ├── Potion3.obj
    │   ├── Potion4.obj
    │   ├── Potion5.obj
    │   ├── Potion6.obj
    │   ├── Potion.obj
    │   ├── rug.obj
    │   ├── Scroll.obj
    │   ├── Shield.obj
    │   ├── Sword.obj
    │   ├── Sword_WallMount.obj
    │   ├── Table_Big.obj
    │   ├── Table_Small.obj
    │   ├── Torch.obj
    │   ├── wizard2.gltf
    │   └── Woodfire.obj
    └── structures/
        ├── materials/
        │   ├── Arch.mtl
        │   ├── Column.mtl
        │   ├── Entrance2.mtl
        │   ├── ModularFloor.mtl
        │   └── ModularStoneWall.mtl
        ├── Arch.obj
        ├── Column.obj
        ├── Entrance2.obj
        ├── ModularFloor.obj
        └── ModularStoneWall.obj

I don’t understand the problem.

I followed along, and I see what you mean. Is the problem, then, that I’m not calling the right directory for the objects in the footer.html partial under “themes”?

If so, how would I go about calling the objects in “3d”? I followed the same format I would if working with /css or /scripts

Run hugo server then look at the browser console in developer tools. There are many errors.

You’re loading aframe.min.js in both the head and the footer. It works if you remove it from head.

Wow! That fixed it. Thanks so much for your time. I was sure I did something wrong concerning the static folder but it looks like that wasn’t the problem at all. Can’t believe I didn’t catch that error in the console. I’m quite embarrassed. Thanks so much!

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