From 4f438b295a2a94587188c2546bc48e31f2e3a883 Mon Sep 17 00:00:00 2001 From: Damillora Date: Thu, 12 Nov 2020 02:54:23 +0700 Subject: [PATCH] Update design for tags and authors --- assets/css/styles.css | 13 +++++++++++-- author.hbs | 18 +++++++----------- index.hbs | 6 +++--- package.json | 2 +- partials/post-card.hbs | 14 +++++++++++--- partials/primary-tag.hbs | 14 ++++++++++++++ post.hbs | 26 ++++++++++++++++---------- tag.hbs | 24 ++++++++++++++++-------- 8 files changed, 79 insertions(+), 38 deletions(-) create mode 100644 partials/primary-tag.hbs diff --git a/assets/css/styles.css b/assets/css/styles.css index 28b105a..3663819 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -329,15 +329,21 @@ footer { @apply bg-blue-700 w-auto inline-block px-2 py-1 text-white text-sm transition duration-300 ease-in-out; } .primary-tag-header:hover { - @apply bg-blue-900 transition duration-300 ease-in-out; + @apply transition-all duration-300 ease-in-out underline; } .tag-header { @apply bg-blue-700 w-auto inline-block px-2 py-1 text-white text-sm; } +.tag-accent-color { + @apply inline-block rounded-full align-text-bottom h-16 w-16; + +} .author-header { @apply bg-red-700 w-auto inline-block px-2 py-1 text-white text-sm; } - +.author-image { + @apply inline-block rounded-full align-text-bottom h-16 w-16; +} .author-list { @apply flex flex-row items-center my-2 py-2; } @@ -347,6 +353,9 @@ footer { .author-names { @apply flex-grow flex flex-col; } +.author-names a:hover { + @apply underline; +} /* 6. Post feed */ .post-feed { diff --git a/author.hbs b/author.hbs index 5ffcd88..0c72348 100644 --- a/author.hbs +++ b/author.hbs @@ -7,20 +7,16 @@
-
- Author +
+ Author
-
- {{#if profile_image}} -
- {{name}} -
- {{/if}} -
-
-

{{name}}

+
+ {{#if profile_image}} + {{name}} + {{/if}} +

{{name}}

{{plural ../pagination.total empty='No posts' singular='% post' plural='% posts'}} diff --git a/index.hbs b/index.hbs index 1360861..87b33c1 100644 --- a/index.hbs +++ b/index.hbs @@ -5,20 +5,20 @@
-
+
{{#if @site.logo}}
{{@site.title}}
{{/if}} - +
diff --git a/package.json b/package.json index f9e79a7..52e0239 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "yuika", "description": "nanao.moe's blog theme", - "version": "2.1.3", + "version": "2.2.0", "engines": { "ghost-api": "v3" }, diff --git a/partials/post-card.hbs b/partials/post-card.hbs index 6888fc3..caa1e65 100644 --- a/partials/post-card.hbs +++ b/partials/post-card.hbs @@ -1,17 +1,25 @@
-
- {{> post-background}} {{!--Special header-image.hbs partial to generate the background image--}} +
+ + {{> post-background}} {{!--Special header-image.hbs partial to generate the background image--}} +
{{#if primary_tag}} {{#primary_tag}} + {{#if accent_color}} + + {{name}} + + {{else}} {{name}} + {{/if}} {{/primary_tag}} {{/if}}
-
+
diff --git a/partials/primary-tag.hbs b/partials/primary-tag.hbs new file mode 100644 index 0000000..51e7b58 --- /dev/null +++ b/partials/primary-tag.hbs @@ -0,0 +1,14 @@ + +{{#if primary_tag}} +{{#primary_tag}} + {{#if accent_color}} + + {{name}} + + {{else}} + + {{name}} + + {{/if}} +{{/primary_tag}} +{{/if}} \ No newline at end of file diff --git a/post.hbs b/post.hbs index 8681e38..60767a5 100644 --- a/post.hbs +++ b/post.hbs @@ -8,13 +8,9 @@
- {{#if primary_tag}} - {{#primary_tag}} -
- {{name}} -
- {{/primary_tag}} - {{/if}} +
+ {{> primary-tag}} +

{{title}}

@@ -81,9 +77,19 @@ {{#get "posts" filter="tags:{{primary_tag.slug}}+id:-{{id}}" limit="3" as |related_posts|}} {{#if related_posts}} {{#../primary_tag}} -
-

More in {{name}}

-
+
+

More in + {{#if accent_color}} + + {{name}} + + {{else}} + + {{name}} + + {{/if}} +

+
{{/../primary_tag}}
{{#foreach related_posts}} diff --git a/tag.hbs b/tag.hbs index 3934a35..b52c39c 100644 --- a/tag.hbs +++ b/tag.hbs @@ -8,19 +8,27 @@
-
- Tag -
-

{{name}}

+ Tag
-
- {{#if description}} -

{{description}}

+
+ {{#if accent_color}} + {{else}} -

A collection of {{plural ../pagination.total empty='posts' singular='% post' plural='% posts'}}

+ {{/if}} +

+ {{name}} +

+
+ {{plural ../pagination.total empty='posts' singular='% post' plural='% posts'}} +
+ {{#if description}} +
+

{{description}}

+
+ {{/if}}