dencold / hasper

a port of Ghost's casper theme for Hugo
MIT License
22 stars 7 forks source link

Add .Site.BaseURL into all theme paths #28

Open dencold opened 7 years ago

dencold commented 7 years ago

This is a reversal from my thinking on #18, where I was planning to axe all references to .Site.BaseURL. Here was my followup from that ticket:

I've revisited this and have decided my original intuition is not correct. The .Site.BaseURL parameter can be very helpful for users who use hugo for serving content from a specific location that isn't at the server root. A common example is http://mywebsite.com/blog.

Without using BaseURL the user would be forced to locate all resources (like css/js/etc.) at the root directory, but maybe they have an application running there and that has its own set of assets. If we use BaseURL we can encapsulate everything we need in the static site. Much better approach.

I'll go through all template files and make sure we reference this site variable correctly. It will make the lives of those users who use a separate directory for deployment much easier.