{article.title}
} + {(article.author || datePublished) && ( +-
+ {article.author &&
- ️{article.author} } + {datePublished &&
- ️{datePublished} } +
diff --git a/src/components/address-bar.astro b/src/components/address-bar.astro new file mode 100644 index 0000000..5763e19 --- /dev/null +++ b/src/components/address-bar.astro @@ -0,0 +1,56 @@ +--- +import Form, { FormGroup } from "@astro-reactive/form"; +import { Validators } from "@astro-reactive/validator"; + +export interface Props { + url: string; +} + +const { url } = Astro.props; +const form = new FormGroup([ + { + name: "url", + value: url, + placeholder: "Put the URL here", + validators: [Validators.required, Validators.minLength(11)], + }, +]); +--- + +
+ + diff --git a/src/components/post.astro b/src/components/post.astro index 3cafbd3..f0336b9 100644 --- a/src/components/post.astro +++ b/src/components/post.astro @@ -1,23 +1,55 @@ --- import { ArticleData } from "@extractus/article-extractor"; +import CSS from "./post.module.scss"; const article = Astro.props.article; export interface Props { article: ArticleData; } +const datePublished = + article.published && new Date(article.published).toDateString(); --- { - article ? ( -- by {article.author} -
+ article && ( +