This commit is contained in:
Morten Olsen
2023-03-28 14:26:31 +02:00
parent e63e7cc2d6
commit a04d5f5d71
8 changed files with 24 additions and 18 deletions

View File

@@ -21,7 +21,7 @@ const createArticles = ({ bundler, cwd, pattern }: ArticleOptions) => {
const file = createFile({ path });
const article = file.pipe(async (raw) => {
const { data, content } = grayMatter(raw);
const { title, slug, cover, color } = data;
const { title, slug, cover, color, ...rest } = data;
const cwd = dirname(path);
const markdown = await markdownBundleImages({
cwd,
@@ -40,6 +40,7 @@ const createArticles = ({ bundler, cwd, pattern }: ArticleOptions) => {
bundler,
});
const result: Article = {
...rest,
title,
raw: content,
cover,

View File

@@ -18,11 +18,10 @@ const createPositions = ({ cwd, pattern, bundler }: PositionOptions) => {
pattern,
cwd,
create: (path) => {
console.log('c', path);
const file = createFile({ path });
const position = file.pipe(async (raw) => {
const { data, content } = grayMatter(raw);
const { title } = data;
const { title, ...rest } = data;
const cwd = dirname(path);
const markdown = await markdownBundleImages({
cwd,
@@ -30,6 +29,7 @@ const createPositions = ({ cwd, pattern, bundler }: PositionOptions) => {
bundler,
});
const result = {
...rest,
company: data.company,
title,
from: data.from,