Verified Commit f1de77ac authored by Maxim Lebedev's avatar Maxim Lebedev 🔀

🔍 Refactored contacts page

parent c93ef2f6
Pipeline #133635251 passed with stage
in 27 seconds
......@@ -4,4 +4,17 @@ title: Контакты
description: Информация для обратной связи
aliases:
- /ru/tulpawiki/контакты
contacts:
- givenName: Максим
familyName: Лебедев
image: "toby3d"
email: [email protected]
jobTitle: руководитель
- name: Verdana
jobTitle: редактор
email: [email protected]
resources:
- name: "toby3d"
src: toby3d.jpg
title: Лебедев Максим
---
---
name: Максим Лебедев
role: руководитель
mail: [email protected]
image: toby3d.jpg
---
---
name: Verdana
role: редактор
mail: [email protected]
---
......@@ -6,20 +6,27 @@
<article class="stack">
{{ with .Content }}{{ . }}{{ end }}
<div class="stack">
{{ range .Page.Resources.Match (print "*." .Language ".md") }}
{{ range $index, $contact := .Params.contacts }}
<div class="box cluster cluster_justify_space-between cluster_align_center">
<div>
{{ if .Params.image }}
{{ $image := $.Page.Resources.GetMatch .Params.image }}
<span>
<img alt="{{ .Params.name }}" src="{{ $image.Permalink | absURL }}" width="64" height="64" loading="lazy">
</span>
{{ end }}
<div itemscope itemtype="http://schema.org/Person">
{{ $image := $.Page.Resources.GetMatch (print $contact.image) }}
{{- if $image }}
<img alt="{{ $contact.name }}" src="{{ $image.RelPermalink }}" width="64" height="64" loading="lazy" itemprop="image">
{{ end -}}
<span>
<h3>{{ .Params.name }}</h3>
{{ with .Params.role }}<p>{{ . }}</p>{{ end }}
{{- if (and $contact.givenName $contact.familyName) }}
<h3>
<span itemprop="givenName">{{ $contact.givenName }}</span>
<span itemprop="familyName">{{ $contact.familyName }}</span>
</h3>
{{ else if $contact.name }}
<h3 itemprop="name">{{ $contact.name }}</h3>
{{ end -}}
{{- with $contact.jobTitle }}
<p itemprop="jobTitle">{{ . }}</p>
{{ end -}}
</span>
{{ with .Params.mail }}
{{ with $contact.email }}
<a class="button" href="mailto:{{ . }}">{{ i18n "contacts__write" }}</a>
{{ end }}
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment