wvuweb / hammer

A tool for CleanSlate theme development
https://cleanslate.wvu.edu
4 stars 2 forks source link

Add support for tag: `cache_key` #99

Open adamjohnson opened 3 years ago

adamjohnson commented 3 years ago

How to reproduce

  1. Start hammer: hammer-start
  2. Navigate to the backpage template in Brand Patterns (or any theme you like): http://localhost:2000/brand-patterns/views/backpage.html
  3. Open the Backpage template in the brand-patterns repo in your code editor then add <r:r:cache_key /> anywhere in the template.

Tag to add support for

r:cache_key:

<h1><r:cache_key /></h1>

Example output:

A random 10 digit number:

1627497592

This tag can be useful when building URL's to assets. EG:

https://<r:site:domain />/public/<r:cache_key />/sitemap.xml

Link to tags in CleanSlate repo

cleanslate/app/lib/slate/radius/tags/theme_asset.rb (Github)