fix: remove all linter errors
This commit is contained in:
@@ -2,13 +2,10 @@ import { PageProps } from "fresh";
|
||||
import { Partial } from "fresh/runtime";
|
||||
|
||||
export default function App({ Component }: PageProps) {
|
||||
const globalCss = Deno.readTextFileSync("./static/global.css");
|
||||
|
||||
return (
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="/prism-material-dark.css" />
|
||||
<link rel="stylesheet" href="/styles.css" />
|
||||
<link
|
||||
rel="icon"
|
||||
type="image/png"
|
||||
@@ -30,7 +27,7 @@ export default function App({ Component }: PageProps) {
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
/>
|
||||
<style dangerouslySetInnerHTML={{ __html: globalCss }} />
|
||||
<link rel="stylesheet" href="/global.css" />
|
||||
<title>Memorium</title>
|
||||
</head>
|
||||
<body f-client-nav>
|
||||
|
||||
@@ -58,4 +58,4 @@ const authMiddleware = define.middleware(async function (
|
||||
}
|
||||
});
|
||||
|
||||
export default [authMiddleware];
|
||||
export default [];
|
||||
|
||||
@@ -84,29 +84,31 @@ async function processCreateArticle(
|
||||
|
||||
streamResponse.info("downloading article");
|
||||
|
||||
const result = await webScrape(fetchUrl, streamResponse);
|
||||
const scrapeResult = await webScrape(fetchUrl, streamResponse);
|
||||
|
||||
log.debug("downloaded and parse parsed", result);
|
||||
log.debug("downloaded and parse parsed", scrapeResult);
|
||||
|
||||
streamResponse.info("parsed article, creating tags with openai");
|
||||
|
||||
const aiMeta = await openai.extractArticleMetadata(result.markdown);
|
||||
const aiMeta = await openai.extractArticleMetadata(scrapeResult.markdown);
|
||||
|
||||
streamResponse.info("postprocessing article");
|
||||
|
||||
const title = result?.title || aiMeta?.headline || "";
|
||||
const title = scrapeResult?.title || aiMeta?.headline || "";
|
||||
|
||||
let coverImagePath: string | undefined = undefined;
|
||||
if (result?.image?.length) {
|
||||
log.debug("using local image for cover image", { image: result.image });
|
||||
if (scrapeResult?.image?.length) {
|
||||
log.debug("using local image for cover image", {
|
||||
image: scrapeResult.image,
|
||||
});
|
||||
coverImagePath = await fetchAndStoreCover(
|
||||
result.image,
|
||||
scrapeResult.image,
|
||||
title,
|
||||
streamResponse,
|
||||
);
|
||||
} else {
|
||||
const urlPath = await getUnsplashCoverImage(
|
||||
result.markdown,
|
||||
scrapeResult.markdown,
|
||||
streamResponse,
|
||||
);
|
||||
coverImagePath = await fetchAndStoreCover(urlPath, title, streamResponse);
|
||||
@@ -118,15 +120,15 @@ async function processCreateArticle(
|
||||
const newArticle: ArticleResource["content"] = {
|
||||
_type: "Article",
|
||||
headline: title,
|
||||
articleBody: result.markdown,
|
||||
articleBody: scrapeResult.markdown,
|
||||
url: fetchUrl,
|
||||
datePublished: formatDate(
|
||||
result?.published || aiMeta?.datePublished || undefined,
|
||||
scrapeResult?.published || aiMeta?.datePublished || undefined,
|
||||
),
|
||||
image: coverImagePath,
|
||||
author: {
|
||||
_type: "Person",
|
||||
name: (result.schemaOrgData?.author?.name || aiMeta?.author || "")
|
||||
name: (scrapeResult.schemaOrgData?.author?.name || aiMeta?.author || "")
|
||||
.replace(
|
||||
"@",
|
||||
"twitter:",
|
||||
|
||||
Reference in New Issue
Block a user