Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder head elements in base.html #6

Merged
merged 2 commits into from
Mar 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/_includes/layout/base.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script src="/js/theme-detection.js"></script>
{% include "partial/preload.html" %}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="alternate" type="application/rss+xml" href="{{ site.url }}/feed.xml" />
<meta http-equiv="X-UA-Compatible" content="ie=edge">
{% include "partial/meta.html" %}
<link rel="alternate" type="application/rss+xml" href="{{ site.url }}/feed.xml">

<script src="/js/theme-detection.js"></script>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meta elements above this cause no delay in execution.

{% include "partial/preload.html" %}

<link rel="stylesheet" href="/css/main.css">
</head>
<body>
Expand Down
28 changes: 14 additions & 14 deletions src/_includes/partial/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@
{% endif %}

<title>{{ pageTitle }}</title>
<link rel="canonical" href="{{ currentUrl }}" />
<link rel="canonical" href="{{ currentUrl }}">

<meta name="generator" content="{{ eleventy.generator }}" />
<meta name="generator" content="{{ eleventy.generator }}">

<meta property="og:site_name" content="{{ siteTitle }}" />
<meta property="og:title" content="{{ pageTitle }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ currentUrl }}" />
<meta property="og:site_name" content="{{ siteTitle }}">
<meta property="og:title" content="{{ pageTitle }}">
<meta property="og:type" content="website">
<meta property="og:url" content="{{ currentUrl }}">

{% if socialImage %}
<meta name="twitter:card" content="summary_large_image" />
<meta property="og:image" content="{{ socialImage }}" />
<meta name="twitter:image" content="{{ socialImage }}" />
<meta property="og:image:alt" content="Page image for {{ site.name }}" />
<meta name="twitter:image:alt" content="Page image for {{ site.name }}" />
<meta name="twitter:card" content="summary_large_image">
<meta property="og:image" content="{{ socialImage }}">
<meta name="twitter:image" content="{{ socialImage }}">
<meta property="og:image:alt" content="Page image for {{ site.name }}">
<meta name="twitter:image:alt" content="Page image for {{ site.name }}">
{% endif %}

{% if metaDesc %}
<meta name="description" content="{{ metaDesc }}" />
<meta name="twitter:description" content="{{ metaDesc }}" />
<meta property="og:description" content="{{ metaDesc }}" />
<meta name="description" content="{{ metaDesc }}">
<meta name="twitter:description" content="{{ metaDesc }}">
<meta property="og:description" content="{{ metaDesc }}">
{% endif %}

<link rel="apple-touch-icon" sizes="180x180" href="/img/favicon/apple-touch-icon.png">
Expand Down