Skip to content

Commit f91168c

Browse files
authored
Merge pull request #41 from szolkowski/feature/wave-1-seo-perf-quick-wins
Enhance SEO and accessibility by adding Open Graph image properties and improving modal structure
2 parents 5a2b60e + 4c46b32 commit f91168c

9 files changed

Lines changed: 15 additions & 3 deletions

_includes/code-modal.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
<i class="fas fa-copy"></i> Copy
1414
</button>
1515
<pre><code class="language-{{ include.lang | default: 'csharp' }} hljs">{{ code_content | escape }}</code></pre>
16-
</div><!-- Modal structure with only copy and close --><div id="codeModal-{{ include.id }}" class="code-modal" role="dialog" aria-modal="true" aria-label="Code viewer">
16+
</div>
17+
18+
<!-- Modal structure with only copy and close -->
19+
<div id="codeModal-{{ include.id }}" class="code-modal" role="dialog" aria-modal="true" aria-label="Code viewer">
1720
<div class="code-modal-content">
1821
<div class="modal-toolbar">
1922
<button class="code-modal-close" aria-label="Close code viewer">&times;</button>

_includes/head-custom.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
{% unless page.image %}
1616
<meta property="og:image" content="{{ '/assets/img/og-default.png' | absolute_url }}" />
17+
<meta property="og:image:width" content="1200" />
18+
<meta property="og:image:height" content="630" />
19+
<meta property="og:image:type" content="image/png" />
1720
<meta property="og:image:alt" content="{{ site.title | escape }}" />
1821
<meta name="twitter:image" content="{{ '/assets/img/og-default.png' | absolute_url }}" />
1922
<meta name="twitter:card" content="summary_large_image" />
@@ -140,6 +143,7 @@
140143
"@type": "BlogPosting",
141144
"@id": "{{ page_id }}",
142145
"url": "{{ page.url | absolute_url }}",
146+
"isAccessibleForFree": true,
143147
"headline": {{ page.title | jsonify }},
144148
"description": {{ page.description | jsonify }},
145149
"inLanguage": "en-US",
@@ -179,6 +183,7 @@
179183
"@type": "CollectionPage",
180184
"@id": "{{ page_id }}",
181185
"url": "{{ page.url | absolute_url }}",
186+
"isAccessibleForFree": true,
182187
"name": "All topics — Szołkowski's Blog",
183188
"description": {{ page.description | jsonify }},
184189
"inLanguage": "en-US",
@@ -211,6 +216,7 @@
211216
"@type": "CollectionPage",
212217
"@id": "{{ page_id }}",
213218
"url": "{{ page.url | absolute_url }}",
219+
"isAccessibleForFree": true,
214220
"name": {{ page.title | jsonify }},
215221
"inLanguage": "en-US",
216222
"isPartOf": { "@id": "{{ website_id }}" },

_layouts/default.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon32.png">
1414
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon16.png">
1515

16+
<link rel="preconnect" href="https://cdnjs.cloudflare.com" crossorigin>
17+
18+
{%- if page.layout == "post" -%}
1619
<!-- Highlight.js CSS -->
1720
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" integrity="sha384-wH75j6z1lH97ZOpMOInqhgKzFkAInZPPSPlZpYKYTOqsaizPvhQZmAtLcPKXpLyH" crossorigin="anonymous">
1821

1922
<!-- Highlight.js JS -->
2023
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" integrity="sha384-F/bZzf7p3Joyp5psL90p/p89AZJsndkSoGwRpXcZhleCWhd8SnRuoYo4d0yirjJp" crossorigin="anonymous"></script>
24+
{%- endif -%}
2125

2226
<!-- Font Awesome CDN -->
2327
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" integrity="sha384-/o6I2CkkWC//PSjvWC/eYN7l3xM3tJm8ZzVkCOfp//W05QcE3mlGskpoHB6XqI+B" crossorigin="anonymous">

assets/css/custom-styles.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ ul.share-buttons li{
1313

1414
ul.share-buttons .sr-only{
1515
position: absolute;
16-
clip: rect(1px 1px 1px 1px);
17-
clip: rect(1px, 1px, 1px, 1px);
16+
clip-path: inset(50%);
1817
padding: 0;
1918
border: 0;
2019
height: 1px;
-170 KB
Loading
-291 KB
Loading
-384 KB
Loading
-153 KB
Loading
-132 KB
Loading

0 commit comments

Comments
 (0)