From 3b29bb3b59069fc5a149a11f5cd5221e72dcb1b2 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Tue, 3 Sep 2019 00:17:26 +0200 Subject: [PATCH] Add support to the new Bookmark card --- README.md | 1 + package.json | 2 +- src/docker-compose.yml | 2 +- src/js/page.js | 4 +- src/js/post.js | 4 +- src/sass/layouts/_post-content.scss | 105 ++++++++++++++++++++++++++++ 6 files changed, 114 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a044176..65bf35f 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ To get the latest version please head over the [releases page](https://github.co * Featured posts and pages * Post, Page, Tag, Authors, pages * Koenig editor +* Bookmark card * Gallery card * Blog title and description * Cover image for Home, Post, Page, Tag, Author pages diff --git a/package.json b/package.json index 18c571e..8846575 100644 --- a/package.json +++ b/package.json @@ -54,5 +54,5 @@ "desktop": "assets/screenshot-desktop.jpg", "mobile": "assets/screenshot-mobile.jpg" }, - "version": "0.2.8" + "version": "0.2.9" } diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 8825780..5e34f91 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: ghost: - image: ghost + image: ghost:2.30.2 container_name: ghost volumes: - $PWD/..:/var/lib/ghost/content/themes/liebling diff --git a/src/js/page.js b/src/js/page.js index 14b0abc..6eafab9 100644 --- a/src/js/page.js +++ b/src/js/page.js @@ -20,7 +20,9 @@ $(document).ready(() => { adjustImageGallery() $('.js-post-content').find('figure img').each(function() { - $(this).addClass('js-zoomable') + if (!$(this).closest('figure').hasClass('kg-bookmark-card')) { + $(this).addClass('js-zoomable') + } const $figcaption = $(this).parent().find('figcaption') if ($figcaption) { diff --git a/src/js/post.js b/src/js/post.js index 00024bf..9ef9cf1 100644 --- a/src/js/post.js +++ b/src/js/post.js @@ -166,7 +166,9 @@ $(document).ready(() => { }) $('.js-post-content').find('img').each(function() { - $(this).addClass('js-zoomable') + if (!$(this).closest('figure').hasClass('kg-bookmark-card')) { + $(this).addClass('js-zoomable') + } const $figcaption = $(this).parent().find('figcaption') if ($figcaption) { diff --git a/src/sass/layouts/_post-content.scss b/src/sass/layouts/_post-content.scss index 08b5952..1ccc43b 100644 --- a/src/sass/layouts/_post-content.scss +++ b/src/sass/layouts/_post-content.scss @@ -415,4 +415,109 @@ @extend .m-button; } + .kg-bookmark-card { + width: 100%; + padding: 0 !important; + margin: 30px auto !important; + background: $white; + + @include respond-to('medium') { + margin: 40px auto !important; + } + } + + .kg-card + .kg-bookmark-card { + margin-top: 0; + } + + .kg-bookmark-container { + display: flex; + color: $body; + text-decoration: none !important; + min-height: 148px; + box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 4px, + rgba(0, 0, 0, 0.1) 0px 0px 0px 1px; + border-radius: 3px; + } + + .kg-bookmark-content { + display: flex; + flex-direction: column; + flex-grow: 1; + align-items: flex-start; + justify-content: start; + padding: 20px; + } + + .kg-bookmark-title { + font-size: 1.125rem; + line-height: 1.3; + font-weight: 600; + } + + .kg-bookmark-description { + font-size: 0.875rem; + font-weight: 400; + line-height: 1.4; + margin-top: 12px; + overflow-y: hidden; + } + + .kg-bookmark-thumbnail { + position: relative; + min-width: 30%; + max-height: 100%; + overflow: hidden; + } + + .kg-bookmark-thumbnail img { + position: absolute; + top: 0; + left: 0; + width: 100% !important; + height: 100% !important; + object-fit: cover; + border-radius: 0 3px 3px 0; + } + + .kg-bookmark-metadata { + display: flex; + align-items: center; + flex-wrap: wrap; + font-size: 0.9rem; + font-weight: 400; + color: $gray; + margin-top: 14px; + } + + .kg-bookmark-icon { + width: 22px !important; + height: 22px !important; + margin-right: 8px !important; + } + + .kg-bookmark-author:after { + content: '•'; + margin: 0 6px; + } + + @media (max-width: 500px) { + .kg-bookmark-container { + flex-direction: column; + } + + .kg-bookmark-thumbnail { + order: 1; + width: 100%; + min-height: 160px; + } + + .kg-bookmark-thumbnail img { + border-radius: 3px 3px 0 0; + } + + .kg-bookmark-content { + order: 2; + } + } }