Skip to content

Commit

Permalink
SEO improvements, canonical ref
Browse files Browse the repository at this point in the history
  • Loading branch information
allanwhite committed Sep 14, 2020
1 parent d3d6b7b commit deb7738
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
10 changes: 5 additions & 5 deletions data/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions source/images/icon-eyeball.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions source/layouts/layout.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/partials/_blocks.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions source/stylesheets/components/_content-blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@
@apply font-sans text-base;
}
}
}
.block-quote { // necessary when using markdown
p {
@apply text-4xl-scale font-serif font-light;
}
}
5 changes: 5 additions & 0 deletions source/stylesheets/custom/_blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@
@apply px-20;
}
}
.block-quote {
p {
@apply font-book font-light leading-relaxed opacity-75;
}
}
}
7 changes: 6 additions & 1 deletion source/templates/post.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit deb7738

Please sign in to comment.