Skip to content

Commit

Permalink
Normalize link icon
Browse files Browse the repository at this point in the history
This reverts commit 6c63732.
  • Loading branch information
jeroen committed Oct 13, 2023
1 parent 6c63732 commit 26d7449
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 23 deletions.
4 changes: 2 additions & 2 deletions themes/ropensci/layouts/partials/blogs/blog-single.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ <h1>{{ .Title | markdownify }}</h1>
<span>{{ i18n "Cite" }}</span><br/>
{{ $doi := (partial "blogs/doi" ( dict "RelPermalink" .RelPermalink )) }}
{{ if ne $doi "" }}
<a href="{{ $doi }}" class="cite link mt-2">{{ $doi | replaceRE "https://" "" }}</a>
<a href="{{ $doi }}" class="cite link mt-2">{{ $doi | replaceRE "https://" "" }} <i class='fas fa-copy copy-cite-link'></i></a>
{{ else }}
<a href="https://rogue-scholar.org/blogs/ropensci " class="cite link mt-2">rogue-scholar.org/blogs/ropensci</a>
<a href="https://rogue-scholar.org/blogs/ropensci " class="cite link mt-2">rogue-scholar.org/blogs/ropensci <i class='fas fa-copy copy-cite-link'></i></a>
{{ end }}
</div>
<div class="field-under mt-4">
Expand Down
2 changes: 1 addition & 1 deletion themes/ropensci/layouts/partials/skeleton/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.js" integrity="sha512-8A++P507RNeVXI9ij39nW3Rlktj3SeblU/NN3uXrSBwKy/yemNU/H6tpdO3VCemVpqHWr2S5CQvChiPAzU+gAg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="/scripts/search.js"></script>
<script src="/scripts/copypaste.js"></script>
<script src="/scripts/copypaste.js?nocache=2"></script>
{{ if and (eq .Kind "page") (eq .Type "packages") }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min.js"></script>
{{ $pkgjs := resources.Get "pagination.min.js" }}
Expand Down
1 change: 0 additions & 1 deletion themes/ropensci/layouts/partials/skeleton/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

<meta http-equiv="X-UA-Compatible" content="ie=edge" />
{{ $css := resources.Get "main.min.css" }}
<link rel="stylesheet" type ="text/css" href="/copypaste.css">
{{ $secureCSS := $css | resources.Fingerprint "sha512" }}
<link href="{{ $secureCSS.Permalink }}" rel="stylesheet" integrity="{{ $secureCSS.Data.Integrity }}">
<link
Expand Down
11 changes: 0 additions & 11 deletions themes/ropensci/static/copypaste.css

This file was deleted.

14 changes: 6 additions & 8 deletions themes/ropensci/static/scripts/copypaste.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
document.querySelectorAll('a.cite').forEach(el => {
const btn = document.createElement('button');
btn.typeName = 'button';
btn.className = 'btn-sm btn-primary copy-button';
btn.innerHTML = "<i class='fa fa-copy'></i>";
btn.onclick = () => navigator.clipboard.writeText(el.getAttribute("href"));
el.parentNode.append(btn);
});
$('.copy-cite-link').click(function(e){
e.preventDefault();
alert("Copying link to cliboard!");
var txt = $(this).parent().focus().attr('href');
navigator.clipboard.writeText(txt);
});

0 comments on commit 26d7449

Please sign in to comment.