fix: use creation date for .txt posts rather than modified date

This commit is contained in:
Lewis Wynne 2026-03-26 19:24:21 +00:00
parent 705a5a39f3
commit 5cd41e1b51

View file

@ -2,7 +2,7 @@ import fs from 'node:fs';
import path from 'node:path'; import path from 'node:path';
import yaml from 'js-yaml'; import yaml from 'js-yaml';
import { sortByPinnedThenDate } from './format'; import { sortByPinnedThenDate } from './format';
import { getGitLastModifiedDate } from './git'; import { getGitCreationDate } from './git';
export interface TxtFile { export interface TxtFile {
name: string; name: string;
@ -39,7 +39,7 @@ export function getTxtFiles(): TxtFile[] {
.filter(file => file.endsWith('.txt')) .filter(file => file.endsWith('.txt'))
.map(name => ({ .map(name => ({
name, name,
date: getGitLastModifiedDate(path.join(txtDir, name)), date: getGitCreationDate(path.join(txtDir, name)),
pinned: pinnedSet.has(name), pinned: pinnedSet.has(name),
description: descriptions[name], description: descriptions[name],
})); }));