mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
landing page - use correct gitworkshop link
This commit is contained in:
+14
-2
@@ -51,7 +51,6 @@ pub fn get_html(config: &Config) -> String {
|
||||
base_css = get_base_css(),
|
||||
relay_name = config.relay_name,
|
||||
relay_description = config.relay_description,
|
||||
domain = config.domain,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -323,7 +322,7 @@ pub fn get_repo_html(config: &Config, npub: &str, identifier: &str) -> String {
|
||||
<span class="client-name">gitworkshop.dev</span>
|
||||
<span class="client-desc">Web-based repository browser</span>
|
||||
</div>
|
||||
<a href="https://gitworkshop.dev" target="_blank">Visit →</a>
|
||||
<a id="gitworkshop-link" href="https://gitworkshop.dev" target="_blank">Visit →</a>
|
||||
</div>
|
||||
<div class="card client-card">
|
||||
<div class="client-info">
|
||||
@@ -342,6 +341,19 @@ pub fn get_repo_html(config: &Config, npub: &str, identifier: &str) -> String {
|
||||
</div>
|
||||
<div class="footer">Powered by <strong>ngit-grasp</strong></div>
|
||||
</div>
|
||||
<script>
|
||||
// Detect protocol and construct gitworkshop link
|
||||
const protocol = window.location.protocol; // 'http:' or 'https:'
|
||||
const host = window.location.host; // 'domain.com' or 'domain.com:port'
|
||||
|
||||
// For http, use ws:// prefix and URL encode; for https, just use host (implies wss://)
|
||||
let relayref = host;
|
||||
if (protocol === 'http:') relayref = encodeURIComponent("ws://" + host);
|
||||
|
||||
// Construct gitworkshop link: gitworkshop.dev/npub/relayref/identifier
|
||||
const gitworkshopLink = document.getElementById('gitworkshop-link');
|
||||
gitworkshopLink.setAttribute('href', 'https://gitworkshop.dev/{npub}/' + relayref + '/{identifier}');
|
||||
</script>
|
||||
</body>
|
||||
</html>"##,
|
||||
base_css = get_base_css(),
|
||||
|
||||
+14
-1
@@ -220,7 +220,7 @@
|
||||
|
||||
<p class="subtitle">{relay_description}</p>
|
||||
|
||||
<a href="https://gitworkshop.dev/relay/{domain}" class="browse-link" target="_blank">
|
||||
<a id="browse-link" href="https://gitworkshop.dev" class="browse-link" target="_blank">
|
||||
Browse Repositories on GitWorkshop.dev →
|
||||
</a>
|
||||
|
||||
@@ -295,5 +295,18 @@
|
||||
Powered by <strong>ngit-grasp</strong>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
// Detect protocol and construct gitworkshop relay link
|
||||
const protocol = window.location.protocol; // 'http:' or 'https:'
|
||||
const host = window.location.host; // 'domain.com' or 'domain.com:port'
|
||||
|
||||
// For http, use ws:// prefix and URL encode; for https, just use host (implies wss://)
|
||||
let relayref = host;
|
||||
if (protocol === 'http:') relayref = encodeURIComponent("ws://" + host);
|
||||
|
||||
// Update the browse link to point to the relay on gitworkshop
|
||||
const browseLink = document.getElementById('browse-link');
|
||||
browseLink.setAttribute('href', 'https://gitworkshop.dev/relay/' + relayref);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user