I am building a Jekyll site with around 30 favicon files (e.g. apple-icon, android-icon, etc.) that need to be in the root directory of the compiled site.
Putting all of the files in the root of the source Jekyll folder is possible, and would work, but produces a lot of clutter in the root directory, which I don't want. For that reason, would is it possible to put all of these files in a single separate folder, and force all of the files in that folder to compile into the root directory of the compiled folder (like a permalink).
I know it is possible to set permalinks for individual files like index.md
, but is it possible to set permalinks for entire folders, or every file in a folder?
Effectively, my file structure for the source of the Jekyll site would look like this:
-- index.md
-- _posts
...
-- favicons
-- android-icon-36x36.png
-- android-icon-72x72.png
-- apple-icon.png
And I'd like all of the files in the favicons
folder to compile to the root folder, like this:
-- index.html
...
-- android-icon-36x36.png
-- android-icon-72x72.png
-- apple-icon.png
I'm sorry if this question was too long or too short — this is my first question, and I hope to learn how to write questions most effectively on Stack Overflow in the near future.
Fred,
I'm not sure exactly what your use case is, but it may not be that you need your favicons to be in your root folder.
If you have not already specified a baseurl/permalink in your config.yml
, it may be worth doing that and confirming that your links are pointing to the right place.
Overall, the best solution is likely to leave your favicons in the favicons
folder and link to that folder explicitly. The best way to do this is typically by defining a baseurl
in your config.yml
. You'd then link to your favicons by using links that look like {{site.baseurl}}/favicons/apple-icon.png
.