This commit is contained in:
Morten Olsen
2023-03-28 08:10:46 +02:00
parent 9b1a067d56
commit 7adf03c83f
44 changed files with 1780 additions and 411 deletions

View File

@@ -1,27 +1,29 @@
import { resolve } from "path";
import { createFile } from "../../resources/file";
import YAML from "yaml";
import { Bundler } from "../../bundler";
import { Profile } from "../../../types";
import { createImage } from "../../resources/image";
import { resolve } from 'path';
import { createFile } from '../../resources/file';
import YAML from 'yaml';
import { Bundler } from '../../bundler';
import { Profile } from '../../../types';
import { createImage } from '../../resources/image';
type ProfileOptions = {
path: string;
cwd: string;
bundler: Bundler;
};
const createProfile = ({ bundler }: ProfileOptions) => {
const createProfile = ({ cwd, path, bundler }: ProfileOptions) => {
const file = createFile({
path: resolve("content/profile.yml"),
path: resolve(cwd, path),
});
const profile = file.pipe(async (yaml) => {
const data = YAML.parse(yaml);
const imagePath = resolve("content", data.image);
const imagePath = resolve('content', data.image);
const result: Profile = {
...data,
imageUrl: createImage({
image: imagePath,
format: "avif",
format: 'webp',
bundler,
}),
imagePath,