Permalink front matter variable for static files?

I’d like to have a folder /static/ which contains all the static files like css or images, but I’d like to change the permalinks of the files, for example I’d like to access /static/img/favicon.ico via /favicon.ico. How can I do so ?

I tried

defaults:
    - scope: 
        path: "static/img/favicon.ico"
      values:
        permalink: /favicon.ico

But it changes nothing

1 Like

I don’t think that defaults section works on files that don’t have frontmatter. And from your experiment that looks like the case.

For alternatives…

For favicon specifically, why don’t you put it in assets or assets/images and then link to it in your head by a path.

For CSS and JS, if you have one of each then put them at your root if you must.

But the pattern in Jekyll sites is to put them in assets, even if you only have one of each. I don’t really see static in use but it means the same.

Assets in Minima theme for CSS

And it doesn’t have to be nested as assets/js/main.js, it could just be assets/main.js

Ok thanks I’ll see it then! :+1:

1 Like