mirror of
https://github.com/10h30/astroplate.git
synced 2026-06-05 15:08:00 +09:00
@@ -24,3 +24,6 @@ package-lock.json
|
||||
|
||||
# ignore .astro directory
|
||||
.astro
|
||||
|
||||
# ide
|
||||
.idea/
|
||||
|
||||
+6
-6
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"name": "astroplate",
|
||||
"version": "5.2.0",
|
||||
"version": "5.3.0",
|
||||
"description": "Astro and Tailwindcss boilerplate",
|
||||
"author": "zeon.studio",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"packageManager": "yarn@1.22.22",
|
||||
"scripts": {
|
||||
"dev": "yarn generate-json && astro dev",
|
||||
@@ -16,11 +17,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/check": "0.9.4",
|
||||
"@astrojs/mdx": "4.0.8",
|
||||
"@astrojs/react": "4.2.0",
|
||||
"@astrojs/mdx": "4.2.1",
|
||||
"@astrojs/react": "4.2.1",
|
||||
"@astrojs/rss": "4.0.11",
|
||||
"@astrojs/sitemap": "3.2.1",
|
||||
"astro": "5.3.0",
|
||||
"@astrojs/sitemap": "3.3.0",
|
||||
"astro": "5.5.4",
|
||||
"astro-auto-import": "^0.4.4",
|
||||
"astro-font": "^1.0.0",
|
||||
"date-fns": "^4.1.0",
|
||||
@@ -41,7 +42,6 @@
|
||||
"@tailwindcss/forms": "^0.5.10",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@tailwindcss/vite": "^4.0.6",
|
||||
"@types/marked": "^6.0.0",
|
||||
"@types/node": "22.13.4",
|
||||
"@types/react": "19.0.9",
|
||||
"@types/react-dom": "19.0.3",
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
</h2>
|
||||
|
||||
<p align=center>
|
||||
<a href="https://github.com/withastro/astro/releases/tag/astro%404.3.2" alt="Contributors">
|
||||
<img src="https://img.shields.io/static/v1?label=ASTRO&message=4.3&color=000&logo=astro" />
|
||||
<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>
|
||||
|
||||
<a href="https://github.com/zeon-studio/astroplate/blob/main/LICENSE">
|
||||
@@ -66,27 +66,27 @@
|
||||
|
||||
### 📦 Dependencies
|
||||
|
||||
- astro v5.1+
|
||||
- astro v5.5+
|
||||
- node v20.10+
|
||||
- npm v10.2+
|
||||
- tailwind v3.4+
|
||||
- yarn v1.22+
|
||||
- tailwind v4+
|
||||
|
||||
### 👉 Install Dependencies
|
||||
|
||||
```bash
|
||||
npm install
|
||||
yarn install
|
||||
```
|
||||
|
||||
### 👉 Development Command
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
yarn run dev
|
||||
```
|
||||
|
||||
### 👉 Build Command
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
yarn run build
|
||||
```
|
||||
|
||||
### 👉 Build and Run With Docker
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const matter = require("gray-matter");
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import matter from "gray-matter";
|
||||
|
||||
const CONTENT_DEPTH = 2;
|
||||
const JSON_FOLDER = "./.json";
|
||||
@@ -41,10 +41,7 @@ const getData = (folder, groupDepth) => {
|
||||
}
|
||||
});
|
||||
|
||||
const publishedPages = getPaths.filter(
|
||||
(page) => !page.frontmatter?.draft && page,
|
||||
);
|
||||
return publishedPages;
|
||||
return getPaths.filter((page) => !page.frontmatter?.draft && page);
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -60,7 +57,8 @@ try {
|
||||
);
|
||||
|
||||
// merger json files for search
|
||||
const posts = require(`../${JSON_FOLDER}/posts.json`);
|
||||
const postsPath = new URL(`../${JSON_FOLDER}/posts.json`, import.meta.url);
|
||||
const posts = JSON.parse(fs.readFileSync(postsPath, "utf8"));
|
||||
const search = [...posts];
|
||||
fs.writeFileSync(`${JSON_FOLDER}/search.json`, JSON.stringify(search));
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user