@@ -22,9 +23,15 @@
{{ end }}
{{ if $homepageImage }}
-
-
+ {{ if not $disableHeroImageFilter }}
+
+
+ {{ else }}
+
+
+ {{ end }}
{{ end }}
@@ -43,22 +50,39 @@
alt="{{ $.Site.Params.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}
{{ end }}
-
- {{ .Site.Params.Author.name | default .Site.Title }} -
- {{ with .Site.Params.Author.headline }} -- {{ . | markdownify }} -
+ {{ if not $disableHeroImageFilter }} ++ {{ .Site.Params.Author.name | default .Site.Title }} +
+ {{ with .Site.Params.Author.headline }} ++ {{ . | markdownify }} +
+ {{ end }} + {{ else }} ++ {{ .Site.Params.Author.name | default .Site.Title }} +
+ {{ with .Site.Params.Author.headline }} ++ {{ . | markdownify }} +
+ {{ end }} {{ end }}
{{ with .Site.Params.Author.links }}
{{ range $links := . }}
{{ range $name, $url := $links }}
- {{ partial
"icon.html" $name }}
+ {{ else }}
+ {{ partial
+ "icon.html" $name }}
+ {{ end }}
{{ end }}
{{ end }}
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
index 5f3ffa1f..f7d0acf7 100644
--- a/layouts/partials/toc.html
+++ b/layouts/partials/toc.html
@@ -1,5 +1,4 @@
-
+
diff --git a/layouts/shortcodes/article.html b/layouts/shortcodes/article.html
index 68d74e71..b85a3ca2 100644
--- a/layouts/shortcodes/article.html
+++ b/layouts/shortcodes/article.html
@@ -1,9 +1,10 @@
-{{ $parent := .Page.RelPermalink }}
-
- {{ $RelPermalink := .Get "link" }}
- {{ range ( where .Site.RegularPages "RelPermalink" $RelPermalink | first 1 ) }}
- {{ if not (eq .RelPermalink $parent) }}
- {{ partial "article-link/simple.html" . }}
- {{ end }}
- {{end}}
-
\ No newline at end of file
+{{ $link := .Get "link" }}
+{{ $target := .Page }}
+{{ if ne $link .Page.RelPermalink }}
+ {{ $target = index (first 1 (where .Site.AllPages "RelPermalink" $link)) 0 }}
+{{ end }}
+{{ if $target }}
+
+ {{ partial "article-link/simple.html" $target }}
+
+{{ end }}
diff --git a/layouts/shortcodes/codeberg.html b/layouts/shortcodes/codeberg.html
index a6a8efa0..49fe7380 100644
--- a/layouts/shortcodes/codeberg.html
+++ b/layouts/shortcodes/codeberg.html
@@ -4,6 +4,7 @@
{{- $codebergColors := .Site.Data.codebergColors -}}
{{- with $codebergData -}}
+
{{ i18n "article.table_of_contents" }} @@ -21,32 +20,7 @@
@@ -64,4 +65,5 @@
.catch(error => console.error(error))
+
{{- end -}}
diff --git a/layouts/shortcodes/forgejo.html b/layouts/shortcodes/forgejo.html
index 689dbf85..6bd3de2b 100644
--- a/layouts/shortcodes/forgejo.html
+++ b/layouts/shortcodes/forgejo.html
@@ -4,6 +4,7 @@
{{- $forgejoColors := .Site.Data.forgejoColors -}}
{{- with $forgejoData -}}
+
@@ -64,4 +65,5 @@
.catch(error => console.error(error))
+
{{- end -}}
diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/gallery.html
index 31d9bc9b..68a65488 100644
--- a/layouts/shortcodes/gallery.html
+++ b/layouts/shortcodes/gallery.html
@@ -1,31 +1,40 @@
-{{ $id := delimit (slice "gallery" (partial "functions/uid.html" .)) "-" }}
+{{ $id := delimit (slice "gallery" (partial "functions/uid.html" .)) "-" -}}
-
- {{ $page := .Page }}
-
- {{/* find all img tags */}}
- {{ $imgTagRegex := `
]*>` }}
- {{ $imgTags := findRE $imgTagRegex .Inner }}
- {{ $newContent := .Inner }}
-
- {{ range $imgTags }}
- {{ $imgTag := . }}
- {{/* extract src attribute */}}
- {{ $srcRegex := `src=['"]([^'"]+)['"]` }}
- {{ $srcMatches := findRESubmatch $srcRegex $imgTag }}
-
- {{ if $srcMatches }}
- {{ $srcFull := index (index $srcMatches 0) 0 }}
- {{ $src := index (index $srcMatches 0) 1 }}
-
- {{ $resource := $page.Resources.GetMatch $src }}
- {{ if $resource }}
- {{ $newSrc := printf `src="%s"` $resource.RelPermalink }}
- {{ $newImg := replace $imgTag $srcFull $newSrc }}
- {{ $newContent = replace $newContent $imgTag $newImg }}
- {{ end }}
- {{ end }}
- {{ end }}
-
- {{ $newContent | safeHTML }}
+
+ {{ $page := .Page -}}
+
+
+ {{ $imgTagRegex := `
]*>` -}}
+ {{ $imgTags := findRE $imgTagRegex .Inner -}}
+ {{ $newContent := .Inner -}}
+
+ {{ range $imgTags -}}
+ {{ $imgTag := . -}}
+
+ {{ $srcRegex := `src=['"]([^'"]+)['"]` -}}
+ {{ $srcMatches := findRESubmatch $srcRegex $imgTag -}}
+
+ {{ if $srcMatches -}}
+ {{ $srcFull := index (index $srcMatches 0) 0 -}}
+ {{ $src := index (index $srcMatches 0) 1 -}}
+
+ {{ $finalSrc := $src -}}
+ {{ $isExternalURL := or (hasPrefix $src "http://") (hasPrefix $src "https://") -}}
+
+ {{ if $isExternalURL -}}
+ {{ with resources.GetRemote $src -}}{{ $finalSrc = .RelPermalink -}}{{ end -}}
+ {{ else -}}
+ {{ with $page.Resources.GetMatch $src -}}{{ $finalSrc = .RelPermalink -}}
+ {{ else -}}
+ {{ with resources.GetMatch $src -}}{{ $finalSrc = .RelPermalink }}{{ end -}}
+ {{ end -}}
+ {{ end -}}
+
+ {{ $newSrc := printf `src="%s"` $finalSrc -}}
+ {{ $newImg := replace $imgTag $srcFull $newSrc -}}
+ {{ $newContent = replace $newContent $imgTag $newImg -}}
+ {{ end -}}
+ {{ end -}}
+
+ {{ $newContent | safeHTML -}}
diff --git a/layouts/shortcodes/gitea.html b/layouts/shortcodes/gitea.html
index f4e15d7d..23bcb874 100644
--- a/layouts/shortcodes/gitea.html
+++ b/layouts/shortcodes/gitea.html
@@ -4,6 +4,7 @@
{{- $giteaColors := .Site.Data.giteaColors -}}
{{- with $giteaData -}}
+
@@ -64,4 +65,5 @@
.catch(error => console.error(error))
+
{{- end -}}
diff --git a/layouts/shortcodes/github.html b/layouts/shortcodes/github.html
index 484d7e90..7abb47a8 100644
--- a/layouts/shortcodes/github.html
+++ b/layouts/shortcodes/github.html
@@ -2,13 +2,20 @@
{{- $githubURL := print "https://api.github.com/repos/" (.Get "repo") -}}
{{- $githubData := resources.GetRemote $githubURL | transform.Unmarshal -}}
{{- $githubColors := .Site.Data.githubColors -}}
-{{- with $githubData -}}
+{{- $githubThumbnailURL := print "https://opengraph.githubassets.com/0/" (.Get "repo") -}}
+
+{{- if (.Get "showThumbnail") -}}
+
+{{- end -}}
+
+{{- with $githubData -}}
+
diff --git a/layouts/shortcodes/gitlab.html b/layouts/shortcodes/gitlab.html
index 12f08808..3bdcd2c7 100644
--- a/layouts/shortcodes/gitlab.html
+++ b/layouts/shortcodes/gitlab.html
@@ -4,6 +4,7 @@
{{- $gitLabData := resources.GetRemote $gitlabURL | transform.Unmarshal -}}
{{- with $gitLabData -}}
+
{{ partial "icon.html" "github" }}
@@ -65,5 +72,6 @@
.catch(error => console.error(error))
-
{{- end -}}
+
+
+{{< figure src="img/home-profile.png" class="thumbnailshadow" >}}
Le informazioni sull'autore sono fornite nel file di configurazione delle lingue. Fare riferimento alle sezioni [Guida introduttiva]({{< ref "getting-started" >}}) e [Configurazione della lingua]({{< ref "configuration##language-and-i18n" >}}) per i dettagli sui parametri.
@@ -28,7 +28,7 @@ Per abilitare il layout del profilo, impostare `homepage.layout = “profile”`
## Page layout
Il layout di pagina è semplicemente una normale pagina di contenuto che visualizza il contenuto Markdown. È ottimo per i siti web statici e offre una grande flessibilità.
-
+{{< figure src="img/home-page.png" class="thumbnailshadow" >}}
Per abilitare il layout di pagina, impostare `homepage.layout = “page”` nel file di configurazione `params.toml`.
@@ -36,7 +36,7 @@ Per abilitare il layout di pagina, impostare `homepage.layout = “page”` nel
Il layout hero riunisce le idee dei layout profilo e scheda. Questo non solo mostra le informazioni sull'autore del sito, ma carica anche il markdown sotto di esso.
-
+{{< figure src="img/home-hero.png" class="thumbnailshadow" >}}
Per abilitare il layout Hero, impostare `homepage.layout = “hero”` e `homepage.homepageImage` nel file di configurazione `params.toml`.
@@ -44,7 +44,7 @@ Per abilitare il layout Hero, impostare `homepage.layout = “hero”` e `homepa
Il layout di sfondo è una versione più fluida del layout Hero. Come nel layout Hero, anche in questo caso vengono visualizzate le informazioni sull'autore del sito e viene caricato il markdown sotto di esso.
-
+{{< figure src="img/home-background.png" class="thumbnailshadow" >}}
Per abilitare il layout di sfondo, impostare `homepage.layout = “background”` e `homepage.homepageImage` nel file di configurazione `params.toml`.
@@ -52,7 +52,7 @@ Per abilitare il layout di sfondo, impostare `homepage.layout = “background”
Il layout delle schede è un'estensione del layout di pagina. Offre lo stesso livello di flessibilità, visualizzando anche i contenuti markdown e aggiungendo un'immagine per visualizzare i contenuti visivi.
-
+{{< figure src="img/home-card.png" class="thumbnailshadow" >}}
Per abilitare il layout a scheda, impostare `homepage.layout = “card”` e `homepage.homepageImage` nel file di configurazione `params.toml`.
@@ -65,7 +65,7 @@ Per abilitare il layout personalizzato, impostare `homepage.layout = “custom
Con il valore di configurazione impostato, creare un nuovo file `custom.html` e collocarlo in `layouts/partials/home/custom.html`. Ora tutto ciò che è contenuto nel file `custom.html` sarà collocato nell'area dei contenuti della homepage del sito. È possibile utilizzare qualsiasi funzione HTML, Tailwind o Hugo per definire il layout.
-Per includere [articoli recenti](#recent-articles) nel layout personalizzato, utilizzare il partial `recent-articles/main.html`.
+Per includere [articoli recenti](#articoli-recenti) nel layout personalizzato, utilizzare il partial `recent-articles/main.html`.
Ad esempio, la [homepage]({{< ref "/" >}}) di questo sito utilizza il layout personalizzato per consentire di passare dal layout del profilo a quello della pagina. Visitare il [repo GitHub](https://github.com/nunocoracao/blowfish/blob/main/exampleSite/layouts/partials/home/custom.html) per vedere come funziona.
@@ -73,7 +73,7 @@ Ad esempio, la [homepage]({{< ref "/" >}}) di questo sito utilizza il layout per
Tutti i layout delle homepage hanno la possibilità di visualizzare gli articoli recenti sotto il contenuto della pagina principale. Per attivarla, è sufficiente impostare l'opzione `homepage.showRecent` a `true` nel file di configurazione `params.toml`.
-
+{{< figure src="img/home-list.png" class="thumbnailshadow" >}}
Gli articoli elencati in questa sezione sono derivati dall'impostazione `mainSections`, che consente di utilizzare i tipi di contenuto del sito web. Per esempio, se si hanno sezioni di contenuto per _post_ e _progetti_, si può impostare questa impostazione su `[“post”, “progetti”]` e tutti gli articoli di queste due sezioni saranno utilizzati per popolare l'elenco dei recenti. Il tema si aspetta che questa impostazione sia un array, quindi se si utilizza una sola sezione per tutti i contenuti, è necessario impostarla di conseguenza: `[“blog”]`.
diff --git a/exampleSite/content/docs/homepage-layout/index.ja.md b/exampleSite/content/docs/homepage-layout/index.ja.md
index cb4eee20..e0f2ae91 100644
--- a/exampleSite/content/docs/homepage-layout/index.ja.md
+++ b/exampleSite/content/docs/homepage-layout/index.ja.md
@@ -17,7 +17,7 @@ Blowfish は完全に柔軟なホームページレイアウトを提供しま
デフォルトのレイアウトはプロフィールレイアウトで、個人ウェブサイトやブログに最適です。画像とソーシャルプロファイルへのリンクを提供することで、著者の詳細を前面に押し出します。
-
{{< /gallery >}}
+{{< /timelineItem >}}
+
{{< timelineItem icon="code" header="Another Awesome Header">}}
{{< github repo="nunocoracao/blowfish" >}}
-{{ timelineItem >}}
-{{ timelineItem >}}
+{{< /timelineItem >}}
-{{ timeline >}}
+{{< /timeline >}}