mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-16 21:23:30 +09:00
format code
This commit is contained in:
@@ -3,7 +3,7 @@ import Base from "@/layouts/Base.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
|
||||
export async function getStaticPaths(): Promise<{params: {regular: string}}[]> {
|
||||
export async function getStaticPaths() {
|
||||
const pages = await getSinglePage("pages");
|
||||
|
||||
const paths = pages.map((page) => ({
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
---
|
||||
import { Image } from "@astrojs/image/components";
|
||||
import BlogCard from "@/components/BlogCard.astro";
|
||||
import Social from "@/components/Social.astro";
|
||||
import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import { slugify } from "@/lib/utils/textConverter";
|
||||
import type { Blog_folder } from "types";
|
||||
import { Image } from "@astrojs/image/components";
|
||||
|
||||
export async function getStaticPaths(): Promise<{params: {single: string}, props: {author: string}}[]> {
|
||||
export async function getStaticPaths(): Promise<
|
||||
{ params: { single: string }; props: { author: string } }[]
|
||||
> {
|
||||
const authors = await getSinglePage("authors");
|
||||
|
||||
const paths = authors.map((author) => ({
|
||||
@@ -20,7 +21,7 @@ export async function getStaticPaths(): Promise<{params: {single: string}, props
|
||||
return paths;
|
||||
}
|
||||
|
||||
const { blog_folder }: Blog_folder = config.settings;
|
||||
const { blog_folder }: { blog_folder: string } = config.settings;
|
||||
const { author } = Astro.props;
|
||||
const { title, social, meta_title, description, image } = author.data;
|
||||
const { Content } = await author.render();
|
||||
|
||||
@@ -7,7 +7,9 @@ import { getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import taxonomyFilter from "@/lib/utils/taxonomyFilter";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
|
||||
export async function getStaticPaths(): Promise<{params: {category: string}}[]> {
|
||||
export async function getStaticPaths(): Promise<
|
||||
{ params: { category: string } }[]
|
||||
> {
|
||||
const categories = await getTaxonomy(
|
||||
config.settings.blog_folder,
|
||||
"categories"
|
||||
|
||||
@@ -4,9 +4,8 @@ import Base from "@/layouts/Base.astro";
|
||||
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { humanize } from "@/lib/utils/textConverter";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import type { Blog_folder } from "types";
|
||||
|
||||
const { blog_folder }: Blog_folder = config.settings;
|
||||
const { blog_folder }: { blog_folder: string } = config.settings;
|
||||
const categories = await getTaxonomy(blog_folder, "categories");
|
||||
const allCategories = await getAllTaxonomy(blog_folder, "categories");
|
||||
---
|
||||
|
||||
@@ -5,7 +5,7 @@ import PageHeader from "@/partials/PageHeader.astro";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
|
||||
const entry = await getEntryBySlug("pages", "contact");
|
||||
const { contact_form_action }: {contact_form_action: string} = config.params;
|
||||
const { contact_form_action }: { contact_form_action: string } = config.params;
|
||||
const { title, description, meta_title, image } = entry.data;
|
||||
---
|
||||
|
||||
|
||||
+41
-53
@@ -10,12 +10,12 @@ import type { Button, Feature } from "types";
|
||||
|
||||
interface Homepage {
|
||||
banner: {
|
||||
title: string
|
||||
content: string,
|
||||
image: string,
|
||||
button: Button,
|
||||
}
|
||||
features: Feature[]
|
||||
title: string;
|
||||
content: string;
|
||||
image: string;
|
||||
button: Button;
|
||||
};
|
||||
features: Feature[];
|
||||
}
|
||||
|
||||
const homepage = await getEntryBySlug("homepage", "index");
|
||||
@@ -59,55 +59,43 @@ const { banner, features }: Homepage = homepage.data;
|
||||
|
||||
<!-- Features -->
|
||||
{
|
||||
features.map(
|
||||
(
|
||||
feature,
|
||||
index: number
|
||||
) => (
|
||||
<section class={`section-sm ${index % 2 === 0 && "bg-gradient"}`}>
|
||||
<div class="container">
|
||||
<div class="row items-center justify-between">
|
||||
<div
|
||||
class={`mb:md-0 mb-6 md:col-5 ${
|
||||
index % 2 !== 0 && "md:order-2"
|
||||
}`}
|
||||
>
|
||||
<Image
|
||||
src={feature.image}
|
||||
height={480}
|
||||
width={520}
|
||||
fit="contain"
|
||||
background="rgba(0,0,0,0)"
|
||||
alt={feature.title}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class={`md:col-7 lg:col-6 ${index % 2 !== 0 && "md:order-1"}`}
|
||||
>
|
||||
<h2 set:html={markdownify(feature.title)} class="mb-4" />
|
||||
<p
|
||||
set:html={markdownify(feature.content)}
|
||||
class="mb-8 text-lg"
|
||||
/>
|
||||
<ul>
|
||||
{feature.bulletpoints.map((bullet: string) => (
|
||||
<li class="relative mb-4 pl-6">
|
||||
<FaCheck className={"absolute left-0 top-1.5"} />
|
||||
<span set:html={markdownify(bullet)} />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{feature.button.enable && (
|
||||
<a class="btn btn-primary mt-5" href={feature.button.link}>
|
||||
{feature.button.label}
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
features.map((feature, index: number) => (
|
||||
<section class={`section-sm ${index % 2 === 0 && "bg-gradient"}`}>
|
||||
<div class="container">
|
||||
<div class="row items-center justify-between">
|
||||
<div
|
||||
class={`mb:md-0 mb-6 md:col-5 ${index % 2 !== 0 && "md:order-2"}`}
|
||||
>
|
||||
<Image
|
||||
src={feature.image}
|
||||
height={480}
|
||||
width={520}
|
||||
fit="contain"
|
||||
background="rgba(0,0,0,0)"
|
||||
alt={feature.title}
|
||||
/>
|
||||
</div>
|
||||
<div class={`md:col-7 lg:col-6 ${index % 2 !== 0 && "md:order-1"}`}>
|
||||
<h2 set:html={markdownify(feature.title)} class="mb-4" />
|
||||
<p set:html={markdownify(feature.content)} class="mb-8 text-lg" />
|
||||
<ul>
|
||||
{feature.bulletpoints.map((bullet: string) => (
|
||||
<li class="relative mb-4 pl-6">
|
||||
<FaCheck className={"absolute left-0 top-1.5"} />
|
||||
<span set:html={markdownify(bullet)} />
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{feature.button.enable && (
|
||||
<a class="btn btn-primary mt-5" href={feature.button.link}>
|
||||
{feature.button.label}
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
)
|
||||
</div>
|
||||
</section>
|
||||
))
|
||||
}
|
||||
<!-- /Features -->
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ import Base from "@/layouts/Base.astro";
|
||||
import PostSingle from "@/layouts/PostSingle.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
|
||||
export async function getStaticPaths(): Promise<{params: {single: string}, props: {post: any}}[]> {
|
||||
export async function getStaticPaths(): Promise<
|
||||
{ params: { single: string }; props: { post: any } }[]
|
||||
> {
|
||||
const posts = await getSinglePage(config.settings.blog_folder);
|
||||
|
||||
const paths = posts.map((post) => ({
|
||||
|
||||
@@ -4,9 +4,8 @@ import Base from "@/layouts/Base.astro";
|
||||
import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { humanize } from "@/lib/utils/textConverter";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import type { Blog_folder } from "types";
|
||||
|
||||
const { blog_folder }: Blog_folder = config.settings;
|
||||
const { blog_folder }: { blog_folder: string } = config.settings;
|
||||
const tags = await getTaxonomy(blog_folder, "tags");
|
||||
const allTags = await getAllTaxonomy(blog_folder, "tags");
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user