Skip to content

Commit

Permalink
Merge pull request #1228 from nunocoracao/dev
Browse files Browse the repository at this point in the history
🔖 v2.56.0
  • Loading branch information
nunocoracao authored Feb 13, 2024
2 parents c77c69d + 8e14d69 commit 9d440a8
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 26 deletions.
2 changes: 1 addition & 1 deletion assets/js/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function createCopyButton(highlightDiv) {
}

async function copyCodeToClipboard(button, highlightDiv) {
const codeToCopy = highlightDiv.querySelector(":last-child > .chroma > code").innerText;
const codeToCopy = highlightDiv.querySelector(":last-child").innerText;
try {
result = await navigator.permissions.query({ name: "clipboard-write" });
if (result.state == "granted" || result.state == "prompt") {
Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Welcome to Blowfish, one of the most flexible and robust Hugo themes. It is desi
```node
npx blowfish-tools
```

<iframe width="100%" height="350" src="https://www.youtube.com/embed/SgXhGb-7QbU?si=ce44baicuQ6zMeXz" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

<!--You can also find the complete theme documentation in [docs]({{< ref "docs" >}}). Blowfish is highly customizable and can be configured to fit your needs: from a static website to a blog. Checkout some [examples](/examples) and what some of our [users](/users) have been building.
Expand Down
18 changes: 9 additions & 9 deletions layouts/partials/header/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{{ partial "translations.html" . }}

{{ if .Site.Params.enableSearch | default false }}
<button id="search-button" aria-label="Search" class="text-base hover:text-primary-600 dark:hover:text-primary-400 h-12"
<button id="search-button" aria-label="Search" class="text-base hover:text-primary-600 dark:hover:text-primary-400"
title="{{ i18n " search.open_button_title" }}">
{{ partial "icon.html" "search" }}
</button>
Expand All @@ -45,20 +45,20 @@
{{/* Appearance switch */}}
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
<div
class="{{ if .Site.Params.footer.showScrollToTop | default true -}} ltr:mr-14 rtl:ml-14 {{- end }} cursor-pointer text-sm text-neutral-700 hover:text-primary-600 dark:text-neutral dark:hover:text-primary-400">
<button id="appearance-switcher" aria-label="Dark mode switcher" type="button">
<div class="flex items-center justify-center h-12 dark:hidden">
class="{{ if .Site.Params.footer.showScrollToTop | default true -}} ltr:mr-14 rtl:ml-14 {{- end }} flex items-center">
<button id="appearance-switcher" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400">
<div class="flex items-center justify-center dark:hidden">
{{ partial "icon.html" "moon" }}
</div>
<div class="items-center justify-center hidden h-12 dark:flex">
<div class="items-center justify-center hidden dark:flex">
{{ partial "icon.html" "sun" }}
</div>
</button>
</div>
{{ end }}

</nav>
<div class="flex md:hidden items-center space-x-5 md:ml-12">
<div class="flex md:hidden items-center space-x-5 md:ml-12 h-12">

<span></span>

Expand All @@ -73,11 +73,11 @@

{{/* Appearance switch */}}
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
<button id="appearance-switcher-mobile" aria-label="Dark mode switcher" type="button" style="margin-right:5px">
<div class="flex items-center justify-center h-12 dark:hidden">
<button id="appearance-switcher-mobile" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400" style="margin-right:5px">
<div class="flex items-center justify-center dark:hidden">
{{ partial "icon.html" "moon" }}
</div>
<div class="items-center justify-center hidden h-12 dark:flex">
<div class="items-center justify-center hidden dark:flex">
{{ partial "icon.html" "sun" }}
</div>
</button>
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/header/header-mobile-option-nested.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<li class="mt-1">
<a class="flex items-center">
<a class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-bg font-bg text-gray-500 hover:text-gray-900" title="{{ .Title }}">
<p class="text-bg font-bg" title="{{ .Title }}">
{{ .Name | markdownify | emojify }}
</p>
<span>
Expand All @@ -16,13 +16,13 @@
{{ range .Children }}
<li class="mt-1">
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
) }} target="_blank" {{ end }} class="flex items-center">
) }} target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-sm font-small text-gray-500 hover:text-gray-900" title="{{ .Title }}">
<p class="text-sm font-small" title="{{ .Title }}">
{{ .Name | markdownify | emojify }}
</p>
</a>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/header/header-mobile-option-simple.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<li class="mt-1">
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
) }} target="_blank" {{ end }} class="flex items-center">
) }} target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<div {{ if and .Pre .Name}} class="mr-2" {{ end }}>
{{ partial "icon.html" .Pre }}
</div>
{{ end }}
<p class="text-bg font-bg text-gray-500 hover:text-gray-900" title="{{ .Title }}">
<p class="text-bg font-bg" title="{{ .Title }}">
{{ .Name | markdownify | emojify }}
</p>
</a>
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/header/header-option-nested.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</span>
{{ end }}
<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 }}">
target="_blank" {{ end }} {{ end }} class="text-base font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}">
{{ .Name | markdownify | emojify }}
</a>
<span>
Expand All @@ -18,13 +18,13 @@
<div class="flex flex-col space-y-3">
{{ range .Children }}
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
target="_blank" {{ end }} class="flex items-center">
target="_blank" {{ end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-sm font-sm text-gray-500 hover:text-gray-900" title="{{ .Title }}">
<p class="text-sm font-sm" title="{{ .Title }}">
{{ .Name | markdownify | emojify }}
</p>
</a>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/header/header-option-simple.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }} target="_blank" {{
end }} class="flex items-center">
end }} class="flex items-center text-gray-500 hover:text-primary-600 dark:hover:text-primary-400">
{{ if .Pre }}
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
{{ partial "icon.html" .Pre }}
</span>
{{ end }}
<p class="text-base font-medium text-gray-500 hover:text-gray-900" title="{{ .Title }}">
<p class="text-base font-medium" title="{{ .Title }}">
{{ .Name | markdownify | emojify }}
</p>
</a>
13 changes: 12 additions & 1 deletion layouts/partials/hero/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@
{{- $featured := $images.GetMatch "*background*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "*feature*" }}{{ end -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}

{{ if and .Params.featureimage (not $featured) }}
{{- $url:= .Params.featureimage -}}
{{ $featured = resources.GetRemote $url }}
{{ end }}
{{- if not $featured }}{{ with .Site.Params.defaultBackgroundImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}}

{{- if not $featured }}
{{ with .Site.Params.defaultBackgroundImage }}
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
{{ $featured = resources.GetRemote . }}
{{ else }}
{{ $featured = resources.Get . }}
{{ end }}
{{ end }}
{{ end -}}

{{ $isParentList := eq (.Scratch.Get "scope") "list" }}
{{ $shouldBlur := $.Params.layoutBackgroundBlur | default (or
(and ($.Site.Params.article.layoutBackgroundBlur | default true) (not $isParentList))
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/translations.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ if .IsTranslated }}
<div>
<div class="cursor-pointer flex items-center nested-menu">
<a href="#" class="text-base font-medium text-gray-500 hover:text-gray-900" title="{{ .Title }}">
<a href="#" class="text-base font-medium text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}">
{{- i18n "global.language" | markdownify | emojify -}}
</a>
</div>
Expand All @@ -10,7 +10,7 @@
<div class="flex flex-col space-y-3">
{{ range .AllTranslations }}
<a href="{{ .RelPermalink }}" class="flex items-center">
<p class="text-sm font-sm text-gray-500 hover:text-gray-900" title="{{ .Title }}">
<p class="text-sm font-sm text-gray-500 hover:text-primary-600 dark:hover:text-primary-400" title="{{ .Title }}">
{{ .Language.Params.displayName | emojify }}
</p>
</a>
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/gitlab.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- $gitLabData := getJSON ($gitlabURL) -}}
{{- with $gitLabData -}}

<a target="_blank" href="{{ .html_url }}" class="cursor-pointer">
<a id="{{ $id }}" target="_blank" href="{{ .web_url }}" class="cursor-pointer">
<div class="w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl">

<div class="flex items-center">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hugo-blowfish-theme",
"version": "2.55.0",
"version": "2.56.0",
"description": "Blowfish theme for Hugo",
"scripts": {
"postinstall": "vendor-copy",
Expand Down

0 comments on commit 9d440a8

Please sign in to comment.