404 with assets

Hi, having issues with loading/referencing any asset files that are contained in a regular sub dir on my server. Whenever I try to call it directly ghost gives me a 404 for css/js/images.

  • graphitika.net
  • latest
  • nginx latest
  • FF latest
  • n/a
  • any asset files (js, images, css) called receive 404, seems ghost is appending a / at the tail end of any assets

e.g. example.com/style.css is transformed to example.com/style.css/

I’ve tried the {{asset }} tags but same thing keeps popping up.

need to be able to call css/js and imagery

You’ll need to use the {{asset}} helper, and then clear all relevant caches (try using incognito mode on browser, too) to ensure that the changes are taking effect

See default theme code for an example:

Hmmm had no apparent effect, since I used your suggested method and called the style sheet in question it didn’t render the desired font to a particular css class.

In theme root you have to have a folder named “assets”. {{asset}} helper points to that directory.

So in your theme, if the file location is assets/css/style.css then use the following line to reference that file.

<link rel="stylesheet" type="text/css" href="{{asset "css/style.css"}}" />
1 Like

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