diff --git a/_layouts/analytics.html b/_layouts/analytics.html index ba831625c461..d9d19cde3a6b 100644 --- a/_layouts/analytics.html +++ b/_layouts/analytics.html @@ -54,7 +54,8 @@

Total Events: {{ analytics_data.total_count }}

{%- elsif page.category == "homebrew-versions" -%} {{ item.version | escape }} {%- elsif page.category == "cask-install" -%} - {%- if site.data.cask[item.cask] != nil -%} + {%- assign data_name = item.cask | remove: "@" | remove: "." | replace: "+", "_" -%} + {%- if site.data.cask[data_name] != nil -%} {{ item.cask | escape }} {%- else -%} {{ item.cask | escape }} diff --git a/_layouts/cask_json.json b/_layouts/cask_json.json index f6f72fbf5a57..df10c049c034 100644 --- a/_layouts/cask_json.json +++ b/_layouts/cask_json.json @@ -1,7 +1,8 @@ --- --- -{%- assign token = page.name | remove: ".json" -%} -{%- assign cask = site.data.cask[token] -%} +{%- assign full_name = page.name | remove: ".json" -%} +{%- assign data_name = full_name | remove: "@" | remove: "." | replace: "+", "_" -%} +{%- assign cask = site.data.cask[data_name] -%} { {%- for key_value in cask -%} @@ -11,19 +12,20 @@ "analytics":{"install":{ {%- for interval in site.analytics.intervals -%} "{{ interval.path }}":{ - {%- if site.data.analytics.cask-install.homebrew-cask[interval.path].formulae[token].size > 0 -%} - {%- for fa in site.data.analytics.cask-install.homebrew-cask[interval.path].formulae[token] -%} + {%- if site.data.analytics.cask-install.homebrew-cask[interval.path].formulae[full_name].size > 0 -%} + {%- for fa in site.data.analytics.cask-install.homebrew-cask[interval.path].formulae[full_name] -%} {{ fa.cask | jsonify }}:{{ fa.count | remove: "," | plus: 0 }} {%- unless forloop.last -%} , {%- endunless -%} {%- endfor -%} {%- else -%} - {{ token | jsonify }}:0 + {{ full_name | jsonify }}:0 {%- endif -%} } {%- unless forloop.last -%} , {%- endunless -%} {%- endfor -%} -}},"generated_date":"{{ "today" | date: "%F" }}"} +}}, +"generated_date":"{{ "today" | date: "%F" }}"}