From 8e1809513b50cc39f8ed2421487ba8a9aaaf0eda Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 29 Sep 2019 16:50:34 +0200 Subject: [PATCH 1/4] feat(Post): Implement asset cover feature --- package.json | 5 -- .../src/components/PostCard.vue | 27 ++++--- .../saber-theme-portfolio/src/css/global.css | 22 +++++- .../src/layouts/post.vue | 72 +++++++++++-------- .../saber-theme-portfolio/src/saber-node.js | 1 + 5 files changed, 84 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 03fb4d7..380e3b5 100644 --- a/package.json +++ b/package.json @@ -44,10 +44,5 @@ "xo --fix", "git add" ] - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } } } diff --git a/packages/saber-theme-portfolio/src/components/PostCard.vue b/packages/saber-theme-portfolio/src/components/PostCard.vue index cb9a8f9..464edb4 100644 --- a/packages/saber-theme-portfolio/src/components/PostCard.vue +++ b/packages/saber-theme-portfolio/src/components/PostCard.vue @@ -1,14 +1,23 @@ diff --git a/packages/saber-theme-portfolio/src/css/global.css b/packages/saber-theme-portfolio/src/css/global.css index 3e9dcb2..963c82c 100644 --- a/packages/saber-theme-portfolio/src/css/global.css +++ b/packages/saber-theme-portfolio/src/css/global.css @@ -51,6 +51,26 @@ a { } } +.post-cover { + overflow: hidden; + width: 100%; + margin-bottom: 30px; + border-radius: 3px; + align-content: center; + display: flex; +} + +.post-card .post-cover { + height: 250px; + border-radius: 3px 3px 0 0; + margin-bottom: 0; +} + +.post-cover .post-cover__image { + width: 100%; + object-fit: cover; +} + .page-title { font-size: 3rem; font-weight: 400; @@ -150,4 +170,4 @@ a { &:hover { box-shadow: inset 0 0 0 1px var(--border-color); } -} \ No newline at end of file +} diff --git a/packages/saber-theme-portfolio/src/layouts/post.vue b/packages/saber-theme-portfolio/src/layouts/post.vue index 58f7068..28def37 100644 --- a/packages/saber-theme-portfolio/src/layouts/post.vue +++ b/packages/saber-theme-portfolio/src/layouts/post.vue @@ -1,34 +1,50 @@