refactor: move bookmarks.yaml into content directory
This commit is contained in:
parent
87c8260c80
commit
ff39ba2e1a
6 changed files with 5 additions and 5 deletions
|
|
@ -35,7 +35,7 @@ for (const txt of txtFiles) {
|
|||
}
|
||||
|
||||
// Count bookmarks
|
||||
const bookmarksFile = path.join(root, 'src/data/bookmarks.yaml');
|
||||
const bookmarksFile = path.join(root, 'src/content/bookmarks.yaml');
|
||||
const bookmarks = fs.existsSync(bookmarksFile)
|
||||
? yaml.load(fs.readFileSync(bookmarksFile, 'utf-8')) || []
|
||||
: [];
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
import Layout from '../../layouts/Layout.astro';
|
||||
import yaml from 'js-yaml';
|
||||
import bookmarksRaw from '../../data/bookmarks.yaml?raw';
|
||||
import bookmarksRaw from '../../content/bookmarks.yaml?raw';
|
||||
|
||||
interface Bookmark {
|
||||
date: string;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
import yaml from 'js-yaml';
|
||||
import bookmarksRaw from '../data/bookmarks.yaml?raw';
|
||||
import bookmarksRaw from '../content/bookmarks.yaml?raw';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import type { APIContext } from 'astro';
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { getCollection } from 'astro:content';
|
||||
import Layout from '../layouts/Layout.astro';
|
||||
import yaml from 'js-yaml';
|
||||
import bookmarksRaw from '../data/bookmarks.yaml?raw';
|
||||
import bookmarksRaw from '../content/bookmarks.yaml?raw';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { getApprovedEntries, type GuestbookEntry } from '../lib/db';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { getCollection } from 'astro:content';
|
||||
import yaml from 'js-yaml';
|
||||
import bookmarksRaw from '../data/bookmarks.yaml?raw';
|
||||
import bookmarksRaw from '../content/bookmarks.yaml?raw';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import type { APIContext } from 'astro';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue