Skip to content

Instantly share code, notes, and snippets.

TK leandrotk

Block or report user

Report or block leandrotk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View example-43.ts
const {
newArticlePath,
imageCoverExamplePath,
imageCoverPath,
assetsFolder,
imageCoverFileName
}: ArticlePaths = buildPaths(newArticleFolderPath);
View example-42.ts
type ArticlePaths = {
newArticlePath: string;
imageCoverExamplePath: string;
imageCoverPath: string;
assetsFolder: string;
imageCoverFileName: string;
};
View example-41.ts
const buildPaths = (newArticleFolderPath: string): ArticlePaths => {
const imageExtension: string = getImageExtension();
const imageCoverFileName: string = `cover.${imageExtension}`;
const newArticlePath: string = `${newArticleFolderPath}/index.html`;
const imageCoverExamplePath: string = resolve(__dirname, `../examples/${imageCoverFileName}`);
const assetsFolder: string = `${newArticleFolderPath}/assets`;
const imageCoverPath: string = `${assetsFolder}/${imageCoverFileName}`;
return {
newArticlePath,
View example-40.ts
await copyFile(imageCoverExamplePath, imageCoverPath);
View example-39.ts
await mkdir(assetsFolder, { recursive: true });
View example-38.ts
const imageCoverPath: string = `${assetsFolder}/${imageCoverFileName}`;
View example-37.ts
const imageCoverExamplePath: string = resolve(__dirname, `../examples/${imageCoverFileName}`);
View example-36.ts
const assetsFolder: string = `${newArticleFolderPath}/assets`;
View example-35.ts
2020/04/publisher-a-tooling-to-blog-post-publishing/assets/cover.png
You can’t perform that action at this time.