Skip to content

Commit 55c9579

Browse files
committed
Include Open Graph and JSON-LD data
Fixes #97
1 parent d5e0d74 commit 55c9579

6 files changed

Lines changed: 86 additions & 4 deletions

File tree

dist/four-point-seven/forms/article/search_results.txp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
<txp:newer rel="prev">
6868
<txp:text item="prev" />
6969
</txp:newer>
70-
7170
<txp:older rel="next">
7271
<txp:text item="next" />
7372
</txp:older>

dist/four-point-seven/pages/archive.txp

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
<txp:if_variable name="page" value="1">
2626
<meta name="robots" content="index, follow">
2727
<link rel="canonical" href="<txp:section url="1" />">
28+
<script type="application/ld+json">
29+
{
30+
"@context": "https://schema.org",
31+
"@type": "Blog",
32+
"headline": "<txp:section title="1" escape="json" />",
33+
<txp:if_description>"description": "<txp:meta_description format="" escape="json" />",</txp:if_description>
34+
"url": "<txp:section url="1" />"
35+
}
36+
</script>
2837
<txp:else />
2938
<meta name="robots" content="noindex, follow">
3039
</txp:if_variable>
@@ -33,6 +42,31 @@
3342
<txp:meta_author title="1" />
3443
<meta name="robots" content="<txp:if_expires>unavailable_after: <txp:expires gmt="1" format="%d-%b-%y %T" /> GMT<txp:else />index, follow</txp:if_expires>">
3544
<link rel="canonical" href="<txp:permlink />">
45+
<meta property="og:site_name" content="<txp:site_name />">
46+
<meta property="og:type" content="article">
47+
<meta property="og:title" content="<txp:title />">
48+
<txp:if_description><meta property="og:description" content="<txp:meta_description format="" />"></txp:if_description>
49+
<meta property="og:url" content="<txp:permlink />">
50+
<txp:if_article_image>
51+
<txp:images limit="1">
52+
<meta property="og:image" content="<txp:image_url />">
53+
<meta property="og:image:width" content="<txp:image_info type="w" />">
54+
<meta property="og:image:height" content="<txp:image_info type="h" />">
55+
<meta property="og:image:alt" content="<txp:image_info type="alt" />">
56+
</txp:images>
57+
</txp:if_article_image>
58+
<script type="application/ld+json">
59+
{
60+
"@context": "https://schema.org",
61+
"@type": "Blog",
62+
"blogPost": [{
63+
"@type": "BlogPosting",
64+
"headline": "<txp:title escape="json" />",
65+
<txp:if_description>"description": "<txp:meta_description format="" escape="json" />",</txp:if_description>
66+
"url": "<txp:permlink />"
67+
}]
68+
}
69+
</script>
3670
</txp:if_article_list>
3771
</txp:if_author>
3872

@@ -83,7 +117,6 @@
83117
<txp:link_to_prev>
84118
<txp:text item="prev" />
85119
</txp:link_to_prev>
86-
87120
<txp:link_to_next>
88121
<txp:text item="next" />
89122
</txp:link_to_next>

dist/four-point-seven/pages/default.txp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
<txp:if_variable name="page" value="1">
3131
<meta name="robots" content="index, follow">
3232
<link rel="canonical" href="<txp:site_url />">
33+
<script type="application/ld+json">
34+
{
35+
"@context": "https://schema.org",
36+
"@type": "WebSite",
37+
"headline": "<txp:site_name escape="json" />",
38+
<txp:if_description>"description": "<txp:meta_description format="" escape="json" />",</txp:if_description>
39+
"url": "<txp:site_url />"
40+
}
41+
</script>
3342
<txp:else />
3443
<meta name="robots" content="noindex, follow">
3544
</txp:if_variable>

src/templates/forms/article/search_results.txp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
<txp:newer rel="prev">
6868
<txp:text item="prev" />
6969
</txp:newer>
70-
7170
<txp:older rel="next">
7271
<txp:text item="next" />
7372
</txp:older>

src/templates/pages/archive.txp

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
<txp:if_variable name="page" value="1">
2626
<meta name="robots" content="index, follow">
2727
<link rel="canonical" href="<txp:section url="1" />">
28+
<script type="application/ld+json">
29+
{
30+
"@context": "https://schema.org",
31+
"@type": "Blog",
32+
"headline": "<txp:section title="1" escape="json" />",
33+
<txp:if_description>"description": "<txp:meta_description format="" escape="json" />",</txp:if_description>
34+
"url": "<txp:section url="1" />"
35+
}
36+
</script>
2837
<txp:else />
2938
<meta name="robots" content="noindex, follow">
3039
</txp:if_variable>
@@ -33,6 +42,31 @@
3342
<txp:meta_author title="1" />
3443
<meta name="robots" content="<txp:if_expires>unavailable_after: <txp:expires gmt="1" format="%d-%b-%y %T" /> GMT<txp:else />index, follow</txp:if_expires>">
3544
<link rel="canonical" href="<txp:permlink />">
45+
<meta property="og:site_name" content="<txp:site_name />">
46+
<meta property="og:type" content="article">
47+
<meta property="og:title" content="<txp:title />">
48+
<txp:if_description><meta property="og:description" content="<txp:meta_description format="" />"></txp:if_description>
49+
<meta property="og:url" content="<txp:permlink />">
50+
<txp:if_article_image>
51+
<txp:images limit="1">
52+
<meta property="og:image" content="<txp:image_url />">
53+
<meta property="og:image:width" content="<txp:image_info type="w" />">
54+
<meta property="og:image:height" content="<txp:image_info type="h" />">
55+
<meta property="og:image:alt" content="<txp:image_info type="alt" />">
56+
</txp:images>
57+
</txp:if_article_image>
58+
<script type="application/ld+json">
59+
{
60+
"@context": "https://schema.org",
61+
"@type": "Blog",
62+
"blogPost": [{
63+
"@type": "BlogPosting",
64+
"headline": "<txp:title escape="json" />",
65+
<txp:if_description>"description": "<txp:meta_description format="" escape="json" />",</txp:if_description>
66+
"url": "<txp:permlink />"
67+
}]
68+
}
69+
</script>
3670
</txp:if_article_list>
3771
</txp:if_author>
3872

@@ -83,7 +117,6 @@
83117
<txp:link_to_prev>
84118
<txp:text item="prev" />
85119
</txp:link_to_prev>
86-
87120
<txp:link_to_next>
88121
<txp:text item="next" />
89122
</txp:link_to_next>

src/templates/pages/default.txp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
<txp:if_variable name="page" value="1">
3131
<meta name="robots" content="index, follow">
3232
<link rel="canonical" href="<txp:site_url />">
33+
<script type="application/ld+json">
34+
{
35+
"@context": "https://schema.org",
36+
"@type": "WebSite",
37+
"headline": "<txp:site_name escape="json" />",
38+
<txp:if_description>"description": "<txp:meta_description format="" escape="json" />",</txp:if_description>
39+
"url": "<txp:site_url />"
40+
}
41+
</script>
3342
<txp:else />
3443
<meta name="robots" content="noindex, follow">
3544
</txp:if_variable>

0 commit comments

Comments
 (0)