-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatom.xml
More file actions
83 lines (70 loc) · 2.62 KB
/
atom.xml
File metadata and controls
83 lines (70 loc) · 2.62 KB
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
---
layout: null
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>{{ site.title | xml_escape }}</title>
<subtitle>{{ site.description | xml_escape }}</subtitle>
<link href="{{ site.url }}/atom.xml" rel="self" type="application/atom+xml"/>
<link href="{{ site.url }}/" rel="alternate" type="text/html"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ site.url }}/</id>
<author>
<name>{{ site.author | default: site.title | xml_escape }}</name>
{% if site.email %}<email>{{ site.email | xml_escape }}</email>{% endif %}
</author>
{% for post in site.posts limit:50 %}
<entry>
<title>{{ post.title | xml_escape }}</title>
<link href="{{ site.url }}{{ post.url | xml_escape }}" rel="alternate" type="text/html"/>
<id>{{ site.url }}{{ post.url | xml_escape }}</id>
<published>{{ post.date | date_to_xmlschema }}</published>
<updated>{{ post.date | date_to_xmlschema }}</updated>
{% if post.author %}
<author>
<name>{{ post.author | xml_escape }}</name>
</author>
{% endif %}
<!-- 分类和标签用 dc:subject (更标准) -->
{% for category in post.categories %}
<category term="{{ category | xml_escape }}"/>
{% endfor %}
{% for tag in post.tags %}
<category term="{{ tag | xml_escape }}"/>
{% endfor %}
<!-- 摘要 - 明确声明为文本类型 -->
<summary type="text">
{% if post.excerpt %}
{{ post.excerpt | strip_html | truncate: 200 }}
{% else %}
{{ post.content | strip_html | truncate: 200 }}
{% endif %}...
</summary>
<!-- 完整内容 - 声明为 HTML 类型 -->
<content type="html">
<![CDATA[
<article>
<header>
<h1>{{ post.title | xml_escape }}</h1>
<p class="meta">
Published on <time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %d, %Y" }}</time>
{% if post.categories.size > 0 %}
| Categories: {{ post.categories | join: ', ' | xml_escape }}
{% endif %}
</p>
</header>
{{ post.content }}
{% if post.tags.size > 0 %}
<hr>
<p>Tags: {{ post.tags | join: ' · ' | xml_escape }}</p>
{% endif %}
<hr>
<p style="color: #666; font-style: italic;">
🔗 Original article: <a href="{{ site.url }}{{ post.url | xml_escape }}">{{ site.url }}{{ post.url | xml_escape }}</a>
</p>
</article>
]]>
</content>
</entry>
{% endfor %}
</feed>