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