Files
fundor333.com/layouts/partials/cite.html
2026-01-12 01:04:42 +01:00

28 lines
827 B
HTML

<details>
<summary>Reference this post</summary>
<p id="cite">Please reference this post with a link to this page. I prefer to be called <i>Fundor333</i> (he/him) or <i>Fundor333' Blog</i>.
</p>
<p>
<a href="https://fundor333.com/cite">Learn more</a>
</p>
<label>URL for this post: <input onclick="myFunction()" disabled style="cursor: text;" type="text" value="{{ .Page.Permalink }}" id="citeInput">
</label>
</details>
<script>
function myFunction() {
// Get the text field
var copyText = document.getElementById("citeInput");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
alert("Copied the text!" );
}
</script>