diff --git a/config/collections/index.js b/config/collections/index.js
index 54c4a8e7..aa14d322 100644
--- a/config/collections/index.js
+++ b/config/collections/index.js
@@ -1,5 +1,7 @@
import { DateTime } from 'luxon'
+const BASE_URL = 'https://coryd.dev'
+
export const searchIndex = (collection) => {
const searchIndex = []
let id = 0
@@ -22,7 +24,7 @@ export const searchIndex = (collection) => {
}
}
- addItemToIndex(posts, '📝', item => item['url'], item => item['title'], item => item['tags'])
+ addItemToIndex(posts, '📝', item => new URL(item['slug'], BASE_URL).toString(), item => item['title'], item => item['tags'])
addItemToIndex(links, '🔗', item => item['link'], item => item['title'], item => item['tags'])
if (movieData) addItemToIndex(movieData, '🎥', item => item['url'], item => `${item['title']} (${item['rating']})`, item => item['tags'])
if (bookData) addItemToIndex(bookData, '📖', item => item['url'], item => `${item['title']} (${item['rating']})`, item => item['tags'])
@@ -52,10 +54,11 @@ export const allContent = (collection) => {
if (items) {
items.forEach(item => {
const content = {
- url: `https://coryd.dev${item['url']}`,
+ url: `${BASE_URL}${item['url']}`,
title: `${icon}: ${getTitle(item)}${item?.['authors']?.['name'] ? ' via ' + item['authors']['name'] : ''}`
}
if (item?.['link']) content['url'] = item?.['link']
+ if (item?.['slug']) content['url'] = new URL(item['slug'], BASE_URL).toString()
if (item?.['description']) content['description'] = `${item['description']}
`
const date = getDate ? parseDate(getDate(item)) : null
if (date) content['date'] = date
diff --git a/config/filters/index.js b/config/filters/index.js
index addd30b2..e9cdf921 100644
--- a/config/filters/index.js
+++ b/config/filters/index.js
@@ -121,6 +121,7 @@ export default {
// set the entry url
if (entry.url?.includes('http')) url = entry.url
if (!entry.url?.includes('http')) url = new URL(entry.url, BASE_URL).toString()
+ if (entry?.slug) url = new URL(entry.slug, BASE_URL).toString()
if (entry?.link) {
title = `${entry.title} via ${entry.authors.name}`
url = entry.link
@@ -131,7 +132,7 @@ export default {
if (entry.type === 'book' || entry.type === 'movie' || entry.type === 'link') excerpt = `${entry.description}
` // books
// send full post content to rss
- if (entry?.url?.includes('/posts/') && entry.content) excerpt = sanitizeHtml(`${md.render(entry.content)}${feedNote}`, {
+ if (entry?.slug && entry.content) excerpt = sanitizeHtml(`${md.render(entry.content)}${feedNote}`, {
disallowedTagsMode: 'completelyDiscard'
})
diff --git a/package-lock.json b/package-lock.json
index 50c5e86b..ab459603 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "coryd.dev",
- "version": "18.6.9",
+ "version": "18.7.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
- "version": "18.6.9",
+ "version": "18.7.9",
"license": "MIT",
"dependencies": {
"@cdransf/api-text": "^1.4.0",
diff --git a/package.json b/package.json
index 5546572f..17622d22 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "coryd.dev",
- "version": "18.6.9",
+ "version": "18.7.9",
"description": "The source for my personal site. Built using 11ty.",
"type": "module",
"scripts": {
diff --git a/src/_data/posts.js b/src/_data/posts.js
index 204565ea..88bc9652 100644
--- a/src/_data/posts.js
+++ b/src/_data/posts.js
@@ -1,6 +1,4 @@
import { createClient } from '@supabase/supabase-js'
-import { DateTime } from 'luxon'
-import slugify from 'slugify'
const SUPABASE_URL = process.env.SUPABASE_URL
const SUPABASE_KEY = process.env.SUPABASE_KEY
@@ -81,11 +79,6 @@ const fetchAllPosts = async () => {
for (const post of data) {
post.tags = await fetchTagsForPost(post.id)
post.blocks = await fetchBlocksForPost(post.id)
- post.url = `/posts/${DateTime.fromISO(post.date).year}/${slugify(post.title, {
- replacement: '-',
- remove: /[#,&,+()$~%.'":*?<>{}\[\]\/\\|`!@\^\—]/g,
- lower: true,
- })}/`
}
posts = posts.concat(data)
diff --git a/src/_includes/partials/home/posts.liquid b/src/_includes/partials/home/posts.liquid
index 8fac8523..a84d0c8f 100644
--- a/src/_includes/partials/home/posts.liquid
+++ b/src/_includes/partials/home/posts.liquid
@@ -14,7 +14,7 @@
{{ post.date | date: "%B %e, %Y" }}
-
+
{{ post.title }}
diff --git a/src/_includes/partials/widgets/popular-posts.liquid b/src/_includes/partials/widgets/popular-posts.liquid
index 8ad021c8..777ca6d2 100644
--- a/src/_includes/partials/widgets/popular-posts.liquid
+++ b/src/_includes/partials/widgets/popular-posts.liquid
@@ -7,7 +7,7 @@