Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotate domains next to links #26

Merged
merged 1 commit into from Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions layouts/partials/footer_custom.html
Expand Up @@ -2,6 +2,7 @@
If you want to include any custom html just before </body>, put it in this file.
Or you can delete these file if you don't need it.
-->
<script src="{{ "js/links.js" | relURL }}"></script>
<!-- for example, you could include some js libraries:
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.19.1/vis.js" integrity="sha256-HdIuWBZj4eftihsoDCJoMYjZi6aNVaw7YlUpzKT3ZxI=" crossorigin="anonymous"></script>
-->
1 change: 1 addition & 0 deletions layouts/partials/head_custom.html
Expand Up @@ -13,6 +13,7 @@
}
</style>
-->
<link rel="stylesheet" href="{{ "css/links.css" | relURL }}" />
<!-- or you could include some additional css libraries:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.19.1/vis.css" integrity="sha256-I1UoFd33KHIydu88R9owFaQWzwkiZV4hXXug5aYaM28=" crossorigin="anonymous" />
-->
5 changes: 5 additions & 0 deletions static/css/links.css
@@ -0,0 +1,5 @@
.link-annot {
color: #808080;
font-size: 14px;
font-family: monospace;
}
7 changes: 7 additions & 0 deletions static/js/links.js
@@ -0,0 +1,7 @@
$(document).ready(function() {
$('.blog-post a').not('.share a').each(function() {
if (this.hostname != window.location.hostname) {
this.hostname && $(this).after(' <span class="link-annot">('+this.hostname+')</span>');
}
});
});