mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-22 14:35:43 -06:00
updated authors to be displayed on top of an article
This commit is contained in:
parent
9d8d050cd6
commit
7c6663c348
3 changed files with 60 additions and 56 deletions
|
@ -6,7 +6,7 @@ description: "Some real-life Blowfish examples."
|
|||
slug: "users"
|
||||
tags: ["users", "sample"]
|
||||
showDate: false
|
||||
showAuthor: true
|
||||
showAuthor: false
|
||||
showReadingTime: false
|
||||
showEdit: false
|
||||
layoutBackgroundHeaderSpace: false
|
||||
|
@ -80,7 +80,8 @@ Real websites that are built with Blowfish.
|
|||
| [blog.enmanuelmoreira.com](https://blog.enmanuelmoreira.com) | Personal site |
|
||||
| [halcyonstraits.com](https://www.halcyonstraits.com/) | Doll photography |
|
||||
| [50-nuances-octets.fr](https://www.50-nuances-octets.fr/) | Organization site |
|
||||
| [marupanda.art/marucomics][https://marupanda.art/marucomics/] | Comics site |
|
||||
| [marupanda.art/marucomics](https://marupanda.art/marucomics/) | Comics site |
|
||||
|
||||
{{< alert >}}
|
||||
|
||||
**Blowfish user?** To add your site to this list, [submit a pull request](https://github.com/nunocoracao/blowfish/blob/main/exampleSite/content/users/index.md).
|
||||
|
|
|
@ -23,6 +23,40 @@
|
|||
<div class="mt-1 mb-6 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
|
||||
{{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }}
|
||||
</div>
|
||||
|
||||
{{ $authorsData := .Site.Data.authors }}
|
||||
{{ $taxonomies := .Site.Taxonomies.authors }}
|
||||
{{ $baseURL := .Site.BaseURL }}
|
||||
{{ $taxonomyLink := 0 }}
|
||||
{{ $showAuthor := 0 }}
|
||||
|
||||
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
|
||||
{{ $showAuthor = 1 }}
|
||||
{{ partial "author.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if not (strings.HasSuffix $baseURL "/") }}
|
||||
{{ $baseURL = delimit (slice $baseURL "/") "" }}
|
||||
{{ end }}
|
||||
|
||||
{{ range $author := .Page.Params.authors }}
|
||||
{{ $authorData := index $authorsData $author }}
|
||||
{{- if $authorData -}}
|
||||
|
||||
{{ range $taxonomyname, $taxonomy := $taxonomies }}
|
||||
{{ if (eq $taxonomyname $author) }}
|
||||
{{ $taxonomyLink = delimit (slice $baseURL "/authors/" $author) "" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if or $taxonomyLink $showAuthor }}
|
||||
<div class="mb-5"></div>
|
||||
{{ end }}
|
||||
|
||||
</header>
|
||||
<section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row">
|
||||
{{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in
|
||||
|
@ -54,31 +88,7 @@
|
|||
</section>
|
||||
<footer class="pt-8 max-w-prose print:hidden">
|
||||
|
||||
{{ partial "author.html" . }}
|
||||
|
||||
{{ $authorsData := .Site.Data.authors }}
|
||||
{{ $taxonomies := .Site.Taxonomies.authors }}
|
||||
{{ $baseURL := .Site.BaseURL }}
|
||||
|
||||
{{ if not (strings.HasSuffix $baseURL "/") }}
|
||||
{{ $baseURL = delimit (slice $baseURL "/") "" }}
|
||||
{{ end }}
|
||||
|
||||
{{ range $author := .Page.Params.authors }}
|
||||
{{ $authorData := index $authorsData $author }}
|
||||
{{- if $authorData -}}
|
||||
|
||||
{{ $taxonomyLink := 0 }}
|
||||
{{ range $taxonomyname, $taxonomy := $taxonomies }}
|
||||
{{ if (eq $taxonomyname $author) }}
|
||||
{{ $taxonomyLink = delimit (slice $baseURL "/authors/" $author) "" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $taxonomyLink) }}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ partial "sharing-links.html" . }}
|
||||
|
||||
{{ partial "related.html" . }}
|
||||
|
|
|
@ -1,31 +1,24 @@
|
|||
{{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
|
||||
<div class="flex">
|
||||
{{ with .Site.Author.image }}
|
||||
{{ $authorImage := resources.Get . }}
|
||||
{{ if $authorImage }}
|
||||
{{ $authorImage := $authorImage.Fill "192x192" }}
|
||||
<img
|
||||
class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4"
|
||||
width="96"
|
||||
height="96"
|
||||
alt="{{ $.Site.Author.name | default "Author" }}"
|
||||
src="{{ $authorImage.RelPermalink }}"
|
||||
/>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<div class="place-self-center">
|
||||
{{ with .Site.Author.name | markdownify | emojify }}
|
||||
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
|
||||
{{ i18n "author.byline_title" | markdownify | emojify }}
|
||||
</div>
|
||||
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ with .Site.Author.bio | markdownify | emojify }}
|
||||
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
|
||||
{{ end }}
|
||||
<div class="text-2xl sm:text-lg">{{ partialCached "author-links.html" . }}</div>
|
||||
<div class="flex">
|
||||
{{ with .Site.Author.image }}
|
||||
{{ $authorImage := resources.Get . }}
|
||||
{{ if $authorImage }}
|
||||
{{ $authorImage := $authorImage.Fill "192x192" }}
|
||||
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
|
||||
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<div class="place-self-center">
|
||||
{{ with .Site.Author.name | markdownify | emojify }}
|
||||
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
|
||||
{{ i18n "author.byline_title" | markdownify | emojify }}
|
||||
</div>
|
||||
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
|
||||
{{ . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ with .Site.Author.bio | markdownify | emojify }}
|
||||
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . }}</div>
|
||||
{{ end }}
|
||||
<div class="text-2xl sm:text-lg">{{ partialCached "author-links.html" . }}</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
Loading…
Reference in a new issue