Skip to content

Commit 6a3e89f

Browse files
committed
Add dynamic changelog page for XerahS
1 parent faafc30 commit 6a3e89f

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

_includes/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<a class="nav-link" href="{% if page.url contains '/xerahs/' %}/xerahs/downloads{% else %}/downloads{% endif %}">Downloads</a>
1414
</li>
1515
<li class="nav-item{% if page.title == 'Changelog' %} active{% endif %}">
16-
<a class="nav-link" href="{% if page.url contains '/xerahs/' %}https://github.com/ShareX/XerahS/releases{% else %}/changelog{% endif %}">Changelog</a>
16+
<a class="nav-link" href="{% if page.url contains '/xerahs/' %}/xerahs/changelog{% else %}/changelog{% endif %}">Changelog</a>
1717
</li>
1818
<li class="nav-item{% if page.title == 'Screenshots' %} active{% endif %}">
1919
<a class="nav-link" href="{% if page.url contains '/xerahs/' %}/xerahs/screenshots{% else %}/screenshots{% endif %}">Screenshots</a>

xerahs/changelog.html

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
layout: default
3+
title: Changelog
4+
---
5+
6+
<div class="jumbotron jumbotron-compact">
7+
<div class="container">
8+
<h1>
9+
<a href="/xerahs/">XerahS</a>
10+
</h1>
11+
<p>Changelog</p>
12+
</div>
13+
</div>
14+
15+
<div class="container">
16+
<div class="row">
17+
<div class="col-lg-12">
18+
<div id="changelog-content">
19+
<p class="text-center"><i class="fas fa-spinner fa-spin fa-3x"></i><br>Loading changelog...</p>
20+
</div>
21+
</div>
22+
</div>
23+
</div>
24+
25+
{% include common-js.html %}
26+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
27+
<script>
28+
$(document).ready(function() {
29+
const changelogUrl = "https://raw.githubusercontent.com/ShareX/XerahS/refs/heads/develop/docs/CHANGELOG.md";
30+
31+
$.get(changelogUrl)
32+
.done(function(data) {
33+
const htmlContent = marked.parse(data);
34+
$("#changelog-content").html(htmlContent);
35+
})
36+
.fail(function() {
37+
$("#changelog-content").html('<div class="alert alert-danger">Failed to load changelog from GitHub. <a href="https://github.com/ShareX/XerahS/blob/develop/docs/CHANGELOG.md" target="_blank">View on GitHub</a></div>');
38+
});
39+
});
40+
</script>

0 commit comments

Comments
 (0)