mirror of
https://github.com/10h30/astroplate.git
synced 2026-06-05 15:08:00 +09:00
remove depricated func getEntryBySlug and added getEntry
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "astroplate",
|
||||
"version": "2.1.2",
|
||||
"version": "2.2.0",
|
||||
"description": "Astro and Tailwindcss boilerplate",
|
||||
"author": "zeon.studio",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { markdownify } from "@/lib/utils/textConverter";
|
||||
import { Image } from "astro:assets";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
import { getEntry } from "astro:content";
|
||||
|
||||
const about = await getEntryBySlug("about", "-index");
|
||||
const about = await getEntry("about", "-index");
|
||||
const { Content } = await about.render();
|
||||
const { title, description, meta_title, image } = about.data;
|
||||
---
|
||||
|
||||
@@ -3,9 +3,9 @@ import AuthorCard from "@/components/AuthorCard.astro";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
import { getEntry } from "astro:content";
|
||||
|
||||
const authorIndex = await getEntryBySlug<any, string>("authors", "-index");
|
||||
const authorIndex = await getEntry<any, string>("authors", "-index");
|
||||
const authors = await getSinglePage("authors");
|
||||
---
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { sortByDate } from "@/lib/utils/sortFunctions";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import PostSidebar from "@/partials/PostSidebar.astro";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
import { getEntry } from "astro:content";
|
||||
|
||||
const { blog_folder } = config.settings;
|
||||
const postIndex = await getEntryBySlug<any, string>(blog_folder, "-index");
|
||||
const postIndex = await getEntry<any, string>(blog_folder, "-index");
|
||||
const posts = await getSinglePage(blog_folder);
|
||||
const allCategories = await getAllTaxonomy(blog_folder, "categories");
|
||||
const categories = await getTaxonomy(blog_folder, "categories");
|
||||
|
||||
@@ -8,11 +8,11 @@ import { getAllTaxonomy, getTaxonomy } from "@/lib/taxonomyParser.astro";
|
||||
import { sortByDate } from "@/lib/utils/sortFunctions";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import PostSidebar from "@/partials/PostSidebar.astro";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
import { getEntry } from "astro:content";
|
||||
|
||||
const { blog_folder } = config.settings;
|
||||
const { slug } = Astro.params;
|
||||
const postIndex = await getEntryBySlug<any, string>(blog_folder, "-index");
|
||||
const postIndex = await getEntry<any, string>(blog_folder, "-index");
|
||||
const posts = await getSinglePage(blog_folder);
|
||||
const allCategories = await getAllTaxonomy(blog_folder, "categories");
|
||||
const categories = await getTaxonomy(blog_folder, "categories");
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import config from "@/config/config.json";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
import { getEntry } from "astro:content";
|
||||
|
||||
const contact = await getEntryBySlug("contact", "-index");
|
||||
const contact = await getEntry("contact", "-index");
|
||||
const { contact_form_action }: { contact_form_action: string } = config.params;
|
||||
const { title, description, meta_title, image } = contact.data;
|
||||
---
|
||||
|
||||
@@ -5,7 +5,7 @@ import CallToAction from "@/partials/CallToAction.astro";
|
||||
import Testimonial from "@/partials/Testimonial.astro";
|
||||
import type { Button, Feature } from "@/types";
|
||||
import { Image } from "astro:assets";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
import { getEntry } from "astro:content";
|
||||
import { FaCheck } from "react-icons/fa/index.js";
|
||||
|
||||
interface Homepage {
|
||||
@@ -18,9 +18,9 @@ interface Homepage {
|
||||
features: Feature[];
|
||||
}
|
||||
|
||||
const homepage = await getEntryBySlug("homepage", "-index");
|
||||
const testimonial = await getEntryBySlug("sections", "testimonial");
|
||||
const call_to_action = await getEntryBySlug("sections", "call-to-action");
|
||||
const homepage = await getEntry("homepage", "-index");
|
||||
const testimonial = await getEntry("sections", "testimonial");
|
||||
const call_to_action = await getEntry("sections", "call-to-action");
|
||||
const { banner, features }: Homepage = homepage.data;
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user