Skip to content

Commit

Permalink
📝 Add build information to page
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed May 24, 2024
1 parent f47ac00 commit 896e345
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
12 changes: 12 additions & 0 deletions src/assets/cardfoldr.js
Original file line number Diff line number Diff line change
Expand Up @@ -1049,4 +1049,16 @@ window.onload = async () => {

// load presets
refreshPresetList();

// load and fill in version
try {
const versionInfo = await fetch("./version.json");
const versionData = await versionInfo.json();
const version = versionData.commit && versionData.build && versionData.date ? `Build #${versionData.build} of commit ${versionData.commit}` : "Local build";

const versionElement = document.getElementById("version");
versionElement.innerHTML = ` · ${version}`;
} catch (e) {
console.error("Error loading version information", e);
}
};
3 changes: 0 additions & 3 deletions src/assets/version.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ <h2>Result: Generated PDF</h2>

<footer>
<p>
Created with ❤️ by <a href="https://foosel.net">Gina "foosel" Häußge</a>
Created with ❤️ by <a href="https://foosel.net">Gina "foosel" Häußge</a><span id="version"></span>
</p>
</footer>
</body>
Expand Down
1 change: 1 addition & 0 deletions src/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}

0 comments on commit 896e345

Please sign in to comment.