-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathinfo.json
169 lines (151 loc) · 5.76 KB
/
info.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
---
layout: none
---
{%- comment -%}
ABOUT:
This is a Liquid template allowing us to render to info.json
based on content found in index.yaml. It is put in place in
order to allow a img.shields.io badge dynamically render info
about the latest release of various kinds.
Here is a set of example badges in Markdown for the JupyterHub
Helm chart:
[](https://jupyterhub.github.io/helm-chart/)
[](https://jupyterhub.github.io/helm-chart/)
[](https://jupyterhub.github.io/helm-chart/)
Here is an example rendering of this file:
{
"jupyterhub":
{
"stable": "0.10.1",
"pre": "0.10.2-beta.1",
"dev": "0.10.2-beta.1.n008.ha16f87e6",
"latest": "0.10.2-beta.1.n008.ha16f87e6"
},
"binderhub":
{
"stable": "",
"pre": "0.2.0-072.544c0b1",
"dev": "0.2.0-n361.h6f57706",
"latest": "0.2.0-n361.h6f57706"
},
"pebble":
{
"stable": "0.2.2",
"pre": "0.2.2",
"dev": "0.2.2-n000.hefa0ee7",
"latest": "0.2.2-n000.hefa0ee7"
}
}
{%- endcomment -%}
{%- comment -%}
IMPLEMENTATION LOGIC
all:
pick the latest created chart...
stable:
... with a version without a "-" character in it
pre:
... with a version with a "-" character in it and a single "." character
dev aka. latest:
... just pick the latest version.
{%- endcomment -%}
{%- assign jupyterhub = site.data.index.entries.jupyterhub | sort: 'created' | reverse -%}
{%- assign binderhub = site.data.index.entries.binderhub | sort: 'created' | reverse -%}
{%- assign pebble = site.data.index.entries.pebble | sort: 'created' | reverse -%}
{%- assign jh_latest = jupyterhub | first -%}
{%- assign bh_latest = binderhub | first -%}
{%- assign pebble_latest = pebble | first -%}
{%- capture "jh_stable_version" -%}
{%- for chart in jupyterhub -%}
{%- unless chart.version contains "-" -%}
{{ chart.version }};
{%- endunless -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign jh_stable_version = jh_stable_version | split: ";" | first -%}
{%- capture "jh_pre_version" -%}
{%- for chart in jupyterhub -%}
{%- assign dots_count_after_dash = chart.version | split: "-" | shift | first | split: "." | size | minus: 1 -%}
{%- assign first_char_after_dash = chart.version | split: "-" | shift | first | slice: 0 -%}
{%- if chart.version contains "-" -%}
{%- if dots_count_after_dash == 1 -%}
{%- if first_char_after_dash != "n" -%}
{{ chart.version }};
{%- endif -%}
{%- endif -%}
{%- else -%}
{{ chart.version }};
{%- endif -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign jh_pre_version = jh_pre_version | split: ";" | first -%}
{%- capture "bh_stable_version" -%}
{%- for chart in binderhub -%}
{%- unless chart.version contains "-" -%}
{{ chart.version }};
{%- endunless -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign bh_stable_version = bh_stable_version | split: ";" | first -%}
{%- capture "bh_pre_version" -%}
{%- for chart in binderhub -%}
{%- assign dots_count_after_dash = chart.version | split: "-" | shift | first | split: "." | size | minus: 1 -%}
{%- assign first_char_after_dash = chart.version | split: "-" | shift | first | slice: 0 -%}
{%- if chart.version contains "-" -%}
{%- if dots_count_after_dash == 1 -%}
{%- if first_char_after_dash != "n" -%}
{{ chart.version }};
{%- endif -%}
{%- endif -%}
{%- else -%}
{{ chart.version }};
{%- endif -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign bh_pre_version = bh_pre_version | split: ";" | first -%}
{%- capture "pebble_stable_version" -%}
{%- for chart in pebble -%}
{%- unless chart.version contains "-" -%}
{{ chart.version }};
{%- endunless -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign pebble_stable_version = pebble_stable_version | split: ";" | first -%}
{%- capture "pebble_pre_version" -%}
{%- for chart in pebble -%}
{%- assign dots_count_after_dash = chart.version | split: "-" | shift | first | split: "." | size | minus: 1 -%}
{%- assign first_char_after_dash = chart.version | split: "-" | shift | first | slice: 0 -%}
{%- if chart.version contains "-" -%}
{%- if dots_count_after_dash == 1 -%}
{%- if first_char_after_dash != "n" -%}
{{ chart.version }};
{%- endif -%}
{%- endif -%}
{%- else -%}
{{ chart.version }};
{%- endif -%}
{%- endfor -%}
{%- endcapture -%}
{%- assign pebble_pre_version = pebble_pre_version | split: ";" | first -%}
{
"jupyterhub":
{
"stable": "{{ jh_stable_version }}",
"pre": "{{ jh_pre_version }}",
"dev": "{{ jh_latest.version }}",
"latest": "{{ jh_latest.version }}"
},
"binderhub":
{
"stable": "{{ bh_stable_version }}",
"pre": "{{ bh_pre_version }}",
"dev": "{{ bh_latest.version }}",
"latest": "{{ bh_latest.version }}"
},
"pebble":
{
"stable": "{{ pebble_stable_version }}",
"pre": "{{ pebble_pre_version }}",
"dev": "{{ pebble_latest.version }}",
"latest": "{{ pebble_latest.version }}"
}
}