From b0a9d6348e5ff8c4e9afbeebc5dea6b3dafbb30d Mon Sep 17 00:00:00 2001 From: Boris Mann Date: Fri, 5 Jan 2024 00:47:48 -0800 Subject: [PATCH] absolute image path hack --- _journals/2024-01-05_0042.md | 17 +++++++++++++++++ _notes/BMC.md | 3 ++- journal.xml | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 _journals/2024-01-05_0042.md diff --git a/_journals/2024-01-05_0042.md b/_journals/2024-01-05_0042.md new file mode 100644 index 0000000..808403e --- /dev/null +++ b/_journals/2024-01-05_0042.md @@ -0,0 +1,17 @@ +--- +title: January 5th, 2024 +date: 2024-01-05, 00:42:53 -08:00 +section: journal +aliases: +tags: + - jekyll + - rss +link: https://bdunagan.com/2021/10/29/jekyll-tip-absolute-urls-for-links-and-images-in-rss-feed/ +--- +OK, one more quick hack to the Journal feed. + +Relative paths for images are a problem. Maybe they actually aren't for many modern feed readers. But they ARE if I want Micro.blog to crosspost correctly. + +[Found this hack to use the Liquid `replace` filter](https://bdunagan.com/2021/10/29/jekyll-tip-absolute-urls-for-links-and-images-in-rss-feed/) to look for src tags and then add in the full path to your site. + +I'll test it tomorrow by posting an image. Time for bed! \ No newline at end of file diff --git a/_notes/BMC.md b/_notes/BMC.md index 5d9d5a9..defc6cb 100644 --- a/_notes/BMC.md +++ b/_notes/BMC.md @@ -6,11 +6,12 @@ Yes, I registered it in late 2000 and could have picked a way more interesting w ## To Do -- [ ] Journal feed modification to truncate and include link back to journal post. Will Microblog respect 500 characters? +- [ ] Journal feed modifications - Maybe not? I think things are coming through OK - I should consider linking back to the actual journal entry. Hmm, or maybe appending a hashtag like `BMCJournal` for context - could also do tags-as-hashtags and append them - Maybe: do something special if link exists + - Figure out how to make sure that full path image links are included - [ ] Update front page to have recent journal entries. - [x] Display “via” frontmatter [[via]] - [x] Turn off linking out to notes diff --git a/journal.xml b/journal.xml index f10d912..e96909a 100644 --- a/journal.xml +++ b/journal.xml @@ -18,7 +18,7 @@ {% if site.name %} {{ site.name | xml_escape }} {% endif %} - {{ post.content | xml_escape }} + {{ post.content | xml_escape | replace: 'src="/', 'src="https://bmannconsulting.com/' }} {{ site.url }}{{ post.url }} {{ post.date | date_to_rfc822 }} https://bmannconsulting.com{{ post.url }} -- 2.51.2