Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/asurbernardo/amperage.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsur <asur@asurbernardo.com>2020-01-23 16:27:02 +0300
committerAsur <asur@asurbernardo.com>2020-01-23 16:27:02 +0300
commit18a0c178c09aa5664b5cebb2976689aaab9ddc7f (patch)
tree85fb505c37375ad48fb9b0a844f81f0a8a964feb
parent64252aadeb9f26ee8a395801d202546a69184eed (diff)
Add support for author data
-rw-r--r--assets/theme.scss44
-rw-r--r--i18n/en.toml4
-rw-r--r--i18n/es.toml4
-rw-r--r--layouts/_default/single.html1
-rw-r--r--layouts/partials/post/author.html19
-rw-r--r--layouts/partials/post/social-share.html10
-rw-r--r--layouts/partials/post/under-title.html16
-rw-r--r--layouts/partials/structured-data/article.html8
8 files changed, 80 insertions, 26 deletions
diff --git a/assets/theme.scss b/assets/theme.scss
index 3f219ba..02f7ce0 100644
--- a/assets/theme.scss
+++ b/assets/theme.scss
@@ -206,6 +206,17 @@ blockquote {
}
}
+.social-share {
+ display: flex;
+ align-self: center;
+ align-items: center;
+ &__button {
+ margin: 0 .5em;
+ border-radius: 50%;
+ background-size: 60%;
+ }
+}
+
#tags {
margin: 0;
padding: 0;
@@ -260,21 +271,11 @@ blockquote {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
- line-height: 1.5;
font-size: 1rem;
&__info,
&__social-share {
align-self: center;
}
- &__social-share {
- display: flex;
- align-items: center;
- &__button {
- margin: 0 .5em;
- border-radius: 50%;
- background-size: 60%;
- }
- }
}
.ad {
display: flex;
@@ -293,6 +294,29 @@ blockquote {
}
}
}
+ .author {
+ display:flex;
+ flex-direction: column;
+ align-items: center;
+ background-color: #F1F1F1;
+ padding: 1.5rem;
+ & > *:not(:first-child) {
+ margin-top: 1rem;
+ }
+ &__name {
+ font-weight: 700;
+ font-size: 1.5em;
+ }
+ &__image {
+ border-radius: 100px;
+ }
+ &__bio {
+ text-align: center;
+ }
+ &__cta {
+ font-size: 1.25em;
+ }
+ }
}
.summary {
diff --git a/i18n/en.toml b/i18n/en.toml
index d4063d3..3222362 100644
--- a/i18n/en.toml
+++ b/i18n/en.toml
@@ -37,4 +37,6 @@ other = "Previous"
[noAd]
other = "No ad for you!"
[keepReading]
-other = "Keep reading..." \ No newline at end of file
+other = "Keep reading..."
+[authorCta]
+other = "✨ ¡If you liked it share and comment! ✨" \ No newline at end of file
diff --git a/i18n/es.toml b/i18n/es.toml
index 9703973..550db52 100644
--- a/i18n/es.toml
+++ b/i18n/es.toml
@@ -37,4 +37,6 @@ other = "Anterior"
[noAd]
other = "Te quedas sin anuncio!"
[keepReading]
-other = "Seguir leyendo..." \ No newline at end of file
+other = "Seguir leyendo..."
+[authorCta]
+other = "✨ ¡Si te ha costado comparte y comenta! ✨" \ No newline at end of file
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 531064f..540480c 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -2,6 +2,7 @@
<article class="content">
{{ .Content }}
{{- partial "post/related-content.html" . -}}
+ {{- partial "post/author.html" . -}}
{{- partial "post/comments.html" . -}}
</article>
{{ end }} \ No newline at end of file
diff --git a/layouts/partials/post/author.html b/layouts/partials/post/author.html
new file mode 100644
index 0000000..ac35743
--- /dev/null
+++ b/layouts/partials/post/author.html
@@ -0,0 +1,19 @@
+{{ with .Params.Author }}
+ <section class="author">
+ {{ with .name }}
+ <p class="author__name">{{ . }}</p>
+ {{ end }}
+ {{ with .image }}
+ <amp-img class="author__image"
+ src="{{ . | absURL }}"
+ layout="fixed" height="200" width="200"></amp-img>
+ {{ end }}
+ {{ with .bio }}
+ <p class="author__bio">{{ . }}</p>
+ {{ end }}
+ <p class="author__cta">{{ i18n "authorCta" }}</p>
+ <div class="social-share">
+ {{- partial "post/social-share.html" . -}}
+ </div>
+ </section>
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/post/social-share.html b/layouts/partials/post/social-share.html
new file mode 100644
index 0000000..a6716c9
--- /dev/null
+++ b/layouts/partials/post/social-share.html
@@ -0,0 +1,10 @@
+<amp-social-share class="social-share__button"
+ aria-label="{{ i18n "share" }}" type="system" width="50" height="50"></amp-social-share>
+<amp-social-share class="social-share__button"
+ aria-label="{{ i18n "shareFacebook" }}" type="facebook" width="50" height="50"></amp-social-share>
+<amp-social-share class="social-share__button"
+ aria-label="{{ i18n "shareTwitter" }}" type="twitter" width="50" height="50"></amp-social-share>
+<amp-social-share class="social-share__button"
+ aria-label="{{ i18n "shareLinkedin" }}" type="linkedin" width="50" height="50"></amp-social-share>
+<amp-social-share class="social-share__button"
+ aria-label="{{ i18n "sharePinterest" }}" type="pinterest" width="50" height="50"></amp-social-share> \ No newline at end of file
diff --git a/layouts/partials/post/under-title.html b/layouts/partials/post/under-title.html
index bc42571..89f47dc 100644
--- a/layouts/partials/post/under-title.html
+++ b/layouts/partials/post/under-title.html
@@ -4,7 +4,8 @@
{{ $months := index .Site.Data (i18n "months") }}
{{ $month := index $months (printf "%d" .Page.PublishDate.Month) }}
{{ i18n "published" (dict "Day" .Page.PublishDate.Day "Month" $month "Year" .Page.PublishDate.Year) }}
- </time> {{ i18n "by" }} {{.Page.Params.Author.Name}}
+ </time>
+ {{ with .Page.Params.Author.Name }} {{ i18n "by" }} {{ . }} {{ end }}
{{ $taxonomy := "tags" }}
<ul id="{{ $taxonomy }}">
<li>{{ i18n "tags" }}:</li>&nbsp;
@@ -16,16 +17,7 @@
{{ end }}
</ul>
</div>
- <div class="under-title__social-share">
- <amp-social-share class="under-title__social-share__button"
- aria-label="{{ i18n "share" }}" type="system" width="50" height="50"></amp-social-share>
- <amp-social-share class="under-title__social-share__button"
- aria-label="{{ i18n "shareFacebook" }}" type="facebook" width="50" height="50"></amp-social-share>
- <amp-social-share class="under-title__social-share__button"
- aria-label="{{ i18n "shareTwitter" }}" type="twitter" width="50" height="50"></amp-social-share>
- <amp-social-share class="under-title__social-share__button"
- aria-label="{{ i18n "shareLinkedin" }}" type="linkedin" width="50" height="50"></amp-social-share>
- <amp-social-share class="under-title__social-share__button"
- aria-label="{{ i18n "sharePinterest" }}" type="pinterest" width="50" height="50"></amp-social-share>
+ <div class="under-title__social-share social-share">
+ {{- partial "post/social-share.html" . -}}
</div>
</section> \ No newline at end of file
diff --git a/layouts/partials/structured-data/article.html b/layouts/partials/structured-data/article.html
index bac37e9..691edae 100644
--- a/layouts/partials/structured-data/article.html
+++ b/layouts/partials/structured-data/article.html
@@ -21,12 +21,16 @@
"author": {
"@type": "Person",
"name": "{{ .Page.Params.Author.Name }}",
- "url": "{{ .Page.Params.Author.Homepage | absURL }}"
+ "url": "{{ .Page.Params.Author.Homepage | absURL }}",
+ "image": "{{ .Page.Params.Author.Image | absURL }}",
+ "description": "{{ .Page.Params.Author.Bio }}"
},
"creator": {
"@type": "Person",
"name": "{{ .Page.Params.Author.Name }}",
- "url": "{{ .Page.Params.Author.Homepage | absURL }}"
+ "url": "{{ .Page.Params.Author.Homepage | absURL }}",
+ "image": "{{ .Page.Params.Author.Image | absURL }}",
+ "description": "{{ .Page.Params.Author.Bio }}"
},
"publisher": {
"@type": "Organization",