forked from hexojs/hexo-generator-feed
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fbia.xml
150 lines (132 loc) · 6.34 KB
/
fbia.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>{{ config.title }}</title>
<link>{{ url }}</link>
<description>
{{ config.description }}
</description>
<language>{{ config.language }}</language>
<lastBuildDate>{{ posts.first().updated.toISOString() }}</lastBuildDate>
{% for post in posts.toArray() %}
<item>
<title>{{ post.title }}</title>
<link>{{ (url + post.path) | uriencode }}</link>
<guid isPermaLink="true">{{ (url + post.path) | uriencode }}</guid>
<pubDate>{{ post.date.toISOString() }}</pubDate>
{% if post.author %}
<author>{{ post.author }}</author>
{% else %}
<author>{{ config.author }}</author>
{% endif %}
<description>
{% if post.description %}
{{ post.description }}
{% elif post.excerpt %}
{{ post.excerpt }}
{% elif post.content %}
{{ post.content.substring(0, 140) }}
{% endif %}
</description>
<content:encoded>
<![CDATA[
<!doctype html>
<html lang="en" prefix="op: http://media.facebook.com/op#">
<head>
<meta charset="utf-8">
<link rel="canonical" href="{{ (url + post.path) | uriencode }}">
<meta property="op:markup_version" content="v1.0">
{% if config.fbia.use_automatic_ad_placement and post.fbia.ad | ad_enable %}
<!-- Step #1 - Enable Automatic Ad Placement -->
<meta property="fb:use_automatic_ad_placement" content="enable=true ad_density=default">
{% endif %}
{% if config.fbia.op_recirculation_ads and post.fbia.ad | ad_enable %}
<!-- Step #2 - Enable Audience Network Recirc Ad -->
<meta property="fb:op-recirculation-ads" content="placement_id={{ config.fbia.ad_placement.recirculation_ads }}">
{% endif %}
{% if post.fbia.og %}
<meta property="og:title" content="{{ post.fbia.og.title }}">
<meta property="og:description" content="{{ post.fbia.og.description }}">
<meta property="og:image" content="{{ post.fbia.og.image }}">
{% endif %}
</head>
<body>
<article>
<header>
<!-- The title and subtitle shown in your Instant Article -->
<h1>{{ post.title }}</h1>
{% if post.fbia.header.img %}
<!-- The header image shown inside your article -->
<figure>
<img src="{{ post.fbia.header.img }}" />
<figcaption>{{ post.fbia.header.caption }}</figcaption>
</figure>
{% endif %}
{% if post.fbia.header.subtitle %}
<!-- The subtitle shown in your article -->
<h2>{{ post.fbia.header.subtitle }}</h2>
{% endif %}
{% if post.fbia.header.kicker %}
<!-- A kicker for your article -->
<h3 class="op-kicker">{{ post.fbia.header.kicker }}</h3>
{% endif %}
<address>
{% if post.author %}
<a>{{ post.author }}</a>
{% else %}
<a>{{ config.author }}</a>
{% endif %}
</address>
<!-- The date and time when your article was originally published -->
<time class="op-published" datetime="{{ post.date.toISOString() }}">{{ post.date.toISOString() }}</time>
{% if post.updated %}
<!-- The date and time when your article was last updated -->
<time class="op-modified" dateTime="{{ post.updated.toISOString() }}">{{ post.updated.toISOString() }}</time>
{% endif %}
{% if config.fbia.use_automatic_ad_placement and post.fbia.ad | ad_enable %}
<!-- Ad to be automatically placed throughout the article -->
<figure class="op-ad">
<iframe width="300" height="250" style="border:0; margin:0;" src="https://www.facebook.com/adnw_request?placement={{ config.fbia.ad_placement.id }}&adtype={{ config.fbia.ad_placement.adtype }}"></iframe>
</figure>
{% endif %}
</header>
{{ post._content | markdown_it_fbia | safe }}
<figure class="op-tracker">
<!-- FYI http://stackoverflow.com/questions/29466494/nginx-turn-off-cache-for-a-specific-file -->
<iframe hidden>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ config.fbia.google_analytics }}', 'auto');
ga('require', 'displayfeatures');
ga('set', 'campaignSource', 'Facebook');
ga('set', 'campaignMedium', 'Social Instant Article');
ga('send', 'pageview', {title: '{{ post.title }}'});
</script>
</iframe>
</figure>
<footer>
{% if post.fbia.footer.credits %}
<!-- Credits for your article -->
<aside>{{ post.fbia.footer.credits }}</aside>
{% endif %}
{% if post.fbia.footer.related_articles %}
<ul class="op-related-articles">
{% for article in post.fbia.footer.related_articles %}
<li><a href="{{ article }}"></a></li>
{% endfor %}
</ul>
{% endif %}
<!-- Copyright details for your article -->
<small>Copyright {{ config.author }}</small>
</footer>
</article>
</body>
</html>
]]>
</content:encoded>
</item>
{% endfor %}
</channel>
</rss>