diff --git a/src/pages/archive.xml.js b/src/pages/archive.xml.js index be831857e..4c629deb6 100644 --- a/src/pages/archive.xml.js +++ b/src/pages/archive.xml.js @@ -2,6 +2,7 @@ import MarkdownIt from 'markdown-it'; import rss from '@astrojs/rss'; import sanitizeHtml from 'sanitize-html'; import { getCollection } from 'astro:content'; +import * as _ from 'lodash'; export async function get() { const emails = await getCollection('daily-email'); @@ -14,13 +15,26 @@ export async function get() { const parser = new MarkdownIt(); + const callToAction = () => { + return _.sample([ + 'Do you need help or want another pair of eyes on your code? Book a 1-on-1 consulting call or an online pair programming session with a 100% money-back guarantee.', + 'If you\'re creating a new Drupal module, try my free Drupal module template.', + ]); + }; + return rss({ title: 'Daily email list', description: 'A daily newsletter on software development, DevOps, community, and open-source.', site: import.meta.env.SITE, items: sortedEmails.slice(0, 1).map((email) => ({ - description: `
${sanitizeHtml(parser.render(email.body))}
`, + description: ` +
+ ${sanitizeHtml(parser.render(email.body))} +
+

P.S. ${callToAction()}

+
+ `, link: `${import.meta.env.SITE}/${email.data.permalink}`, pubDate: email.data.pubDate, title: `${email.data.title}`,