Skip to content

Commit

Permalink
Add multiple authors feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kshpdr committed Jan 5, 2024
1 parent 4d2a465 commit 77856db
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 31 deletions.
Binary file added client/assets/denis.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/assets/dovat.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/content/posts/cs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: "Гайд по Informatik B.Sc., ТУ Берлин"
description: "Информатика, ТУ Берлин"
date: 2023-12-02
draft: false
authors: ["denis"]
---

Важная ремарка. Я "везучий" и учиться начал прямо в разгар ковида, в WiSe 20/21. Поэтому первые два семестра я провел полностью в онлайн, третий полу-очно, все остальные ходил в универ. Это важно, потому что формат модуля много чего определяет, но глобально все, что я напишу тут, все еще релевантно.
Expand Down
1 change: 1 addition & 0 deletions client/content/posts/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: "Гайд по универу, ТУ Берлин"
description: "Как выжить в ТУ Берлин?"
date: 2023-12-01
draft: false
authors: ["denis"]
---

Если вы первак, то тут все, что важно знать. Есть три всадника апокалипсиса — ISIS, Moses и Tuport. Четвёртый, Quispos, стал частью Tuport, поэтому не считается. О каждом отдельно:
Expand Down
7 changes: 7 additions & 0 deletions client/data/authors/denis.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name = "Денис Кошелев"
image = "denis.jpeg"
links = [
{ github = "https://github.com/kshpdr" },
{ telegram = "https://t.me/kshpdr" },
{ linkedin = "https://linkedin.com/in/koshelev-denis" }
]
6 changes: 6 additions & 0 deletions client/data/authors/dovat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name = "Доват Атаев"
image = "dovat.jpeg"
links = [
{ telegram = "https://t.me/dovatello" },
{ linkedin = "https://www.linkedin.com/in/dovat-a-9a2400200/" }
]
6 changes: 3 additions & 3 deletions client/themes/congo/layouts/partials/author-links.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ with .Site.Author.links }}
{{ with .context }} <!-- Use the passed context -->
<div class="flex flex-wrap text-neutral-400 dark:text-neutral-500">
{{ range $links := . }}
{{ range $name, $url := $links }}
{{ range . }}
{{ range $name, $url := . }}
<a
class="px-1 transition-transform hover:scale-125 hover:text-primary-700 dark:hover:text-primary-400"
style="will-change:transform;"
Expand Down
59 changes: 31 additions & 28 deletions client/themes/congo/layouts/partials/author.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
{{ 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 Center" }}
<img
class="!mb-0 !mt-0 me-4 h-24 w-24 rounded-full"
width="96"
height="96"
alt="{{ $.Site.Author.name | default "Author" }}"
src="{{ $authorImage.RelPermalink }}"
{{ if $.Site.Params.enableImageLazyLoading | default true }}
{{ if .Params.authors }}
{{ range .Params.authors }}
{{ $authorData := index $.Site.Data.authors . }}
<div class="flex">
{{ with $authorData.image }} <!-- Author image -->
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}
{{ $authorImage := $authorImage.Fill "192x192 Center" }}
<img
class="!mb-0 !mt-0 me-4 h-24 w-24 rounded-full"
width="96"
height="96"
alt="{{ $authorData.name | default "Author" }}"
src="{{ $authorImage.RelPermalink }}"
loading="lazy"
{{ end }}
/>
/>
{{ end }}
{{ 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 class="place-self-center">
{{ with $authorData.name }} <!-- Author name -->
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . | markdownify | emojify }}
</div>
{{ end }}
{{ with $authorData.bio }} <!-- Author bio -->
<div class="text-sm text-neutral-700 dark:text-neutral-400">{{ . | markdownify | emojify }}</div>
{{ end }}
<!-- Author links -->
{{ with $authorData.links }}
<div class="text-2xl sm:text-lg">
{{ partial "author-links.html" (dict "context" .) }}
</div>
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
{{ . }}
{{ end }}
</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>
</div>
{{ end }}
{{ end }}

0 comments on commit 77856db

Please sign in to comment.