Static themes files not present in public directory (basic question)

Hugo works perfectly locally when I use hugo serve during development.

However, when I use the hugo command to generate the static pages, the web site breaks as all of the images, css and scripts there were located on my theme directory do not appear on my public directory. In other words, the htmls are on the public directory, but everything else is not.

When I deploy to firebase or github pages, only the public directory is sent to those hosting environments and the website breaks without the jpg/css/javascript.

What am I doing wrong? How to make hugo copy the static content from themes to the public directory?

We cannot know the answer without seeing the project in question or a minimal project that reproduces the issue.

Also have a look at the Requesting Help guidelines.

Many thanks for the prompt reply. The code is available at https://github.com/opinsky/paulinapinsky_code

I am unable to reproduce the problem.

git clone --recurse-submodules https://github.com/opinsky/paulinapinsky_code
cd paulinapinsky_code
rm -rf public/

Then delete this line from config.toml:

staticDir = ["themes/paulin/static"]

Then build with hugo:

                   | EN  
-------------------+-----
  Pages            | 86  
  Paginator pages  |  3  
  Non-page files   |  2  
  Static files     | 76  <-- LOOKS GOOD TO ME
  Processed images |  0  
  Aliases          | 28  
  Sitemaps         |  1  
  Cleaned          |  0
tree public/img/ public/css/ public/js
public/img/
├── 003-590x475.jpg
├── 003-950x765.jpg
├── 41-150x150.jpg
├── 4-590x669.jpg
├── 4-950x1077.jpg
├── 928.jpg
├── 928_thumb (1).jpg
├── 928_thumb.jpg
├── arrows-ffffff.png
├── DSC_0027.jpg
├── DSC06239A-590x381.jpg
├── DSC06239A.jpg
├── DSC06239A_thumb.jpg
├── DSC06243A1-590x320.jpg
├── DSC06243A1.jpg
├── DSC06243A_thumb.jpg
├── DSC06943.jpg
├── DSC06943_thumb1.jpg
├── marca_Paulina3.png
├── marinaintelaviv_01.jpg
├── moldura-150x150.jpg
├── moldura.jpg
├── NAIF_03_03.jpg
├── obra_disponivel_GINA.jpg
├── Obra_recente_03_03_03.jpg
├── oinoisaquitraveis_slideshow_01.jpg
├── P1000460-590x495.jpg
├── P1000460.jpg
├── P1000460_thumb.jpg
├── P1000465-590x388.jpg
├── P1000465600.jpg
├── P1000465_thumb.jpg
├── P1000469.jpg
├── Paulina018_thumb.jpg
├── Paulina022-590x383.jpg
├── Paulina022.jpg
├── Paulina023_thumb.jpg
├── Paulina026_thumb.jpg
├── Paulina032-590x389.jpg
├── Paulina032.jpg
├── Paulina033-590x676.jpg
├── Paulina033.jpg
├── Paulina035.jpg
├── Paulina035_thumb1.jpg
├── Paulina037E036.jpg
└── vangoghnacabeca.jpg
public/css/
├── styles/
│   ├── ie7.css
│   ├── ie.css
│   ├── nav.css
│   └── screen.css
├── custom.css
├── custom-styles.php.css
├── print.css
├── recaptcha.css
├── style.css
└── styles.css
public/js
├── analytics.js
├── IC7v8PiZtgJn-f645XNlmTJb_H8.js
├── jquery.cycle.js
├── jquery.form.min.js
├── jquery.js
├── jquery-migrate.min.js
├── jquery.min.js
├── jquery-ui-1.7.2.custom.min.js
├── rocket-loader.min.js
├── scripts.js
├── search.js
├── slider.js
├── suckerfish.init.js
├── superfish.js
├── supersubs.js
├── swfobject.js
├── ui.slider.js
├── wlwmanifest.xml
├── wp-embed.min.js
└── wp-emoji-release.min.js

Many thanks! It was the staticDir line that was breaking the deployment.

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