ContentParser && Tabs Updated

This commit is contained in:
Al Murad Uzzaman
2025-04-29 11:13:55 +06:00
parent 423ad81a1c
commit 68c865c652
5 changed files with 32 additions and 17 deletions
+10 -10
View File
@@ -1,6 +1,6 @@
{
"name": "astroplate",
"version": "5.5.0",
"version": "5.5.1",
"description": "Astro and Tailwindcss boilerplate",
"author": "zeon.studio",
"license": "MIT",
@@ -17,20 +17,20 @@
},
"dependencies": {
"@astrojs/check": "0.9.4",
"@astrojs/mdx": "4.2.4",
"@astrojs/react": "4.2.4",
"@astrojs/mdx": "4.2.5",
"@astrojs/react": "4.2.5",
"@astrojs/rss": "4.0.11",
"@astrojs/sitemap": "3.3.0",
"@astrojs/sitemap": "3.3.1",
"@digi4care/astro-google-tagmanager": "^1.4.0",
"@justinribeiro/lite-youtube": "^1.7.1",
"astro": "5.7.4",
"@justinribeiro/lite-youtube": "^1.8.0",
"astro": "5.7.8",
"astro-auto-import": "^0.4.4",
"astro-font": "^1.1.0",
"date-fns": "^4.1.0",
"disqus-react": "^1.1.6",
"github-slugger": "^2.0.0",
"gray-matter": "^4.0.3",
"marked": "^15.0.8",
"marked": "^15.0.11",
"prop-types": "^15.8.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
@@ -38,16 +38,16 @@
"remark-collapse": "^0.1.2",
"remark-toc": "^9.0.0",
"swiper": "^11.2.6",
"vite": "^6.3.2"
"vite": "^6.3.3"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.10",
"@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.1.4",
"@types/node": "22.14.1",
"@types/node": "22.15.3",
"@types/react": "19.1.2",
"@types/react-dom": "19.1.2",
"eslint": "^9.25.0",
"eslint": "^9.25.1",
"prettier": "^3.5.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.11",
+4 -3
View File
@@ -10,8 +10,8 @@
</h2>
<p align=center>
<a href="https://github.com/withastro/astro/releases/tag/astro%405.5.4">
<img src="https://img.shields.io/static/v1?label=ASTRO&message=5.5&color=000&logo=astro" alt="Astro Version 5.5"/>
<a href="https://github.com/withastro/astro/releases/tag/astro%405.7.8">
<img src="https://img.shields.io/static/v1?label=ASTRO&message=5.7&color=000&logo=astro" alt="Astro Version 5.7"/>
</a>
<a href="https://github.com/zeon-studio/astroplate/blob/main/LICENSE">
@@ -35,6 +35,7 @@
- 📞 Support contact form
- 📱 Fully responsive
- 📝 Write and update content in Markdown / MDX
- 📎 Google Tag Manager
- 💬 Disqus Comment
- 🔳 Syntax Highlighting
@@ -66,7 +67,7 @@
### 📦 Dependencies
- astro v5.5+
- astro v5.7+
- node v20.10+
- yarn v1.22+
- tailwind v4+
+1 -1
View File
@@ -3,7 +3,7 @@ import config from "@/config/config.json";
const {
theme_switcher,
default_theme,
// default_theme,
}: { theme_switcher: boolean; default_theme: string } = config.settings;
const { className }: { className?: string } = Astro.props;
---
+2 -2
View File
@@ -16,8 +16,8 @@ const Tabs = ({ children }: { children: React.ReactElement }) => {
}, [active]);
const tabLinks = Array.from(
children.props.value.matchAll(
/<div\s+data-name="([^"]+)"[^>]*>(.*?)<\/div>/gs,
(children.props as any).value.matchAll(
/<div\s+data-name="([^"]+)"[^>]*>((?:.|\n)*?)<\/div>/g,
),
(match: RegExpMatchArray) => ({ name: match[1], children: match[0] }),
);
+15 -1
View File
@@ -5,12 +5,26 @@ import {
type CollectionKey,
} from "astro:content";
type PageData = {
title: string;
meta_title?: string;
description?: string;
image?: string;
draft?: boolean;
};
export const getSinglePage = async <C extends CollectionKey>(
collectionName: C
): Promise<CollectionEntry<C>[]> => {
const allPages = await getCollection(collectionName);
const removeIndex = allPages.filter((data) => data.id.match(/^(?!-)/));
const removeDrafts = removeIndex.filter((data) => !data.data.draft);
const removeDrafts = removeIndex.filter((data) => {
const pageData = data.data as PageData;
return pageData.draft !== true;
});
return removeDrafts;
};
---