mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-11-03 17:49:45 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c0d54c41d | ||
|
|
e832e646bf | ||
|
|
49bf99641e | ||
|
|
e015e32356 | ||
|
|
f11c652362 | ||
|
|
bb44f5b17a | ||
|
|
bdd1c3f136 | ||
|
|
9bc237dc34 | ||
|
|
802d9369b8 | ||
|
|
4685aff77c | ||
|
|
2d0f9852d8 | ||
|
|
23ef06829a | ||
|
|
92f704cd61 | ||
|
|
9e1fc48e96 | ||
|
|
a387038958 | ||
|
|
08d28ec1c1 | ||
|
|
914352f71c | ||
|
|
8ca246ce31 | ||
|
|
485b08193c | ||
|
|
50e4c2b9aa | ||
|
|
34ca5acc8f | ||
|
|
7c2ca7969e | ||
|
|
00704d369a | ||
|
|
1aa41fae0f | ||
|
|
99c5fa5a00 | ||
|
|
96529363cd | ||
|
|
cd946b93e5 | ||
|
|
a660482b24 | ||
|
|
c6869834ea | ||
|
|
0e07a9f265 | ||
|
|
5c12f7597a | ||
|
|
e3869849bd | ||
|
|
b8f23598c8 | ||
|
|
bf8f63b4a6 | ||
|
|
9e7abf32cf | ||
|
|
25a60fffd1 |
No files matched your search
+32
-6
@@ -26,16 +26,19 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
|||||||
const switcher = document.getElementById("appearance-switcher");
|
const switcher = document.getElementById("appearance-switcher");
|
||||||
const switcherMobile = document.getElementById("appearance-switcher-mobile");
|
const switcherMobile = document.getElementById("appearance-switcher-mobile");
|
||||||
|
|
||||||
updateMeta()
|
updateMeta();
|
||||||
|
this.updateLogo?.(getTargetAppearance());
|
||||||
|
|
||||||
if (switcher) {
|
if (switcher) {
|
||||||
switcher.addEventListener("click", () => {
|
switcher.addEventListener("click", () => {
|
||||||
document.documentElement.classList.toggle("dark");
|
document.documentElement.classList.toggle("dark");
|
||||||
|
var targetAppearance = getTargetAppearance();
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"appearance",
|
"appearance",
|
||||||
document.documentElement.classList.contains("dark") ? "dark" : "light"
|
targetAppearance
|
||||||
);
|
);
|
||||||
updateMeta()
|
updateMeta();
|
||||||
|
this.updateLogo?.(targetAppearance);
|
||||||
});
|
});
|
||||||
switcher.addEventListener("contextmenu", (event) => {
|
switcher.addEventListener("contextmenu", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -45,11 +48,13 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
|||||||
if (switcherMobile) {
|
if (switcherMobile) {
|
||||||
switcherMobile.addEventListener("click", () => {
|
switcherMobile.addEventListener("click", () => {
|
||||||
document.documentElement.classList.toggle("dark");
|
document.documentElement.classList.toggle("dark");
|
||||||
|
var targetAppearance = getTargetAppearance();
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"appearance",
|
"appearance",
|
||||||
document.documentElement.classList.contains("dark") ? "dark" : "light"
|
targetAppearance
|
||||||
);
|
);
|
||||||
updateMeta()
|
updateMeta();
|
||||||
|
this.updateLogo?.(targetAppearance);
|
||||||
});
|
});
|
||||||
switcherMobile.addEventListener("contextmenu", (event) => {
|
switcherMobile.addEventListener("contextmenu", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -66,10 +71,31 @@ var updateMeta = () => {
|
|||||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', style.backgroundColor);
|
document.querySelector('meta[name="theme-color"]').setAttribute('content', style.backgroundColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{ if and (.Site.Params.Logo) (.Site.Params.SecondaryLogo) }}
|
||||||
|
{{ $primaryLogo := resources.Get .Site.Params.Logo }}
|
||||||
|
{{ $secondaryLogo := resources.Get .Site.Params.SecondaryLogo }}
|
||||||
|
{{ if and ($primaryLogo) ($secondaryLogo) }}
|
||||||
|
var updateLogo = (targetAppearance) => {
|
||||||
|
var elems;
|
||||||
|
elems = document.querySelectorAll("img.logo")
|
||||||
|
targetLogoPath =
|
||||||
|
targetAppearance == "{{ .Site.Params.DefaultAppearance }}" ?
|
||||||
|
"{{ $primaryLogo.RelPermalink }}" : "{{ $secondaryLogo.RelPermalink }}"
|
||||||
|
for (const elem of elems) {
|
||||||
|
elem.setAttribute("src", targetLogoPath)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
var getTargetAppearance = () => {
|
||||||
|
return document.documentElement.classList.contains("dark") ? "dark" : "light"
|
||||||
|
}
|
||||||
|
|
||||||
window.addEventListener("DOMContentLoaded", (event) => {
|
window.addEventListener("DOMContentLoaded", (event) => {
|
||||||
const scroller = document.getElementById("top-scroller");
|
const scroller = document.getElementById("top-scroller");
|
||||||
const footer = document.getElementById("site-footer");
|
const footer = document.getElementById("site-footer");
|
||||||
if(scroller.getBoundingClientRect().top > footer.getBoundingClientRect().top) {
|
if(scroller && footer && scroller.getBoundingClientRect().top > footer.getBoundingClientRect().top) {
|
||||||
scroller.hidden = true;
|
scroller.hidden = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
[module.hugoVersion]
|
[module.hugoVersion]
|
||||||
extended = true
|
extended = true
|
||||||
min = "0.87.0 "
|
min = "0.87.0 "
|
||||||
max = "0.111.3"
|
max = "0.112.0"
|
||||||
@@ -7,6 +7,7 @@ rtl = false
|
|||||||
|
|
||||||
title = "Blowfish"
|
title = "Blowfish"
|
||||||
# logo = "img/logo.png"
|
# logo = "img/logo.png"
|
||||||
|
# secondaryLogo = "img/secondary-logo.png"
|
||||||
# description = "My awesome website"
|
# description = "My awesome website"
|
||||||
# copyright = "Copy, _right?_ :thinking_face:"
|
# copyright = "Copy, _right?_ :thinking_face:"
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ rtl = false
|
|||||||
|
|
||||||
title = "Blowfish"
|
title = "Blowfish"
|
||||||
logo = "img/blowfish_logo_transparent.png"
|
logo = "img/blowfish_logo_transparent.png"
|
||||||
|
#secondaryLogo = "PATH"
|
||||||
description = "A powerful, lightweight theme for Hugo built with Tailwind CSS."
|
description = "A powerful, lightweight theme for Hugo built with Tailwind CSS."
|
||||||
# copyright = "Copy, _right?_ :thinking_face:"
|
# copyright = "Copy, _right?_ :thinking_face:"
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
# name = "Examples"
|
# name = "Examples"
|
||||||
# weight = 20
|
# weight = 20
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[[main]]
|
[[main]]
|
||||||
name = "Samples"
|
name = "Samples"
|
||||||
pageRef = "samples"
|
pageRef = "samples"
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ Many of the article defaults here can be overridden on a per article basis by sp
|
|||||||
| `enableSearch` | `false` | Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly. |
|
| `enableSearch` | `false` | Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly. |
|
||||||
| `enableCodeCopy` | `false` | Whether copy-to-clipboard buttons are enabled for `<code>` blocks. The `highlight.noClasses` parameter must be set to `false` for code copy to function correctly. Read more about [other configuration files](#other-configuration-files) below. |
|
| `enableCodeCopy` | `false` | Whether copy-to-clipboard buttons are enabled for `<code>` blocks. The `highlight.noClasses` parameter must be set to `false` for code copy to function correctly. Read more about [other configuration files](#other-configuration-files) below. |
|
||||||
| `logo` | _Not set_ | The relative path to the site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions. |
|
| `logo` | _Not set_ | The relative path to the site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions. |
|
||||||
|
| `secondaryLogo` | _Not set_ | The relative path to the secondary site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions. This should have an inverted/contrasting colour scheme to `logo`. If set, this logo will be shown when users toggle from the `defaultAppearance` mode. |
|
||||||
| `mainSections` | _Not set_ | The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used. |
|
| `mainSections` | _Not set_ | The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used. |
|
||||||
| `showViews` | _Not set_ | Whether or not articles and list views are displayed. This requires firebase integrations to be enabled, look below. |
|
| `showViews` | _Not set_ | Whether or not articles and list views are displayed. This requires firebase integrations to be enabled, look below. |
|
||||||
| `showLikes` | _Not set_ | Whether or not articles and list likes are displayed. This requires firebase integrations to be enabled, look below. |
|
| `showLikes` | _Not set_ | Whether or not articles and list likes are displayed. This requires firebase integrations to be enabled, look below. |
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ Both menus are completely optional and can be commented out if not required. Use
|
|||||||
|
|
||||||
### Nested menus
|
### Nested menus
|
||||||
|
|
||||||
The theme also supports nested menus. In order to use them you just need to define a parent entry in `menu.toml` and its sub-menus using the `parent` parameter to reference the parent. All properties can be used for sub-menus. Note that `pageRef` and `url` will be ignored for the parent entry. Nested menus is only available in the main menu not for the footer.
|
The theme also supports nested menus. In order to use them you just need to define a parent entry in `menu.toml` and its sub-menus using the `parent` parameter to reference the parent. All properties can be used for sub-menus. `pageRef` and `url` can also be used in the parent entry. Nested menus are only available in the main menu not for the footer.
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# config/_default/menus.toml
|
# config/_default/menus.toml
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ Real websites that are built with Blowfish.
|
|||||||
| [hellstabber.github.io](https://hellstabber.github.io/) | Personal site |
|
| [hellstabber.github.io](https://hellstabber.github.io/) | Personal site |
|
||||||
| [clemsau.com](https://clemsau.com/) | Personal site |
|
| [clemsau.com](https://clemsau.com/) | Personal site |
|
||||||
| [lelouvincx.github.io](https://lelouvincx.github.io/) | Personal site |
|
| [lelouvincx.github.io](https://lelouvincx.github.io/) | Personal site |
|
||||||
|
| [weaxsey.org](https://weaxsey.org/) | Personal site |
|
||||||
|
|
||||||
{{< alert >}}
|
{{< alert >}}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<meta name="title" content="{{ .Title | emojify }} · {{ .Site.Title | emojify }}" />
|
<meta name="title" content="{{ .Title | emojify }} · {{ .Site.Title | emojify }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{/* Metadata */}}
|
{{/* Metadata */}}
|
||||||
{{ with .Params.Summary | default .Site.Params.description -}}
|
{{ with (.Params.Summary | default .Params.Description) | default .Site.Params.description -}}
|
||||||
<meta name="description" content="{{ . }}" />
|
<meta name="description" content="{{ . }}" />
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ with .Params.Tags | default .Site.Params.keywords -}}
|
{{ with .Params.Tags | default .Site.Params.keywords -}}
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<link type="text/css" rel="stylesheet" href="{{ $bundleCSS.RelPermalink }}"
|
<link type="text/css" rel="stylesheet" href="{{ $bundleCSS.RelPermalink }}"
|
||||||
integrity="{{ $bundleCSS.Data.Integrity }}" />
|
integrity="{{ $bundleCSS.Data.Integrity }}" />
|
||||||
{{ $jsAppearance := resources.Get "js/appearance.js" }}
|
{{ $jsAppearance := resources.Get "js/appearance.js" }}
|
||||||
{{ $jsAppearance = $jsAppearance | resources.Minify | resources.Fingerprint "sha512" }}
|
{{ $jsAppearance = $jsAppearance | resources.ExecuteAsTemplate $jsAppearance.RelPermalink . | resources.Minify | resources.Fingerprint "sha512" }}
|
||||||
<script type="text/javascript" src="{{ $jsAppearance.RelPermalink }}"
|
<script type="text/javascript" src="{{ $jsAppearance.RelPermalink }}"
|
||||||
integrity="{{ $jsAppearance.Data.Integrity }}"></script>
|
integrity="{{ $jsAppearance.Data.Integrity }}"></script>
|
||||||
{{ if .Site.Params.enableSearch | default false }}
|
{{ if .Site.Params.enableSearch | default false }}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<span class="sr-only">{{ .Site.Title | markdownify | emojify }}</span>
|
<span class="sr-only">{{ .Site.Title | markdownify | emojify }}</span>
|
||||||
|
|
||||||
<img src="{{ $logo.RelPermalink }}" width="{{ div $logo.Width 2 }}" height="{{ div $logo.Height 2 }}"
|
<img src="{{ $logo.RelPermalink }}" width="{{ div $logo.Width 2 }}" height="{{ div $logo.Height 2 }}"
|
||||||
class="max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom" alt="{{ .Site.Title }}" />
|
class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom" alt="{{ .Site.Title }}" />
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
{{ partial "icon.html" .Pre }}
|
{{ partial "icon.html" .Pre }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<a class="text-base font-medium text-gray-500 hover:text-gray-900" title="{{ .Title }}">
|
<a {{ if .URL }} href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
|
||||||
|
target="_blank" {{ end }} {{ end }} class="text-base font-medium text-gray-500 hover:text-gray-900" title="{{ .Title }}">
|
||||||
{{ .Name | markdownify | emojify }}
|
{{ .Name | markdownify | emojify }}
|
||||||
</a>
|
</a>
|
||||||
<span>
|
<span>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{{ $time := now.UnixNano }}
|
{{ $time := now.UnixNano }}
|
||||||
{{ $id := delimit (slice "gallery" $time) "-" }}
|
{{ $id := delimit (slice "gallery" .Ordinal $time) "-" }}
|
||||||
|
|
||||||
<div id="{{ $id }}">
|
<div id="{{ $id }}">
|
||||||
{{ .Inner }}
|
{{ .Inner }}
|
||||||
|
|||||||
Generated
+728
-68
File diff suppressed because it is too large.
Load diff
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hugo-blowfish-theme",
|
"name": "hugo-blowfish-theme",
|
||||||
"version": "2.33.1",
|
"version": "2.34.0",
|
||||||
"description": "Blowfish theme for Hugo",
|
"description": "Blowfish theme for Hugo",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"fullinstall": "npm run preinstall && npm install && npm run postinstall",
|
"fullinstall": "npm run preinstall && npm install && npm run postinstall",
|
||||||
@@ -37,13 +37,13 @@
|
|||||||
"@tailwindcss/typography": "^0.5.9",
|
"@tailwindcss/typography": "^0.5.9",
|
||||||
"chart.js": "^4.3.0",
|
"chart.js": "^4.3.0",
|
||||||
"fuse.js": "^6.6.2",
|
"fuse.js": "^6.6.2",
|
||||||
"jquery": "^3.6.4",
|
"jquery": "^3.7.0",
|
||||||
"katex": "^0.16.7",
|
"katex": "^0.16.7",
|
||||||
"packery": "^2.1.2",
|
"packery": "^2.1.2",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"prettier-plugin-go-template": "^0.0.13",
|
"prettier-plugin-go-template": "^0.0.13",
|
||||||
"prettier-plugin-tailwindcss": "^0.2.8",
|
"prettier-plugin-tailwindcss": "^0.3.0",
|
||||||
"rimraf": "^5.0.0",
|
"rimraf": "^5.0.1",
|
||||||
"tailwindcss": "^3.3.2",
|
"tailwindcss": "^3.3.2",
|
||||||
"tw-elements": "1.0.0-beta2",
|
"tw-elements": "1.0.0-beta2",
|
||||||
"typeit": "^8.7.1",
|
"typeit": "^8.7.1",
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@headlessui/react": "^1.7.14",
|
"@headlessui/react": "^1.7.14",
|
||||||
"@heroicons/react": "^2.0.17",
|
"@heroicons/react": "^2.0.18",
|
||||||
"@tailwindcss/forms": "^0.5.3",
|
"@tailwindcss/forms": "^0.5.3",
|
||||||
"commander": "^10.0.1"
|
"commander": "^10.0.1"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user