Skip to content

Commit dd24b3f

Browse files
authored
releases from github directly
1 parent a14a123 commit dd24b3f

File tree

1 file changed

+42
-7
lines changed

1 file changed

+42
-7
lines changed

index.html

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,48 @@ <h2>News and Updates</h2>
119119
<div class="col-sm-4">
120120
<h2>Releases</h2>
121121
<div>
122-
{% for post in site.tags.release limit:6 %}
123-
{% if post.categories contains 'release' %}
124-
<p class="post-item">
125-
{{ post.date | date: '%Y-%m-%d' }} <a class="post-link" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
126-
</p>
127-
{% endif %}
128-
{% endfor %}
122+
<div id="github-releases">
123+
<p>Loading releases...</p>
124+
</div>
125+
126+
<script>
127+
(async function () {
128+
const container = document.getElementById('github-releases');
129+
const repo = "eclipse-dirigible/dirigible";
130+
const limit = 6;
131+
132+
try {
133+
const response = await fetch(`https://api.github.com/repos/${repo}/releases`);
134+
const releases = await response.json();
135+
136+
if (!Array.isArray(releases)) {
137+
container.innerHTML = "<p>Failed to load releases.</p>";
138+
return;
139+
}
140+
141+
const html = releases
142+
.slice(0, limit)
143+
.map(r => {
144+
const date = new Date(r.published_at).toISOString().split('T')[0];
145+
return `
146+
<p class="post-item">
147+
${date}
148+
<a class="post-link" href="${r.html_url}" target="_blank">
149+
${r.name || r.tag_name}
150+
</a>
151+
</p>
152+
`;
153+
})
154+
.join("");
155+
156+
container.innerHTML = html;
157+
158+
} catch (e) {
159+
container.innerHTML = "<p>Error loading releases.</p>";
160+
console.error(e);
161+
}
162+
})();
163+
</script>
129164
</div>
130165
<br>
131166
<a class="btn btn-default" href="{{ site.url }}/releases.html" target="_blank">All Releases ...</a> <a class="btn btn-primary" href="http://download.dirigible.io" target="_blank">Downloads</a>

0 commit comments

Comments
 (0)