5 Commits

Author SHA1 Message Date
b1cdf7c318 Remove share buttons
About 0.19% of visitors in the past 12 months have clicked the share
buttons at all. The code is a little ugly, and it wastes a tiny bit of
space at the bottom of the page. I don't think it's really worth having.

And I think people probably print a page through the browser UI anyways.
2025-08-09 00:22:27 -05:00
14475c13f4 Remove full-width-hr shortcode
Not sure what I planned to use this for. It has since become outdated
and out of sync with the new margins I set on body recently in
4e753395ba and
6b729c6acf.
2025-08-08 14:10:20 -05:00
6b729c6acf Adjust margins on related-posts to match rest of body
Didn't notice this when writing 4e753395ba
2025-08-08 14:01:37 -05:00
f751c4b104 Remove unused .full-width-page-list rule 2025-08-08 13:51:50 -05:00
de20387b5a Fix useless scrollbar on related posts
When all related posts fit on the same screen, there was a useless
scrollbar. I never noticed this because Firefox incorrectly hides the
scrollbar automatically. The issue is visible on Chromium.
2025-08-08 13:45:30 -05:00
7 changed files with 9 additions and 153 deletions

View File

@@ -217,14 +217,6 @@ hr {
border: 1px solid var(--background-3);
}
@media (min-width: 720px) {
.full-width-hr {
/* see also: the related-posts section too */
margin-left: calc(-100vw / 2 + 760px / 2);
margin-right: calc(-100vw / 2 + 760px / 2);
}
}
table.simple {
border-collapse: collapse;
border: 2px solid var(--text-1);
@@ -676,43 +668,6 @@ footer p {
padding: 8px 15px;
}
/* Social media share buttons */
.share-buttons {
background: var(--background-1);
color: var(--text-1);
margin: 25px 0;
padding: 8px 0;
border-radius: 8px;
display: flex;
gap: 8px;
justify-content: center;
font-size: 32px;
}
.share-buttons a {
background-color: var(--background-2);
color: var(--text-2);
padding: 4px;
border-radius: 8px;
}
.share-buttons a:hover {
background-color: var(--background-3);
color: var(--text-3);
}
.share-buttons svg {
display: block;
}
/* https://stackoverflow.com/a/72073682/19003757 */
/*
.telegram-share > svg {
transform: scale(1.5);
margin: 9px -9px -9px 9px;
}
*/
/* See also formating */
.see-also {
background-color: var(--background-1);
@@ -891,15 +846,14 @@ aside.quote {
/* Related posts section {{{ */
.full-width-page-list {
/* make left/right 0 margin so it takes up full width */
margin: 25px 0;
}
/* set the margins on the contents instead of the parent .related-posts
* so that the posts in the list clip off the edge of the screen,
* which makes a more obvious indicator that it's scrollable
*/
.related-posts > hr,
.related-posts > h1 {
margin-left: 20px;
margin-right: 20px;
margin: var(--page-margin);
}
.related-posts .page {
@@ -909,17 +863,18 @@ aside.quote {
}
.related-posts .page:first-child {
margin-left: 20px;
margin-left: var(--page-margin);
}
.related-posts .page:last-child {
margin-right: 20px;
margin-right: var(--page-margin);
}
.related-posts .page-list {
display: flex;
flex-direction: row;
gap: 20px;
overflow-x: scroll;
overflow-x: auto;
margin-bottom: var(--page-margin);
}
/* }}} */
@@ -945,7 +900,6 @@ aside.quote {
.post-meta-view-markdown,
.code-copy-button,
.prevnext,
.share-buttons,
.related-posts {
display: none;
}

View File

@@ -1,3 +0,0 @@
function share_event(service) {
plausible("Share", {props: {Network: service}});
}

View File

@@ -125,21 +125,3 @@ aria_navbar:
aria_table_of_contents:
other: "table of contents"
aria_share_twitter:
other: "share to twitter button"
aria_share_facebook:
other: "share to facebook button"
aria_share_linkedin:
other: "share to linkedin button"
aria_share_reddit:
other: "share to reddit button"
aria_share_telegram:
other: "share to telegram button"
aria_share_print:
other: "print article button"

View File

@@ -19,9 +19,6 @@
{{ if not hugo.IsServer }}
<script defer data-domain="bbaovanc.com" src="https://plausible.bbaovanc.com/js/bobalytics.outbound-links.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
{{ with resources.Get "js/share-event.js" | fingerprint "sha512" }}
<script defer src="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ end }}
{{ $isso_url := .Permalink }}
{{ if .IsTranslated }}

View File

@@ -1,69 +0,0 @@
<div class="share-buttons">
{{ if .Site.Params.shareButtons.twitter }}
<a class="twitter-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_twitter" }}"
onclick="share_event('Twitter');"
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
{{- partial "icon.html" "twitter" -}}
</a>
{{ end }}
{{ if .Site.Params.shareButtons.facebook }}
<a class="facebook-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_facebook" }}"
onclick="share_event('Facebook');"
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
{{- partial "icon.html" "facebook" -}}
</a>
{{ end }}
{{ if .Site.Params.shareButtons.linkedin }}
<a class="linkedin-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_linkedin" }}"
onclick="share_event('LinkedIn');"
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
{{- partial "icon.html" "linkedin" -}}
</a>
{{ end }}
{{ if .Site.Params.shareButtons.reddit }}
<a class="reddit-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_reddit" }}"
onclick="share_event('Reddit');"
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
{{- partial "icon.html" "reddit" -}}
</a>
{{ end }}
{{/* Telegram icon doesn't have `viewbox` set, which breaks the sizing.
https://stackoverflow.com/q/72073399/19003757
https://github.com/michaelampr/jam/issues/39
{{ if .Site.Params.shareButtons.telegram }}
<a class="telegram-share"
target="_blank"
rel="noopener"
aria-label="{{ i18n "aria_share_telegram" }}"
onclick="share_event('Telegram');"
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
{{- partial "icon.html" "telegram" -}}
</a>
{{ end }}
*/}}
{{ if .Site.Params.shareButtons.print }}
<a class="print-share"
aria-label="{{ i18n "aria_share_print" }}"
href="javascript:void(0)"
onclick="window.print(); share_event('Print');">
{{- partial "icon.html" "printer" -}}
</a>
{{ end }}
</div>

View File

@@ -1 +0,0 @@
<hr class="full-width-hr">

View File

@@ -60,10 +60,6 @@
</div>
{{ end }}
{{ if .Site.Params.shareButtons }}
{{ partial "share.html" . }}
{{ end }}
{{ if .Params.comments }}
<div class="comments">
{{ partial "comments.html" . }}