]> git.ardis.lu - ardislu.dev/commitdiff
Adjust whitespace so the output is human-readable
authorArdis Lu <ardisglu@gmail.com>
Thu, 21 Jul 2022 02:38:50 +0000 (19:38 -0700)
committerArdis Lu <ardisglu@gmail.com>
Thu, 21 Jul 2022 02:38:50 +0000 (19:38 -0700)
functions/atom.xml.js

index bd6cc58dbbcd454beeac658d4c2c9efab73b586c..266b089036fcfb5b83072eaa63f3bc22bd02a6d8 100644 (file)
@@ -10,32 +10,32 @@ export async function onRequestGet({ env }) {
     .then(googleSheet => {
       for (const article of googleSheet.values) {
         entries.push(`<entry>
-          <id>urn:google.com:${article[2]}</id>
-          <title>${article[0]}</title>
-          <summary>${article[1]}</summary>
-          <link href="https://ardislu.dev${article[4]}"/>
-          <published>${new Date(article[5]).toISOString()}</published>
-          <updated>${new Date(article[6]).toISOString()}</updated>
-        </entry>`);
+    <id>urn:google.com:${article[2]}</id>
+    <title>${article[0]}</title>
+    <summary>${article[1]}</summary>
+    <link href="https://ardislu.dev${article[4]}"/>
+    <published>${new Date(article[5]).toISOString()}</published>
+    <updated>${new Date(article[6]).toISOString()}</updated>
+  </entry>`);
         updatedDates.push(new Date(article[6]));
       }
     });
 
   const feed = `<?xml version="1.0" encoding="utf-8"?>
-  <feed xmlns="http://www.w3.org/2005/Atom">
-    
-    <id>https://ardislu.dev/</id>
-    <title>ardislu.dev</title>
-    <subtitle>Notes on web development, crypto, self-hosting, and tech in general.</subtitle>
-    <author>
-      <name>Ardis Lu</name>
-    </author>
-    <link href="https://ardislu.dev/"/>
-    <updated>${new Date(Math.max(...updatedDates)).toISOString()}</updated>
+<feed xmlns="http://www.w3.org/2005/Atom">
 
-    ${entries.join('')}
+  <id>https://ardislu.dev/</id>
+  <title>ardislu.dev</title>
+  <subtitle>Notes on web development, crypto, self-hosting, and tech in general.</subtitle>
+  <author>
+    <name>Ardis Lu</name>
+  </author>
+  <link href="https://ardislu.dev/"/>
+  <updated>${new Date(Math.max(...updatedDates)).toISOString()}</updated>
 
-  </feed>`
+  ${entries.join('\n  ')}
+
+</feed>`
 
   return new Response(feed, { headers: { 'Content-Type': 'application/atom+xml' } });
 }
\ No newline at end of file
This page took 0.043502 seconds and 4 git commands to generate.