diff options
author | Jade Dominguez <plusjade@gmail.com> | 2012-01-21 18:08:35 -0800 |
---|---|---|
committer | Jade Dominguez <plusjade@gmail.com> | 2012-01-21 18:08:35 -0800 |
commit | 75fa188fa728afea2ad53925b77e317d9b134417 (patch) | |
tree | 4912e48ac24fe0832a5281d1db50d51b5c61f437 /_includes | |
parent | 61cdb7a8031d1c99c222c4242e199a31c42dabb8 (diff) |
Add ability to dynamically set url paths
This makes GitHub Pages for projects support possible as all urls will need to call on the project's subfolder. The other important piece is that urls should resolve to root locally but be able to change when in production. LLastly this gives themes clear integration points for working with paths. (the jbcache hack just makes it so there is not unnecessary whitespace output in the source.
Diffstat (limited to '_includes')
-rw-r--r-- | _includes/JB/set_paths | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/_includes/JB/set_paths b/_includes/JB/set_paths new file mode 100644 index 0000000..890f2d8 --- /dev/null +++ b/_includes/JB/set_paths @@ -0,0 +1,20 @@ +{% capture jbcache %} +<!-- + Dynamically set liquid variables for working with URLs/paths +--> + + {% if site.safe and site.JB.BASE_PATH %} + {% assign BASE_PATH = site.JB.BASE_PATH %} + {% assign HOME_URL = site.JB.BASE_PATH %} + {% else %} + {% assign BASE_PATH = "" %} + {% assign HOME_URL = "/" %} + {% endif %} + + {% if site.JB.ASSET_PATH %} + {% assign ASSET_PATH = site.JB.ASSET_PATH %} + {% else %} + {% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ page.theme.name }}{% endcapture %} + {% endif %} + +{% endcapture %}{% assign jbcache = null %}
\ No newline at end of file |