Browse Source

CDATA maybe dont work so xml_escape all things

Mu-An ✌️ Chiou 1 year ago
parent
commit
60a36d3c30
No account linked to committer's email address
3 changed files with 10 additions and 8 deletions
  1. 4
    4
      feed.xml
  2. 4
    2
      notes.rss
  3. 2
    2
      notes.xml

+ 4
- 4
feed.xml View File

@@ -6,17 +6,17 @@ layout:
6 6
 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
7 7
   <channel>
8 8
     <title>{{ site.title }}</title>
9
-    <description>{{ site.description }}</description>
9
+    <description>{{ site.description | xml_escape }}</description>
10 10
     <link>{{ site.url }}</link>
11 11
     <atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" />
12 12
     {% for post in site.posts limit:10 %}
13 13
       <item>
14
-        <title>{{ post.title }}</title>
14
+        <title>{{ post.title | xml_escape }}</title>
15 15
         <description>{{ post.content | replace: 'src="/', srcbase | xml_escape }}</description>
16
-        <pubDate>{{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
16
+        <pubDate>{{ post.date | date_to_rfc822 }}</pubDate>
17 17
         <link>{{ site.url }}{{ post.url }}</link>
18 18
         <guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
19 19
       </item>
20 20
     {% endfor %}
21 21
   </channel>
22
-</rss>
22
+</rss>

+ 4
- 2
notes.rss View File

@@ -9,11 +9,13 @@ layout:
9 9
     <description>notes</description>
10 10
     <link>{{ site.url }}</link>
11 11
     <atom:link href="{{ site.url }}/notes.rss" rel="self" type="application/rss+xml" />
12
+    <lastBuildDate></lastBuildDate>
12 13
     {% for note in site.data.notes limit: 10 %}
13 14
       <item>
14 15
         <title>{{ note.date | date: "%b %d, %Y" }}</title>
15
-        <description><![CDATA[{{ note.content | markdownify }}]]></description>
16
-        <pubDate>{{ note.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
16
+        <description>{{ note.content | markdownify | xml_escape }}</description>
17
+        <pubDate>{{ note.date | date_to_rfc822 }}</pubDate>
18
+        <link>https://muan.co/notes#date-{{ note.date | date: "%Y-%m-%d" }}</link>
17 19
         <guid isPermaLink="true">https://muan.co/notes#date-{{ note.date | date: "%Y-%m-%d" }}</guid>
18 20
       </item>
19 21
     {% endfor %}

+ 2
- 2
notes.xml View File

@@ -12,8 +12,8 @@ layout:
12 12
     {% for note in site.data.notes limit: 10 %}
13 13
       <item>
14 14
         <title>{{ note.date | date: "%b %d, %Y" }}</title>
15
-        <description><![CDATA[{{ note.content | markdownify }}]]></description>
16
-        <pubDate>{{ note.date | date: "%a, %d %b %Y %H:%M:%S %z" }}</pubDate>
15
+        <description>{{ note.content | markdownify | xml_escape }}</description>
16
+        <pubDate>{{ note.date | date_to_rfc822 }}</pubDate>
17 17
         <guid isPermaLink="true">https://muan.co/notes#date-{{ note.date | date: "%Y-%m-%d" }}</guid>
18 18
       </item>
19 19
     {% endfor %}

Loading…
Cancel
Save