# Using an additional specific css style for a page

**URL:** <https://discourse.gohugo.io/t/using-an-additional-specific-css-style-for-a-page/26547>\
**Category:** Uncategorized\
**Created:** [June 27, 2020, 4:16pm UTC](https://discourse.gohugo.io/t/using-an-additional-specific-css-style-for-a-page/26547 "2020-06-27T16:16:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Polarhardboiled](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/polarhardboiled/32/22623_2.png) [@Polarhardboiled](https://discourse.gohugo.io/u/Polarhardboiled)\
**Post date:** [June 27, 2020, 4:16pm UTC](https://discourse.gohugo.io/t/using-an-additional-specific-css-style-for-a-page/26547/1 "2020-06-27T16:16:21Z")

</div>

I am trying to use the Page Resources feature in order to have a specific css style file for a given page.  
I did it as follows:

- adding the resource in the page bundle with the frontmatter of the page

```auto
resources:
  - src: test.css
    title: style

```

and adding the file test.css in the page directory.  
Note that this file should be in addition of the basic style of the main theme

- in the single layout I put the following code

```auto
{{ with $.Resources.GetMatch "**.css*" }}
{{ $style := . | minify | fingerprint }}
<link type=text/css rel="stylesheet" href="{{ $style.Permalink }}">
{{ end }}

```

I guess it should work (note that I am not a coder)  
But please advise or correct if it’s the proper way to do it or if it exists any other cleaner and simpler option (more [Hugo](https://gohugo.io/content-management/page-resources/) oriented if any)

Please advise

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 27, 2020, 5:25pm UTC](https://discourse.gohugo.io/t/using-an-additional-specific-css-style-for-a-page/26547/2 "2020-06-27T17:25:30Z")

</div>

> [@Polarhardboiled](#):
>
> I guess it should work

Does it?

---

<div class="post-metadata">

**Author:** ![Polarhardboiled](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/polarhardboiled/32/22623_2.png) [@Polarhardboiled](https://discourse.gohugo.io/u/Polarhardboiled)\
**Post date:** [June 28, 2020, 9:04am UTC](https://discourse.gohugo.io/t/using-an-additional-specific-css-style-for-a-page/26547/3 "2020-06-28T09:04:11Z")

</div>

Yes, it works!

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 28, 2020, 2:34pm UTC](https://discourse.gohugo.io/t/using-an-additional-specific-css-style-for-a-page/26547/4 "2020-06-28T14:34:49Z")

</div>

Based on my testing this morning, I suspect this works when you build your site with `hugo`, but fails to update upon changes to your site when running `hugo server`.

When using [Hugo Pipes](https://gohugo.io/hugo-pipes), the documentation states that:

> Asset files must be stored in the asset directory. This is `/assets` by default, but can be configured via the configuration file’s `assetDir` key.

You, on the other hand, are attempting to use Hugo Pipes in conjunction with [Page Resources](https://gohugo.io/content-management/page-resources/). This combination is undocumented, and at least one other person has encountered the problem I described above:

> [@Asset pipelines with page resources?](https://discourse.gohugo.io/t/asset-pipelines-with-page-resources/25199):
>
> Do pipelines work with resources for a local page? I’ve got a simple site like the following: - content/ - posts/ - foo/ - bar.md - bar.scss - layouts/ - \_default/ - baseof.html - assets/ - main.scss The body of bar.md is like: --- title: Foo Bar resources: - src: "\*\*/\*.scss" styles: - main - ./bar --- Hello Foo Bar And in my \_default/baseof.html file (in my layouts directory) I’ve got something like the following: ... \<head\> ... …

Question for @bep (sorry):

Is processing of Page Resources with Hugo Pipes a supported operation when running `hugo` and `hugo server`?
