From deb773804e600d344b26a19d5ae474fa3525c07c Mon Sep 17 00:00:00 2001 From: "R. Allan White" Date: Mon, 14 Sep 2020 15:40:25 -0700 Subject: [PATCH] SEO improvements, canonical ref --- data/site.yml | 10 +++++----- source/images/icon-eyeball.svg | 1 + source/layouts/layout.slim | 2 ++ source/partials/_blocks.slim | 2 +- source/stylesheets/components/_content-blocks.scss | 5 +++++ source/stylesheets/custom/_blog.scss | 5 +++++ source/templates/post.html.slim | 7 ++++++- 7 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 source/images/icon-eyeball.svg diff --git a/data/site.yml b/data/site.yml index 7bcd7d6..e443eb7 100644 --- a/data/site.yml +++ b/data/site.yml @@ -51,14 +51,14 @@ contact: links: - - label: "Behance Portfolio" + label: "Work" action: "See Allan's work at Behance" - url: "https://behance.net/allanwhite" - icon: icon-behance.svg + url: "/#recent" + icon: icon-eyeball.svg - - label: "Dev.to Blog" + label: "Blog" action: "Read Allan's Writing at his blog" - url: "https://dev.to/allanwhite" + url: "/blog" icon: icon-pencil.svg - label: "Github" diff --git a/source/images/icon-eyeball.svg b/source/images/icon-eyeball.svg new file mode 100644 index 0000000..ce155e9 --- /dev/null +++ b/source/images/icon-eyeball.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/source/layouts/layout.slim b/source/layouts/layout.slim index 2c77eb8..c9ed8e3 100644 --- a/source/layouts/layout.slim +++ b/source/layouts/layout.slim @@ -9,6 +9,8 @@ html lang="en-us" meta charset="utf-8" / meta content="ie=edge" http-equiv="x-ua-compatible" / meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport" / + - if current_page.data.canonical_source + link rel="canonical" href=current_page.data.canonical_source = stylesheet_link_tag "site" script src="https://cdn.jsdelivr.net/npm/lozad/dist/lozad.min.js" type="text/javascript" body class=page_classes diff --git a/source/partials/_blocks.slim b/source/partials/_blocks.slim index db218c9..2a980f1 100644 --- a/source/partials/_blocks.slim +++ b/source/partials/_blocks.slim @@ -89,7 +89,7 @@ - when "quote_large" aside.content-block.block-quote.relative.w-full.pad-y-xl class=(block.theme.nil? ? nil : "bg-#{block.theme.class_name}") id=block.id / code = block.item_type.api_key - .text-4xl-scale.font-serif.font-light class=(block.quote_color.nil? ? nil : "text-#{block.quote_color.class_name}") = block.quote_body + div class=(block.quote_color.nil? ? nil : "text-#{block.quote_color.class_name}") = Kramdown::Document.new(block.quote_body).to_html - when "text_block" section.content-block.block-text.relative.w-full.pad class=(block.theme.nil? ? nil : "bg-#{block.theme.class_name}") id=block.id / code = block.item_type.api_key diff --git a/source/stylesheets/components/_content-blocks.scss b/source/stylesheets/components/_content-blocks.scss index 2e5e7d2..7679ece 100644 --- a/source/stylesheets/components/_content-blocks.scss +++ b/source/stylesheets/components/_content-blocks.scss @@ -7,4 +7,9 @@ @apply font-sans text-base; } } +} +.block-quote { // necessary when using markdown + p { + @apply text-4xl-scale font-serif font-light; + } } \ No newline at end of file diff --git a/source/stylesheets/custom/_blog.scss b/source/stylesheets/custom/_blog.scss index 4c2ee38..99c99ae 100644 --- a/source/stylesheets/custom/_blog.scss +++ b/source/stylesheets/custom/_blog.scss @@ -24,4 +24,9 @@ @apply px-20; } } + .block-quote { + p { + @apply font-book font-light leading-relaxed opacity-75; + } + } } \ No newline at end of file diff --git a/source/templates/post.html.slim b/source/templates/post.html.slim index 2d217a3..86ec6b1 100644 --- a/source/templates/post.html.slim +++ b/source/templates/post.html.slim @@ -16,11 +16,14 @@ page_classes: "blog" // --link-color: var(--color-blue); // --link-hover: var(--color-blue-dark); //} - +/ - post = locals[:post] - set_meta_tags title: "#{post.title} | Blog", full_title: false, pull_image: 'foo.jpg' = partial "partials/json-ld", :locals => { :type => "person" } - bg_theme = (post.theme.nil? ? nil : "bg-#{post.theme.class_name}") - entry_id = post.id +- unless post.canonical_source.empty? + - current_page.data.canonical_source = post.canonical_source + - content_for(:head) do = dato_meta_tags(post) / .pad.bg-orange.text-sm @@ -40,6 +43,8 @@ main.relative.w-full.pb-16 class=bg_theme id="top" h4.text-2xl.font-sans.font-light.italic.mb-12 = (post.subheader.nil? ? nil : post.subheader ) .max-w-7xl.mx-auto.flex.flex-col class="lg:flex-row lg:flex-row-reverse" div class="w-full lg:w-2/3 xl:w-3/5" + figure.rounded-lg.overflow-hidden.mb-6 + img.feature-image.lozad.object-fit class="w-auto" src=post.cover_image.url(w: 480, h: 240, blur:200, auto: :compress) data-src=post.cover_image.url(w: 960, h: 480, crop: :edges, fit: :crop, auto: :compress) alt=post.title - unless post.intro.empty? .lead.markdown.pr-0 class="lg:pr-6" = Kramdown::Document.new(post.intro).to_html