Skip to content

Commit 239b8c0

Browse files
Initial Commit
0 parents  commit 239b8c0

File tree

144 files changed

+6743
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+6743
-0
lines changed

Diff for: .dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Dockerfile
2+
.dockerignore
3+
node_modules
4+
npm-debug.log
5+
README.md
6+
.next
7+
.git

Diff for: .editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
; https://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 2
9+
indent_style = space
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false

Diff for: .gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# build output
2+
dist/
3+
.output/
4+
.json/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
yarn.lock
15+
package-lock.json
16+
17+
18+
# environment variables
19+
.env
20+
.env.production
21+
22+
# macOS-specific files
23+
.DS_Store
24+
25+
# ignore .astro directory
26+
.astro

Diff for: .markdownlint.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD033": false,
3+
"MD013": false
4+
}

Diff for: .prettierrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"plugins": ["prettier-plugin-astro"],
3+
"overrides": [
4+
{
5+
"files": ["*.astro"],
6+
"options": {
7+
"parser": "astro"
8+
}
9+
}
10+
]
11+
}

Diff for: .vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode","bradlc.vscode-tailwindcss"]
3+
}

Diff for: .vscode/settings.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"*.mdx": "markdown"
4+
}
5+
}

Diff for: Dockerfile

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
ARG INSTALLER=yarn
2+
3+
FROM node:20-alpine AS base
4+
5+
# Install dependencies only when needed
6+
FROM base AS deps
7+
ARG INSTALLER
8+
9+
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
10+
RUN apk add --no-cache libc6-compat
11+
WORKDIR /app
12+
13+
# Install dependencies based on the preferred package manager
14+
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
15+
RUN \
16+
if [ "${INSTALLER}" == "yarn" ]; then yarn --frozen-lockfile; \
17+
elif [ "${INSTALLER}" == "npm" ]; then npm ci; \
18+
elif [ "${INSTALLER}" == "pnpm" ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
19+
else echo "Valid installer not set." && exit 1; \
20+
fi
21+
22+
23+
# Rebuild the source code only when needed
24+
FROM base AS builder
25+
WORKDIR /app
26+
COPY --from=deps /app/node_modules ./node_modules
27+
COPY . .
28+
29+
# RUN chmod u+x ./installer && ./installer
30+
ARG INSTALLER
31+
RUN \
32+
if [ "${INSTALLER}" == "yarn" ]; then yarn build; \
33+
elif [ "${INSTALLER}" == "npm" ]; then npm run build; \
34+
elif [ "${INSTALLER}" == "pnpm" ]; then pnpm run build; \
35+
else echo "Valid installer not set." && exit 1; \
36+
fi
37+
38+
# Production image, copy all the files and run nginx
39+
FROM nginx:alpine AS runner
40+
COPY ./config/nginx/nginx.conf /etc/nginx/nginx.conf
41+
COPY --from=builder /app/dist /usr/share/nginx/html
42+
43+
WORKDIR /usr/share/nginx/html

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2023 - Present, Zeon Studio
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: astro.config.mjs

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import mdx from "@astrojs/mdx";
2+
import react from "@astrojs/react";
3+
import sitemap from "@astrojs/sitemap";
4+
import tailwind from "@astrojs/tailwind";
5+
import AutoImport from "astro-auto-import";
6+
import { defineConfig, squooshImageService } from "astro/config";
7+
import remarkCollapse from "remark-collapse";
8+
import remarkToc from "remark-toc";
9+
import config from "./src/config/config.json";
10+
import languagesJSON from "./src/config/language.json";
11+
const { default_language } = config.settings;
12+
13+
const supportedLang = [...languagesJSON.map((lang) => lang.languageCode)];
14+
const disabledLanguages = config.settings.disable_languages;
15+
16+
// Filter out disabled languages from supportedLang
17+
const filteredSupportedLang = supportedLang.filter(
18+
(lang) => !disabledLanguages.includes(lang),
19+
);
20+
21+
// https://astro.build/config
22+
export default defineConfig({
23+
site: config.site.base_url ? config.site.base_url : "http://examplesite.com",
24+
base: config.site.base_path ? config.site.base_path : "/",
25+
trailingSlash: config.site.trailing_slash ? "always" : "ignore",
26+
i18n: {
27+
locales: filteredSupportedLang,
28+
defaultLocale: default_language,
29+
},
30+
image: {
31+
service: squooshImageService(),
32+
},
33+
integrations: [
34+
react(),
35+
sitemap(),
36+
tailwind({
37+
applyBaseStyles: false,
38+
}),
39+
AutoImport({
40+
imports: [
41+
"@/shortcodes/Button",
42+
"@/shortcodes/Accordion",
43+
"@/shortcodes/Notice",
44+
"@/shortcodes/Video",
45+
"@/shortcodes/Youtube",
46+
"@/shortcodes/Tabs",
47+
"@/shortcodes/Tab",
48+
],
49+
}),
50+
mdx(),
51+
],
52+
markdown: {
53+
remarkPlugins: [
54+
remarkToc,
55+
[
56+
remarkCollapse,
57+
{
58+
test: "Table of contents",
59+
},
60+
],
61+
],
62+
shikiConfig: {
63+
theme: "one-dark-pro",
64+
wrap: true,
65+
},
66+
extendDefaultPlugins: true,
67+
},
68+
});

Diff for: config/nginx/nginx.conf

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
worker_processes 1;
2+
3+
events {
4+
worker_connections 1024;
5+
}
6+
7+
http {
8+
server {
9+
listen 80;
10+
server_name _;
11+
12+
root /usr/share/nginx/html;
13+
index index.html index.htm;
14+
include /etc/nginx/mime.types;
15+
16+
gzip on;
17+
gzip_min_length 1000;
18+
gzip_proxied expired no-cache no-store private auth;
19+
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
20+
21+
error_page 404 /404.html;
22+
location = /404.html {
23+
root /usr/share/nginx/html;
24+
internal;
25+
}
26+
27+
location / {
28+
try_files $uri ${uri}.html $uri/index.html =404;
29+
}
30+
}
31+
}

Diff for: netlify.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build]
2+
publish = "dist"
3+
command = "yarn build"
4+
5+
[build.environment]
6+
NODE_VERSION = "20"

Diff for: package.json

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "astroplate",
3+
"version": "4.0.1",
4+
"description": "Astro and Tailwindcss boilerplate",
5+
"author": "zeon.studio",
6+
"license": "MIT",
7+
"packageManager": "[email protected]",
8+
"scripts": {
9+
"dev": "yarn generate-json && astro dev",
10+
"build": "yarn generate-json && astro build",
11+
"preview": "astro preview",
12+
"format": "prettier -w ./src",
13+
"check": "astro check",
14+
"generate-json": "node scripts/jsonGenerator.js",
15+
"remove-darkmode": "node scripts/removeDarkmode.js && yarn format",
16+
"remove-multilang": "node scripts/removeMultilang.js && yarn format"
17+
},
18+
"dependencies": {
19+
"@astrojs/check": "^0.9.3",
20+
"@astrojs/mdx": "^3.1.4",
21+
"@astrojs/react": "^3.6.2",
22+
"@astrojs/rss": "^4.0.7",
23+
"@astrojs/sitemap": "^3.1.6",
24+
"@astrojs/tailwind": "^5.1.0",
25+
"astro": "^4.14.5",
26+
"astro-auto-import": "^0.4.2",
27+
"astro-font": "^0.1.81",
28+
"date-fns": "^3.6.0",
29+
"disqus-react": "^1.1.5",
30+
"github-slugger": "^2.0.0",
31+
"gray-matter": "^4.0.3",
32+
"marked": "^14.1.0",
33+
"prettier-plugin-astro": "^0.14.1",
34+
"prettier-plugin-tailwindcss": "^0.6.6",
35+
"prop-types": "^15.8.1",
36+
"react": "^18.3.1",
37+
"react-dom": "^18.3.1",
38+
"react-icons": "^5.3.0",
39+
"react-lite-youtube-embed": "^2.4.0",
40+
"remark-collapse": "^0.1.2",
41+
"remark-toc": "^9.0.0",
42+
"swiper": "^11.1.10"
43+
},
44+
"devDependencies": {
45+
"@tailwindcss/forms": "^0.5.7",
46+
"@tailwindcss/typography": "^0.5.14",
47+
"@types/marked": "^5.0.2",
48+
"@types/node": "22.5.0",
49+
"@types/react": "18.3.4",
50+
"@types/react-dom": "18.3.0",
51+
"autoprefixer": "^10.4.20",
52+
"eslint": "^9.9.1",
53+
"postcss": "^8.4.41",
54+
"prettier": "^3.3.3",
55+
"prettier-plugin-astro": "^0.14.1",
56+
"prettier-plugin-tailwindcss": "^0.6.6",
57+
"sass": "^1.77.8",
58+
"sharp": "0.33.5",
59+
"tailwind-bootstrap-grid": "^5.1.0",
60+
"tailwindcss": "^3.4.10",
61+
"typescript": "^5.5.4"
62+
}
63+
}

Diff for: postcss.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

0 commit comments

Comments
 (0)