{fm.title}
-— {format(toZonedTime(fm.date), 'LLLL d, yyyy')}
+ — {format(toZonedTime(fm.date, timeZone), 'LLLL d, yyyy')}
{(fm.updated) ? (
- , updated {format(toZonedTime(fm.updated), 'LLLL d, yyyy')}
+ , updated {format(toZonedTime(fm.updated, timeZone), 'LLLL d, yyyy')}
) : ''}
{fm.summary}
@@ -73,7 +72,7 @@ const numberToWord = (num: number) => {
{headings.map((heading: {depth: number, slug: string, text: string}) => {
return (
-
+
{(heading.depth > 1) ? '> ' : ''}
{heading.text}
diff --git a/src/layouts/StandaloneMDXLayout.astro b/src/layouts/StandaloneMDXLayout.astro
index 95157d1..c7ae802 100644
--- a/src/layouts/StandaloneMDXLayout.astro
+++ b/src/layouts/StandaloneMDXLayout.astro
@@ -9,8 +9,6 @@ import Footer from '../components/Footer.astro'
import HR from '../components/HR.astro'
-import { mdxComponents } from '@l/mdx.tsx';
-
const { frontmatter } = Astro.props
const title = frontmatter.slug ?? 'me'
@@ -26,14 +24,14 @@ const title = frontmatter.slug ?? 'me'
{title ? title + ' - eleboog.com' : 'eleboog.com'}
-
+
{frontmatter.title}
{frontmatter.summary}
-
+
diff --git a/src/lib/blog.ts b/src/lib/blog.ts
index e03ae0a..2806fbb 100644
--- a/src/lib/blog.ts
+++ b/src/lib/blog.ts
@@ -1,6 +1,6 @@
-export allTags = [
+export const allTags = [
// type of content
- "meta", "reply", "self-promo", "rant", "critique", "tutorial"
+ "meta", "reply", "self-promo", "rant", "critique", "tutorial",
// mood
"silly", "angry", "curious", "happy", "sad", "introspective",
// topic
diff --git a/src/lib/feed.ts b/src/lib/feed.ts
index d0b635b..942d6e5 100644
--- a/src/lib/feed.ts
+++ b/src/lib/feed.ts
@@ -1,11 +1,11 @@
-import { getCollection, getEntry } from "astro:content";
+import { getCollection } from "astro:content";
import { Feed } from "feed";
import { compareDesc } from "date-fns"
import { toZonedTime } from 'date-fns-tz'
-import sfjson from '/src/data/sharefeed.json'
-import type { ShareFeedEntry } from "/src/lib/utils";
+import sfjson from '../data/sharefeed.json'
+import type { ShareFeedEntry } from "../lib/utils";
export const baseURL = "localhost:4321"//"https://eleboog.com"
export const author = {
@@ -14,6 +14,8 @@ export const author = {
link: baseURL
};
+import { timeZone } from "./utils";
+
export async function computeFeed() {
const mainFeed = new Feed({
title: "eleboog.com feed",
@@ -63,7 +65,7 @@ export function addSharefeedEntriesToFeed(feed: Feed, main?: boolean) {
author: [{
name: entry.author
}],
- date: toZonedTime(entry.date)
+ date: toZonedTime(entry.date, timeZone)
})
})
}
@@ -71,11 +73,11 @@ export function addSharefeedEntriesToFeed(feed: Feed, main?: boolean) {
export async function addPostsToFeed(feed: Feed, main?: boolean) {
const posts = await getCollection('posts')
- posts.sort((a:Post,b:Post) => compareDesc(new Date(a.data.date), new Date(b.data.date)))
- .filter((post:Post) => !post.data.draft)
+ posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date)))
+ .filter((post) => !post.data.draft)
.slice(0,20);
- posts.forEach((post: Post) => {
+ posts.forEach((post) => {
const url: string = `${baseURL}/posts/${post.id}`
let title: string = '';
if (main) {
@@ -90,7 +92,7 @@ export async function addPostsToFeed(feed: Feed, main?: boolean) {
description: post.data.summary ?? "Whoops, I didn't write a summary for this. Yell at me that I need to do so.",
content: post.data.summary ?? "Whoops, I didn't write a summary for this. Yell at me that I need to do so.",
author: [author],
- date: toZonedTime(post.data.date),
+ date: toZonedTime(post.data.date, timeZone),
});
})
}
diff --git a/src/lib/utils.ts b/src/lib/utils.ts
index 03bccfa..c82bb93 100644
--- a/src/lib/utils.ts
+++ b/src/lib/utils.ts
@@ -8,4 +8,6 @@ export type ShareFeedEntry = {
title: string,
note: string,
draft?: boolean
-}
\ No newline at end of file
+}
+
+export const timeZone = "America/Chicago";
diff --git a/src/pages/blog.astro b/src/pages/blog.astro
index da38003..143df72 100644
--- a/src/pages/blog.astro
+++ b/src/pages/blog.astro
@@ -1,15 +1,14 @@
---
-import { compareDesc, format, parseISO } from 'date-fns'
-import { fromZonedTime, toZonedTime } from 'date-fns-tz'
+import { compareDesc, format } from 'date-fns'
+import { toZonedTime } from 'date-fns-tz'
+import { timeZone } from "../lib/utils";
import BaseLayout from '../layouts/BaseLayout.astro';
-import cri from "./chills_going_waaaaah.png"
-import { Picture } from 'astro:assets';
import HR from "../components/HR.astro"
-import { getCollection, getEntry } from 'astro:content';
+import { getCollection } from 'astro:content';
const posts = await getCollection('posts');
const archives = await getCollection('archives');
@@ -22,13 +21,13 @@ const archives = await getCollection('archives');
current content
- {posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx, array) => {
- if (post.data.archive) return;
- console.log(toZonedTime(post.data.date));
+ {posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post) => {
+ if (post.data.draft) return;
+ console.log(toZonedTime(post.data.date, timeZone));
return (
- -
+
-
{post.data.title}
- {format(toZonedTime(post.data.date), 'LLL d, yyyy')}
+ {format(toZonedTime(post.data.date, timeZone), 'LLL d, yyyy')}
{post.data.summary}
);
@@ -42,13 +41,13 @@ const archives = await getCollection('archives');
Please check the date of publication before making any comments.
- {archives.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx, array) => {
- if (post.data.archive) return;
- console.log(toZonedTime(post.data.date));
+ {archives.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post) => {
+ if (post.data.draft) return;
+ console.log(toZonedTime(post.data.date, timeZone));
return (
- -
+
-
{post.data.title}
- {format(toZonedTime(post.data.date), 'LLL d, yyyy')}
+ {format(toZonedTime(post.data.date, timeZone), 'LLL d, yyyy')}
{post.data.summary}
);
diff --git a/src/pages/feeds/feed.json.ts b/src/pages/feeds/feed.json.ts
index 830af2d..727f3a0 100644
--- a/src/pages/feeds/feed.json.ts
+++ b/src/pages/feeds/feed.json.ts
@@ -1,7 +1,7 @@
-import { computeFeed } from "/src/lib/feed.ts";
+import { computeFeed } from "../../lib/feed.ts";
import type { APIContext } from 'astro';
-export async function GET({request, url, cookies}: APIContext): Promise {
+export async function GET(context: APIContext): Promise {
const feed = await computeFeed();
return new Response(feed.json1())
diff --git a/src/pages/feeds/feed.xml.ts b/src/pages/feeds/feed.xml.ts
index e8d324b..1f0cf6d 100644
--- a/src/pages/feeds/feed.xml.ts
+++ b/src/pages/feeds/feed.xml.ts
@@ -1,7 +1,6 @@
-import { computeFeed, injectXSL } from "/src/lib/feed.ts";
-import type { APIContext } from 'astro';
+import { computeFeed, injectXSL } from "../../lib/feed.ts";
-export async function GET({request, url, cookies}: APIContext): Promise {
+export async function GET(): Promise {
const feed = await computeFeed();
return new Response(injectXSL(feed.atom1(), "/feed.xsl"))
diff --git a/src/pages/index.astro b/src/pages/index.astro
index d215b41..e2d413c 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,7 +1,7 @@
---
-import { compareDesc, format, parseISO } from 'date-fns'
-import { fromZonedTime, toZonedTime } from 'date-fns-tz'
+import { compareDesc, format } from 'date-fns'
+import { toZonedTime } from 'date-fns-tz'
import BaseLayout from '../layouts/BaseLayout.astro';
import cri from "./chills_going_waaaaah.png"
@@ -9,10 +9,12 @@ import { Picture } from 'astro:assets';
import MDXCallout from "../components/mdx/MDXCallout.astro"
-import { getCollection, getEntry } from 'astro:content';
+import { getCollection } from 'astro:content';
const posts = await getCollection('posts')
+import { timeZone } from "../lib/utils";
+
---
@@ -44,13 +46,13 @@ const posts = await getCollection('posts')
recent posts
- {posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx, array) => {
+ {posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx) => {
if (idx >= 3 || post.data.draft) return;
- console.log(toZonedTime(post.data.date));
+ console.log(toZonedTime(post.data.date, timeZone));
return (
- -
+
-
{post.data.title}
- {format(toZonedTime(post.data.date), 'LLL d, yyyy')}
+ {format(toZonedTime(post.data.date, timeZone), 'LLL d, yyyy')}
{post.data.summary}
);
diff --git a/src/pages/newest/index.ts b/src/pages/newest/index.ts
index d811773..82eb703 100644
--- a/src/pages/newest/index.ts
+++ b/src/pages/newest/index.ts
@@ -1,7 +1,6 @@
-import { compareDesc, format, parseISO } from 'date-fns'
-import { fromZonedTime, toZonedTime } from 'date-fns-tz'
+import { compareDesc } from 'date-fns'
-import { getCollection, getEntry } from 'astro:content';
+import { getCollection } from 'astro:content';
import type { APIRoute } from 'astro';
diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro
index b0ef0d8..c122c39 100644
--- a/src/pages/posts/[...slug].astro
+++ b/src/pages/posts/[...slug].astro
@@ -2,7 +2,6 @@
export const prerender = true;
import {getCollection} from 'astro:content'
-import PostLayout from '../../layouts/PostLayout.astro'
export async function getStaticPaths() {
const posts = await getCollection('posts');
diff --git a/src/pages/sharefeed.astro b/src/pages/sharefeed.astro
index fa88c6b..ea1e0b5 100644
--- a/src/pages/sharefeed.astro
+++ b/src/pages/sharefeed.astro
@@ -1,6 +1,6 @@
---
-import { compareDesc, format, parseISO } from 'date-fns'
+import { compareDesc, format } from 'date-fns'
import { toZonedTime } from 'date-fns-tz'
import BaseLayout from '../layouts/BaseLayout.astro';
@@ -8,13 +8,11 @@ import BaseLayout from '../layouts/BaseLayout.astro';
import HR from "../components/HR.astro";
import MDXCallout from '../components/mdx/MDXCallout.astro';
-import { getCollection, getEntry } from 'astro:content';
-
import sfjson from "../data/sharefeed.json";
import type { ShareFeedEntry } from "../lib/utils";
const entries = sfjson.sharefeed
- .sort((a:ShareFeedEntry,b:ShareFeedEntry) => compareDesc(new Date(a.posted), new Date(b.posted)))
+ .sort((a:ShareFeedEntry,b:ShareFeedEntry) => compareDesc(new Date(a.date), new Date(b.date)))
.filter((entry: ShareFeedEntry) => !(entry.draft))
---
@@ -28,10 +26,9 @@ const entries = sfjson.sharefeed
-
- {entries.map((entry: ShareFeedEntry, idx: number, array: ShareFeedEntry[]) => (
- <>
- -
+
+ {entries.map((entry: ShareFeedEntry) => (
+ -
{entry.author ? `${entry.author}: ` : ''}
{entry.title}
@@ -43,8 +40,6 @@ const entries = sfjson.sharefeed
{entry.note}
- {((idx + 1) % 10 == 0) ? (
) : ''}
- >
))}
{frontmatter.title}
{frontmatter.summary}
current content
-
- {posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx, array) => {
- if (post.data.archive) return;
- console.log(toZonedTime(post.data.date));
+ {posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post) => {
+ if (post.data.draft) return;
+ console.log(toZonedTime(post.data.date, timeZone));
return (
-
- +
-
{post.data.title}
- {format(toZonedTime(post.data.date), 'LLL d, yyyy')}
+ {format(toZonedTime(post.data.date, timeZone), 'LLL d, yyyy')}
{post.data.summary}
);
@@ -42,13 +41,13 @@ const archives = await getCollection('archives');
Please check the date of publication before making any comments.
- +
-
{post.data.title}
- {format(toZonedTime(post.data.date), 'LLL d, yyyy')}
+ {format(toZonedTime(post.data.date, timeZone), 'LLL d, yyyy')}
{post.data.summary}
);
diff --git a/src/pages/feeds/feed.json.ts b/src/pages/feeds/feed.json.ts
index 830af2d..727f3a0 100644
--- a/src/pages/feeds/feed.json.ts
+++ b/src/pages/feeds/feed.json.ts
@@ -1,7 +1,7 @@
-import { computeFeed } from "/src/lib/feed.ts";
+import { computeFeed } from "../../lib/feed.ts";
import type { APIContext } from 'astro';
-export async function GET({request, url, cookies}: APIContext): Promise - +
-
{post.data.title}
- {format(toZonedTime(post.data.date), 'LLL d, yyyy')}
+ {format(toZonedTime(post.data.date, timeZone), 'LLL d, yyyy')}
{post.data.summary}
);
diff --git a/src/pages/newest/index.ts b/src/pages/newest/index.ts
index d811773..82eb703 100644
--- a/src/pages/newest/index.ts
+++ b/src/pages/newest/index.ts
@@ -1,7 +1,6 @@
-import { compareDesc, format, parseISO } from 'date-fns'
-import { fromZonedTime, toZonedTime } from 'date-fns-tz'
+import { compareDesc } from 'date-fns'
-import { getCollection, getEntry } from 'astro:content';
+import { getCollection } from 'astro:content';
import type { APIRoute } from 'astro';
diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro
index b0ef0d8..c122c39 100644
--- a/src/pages/posts/[...slug].astro
+++ b/src/pages/posts/[...slug].astro
@@ -2,7 +2,6 @@
export const prerender = true;
import {getCollection} from 'astro:content'
-import PostLayout from '../../layouts/PostLayout.astro'
export async function getStaticPaths() {
const posts = await getCollection('posts');
diff --git a/src/pages/sharefeed.astro b/src/pages/sharefeed.astro
index fa88c6b..ea1e0b5 100644
--- a/src/pages/sharefeed.astro
+++ b/src/pages/sharefeed.astro
@@ -1,6 +1,6 @@
---
-import { compareDesc, format, parseISO } from 'date-fns'
+import { compareDesc, format } from 'date-fns'
import { toZonedTime } from 'date-fns-tz'
import BaseLayout from '../layouts/BaseLayout.astro';
@@ -8,13 +8,11 @@ import BaseLayout from '../layouts/BaseLayout.astro';
import HR from "../components/HR.astro";
import MDXCallout from '../components/mdx/MDXCallout.astro';
-import { getCollection, getEntry } from 'astro:content';
-
import sfjson from "../data/sharefeed.json";
import type { ShareFeedEntry } from "../lib/utils";
const entries = sfjson.sharefeed
- .sort((a:ShareFeedEntry,b:ShareFeedEntry) => compareDesc(new Date(a.posted), new Date(b.posted)))
+ .sort((a:ShareFeedEntry,b:ShareFeedEntry) => compareDesc(new Date(a.date), new Date(b.date)))
.filter((entry: ShareFeedEntry) => !(entry.draft))
---
@@ -28,10 +26,9 @@ const entries = sfjson.sharefeed
-
+
-
+ {entries.map((entry: ShareFeedEntry) => (
+
-
{entry.author ? `${entry.author}: ` : ''}
{entry.title}
@@ -43,8 +40,6 @@ const entries = sfjson.sharefeed
{entry.note}
- {((idx + 1) % 10 == 0) ? (
) : ''} - > ))} -
{entry.author ? `${entry.author}: ` : ''}
{entry.title}
@@ -43,8 +40,6 @@ const entries = sfjson.sharefeed
-
- {archives.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx, array) => {
- if (post.data.archive) return;
- console.log(toZonedTime(post.data.date));
+ {archives.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post) => {
+ if (post.data.draft) return;
+ console.log(toZonedTime(post.data.date, timeZone));
return (
-
recent posts
-
- {posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx, array) => {
+ {posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx) => {
if (idx >= 3 || post.data.draft) return;
- console.log(toZonedTime(post.data.date));
+ console.log(toZonedTime(post.data.date, timeZone));
return (
-
-
-
- {entries.map((entry: ShareFeedEntry, idx: number, array: ShareFeedEntry[]) => (
- <>
-