Skip to content

Commit 0844f8d

Browse files
feat: use new meta tags engine in Automad version 2
1 parent 7625b33 commit 0844f8d

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

elements/header.php

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
<!DOCTYPE html>
22
<html class="writer-html5 @{ theme | replace('/[^a-z]/', ' ') }<@ if not @{ ?list } @> @{ :template }<@ end @>" lang="en">
33
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<@ set {
7-
:description: @{ +main | findFirstParagraph },
8-
:metaTitle: @{ metaTitle | def('@{ sitename } / @{ title | def ("404") }') }
9-
} ~@>
10-
<title>@{ :metaTitle }</title>
11-
<@ Automad/MetaTags {
12-
description: @{ :description },
13-
ogTitle: @{ :metaTitle },
14-
ogDescription: @{ :description },
15-
ogType: 'website',
16-
ogImage: @{ ogImage | def('*.jpg, *.png, *.gif, /shared/*.jpg, /shared/*.png, /shared/*.gif') },
17-
twitterCard: 'summary_large_image'
18-
} ~@>
4+
<?php if (substr(AM_VERSION, 0, 1) == '1') { ?>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<@ set {
8+
:description: @{ +main | findFirstParagraph },
9+
:metaTitle: @{ metaTitle | def('@{ sitename } / @{ title | def ("404") }') }
10+
} ~@>
11+
<title>@{ :metaTitle }</title>
12+
<@ Automad/MetaTags {
13+
description: @{ :description },
14+
ogTitle: @{ :metaTitle },
15+
ogDescription: @{ :description },
16+
ogType: 'website',
17+
ogImage: @{ ogImage | def('*.jpg, *.png, *.gif, /shared/*.jpg, /shared/*.png, /shared/*.gif') },
18+
twitterCard: 'summary_large_image'
19+
} ~@>
20+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/styles/@{ syntaxTheme | def('ascetic') }.min.css">
21+
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/highlight.min.js"></script>
22+
<script>hljs.initHighlightingOnLoad();</script>
23+
<?php } ?>
1924
<link rel="stylesheet" href="/packages/revitron/automad-revitron/dist/revitron.min.css" type="text/css" />
20-
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/styles/@{ syntaxTheme | def('ascetic') }.min.css">
21-
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/highlight.min.js"></script>
22-
<script>hljs.initHighlightingOnLoad();</script>
2325
@{ customProperties | replace ('/^(.+)$/', '<style>:root{$1}</style>') }
2426
@{ itemsHeader }
2527
</head>

0 commit comments

Comments
 (0)