Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add {{ content_dir }} and {{ content_url }} to twig_vars
This allows you to use {{ content_dir }} or {{ content_url }} in your theme templates. I use it for adding images (sliders, header images, logos) or other file-specific content that I still want to be accessible by the client. It is a lot easier for them if their site "lives" in the content folder. My usage: ```html {% for slide in config.slides %} <div> <img src="{{ content_url }}/images/{{ slide }}"> </div> {% endfor %} ``` Output ```html <div> <img src="http://ohdoylerules.com/images/slide-1.jpg"> </div> <div> <img src="http://ohdoylerules.com/images/slide-2.jpg"> </div> ``` This makes for a universal image. Which can be used regardless of the theme I have enabled.
- Loading branch information