jbake icon indicating copy to clipboard operation
jbake copied to clipboard

.htaccess files disppear from content directory in output

Open ge0ffrey opened this issue 3 years ago • 5 comments

The docs section 5.2.1 state

Any files other than above listed content files, will be treated as static files. When site is baked, all these files will be copied as-is to output folder, while maintaining their directory structure. For example, /content/blog/2013/images/abc.jpg will be copied to to /output/blog/2013/images/abc.jpg.

However, given a content directory that contains:

  • .htaccess
  • something.adoc
  • image.png

It outputs:

  • something.html
  • image.png

The .htaccess file disappears. I'd argue it shouldn't. Or the docs should motivate why it disappears.

ge0ffrey avatar May 11 '21 10:05 ge0ffrey

Ah, this explains what's happening, section 5.4.2.

All hidden files from content directory are ignored by JBake.

That should be in the content directory section, I'd argue.

ge0ffrey avatar May 11 '21 10:05 ge0ffrey

Is there a way to allow .htaccess to be copied over the in content directory?

ge0ffrey avatar May 11 '21 10:05 ge0ffrey

Workaround: Place it in the assets directory. That feels a bit clumsy because my assets directory contains general things (like CSS and JS etc) and my content directory contains the non-general things such as the use case directory which each use case, etc. Those .htaccces files really belong next to the content that they affect (for example renaming foo.html into bar.html)

ge0ffrey avatar May 14 '21 08:05 ge0ffrey

Would be nice to have freemarker for your htaccess as well, which makes it non-static again... ;-)

bmarwell avatar Sep 14 '21 19:09 bmarwell

Related: https://github.com/jbake-org/jbake/issues/751

bmarwell avatar Mar 10 '22 09:03 bmarwell