readme modified

This commit is contained in:
Al Murad Uzzaman
2024-07-31 12:17:20 +06:00
parent b01e1a8e06
commit f4c45c5b8f
7 changed files with 46 additions and 64 deletions
+26 -26
View File
@@ -15,47 +15,47 @@
"remove-multilang": "node scripts/removeMultilang.js && yarn format"
},
"dependencies": {
"@astrojs/mdx": "^2.3.0",
"@astrojs/react": "^3.3.0",
"@astrojs/rss": "^4.0.5",
"@astrojs/sitemap": "^3.1.2",
"@astrojs/mdx": "^3.1.3",
"@astrojs/react": "^3.6.1",
"@astrojs/rss": "^4.0.7",
"@astrojs/sitemap": "^3.1.6",
"@astrojs/tailwind": "^5.1.0",
"astro": "^4.6.1",
"astro": "^4.12.3",
"astro-auto-import": "^0.4.2",
"astro-font": "^0.0.80",
"astro-font": "^0.0.81",
"date-fns": "^3.6.0",
"disqus-react": "^1.1.5",
"github-slugger": "^2.0.0",
"gray-matter": "^4.0.3",
"marked": "^12.0.1",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.13",
"marked": "^13.0.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.5",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.2.1",
"react-lite-youtube-embed": "^2.4.0",
"remark-collapse": "^0.1.2",
"remark-toc": "^9.0.0",
"swiper": "^11.1.1"
"swiper": "^11.1.8"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.7",
"@tailwindcss/typography": "^0.5.12",
"@tailwindcss/typography": "^0.5.13",
"@types/marked": "^5.0.2",
"@types/node": "20.12.7",
"@types/react": "18.2.78",
"@types/react-dom": "18.2.25",
"@types/node": "22.0.0",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"autoprefixer": "^10.4.19",
"eslint": "^9.0.0",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.13",
"sass": "^1.75.0",
"sharp": "0.33.1",
"eslint": "^9.8.0",
"postcss": "^8.4.40",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.5",
"sass": "^1.77.8",
"sharp": "0.33.4",
"tailwind-bootstrap-grid": "^5.1.0",
"tailwindcss": "^3.4.3",
"typescript": "5.4.5"
"tailwindcss": "^3.4.7",
"typescript": "5.5.4"
}
}
+5 -2
View File
@@ -26,6 +26,7 @@
## 📌 Key Features
- 👥 Multi-Authors
- 🌐 Multilingual
- 🎯 Similar Posts Suggestion
- 🔍 Search Functionality
- 🌑 Dark Mode
@@ -65,10 +66,10 @@
### 📦 Dependencies
- astro 4.0+
- astro v4.12+
- node v20.10+
- npm v10.2+
- tailwind v3.3+
- tailwind v3.4+
### 👉 Install Dependencies
@@ -109,12 +110,14 @@ docker run -it --rm astroplate ash
```
<!-- reporting issue -->
## 🐞 Reporting Issues
We use GitHub Issues as the official bug tracker for this Template. Please Search [existing issues](https://github.com/zeon-studio/astroplate/issues). Its possible someone has already reported the same problem.
If your problem or idea has not been addressed yet, feel free to [open a new issue](https://github.com/zeon-studio/astroplate/issues).
<!-- licence -->
## 📝 License
Copyright (c) 2023 - Present, Designed & Developed by [Zeon Studio](https://zeon.studio/)
+1 -1
View File
@@ -22,7 +22,7 @@
"blog_folder": "blog",
"default_language": "en",
"disable_languages": [],
"default_language_in_path": false
"default_language_in_subdir": true
},
"params": {
-24
View File
@@ -1,24 +0,0 @@
import { defineCollection, z } from "astro:content";
const elementsCollection = defineCollection({
schema: z.object({
title: z.string(),
meta_title: z.string().optional(),
description: z.string(),
draft: z.boolean().optional(),
}),
});
const privacyCollection = defineCollection({
schema: z.object({
title: z.string(),
meta_title: z.string().optional(),
description: z.string(),
draft: z.boolean().optional(),
}),
});
export const collections = {
elements: elementsCollection,
privacy: privacyCollection,
};
+4 -3
View File
@@ -1,5 +1,5 @@
import config from "@/config/config.json";
import languages from "@/config/language.json";
import languages from "@/config/language.json"; ``
import React from "react";
const LanguageSwitcher = ({
@@ -21,11 +21,12 @@ const LanguageSwitcher = ({
// Sort languages by weight and filter out disabled languages
const sortedLanguages = languages
// @ts-ignore
.filter(language => !config.settings.disable_languages.includes(language.languageCode))
.sort((a, b) => a.weight - b.weight);
return (
<div className="mr-5">
<div className={`mr-5 ${sortedLanguages.length > 1 ? "block" : "hidden"}`}>
<select
className="border border-dark text-dark bg-transparent dark:border-darkmode-primary dark:text-white py-1 rounded-sm cursor-pointer focus:ring-0 focus:border-dark dark:focus:border-darkmode-primary"
onChange={(e) => {
@@ -55,4 +56,4 @@ const LanguageSwitcher = ({
);
};
export default LanguageSwitcher;
export default LanguageSwitcher;
+8 -6
View File
@@ -4,7 +4,11 @@ import ThemeSwitcher from "@/components/ThemeSwitcher.astro";
import config from "@/config/config.json";
import languages from "@/config/language.json";
import LanguageSwitcher from "@/helpers/LanguageSwitcher";
import { getLangFromUrl, getTranslations, slugSelector } from "@/lib/utils/languageParser";
import {
getLangFromUrl,
getTranslations,
slugSelector,
} from "@/lib/utils/languageParser";
import type { ContentEntryMap } from "astro:content";
import { IoSearch } from "react-icons/io5";
@@ -133,12 +137,10 @@ if (disabledLanguages.includes(lang)) {
}
{/* Theme switcher */}
<ThemeSwitcher className="mr-5" />
{/* Language switcher */}
{
languages.length > 1 && (
<LanguageSwitcher client:load lang={lang} pathname={pathname} />
)
}
<LanguageSwitcher client:load lang={lang} pathname={pathname} />
{/* Navigation button */}
{
navigation_button.enable && (
+2 -2
View File
@@ -76,7 +76,7 @@ const filteredSupportedLang = supportedLang.filter(
export { filteredSupportedLang as supportedLang };
export const slugSelector = (url: string, lang: string) => {
const { default_language, default_language_in_path } = config.settings;
const { default_language, default_language_in_subdir } = config.settings;
const { trailing_slash } = config.site;
let constructedUrl;
@@ -108,7 +108,7 @@ export const slugSelector = (url: string, lang: string) => {
// Add language path if necessary
if (lang === default_language) {
constructedUrl = default_language_in_path
constructedUrl = default_language_in_subdir
? `/${lang}${constructedUrl}`
: constructedUrl;
}