remove depricated func getEntryBySlug and added getEntry

This commit is contained in:
somrat sorkar
2023-10-25 12:09:35 +06:00
parent f714555598
commit 9809ac6e9e
7 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -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 -2
View File
@@ -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;
---
+2 -2
View File
@@ -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");
---
+2 -2
View File
@@ -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");
+2 -2
View File
@@ -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 -2
View File
@@ -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;
---
+4 -4
View File
@@ -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;
---