From adabc3b106f8af4d6757b6740b73ee12326b5c23 Mon Sep 17 00:00:00 2001 From: Chakravarthi Medicharla Date: Wed, 14 Feb 2024 17:38:21 +0530 Subject: [PATCH 1/3] redesign blog page header section --- src/components/AuthorCardTop.jsx | 2 +- .../blog/{MarkdownRemark.fields__slug}.js | 1 + src/styles/blog.css | 4 +- src/styles/style.css | 65 +++++++++++++++---- src/templates/blog-post.js | 16 +++-- 5 files changed, 64 insertions(+), 24 deletions(-) diff --git a/src/components/AuthorCardTop.jsx b/src/components/AuthorCardTop.jsx index ac458045..47102a0a 100644 --- a/src/components/AuthorCardTop.jsx +++ b/src/components/AuthorCardTop.jsx @@ -12,7 +12,7 @@ export default function AuthorCard({ author }) { style={{ fontSize: "16px", fontWeight: "normal", - margin: "-16px 0px 32px", + margin: "16px 0px 32px", color: "#222", }} > diff --git a/src/pages/blog/{MarkdownRemark.fields__slug}.js b/src/pages/blog/{MarkdownRemark.fields__slug}.js index c05452c4..3f06bd20 100644 --- a/src/pages/blog/{MarkdownRemark.fields__slug}.js +++ b/src/pages/blog/{MarkdownRemark.fields__slug}.js @@ -21,6 +21,7 @@ export const pageQuery = graphql` title cover author + description } fields { slug diff --git a/src/styles/blog.css b/src/styles/blog.css index f521259a..11618c17 100644 --- a/src/styles/blog.css +++ b/src/styles/blog.css @@ -269,9 +269,7 @@ gap: 8px; padding-bottom: 36px; - margin-bottom: 32px; - margin-top: 42px; - border-bottom: 1px solid #ddd; + margin: 32px 0px 16px; } .author-card-top-container img{ diff --git a/src/styles/style.css b/src/styles/style.css index 46881c78..bc407102 100644 --- a/src/styles/style.css +++ b/src/styles/style.css @@ -15,7 +15,7 @@ --gatsbyMaxWidth-3xl: 48rem; --gatsbyMaxWidth-4xl: 56rem; --gatsbyMaxWidth-full: "100%"; - --gatsbyMaxWidth-wrapper: 680px; + --gatsbyMaxWidth-wrapper: 900px; --gatsbySpacing-px: "1px"; --gatsbySpacing-0: 0; --gatsbySpacing-1: 0.25rem; @@ -271,19 +271,6 @@ a:focus { padding: 3.75rem 0rem; } -@media screen and (max-width: 768px) { - .global-wrapper { - width: 540px; - } -} - -@media screen and (max-width: 572px) { - .global-wrapper { - width: 100%; - padding: 60px 24px 10px; - } -} - .global-wrapper[data-is-root-path="true"] .bio { margin-bottom: var(--gatsbySpacing-20); } @@ -340,6 +327,32 @@ a:focus { border-radius: 100%; } +.blog-post header{ + display: flex; + flex-direction: row-reverse; + align-items: center; + + border-bottom: 1px solid #ddd; + + margin-bottom: 32px; + gap: 42px; +} + +.blog-post header .blog-description{ + color: rgba(51, 51, 51, 1); + font-size: 16px; + font-weight: 400; + line-height: 22px; + letter-spacing: 0em; + text-align: left; + margin: 0; +} + +.blog-post img{ + width: 50%; + border-radius: 14px; +} + .blog-post header h1 { margin: var(--gatsbySpacing-0) var(--gatsbySpacing-0) var(--gatsbySpacing-8) var(--gatsbySpacing-0); font-size: 39px; @@ -498,4 +511,28 @@ section[itemprop="articleBody"] img[src$=".gif"] { .primary-button:hover{ box-shadow: 2px 2px 20px 0 rgba(0,0,0,.16); +} + + +@media screen and (max-width: 968px) { + .global-wrapper { + width: 540px; + } + + .blog-post header{ + flex-direction: column; + gap: 0px; + } + + .blog-post img{ + width: 100%; + border-radius: 6px; + } +} + +@media screen and (max-width: 572px) { + .global-wrapper { + width: 100%; + padding: 60px 24px 10px; + } } \ No newline at end of file diff --git a/src/templates/blog-post.js b/src/templates/blog-post.js index b9138521..c3c810b8 100644 --- a/src/templates/blog-post.js +++ b/src/templates/blog-post.js @@ -40,6 +40,7 @@ const BlogPostTemplate = ({ data, location }) => { return $.html(); } + console.log({data}) return (
{ itemScope itemType="http://schema.org/Article" > -
+
{post.frontmatter.cover && ( { alt="Cover" /> )} -

{post.frontmatter.date}

-

{post.frontmatter.title}

- {post.frontmatter.author && ( - - )} +
+

{post.frontmatter.date}

+

{post.frontmatter.title}

+

{post.frontmatter.description}

+ {post.frontmatter.author && ( + + )} +
Date: Wed, 14 Feb 2024 18:41:36 +0530 Subject: [PATCH 2/3] Adjust font size --- src/styles/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/style.css b/src/styles/style.css index bc407102..39275104 100644 --- a/src/styles/style.css +++ b/src/styles/style.css @@ -355,8 +355,8 @@ a:focus { .blog-post header h1 { margin: var(--gatsbySpacing-0) var(--gatsbySpacing-0) var(--gatsbySpacing-8) var(--gatsbySpacing-0); - font-size: 39px; - line-height: 3.4375rem; + font-size: 36px; + line-height: 50px; margin: 20px 0px 20px; } From d3cb44f0a165f5499aa8580d4a262b5024123f61 Mon Sep 17 00:00:00 2001 From: Chakravarthi Medicharla Date: Wed, 14 Feb 2024 18:47:33 +0530 Subject: [PATCH 3/3] clean up code --- src/templates/blog-post.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/templates/blog-post.js b/src/templates/blog-post.js index c3c810b8..146febb8 100644 --- a/src/templates/blog-post.js +++ b/src/templates/blog-post.js @@ -40,7 +40,6 @@ const BlogPostTemplate = ({ data, location }) => { return $.html(); } - console.log({data}) return (