Commit 5427f08

Daniel Axtens <dja@axtens.net>
2026-10-05 23:02:59
Drop copy: rarely would I want the content of a blob, plus it requires JS
1 parent 7e1761b
Changed files (3)
pkg/templates/header.gohtml
@@ -26,13 +26,6 @@
             {{ end }}
             {{ if .RawHref }}
                 <div class="raw-actions">
-                    <a class="raw-btn" href="{{.RawHref}}">Raw</a>
-                    <button class="raw-btn has-tooltip" onclick="copyRaw(this, '{{.RawHref}}')">
-                        <svg aria-hidden="true" focusable="false" width="16" height="16">
-                            <use xlink:href="#copy"></use>
-                        </svg>
-                        <span class="tooltip">Copy raw content</span>
-                    </button>
                     <a class="raw-btn has-tooltip" href="{{.RawHref}}" download>
                         <svg aria-hidden="true" focusable="false" width="16" height="16">
                             <use xlink:href="#download"></use>
pkg/templates/layout.gohtml
@@ -367,23 +367,5 @@
 <footer>
     Generated by <a href="https://github.com/antonmedv/gitmal">Gitmal</a>
 </footer>
-<script>
-function copyRaw(btn, url) {
-    var tip = btn.querySelector('.tooltip');
-    var original = tip.textContent;
-    fetch(url)
-        .then(function(r) { return r.text(); })
-        .then(function(text) { return navigator.clipboard.writeText(text); })
-        .then(function() {
-            tip.textContent = 'Copied!';
-            btn.classList.add('copied');
-            setTimeout(function() {
-                btn.classList.remove('copied');
-                tip.textContent = original;
-            }, 2000);
-        })
-        .catch(function(err) { console.error('Copy failed:', err); });
-}
-</script>
 </body>
 </html>
pkg/templates/svg.gohtml
@@ -46,10 +46,6 @@
             <path fill="currentColor"
                   d="m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z"></path>
         </symbol>
-        <symbol id="copy" viewBox="0 0 16 16">
-            <path fill="currentColor"
-                  d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25ZM5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path>
-        </symbol>
         <symbol id="download" viewBox="0 0 16 16">
             <path fill="currentColor"
                   d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14ZM7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06Z"></path>