May I add several css file in theme/static/css/?

Hello,

I’m new in Hugo and to learn how it works I try to code my first Hugo theme.

I have added two css files in the theme/static/css folder

theme
 - static
    - css
       style.css
       tachyons.css

When I build the wesite with Hugo and display the source code in my browser, only style.css appear.

...
<meta name="author" content="Gilles">
<link rel="stylesheet" href="http://localhost:1313/css/style.css">
<link href="http://localhost:1313/index.xml" rel="feed" type="application/rss+xml" title="Pixenjoy">
...

However, the two css files are present in the public/css/ folder

public
    - css
       style.css
       tachyons.css

So I was wondering if we can add several css files in the static folder and how Hugo deal with them?
Do I need to concatenate all my styles in one css file?

Thx

Yes you can.

You have to adapt the layout file that includes the CSS to include both (or all).

A little hard to say without seeing the source; this depends a little if you use a theme or not. But you will have to look in the layouts folder for a file that contains the link rel and then just add one line.

1 Like

Ok I get it :slight_smile:

Thanks for your help