Skip to content

fix: prevent subtitle to break out of attribute #250

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 5 additions & 5 deletions src/_includes/_layout.njk
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
<!doctype html>
<html lang="{{ lang }}" dir="{{ langDir }}">
{% set fullTitle = [_(title), 'no hello'] | select() | join(' - ') %}
{% set escapedSubtitle = _("header.subtitle") | escape %}
<head>
<title>{{ fullTitle }}</title>
<link rel="stylesheet" type="text/css" href="/css/styles.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8" />
<!-- primary meta -->
<meta name="title" content="{{ fullTitle }}" />
<meta name="description" content="{{ _("header.subtitle") }}" />
<meta name="description" content="{{ escapedSubtitle }}" />
<!-- opengraph/facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ site.root }}/" />
<meta property="og:title" content="{{ fullTitle }}" />
<meta
property="og:description"
content="{{ _("header.subtitle") }}"
content="{{ escapedSubtitle }}"
/>
<meta property="og:image" content="{{ site.root }}{%- imageURL "./src/img/newmeta.png", { format: "webp" } -%}" />
<!-- twitter -->
Expand All @@ -24,14 +25,13 @@
<meta property="twitter:title" content="{{ fullTitle }}" />
<meta
property="twitter:description"
content="{{ _("header.subtitle") }}"
content="{{ escapedSubtitle }}"
/>
<meta property="twitter:image" content="{{ site.root }}{%- imageURL "./src/img/newmeta.png", { format: "webp" } -%}" />
<!-- icons -->
<link rel="apple-touch-icon" href="{%- imageURL "./src/img/apple-touch-icon.png", { format: "webp" } -%}" />
<link rel="shortcut icon" href="{%- imageURL "./src/img/favicon.png", { format: "webp" } -%}" type="image/x-icon" />
<link rel="icon" href="{%- imageURL "./src/img/favicon.png", { format: "webp" } -%}" type="image/x-icon" />

{% for locale in locales %}
<link rel="alternate" hreflang="{{ locale.path }}" href="{{ site.root }}{% relocalizePath locale.path, page.url %}" />
{% endfor %}
Expand All @@ -40,4 +40,4 @@
<body>
{{ content | safe }}
</body>
</html>
</html>