Merge pull request #63 from bosh-code/update-astro

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