Merge branch 'dev' into feature/add_logo_dark_light_mode_switching

This commit is contained in:
Daniel Odrinski 2023-05-09 14:12:59 +01:00 committed by GitHub
commit cd946b93e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 88 additions and 74 deletions

View file

@ -748,7 +748,7 @@ select {
}
.prose :where(a):not(:where([class~="not-prose"] *)):hover {
color: rgba(var(--color-neutral), 1);
color: rgba(var(--color-primary-600), 1);
text-decoration: none;
border-radius: 0.09rem;
}
@ -1066,7 +1066,7 @@ select {
--tw-prose-body: rgba(var(--color-neutral-700), 1);
--tw-prose-headings: rgba(var(--color-neutral-800), 1);
--tw-prose-lead: rgba(var(--color-neutral-500), 1);
--tw-prose-links: rgba(var(--color-primary-700), 1);
--tw-prose-links: rgba(var(--color-primary-600), 1);
--tw-prose-bold: rgba(var(--color-neutral-900), 1);
--tw-prose-counters: rgba(var(--color-neutral-800), 1);
--tw-prose-bullets: rgba(var(--color-neutral-500), 1);
@ -1403,8 +1403,8 @@ select {
top: 5rem;
}
.top-\[100vh\] {
top: 100vh;
.top-\[110vh\] {
top: 110vh;
}
.top-\[11px\] {
@ -5384,6 +5384,10 @@ body:has(#menu-controller:checked) {
text-decoration-color: rgba(var(--color-neutral-600), 1);
}
:is(.dark .dark\:prose-invert) :where(a):not(:where([class~="not-prose"] *)):hover {
color: rgba(var(--color-primary-400), 1);
}
:is(.dark .dark\:prose-invert) :where(kbd):not(:where([class~="not-prose"] *)) {
color: rgba(var(--color-neutral-200), 1);
background-color: rgba(var(--color-neutral-700), 1);

View file

@ -91,3 +91,11 @@ var updateLogo = (targetAppearance) => {
var getTargetAppearance = () => {
return document.documentElement.classList.contains("dark") ? "dark" : "light"
}
window.addEventListener("DOMContentLoaded", (event) => {
const scroller = document.getElementById("top-scroller");
const footer = document.getElementById("site-footer");
if(scroller.getBoundingClientRect().top > footer.getBoundingClientRect().top) {
scroller.hidden = true;
}
});

View file

@ -3,26 +3,23 @@ if (typeof auth !== 'undefined') {
var likesCollection = db.collection('likes');
function numberWithCommas(x) {
//return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
var update_views = function (oid, id) {
var update_views = function (node, id) {
viewsCollection.doc(id).onSnapshot(doc => {
var data = doc.data();
if (data) {
var label = document.querySelectorAll("span[id='" + oid + "']")[0].innerText.split(' ')[1]
document.querySelectorAll("span[id='" + oid + "']")[0].innerText = numberWithCommas(data.views)
node.innerText = numberWithCommas(data.views)
}
})
}
var update_likes = function (oid, id) {
var update_likes = function (node, id) {
likesCollection.doc(id).onSnapshot(doc => {
var data = doc.data();
if (data) {
var label = document.querySelectorAll("span[id='" + oid + "']")[0].innerText.split(' ')[1]
document.querySelectorAll("span[id='" + oid + "']")[0].innerText = numberWithCommas(data.likes)
node.innerText = numberWithCommas(data.likes)
}
})
}
@ -33,20 +30,20 @@ if (typeof auth !== 'undefined') {
var views_nodes = document.querySelectorAll("span[id^='views_']")
for (var i in views_nodes) {
var oid = views_nodes[i].id
var id = oid ? oid.replaceAll("/", "-") : oid
var node = views_nodes[i]
var id = node.id ? node.id.replaceAll("/", "-") : node.id
if (id) {
update_views(oid, id)
update_views(node, id)
}
}
var likes_nodes = document.querySelectorAll("span[id^='likes_']")
for (var i in likes_nodes) {
var oid = likes_nodes[i].id
var id = oid ? oid.replaceAll("/", "-") : oid
var node = likes_nodes[i]
var id = node.id ? node.id.replaceAll("/", "-") : node.id
if (id) {
update_likes(oid, id)
update_likes(node, id)
}
}
})

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -57,6 +57,7 @@ The theme currently supports the following languages by default:
| Language | Code |
| ------------------------------ | ------- |
| 🇧🇬 Bulgarian | `bg` |
| 🇧🇩 Bengali | `bn` |
| 🇨🇿 Czech | `cs` |
| 🇩🇪 German | `de` |

View file

@ -73,7 +73,8 @@ Real websites that are built with Blowfish.
| [terraformbuch.de](https://terraformbuch.de/) | Book site |
| [shenshu.fun](https://shenshu.fun/) | Personal site |
| [hellstabber.github.io](https://hellstabber.github.io/) | Personal site |
| [clemsau.com](https://clemsau.com/) | Personal site |
| [lelouvincx.github.io](https://lelouvincx.github.io/) | Personal site |
{{< alert >}}

View file

@ -1,5 +1,5 @@
global:
language: "БГ"
language: "🇧🇬"
article:
anchor_label: "Котва"
@ -24,7 +24,7 @@ article:
part_of_series: "Тази статия е част от поредица."
part: "Част"
this_article: "Тази Статия"
related_articles: "Related"
related_articles: "Подобни"
author:

View file

@ -10,14 +10,6 @@
{{ end }}
{{- end -}}
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in
.TableOfContents "<ul") }} <header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
@ -27,6 +19,13 @@
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
</div>
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
</header>
<section class="{{ if $toc -}}
mt-12
@ -44,6 +43,9 @@
{{ .Content | emojify }}
</div>
</section>
{{ if gt .Pages 0 }}

View file

@ -42,14 +42,16 @@
</br></br>
{{ partial "series-closed.html" . }}
</div>
<script>
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
</section>
</section>
<footer class="pt-8 max-w-prose print:hidden">
{{ partial "author.html" . }}

View file

@ -1,4 +1,4 @@
<footer class="py-10 print:hidden">
<footer id="site-footer" class="py-10 print:hidden">
{{/* Footer menu */}}
{{ if .Site.Params.footer.showMenu | default true }}
{{ if .Site.Menus.footer }}

View file

@ -73,7 +73,7 @@
integrity="{{ $bundleJS.Data.Integrity }}" data-copy="{{ i18n " code.copy" }}" data-copied="{{ i18n " code.copied"
}}"></script>
{{ end }}
<script src="/js/zoom.min.js"></script>
<script src="{{ "js/zoom.min.js" | relURL }}"></script>
{{/* Icons */}}
{{ if templates.Exists "partials/favicons.html" }}
{{ partialCached "favicons.html" .Site }}

View file

@ -1,4 +1,4 @@
<div class="pointer-events-none absolute top-[100vh] bottom-0 w-12 ltr:right-0 rtl:left-0">
<div id="top-scroller" class="pointer-events-none absolute top-[110vh] bottom-0 w-12 ltr:right-0 rtl:left-0">
<a href="#the-top"
class="pointer-events-auto sticky top-[calc(100vh-5.5rem)] flex h-12 w-12 mb-16 items-center justify-center rounded-full bg-neutral/50 text-xl text-neutral-700 backdrop-blur hover:text-primary-600 dark:bg-neutral-800/50 dark:text-neutral dark:hover:text-primary-400"
aria-label="{{ i18n "nav.scroll_to_top_title" }}" title="{{ i18n "nav.scroll_to_top_title" }}">

52
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "hugo-blowfish-theme",
"version": "2.32.1",
"version": "2.33.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "hugo-blowfish-theme",
"version": "2.32.1",
"version": "2.33.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@ -17,14 +17,14 @@
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"chart.js": "^4.2.1",
"chart.js": "^4.3.0",
"fuse.js": "^6.6.2",
"jquery": "^3.6.4",
"katex": "^0.16.6",
"katex": "^0.16.7",
"packery": "^2.1.2",
"prettier": "^2.8.8",
"prettier-plugin-go-template": "^0.0.13",
"prettier-plugin-tailwindcss": "^0.2.7",
"prettier-plugin-tailwindcss": "^0.2.8",
"rimraf": "^5.0.0",
"tailwindcss": "^3.3.2",
"tw-elements": "1.0.0-beta2",
@ -252,15 +252,15 @@
}
},
"node_modules/chart.js": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.2.1.tgz",
"integrity": "sha512-6YbpQ0nt3NovAgOzbkSSeeAQu/3za1319dPUQTXn9WcOpywM8rGKxJHrhS8V8xEkAlk8YhEfjbuAPfUyp6jIsw==",
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.3.0.tgz",
"integrity": "sha512-ynG0E79xGfMaV2xAHdbhwiPLczxnNNnasrmPEXriXsPJGjmhOBYzFVEsB65w2qMDz+CaBJJuJD0inE/ab/h36g==",
"dev": true,
"dependencies": {
"@kurkle/color": "^0.3.0"
},
"engines": {
"pnpm": "^7.0.0"
"pnpm": ">=7"
}
},
"node_modules/chartjs-plugin-datalabels": {
@ -606,9 +606,9 @@
"peer": true
},
"node_modules/katex": {
"version": "0.16.6",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.6.tgz",
"integrity": "sha512-XVB7X8jEogjJ+OY+a9JdE+VOk9i7znela0HP6WaDbpB4sUh8ghrG0Ccluu2MA2tcJbFAViBC9aVXus2UvkEr8A==",
"version": "0.16.7",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.7.tgz",
"integrity": "sha512-Xk9C6oGKRwJTfqfIbtr0Kes9OSv6IFsuhFGc7tW4urlpMJtuh+7YhzU6YEG9n8gmWKcMAFzkp7nr+r69kV0zrA==",
"dev": true,
"funding": [
"https://opencollective.com/katex",
@ -1049,16 +1049,15 @@
}
},
"node_modules/prettier-plugin-tailwindcss": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.7.tgz",
"integrity": "sha512-jQopIOgjLpX+y8HeD56XZw7onupRTC0cw7eKKUimI7vhjkPF5/1ltW5LyqaPtSyc8HvEpvNZsvvsGFa2qpa59w==",
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.8.tgz",
"integrity": "sha512-KgPcEnJeIijlMjsA6WwYgRs5rh3/q76oInqtMXBA/EMcamrcYJpyhtRhyX1ayT9hnHlHTuO8sIifHF10WuSDKg==",
"dev": true,
"engines": {
"node": ">=12.17.0"
},
"peerDependencies": {
"@ianvs/prettier-plugin-sort-imports": "*",
"@prettier/plugin-php": "*",
"@prettier/plugin-pug": "*",
"@shopify/prettier-plugin-liquid": "*",
"@shufo/prettier-plugin-blade": "*",
@ -1078,9 +1077,6 @@
"@ianvs/prettier-plugin-sort-imports": {
"optional": true
},
"@prettier/plugin-php": {
"optional": true
},
"@prettier/plugin-pug": {
"optional": true
},
@ -1807,9 +1803,9 @@
"integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="
},
"chart.js": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.2.1.tgz",
"integrity": "sha512-6YbpQ0nt3NovAgOzbkSSeeAQu/3za1319dPUQTXn9WcOpywM8rGKxJHrhS8V8xEkAlk8YhEfjbuAPfUyp6jIsw==",
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.3.0.tgz",
"integrity": "sha512-ynG0E79xGfMaV2xAHdbhwiPLczxnNNnasrmPEXriXsPJGjmhOBYzFVEsB65w2qMDz+CaBJJuJD0inE/ab/h36g==",
"dev": true,
"requires": {
"@kurkle/color": "^0.3.0"
@ -2085,9 +2081,9 @@
"peer": true
},
"katex": {
"version": "0.16.6",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.6.tgz",
"integrity": "sha512-XVB7X8jEogjJ+OY+a9JdE+VOk9i7znela0HP6WaDbpB4sUh8ghrG0Ccluu2MA2tcJbFAViBC9aVXus2UvkEr8A==",
"version": "0.16.7",
"resolved": "https://registry.npmjs.org/katex/-/katex-0.16.7.tgz",
"integrity": "sha512-Xk9C6oGKRwJTfqfIbtr0Kes9OSv6IFsuhFGc7tW4urlpMJtuh+7YhzU6YEG9n8gmWKcMAFzkp7nr+r69kV0zrA==",
"dev": true,
"requires": {
"commander": "^8.3.0"
@ -2368,9 +2364,9 @@
}
},
"prettier-plugin-tailwindcss": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.7.tgz",
"integrity": "sha512-jQopIOgjLpX+y8HeD56XZw7onupRTC0cw7eKKUimI7vhjkPF5/1ltW5LyqaPtSyc8HvEpvNZsvvsGFa2qpa59w==",
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.2.8.tgz",
"integrity": "sha512-KgPcEnJeIijlMjsA6WwYgRs5rh3/q76oInqtMXBA/EMcamrcYJpyhtRhyX1ayT9hnHlHTuO8sIifHF10WuSDKg==",
"dev": true,
"requires": {}
},

View file

@ -1,6 +1,6 @@
{
"name": "hugo-blowfish-theme",
"version": "2.33.0",
"version": "2.33.1",
"description": "Blowfish theme for Hugo",
"scripts": {
"fullinstall": "npm run preinstall && npm install && npm run postinstall",
@ -35,14 +35,14 @@
"homepage": "https://github.com/nunocoracao/blowfish#readme",
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"chart.js": "^4.2.1",
"chart.js": "^4.3.0",
"fuse.js": "^6.6.2",
"jquery": "^3.6.4",
"katex": "^0.16.6",
"katex": "^0.16.7",
"packery": "^2.1.2",
"prettier": "^2.8.8",
"prettier-plugin-go-template": "^0.0.13",
"prettier-plugin-tailwindcss": "^0.2.7",
"prettier-plugin-tailwindcss": "^0.2.8",
"rimraf": "^5.0.0",
"tailwindcss": "^3.3.2",
"tw-elements": "1.0.0-beta2",

View file

@ -62,7 +62,7 @@ module.exports = {
"--tw-prose-body": theme("colors.neutral.700 / 1"),
"--tw-prose-headings": theme("colors.neutral.800 / 1"),
"--tw-prose-lead": theme("colors.neutral.500 / 1"),
"--tw-prose-links": theme("colors.primary.700 / 1"),
"--tw-prose-links": theme("colors.primary.600 / 1"),
"--tw-prose-bold": theme("colors.neutral.900 / 1"),
"--tw-prose-counters": theme("colors.neutral.800 / 1"),
"--tw-prose-bullets": theme("colors.neutral.500 / 1"),
@ -96,7 +96,7 @@ module.exports = {
textDecorationColor: theme("colors.primary.300 / 1"),
fontWeight: "500",
"&:hover": {
color: theme("colors.neutral.DEFAULT / 1"),
color: theme("colors.primary.600 / 1"),
textDecoration: "none",
borderRadius: "0.09rem",
},
@ -149,6 +149,9 @@ module.exports = {
css: {
a: {
textDecorationColor: theme("colors.neutral.600 / 1"),
"&:hover": {
color: theme("colors.primary.400 / 1"),
},
},
kbd: {
color: theme("colors.neutral.200 / 1"),