Skip to content

Commit aab502e

Browse files
committed
refactor: reorganize and clean up head.html structure
- Add sectioned comments for Meta, Title/Description, Stylesheets, Canonical/RSS, and Scripts - Improve readability with multiline title and description blocks - Remove unused meta tags - Add integrity, crossorigin, and referrerpolicy attributes to external resources - Reorder elements for clearer logical grouping - Add CodeQL annotations around ads script
1 parent 451be2f commit aab502e

File tree

1 file changed

+43
-10
lines changed

1 file changed

+43
-10
lines changed

_includes/head.html

Lines changed: 43 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,51 @@
11
<head>
2+
<!-- Meta -->
23
<meta charset="utf-8" />
3-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
44
<meta name="viewport" content="width=device-width, initial-scale=1" />
5-
<meta name="author" content="Jay Prall" />
6-
<meta name="robots" content="follow" />
75

8-
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
9-
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
6+
<!-- Title & Description -->
7+
<title>
8+
{% if page.title %}
9+
{{ page.title }}
10+
{% else %}
11+
{{ site.title }}
12+
{% endif %}
13+
</title>
1014

11-
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
12-
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
13-
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
14-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />
15+
<meta name="description"
16+
content="{% if page.excerpt %}
17+
{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}
18+
{% else %}
19+
{{ site.description }}
20+
{% endif %}">
1521

16-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js" type="text/javascript"></script>
22+
<!-- Stylesheets -->
23+
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}" />
24+
25+
<link rel="stylesheet"
26+
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css"
27+
integrity="sha512-TktJbycEG5Van9KvrSHFUcYOKBroD7QCYkEe73HAutODCw9QTFcvF6fuxioYM1h6THNudK1GjVidazj6EslK4A=="
28+
crossorigin="anonymous"
29+
referrerpolicy="no-referrer" />
30+
31+
<!-- Canonical & RSS -->
32+
<link rel="canonical"
33+
href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}" />
34+
35+
<link rel="alternate"
36+
type="application/rss+xml"
37+
title="{{ site.title }}"
38+
href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
39+
40+
<!-- Scripts -->
41+
<script
42+
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"
43+
integrity="sha512-3gJwYpMe3QewGELv8k/BX9vcqhryRdzRMxVfq6ngyWXwo03GFEzjsUm8Q7RZcHPHksttq7/GFoxjCVUjkjvPdw=="
44+
crossorigin="anonymous"
45+
referrerpolicy="no-referrer">
46+
</script>
47+
48+
<!-- codeql-disable js/functionality-from-untrusted-source -->
1749
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
50+
<!-- codeql-enable js/functionality-from-untrusted-source -->
1851
</head>

0 commit comments

Comments
 (0)