diff --git a/.eslintrc.js b/.eslintrc.js
index 7728b1e..9caa5d3 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -25,7 +25,10 @@ module.exports = {
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' }],
+ '@typescript-eslint/no-unused-vars': [
+ 'error',
+ { argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' },
+ ],
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
@@ -36,4 +39,4 @@ module.exports = {
parser: '@typescript-eslint/parser',
},
],
-};
\ No newline at end of file
+};
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..429ffcd
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,5 @@
+dist
+node_modules
+.github
+.changeset
+*.md
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..74d86ae
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,16 @@
+{
+ "printWidth": 120,
+ "semi": true,
+ "singleQuote": true,
+ "tabWidth": 2,
+ "trailingComma": "es5",
+ "useTabs": true,
+ "overrides": [
+ {
+ "files": [".*", "*.json", "*.md", "*.toml", "*.yml"],
+ "options": {
+ "useTabs": false
+ }
+ }
+ ]
+}
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index ba411e2..7a01227 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,4 +1,9 @@
{
- "recommendations": ["astro-build.astro-vscode", "bradlc.vscode-tailwindcss", "dbaeumer.vscode-eslint"],
+ "recommendations": [
+ "astro-build.astro-vscode",
+ "bradlc.vscode-tailwindcss",
+ "dbaeumer.vscode-eslint",
+ "esbenp.prettier-vscode"
+ ],
"unwantedRecommendations": []
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 6c4e504..56d5249 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -5,5 +5,9 @@
"astro", // Enable .astro
"typescript", // Enable .ts
"typescriptreact" // Enable .tsx
- ]
-}
\ No newline at end of file
+ ],
+ "prettier.documentSelectors": ["**/*.astro"],
+ "[astro]": {
+ "editor.defaultFormatter": "esbenp.prettier-vscode"
+ }
+}
diff --git a/astro.config.mjs b/astro.config.mjs
index 69bc90f..34092b7 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -1,45 +1,45 @@
-import path from "path";
-import { fileURLToPath } from "url";
+import path from 'path';
+import { fileURLToPath } from 'url';
-import { defineConfig } from "astro/config";
+import { defineConfig } from 'astro/config';
-import tailwind from "@astrojs/tailwind";
-import sitemap from "@astrojs/sitemap";
-import image from "@astrojs/image";
-import partytown from "@astrojs/partytown";
+import tailwind from '@astrojs/tailwind';
+import sitemap from '@astrojs/sitemap';
+import image from '@astrojs/image';
+import partytown from '@astrojs/partytown';
-import { SITE } from "./src/config.mjs";
+import { SITE } from './src/config.mjs';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// https://astro.build/config
export default defineConfig({
- // Astro uses this full URL to generate your sitemap and canonical URLs in your final build
- site: SITE.origin,
- base: SITE.basePathname,
+ // Astro uses this full URL to generate your sitemap and canonical URLs in your final build
+ site: SITE.origin,
+ base: SITE.basePathname,
- output: "static",
+ output: 'static',
- integrations: [
- tailwind({
- config: {
- applyBaseStyles: false,
- },
- }),
- sitemap(),
- image(),
+ integrations: [
+ tailwind({
+ config: {
+ applyBaseStyles: false,
+ },
+ }),
+ sitemap(),
+ image(),
- /* Disable this integration if you don't use Google Analytics (or other external script). */
- partytown({
- config: { forward: ["dataLayer.push"] },
- }),
- ],
+ /* Disable this integration if you don't use Google Analytics (or other external script). */
+ partytown({
+ config: { forward: ['dataLayer.push'] },
+ }),
+ ],
- vite: {
- resolve: {
- alias: {
- "~": path.resolve(__dirname, "./src"),
- },
- },
- },
+ vite: {
+ resolve: {
+ alias: {
+ '~': path.resolve(__dirname, './src'),
+ },
+ },
+ },
});
diff --git a/package.json b/package.json
index 7ea8223..fe81779 100644
--- a/package.json
+++ b/package.json
@@ -7,9 +7,10 @@
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
+ "preview": "astro preview",
+ "format": "prettier -w .",
"lint:eslint": "eslint . --ext .js,.ts,.astro",
- "subfont": "subfont -ir --no-fallbacks --silent --root dist",
- "preview": "astro preview"
+ "subfont": "subfont -ir --no-fallbacks --silent --root dist"
},
"devDependencies": {
"@astrojs/image": "^0.7.0",
@@ -27,6 +28,8 @@
"eslint-plugin-astro": "^0.19.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"limax": "^v2.1.0",
+ "prettier": "^2.7.1",
+ "prettier-plugin-astro": "^0.5.4",
"reading-time": "^1.5.0",
"subfont": "^6.9.0"
},
diff --git a/sandbox.config.json b/sandbox.config.json
index ed537bf..9178af7 100644
--- a/sandbox.config.json
+++ b/sandbox.config.json
@@ -8,4 +8,4 @@
"startScript": "start",
"node": "14"
}
-}
\ No newline at end of file
+}
diff --git a/src/assets/styles/base.css b/src/assets/styles/base.css
index 5b4af3a..19f4b62 100644
--- a/src/assets/styles/base.css
+++ b/src/assets/styles/base.css
@@ -3,26 +3,26 @@
@tailwind utilities;
@layer components {
- .btn {
- @apply inline-flex items-center justify-center rounded border border-transparent font-medium text-center text-base leading-snug transition py-3 px-6 shadow-lg ease-in duration-200 focus:ring-blue-500 focus:ring-offset-blue-200 focus:ring-2 focus:ring-offset-2;
- }
+ .btn {
+ @apply inline-flex items-center justify-center rounded border border-transparent font-medium text-center text-base leading-snug transition py-3 px-6 shadow-lg ease-in duration-200 focus:ring-blue-500 focus:ring-offset-blue-200 focus:ring-2 focus:ring-offset-2;
+ }
}
[astro-icon] > * {
- stroke-width: 1.5;
+ stroke-width: 1.5;
}
[astro-icon].icon-bold > * {
- stroke-width: 2;
+ stroke-width: 2;
}
[data-aw-toggle-menu] path {
- @apply transition;
+ @apply transition;
}
[data-aw-toggle-menu].expanded g > path:first-child {
- @apply -rotate-45 translate-y-[15px] translate-x-[-3px];
+ @apply -rotate-45 translate-y-[15px] translate-x-[-3px];
}
[data-aw-toggle-menu].expanded g > path:last-child {
- @apply rotate-45 translate-y-[-8px] translate-x-[14px];
-}
\ No newline at end of file
+ @apply rotate-45 translate-y-[-8px] translate-x-[14px];
+}
diff --git a/src/components/atoms/ExtraMetaTags.astro b/src/components/atoms/ExtraMetaTags.astro
index 7081697..01f9454 100644
--- a/src/components/atoms/ExtraMetaTags.astro
+++ b/src/components/atoms/ExtraMetaTags.astro
@@ -1,7 +1,7 @@
---
-import { SITE } from "~/config.mjs"
+import { SITE } from '~/config.mjs';
---
-
-
\ No newline at end of file
+
+
diff --git a/src/components/atoms/Fonts.astro b/src/components/atoms/Fonts.astro
index adb227f..c455323 100644
--- a/src/components/atoms/Fonts.astro
+++ b/src/components/atoms/Fonts.astro
@@ -1,5 +1,5 @@
---
-import "@fontsource/inter/variable.css"
+import '@fontsource/inter/variable.css';
---
diff --git a/src/components/atoms/Logo.astro b/src/components/atoms/Logo.astro
index d2c8318..6a9c03a 100644
--- a/src/components/atoms/Logo.astro
+++ b/src/components/atoms/Logo.astro
@@ -2,5 +2,5 @@
---
+ π AstroWind
diff --git a/src/components/atoms/Pagination.astro b/src/components/atoms/Pagination.astro
index c2d558d..0259921 100644
--- a/src/components/atoms/Pagination.astro
+++ b/src/components/atoms/Pagination.astro
@@ -1,34 +1,34 @@
---
-import { Icon } from "astro-icon";
-const { prevUrl, nextUrl, prevText = "Newer posts", nextText = "Older posts" } = Astro.props;
+import { Icon } from 'astro-icon';
+const { prevUrl, nextUrl, prevText = 'Newer posts', nextText = 'Older posts' } = Astro.props;
---
{
- (prevUrl || nextUrl) && (
-
- )
+ (prevUrl || nextUrl) && (
+
+ )
}
diff --git a/src/components/atoms/Tags.astro b/src/components/atoms/Tags.astro
index fb9da43..43fd18f 100644
--- a/src/components/atoms/Tags.astro
+++ b/src/components/atoms/Tags.astro
@@ -1,17 +1,17 @@
---
-import { getPermalink } from "~/utils/permalinks";
+import { getPermalink } from '~/utils/permalinks';
-const { tags, class: className = "text-sm" } = Astro.props;
+const { tags, class: className = 'text-sm' } = Astro.props;
---
{
- tags && Array.isArray(tags) && (
-
- {tags.map((tag) => (
-
- {tag}
-
- ))}
-
- )
+ tags && Array.isArray(tags) && (
+
+ {tags.map((tag) => (
+
+ {tag}
+
+ ))}
+
+ )
}
diff --git a/src/components/blog/HighlightedPosts.astro b/src/components/blog/HighlightedPosts.astro
index 45de848..61364f7 100644
--- a/src/components/blog/HighlightedPosts.astro
+++ b/src/components/blog/HighlightedPosts.astro
@@ -1,58 +1,58 @@
---
-import Picture from "~/components/core/Picture.astro";
+import Picture from '~/components/core/Picture.astro';
-import { findPostsByIds } from "~/utils/posts";
-import { findImage } from "~/utils/images";
-import { getPermalink } from "~/utils/permalinks";
+import { findPostsByIds } from '~/utils/posts';
+import { findImage } from '~/utils/images';
+import { getPermalink } from '~/utils/permalinks';
const ids = [
- "get-started-website-with-astro-tailwind-css",
- "how-to-customize-astrowind-to-your-brand",
- "useful-resources-to-create-websites",
- "astrowind-template-in-depth",
+ 'get-started-website-with-astro-tailwind-css',
+ 'how-to-customize-astrowind-to-your-brand',
+ 'useful-resources-to-create-websites',
+ 'astrowind-template-in-depth',
];
const items = await Promise.all(
- (await findPostsByIds(ids)).map(async (item) => ({ ...item, image: await findImage(item.image) }))
+ (await findPostsByIds(ids)).map(async (item) => ({ ...item, image: await findImage(item.image) }))
);
---
-
-
- Find out more content in our Blog
-
+
+
+ Find out more content in our Blog
+
-
- The blog will be used to display AstroWind documentation. Each new article will be an important step that you will
- need to know to be an expert in creating a website using Astro + Tailwind CSS The blog does not exist yet, but
- very soon. Astro is a very interesting technology. Thanks.
-
-
+
+ The blog will be used to display AstroWind documentation. Each new article will be an important step that you will
+ need to know to be an expert in creating a website using Astro + Tailwind CSS The blog does not exist yet, but
+ very soon. Astro is a very interesting technology. Thanks.
+
+
-
- {
- items.map((post) => (
-
-
-
- {post.excerpt || post.description}
-
- ))
- }
-
+
+ {
+ items.map((post) => (
+
+
+
+ {post.excerpt || post.description}
+
+ ))
+ }
+
diff --git a/src/components/blog/List.astro b/src/components/blog/List.astro
index 8e3eb98..d150d25 100644
--- a/src/components/blog/List.astro
+++ b/src/components/blog/List.astro
@@ -1,15 +1,15 @@
---
-import Item from "~/components/blog/ListItem.astro";
+import Item from '~/components/blog/ListItem.astro';
const { posts } = Astro.props;
---
- {
- posts.map((post) => (
-
-
-
- ))
- }
+ {
+ posts.map((post) => (
+
+
+
+ ))
+ }
diff --git a/src/components/blog/ListItem.astro b/src/components/blog/ListItem.astro
index ef38a93..eaa1d26 100644
--- a/src/components/blog/ListItem.astro
+++ b/src/components/blog/ListItem.astro
@@ -1,10 +1,10 @@
---
-import Picture from "~/components/core/Picture.astro";
-import PostTags from "~/components/atoms/Tags.astro";
+import Picture from '~/components/core/Picture.astro';
+import PostTags from '~/components/atoms/Tags.astro';
-import { getPermalink } from "~/utils/permalinks";
-import { findImage } from "~/utils/images";
-import { getFormattedDate } from "~/utils/utils";
+import { getPermalink } from '~/utils/permalinks';
+import { findImage } from '~/utils/images';
+import { getFormattedDate } from '~/utils/utils';
const { post } = Astro.props;
@@ -12,43 +12,44 @@ const image = await findImage(post.image);
---
-
-
-
-
-
-
- {post.excerpt || post.description}
-
-
-
+
+
+
+
+
+
+ {post.excerpt || post.description}
+
+
+
diff --git a/src/components/blog/SinglePost.astro b/src/components/blog/SinglePost.astro
index 3e78b99..eec02a3 100644
--- a/src/components/blog/SinglePost.astro
+++ b/src/components/blog/SinglePost.astro
@@ -1,43 +1,43 @@
---
-import Picture from "~/components/core/Picture.astro";
-import PostTags from "~/components/atoms/Tags.astro";
+import Picture from '~/components/core/Picture.astro';
+import PostTags from '~/components/atoms/Tags.astro';
-import { getFormattedDate } from "~/utils/utils";
+import { getFormattedDate } from '~/utils/utils';
const { post } = Astro.props;
---
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/components/core/BasicScripts.astro b/src/components/core/BasicScripts.astro
index 31bef14..e52f272 100644
--- a/src/components/core/BasicScripts.astro
+++ b/src/components/core/BasicScripts.astro
@@ -2,47 +2,47 @@
---
diff --git a/src/components/core/GoogleAnalytics.astro b/src/components/core/GoogleAnalytics.astro
index 4d7e182..6a17fc0 100644
--- a/src/components/core/GoogleAnalytics.astro
+++ b/src/components/core/GoogleAnalytics.astro
@@ -1,16 +1,16 @@
---
-const { id = "G-XXXXXXXXXX", partytown = false } = Astro.props;
+const { id = 'G-XXXXXXXXXX', partytown = false } = Astro.props;
-const attrs = partytown ? { type: "text/partytown" } : {};
+const attrs = partytown ? { type: 'text/partytown' } : {};
---
diff --git a/src/components/core/MetaTags.astro b/src/components/core/MetaTags.astro
index 3b77c5c..576f5b0 100644
--- a/src/components/core/MetaTags.astro
+++ b/src/components/core/MetaTags.astro
@@ -1,35 +1,35 @@
---
-import { getImage } from "@astrojs/image";
-import { getRelativeUrlByFilePath } from "~/utils/directories";
+import { getImage } from '@astrojs/image';
+import { getRelativeUrlByFilePath } from '~/utils/directories';
-import GoogleAnalytics from "~/components/core/GoogleAnalytics.astro";
-import defaultImageSrc from "~/assets/images/default.png";
+import GoogleAnalytics from '~/components/core/GoogleAnalytics.astro';
+import defaultImageSrc from '~/assets/images/default.png';
-import { SITE } from "~/config.mjs";
-import Fonts from "../atoms/Fonts.astro";
-import ExtraMetaTags from "../atoms/ExtraMetaTags.astro";
+import { SITE } from '~/config.mjs';
+import Fonts from '../atoms/Fonts.astro';
+import ExtraMetaTags from '../atoms/ExtraMetaTags.astro';
const { src: defaultImage } = await getImage({
- src: defaultImageSrc,
- width: 1200,
- height: 628,
+ src: defaultImageSrc,
+ width: 1200,
+ height: 628,
});
const {
- title = SITE.name,
- description = "",
- image: _image = defaultImage,
- canonical,
- noindex = false,
- nofollow = false,
+ title = SITE.name,
+ description = '',
+ image: _image = defaultImage,
+ canonical,
+ noindex = false,
+ nofollow = false,
} = Astro.props;
const image =
- typeof _image === "string"
- ? new URL(_image, Astro.site)
- : _image && typeof _image["src"] !== "undefined"
- ? new URL(getRelativeUrlByFilePath(_image.src), Astro.site)
- : null;
+ typeof _image === 'string'
+ ? new URL(_image, Astro.site)
+ : _image && typeof _image['src'] !== 'undefined'
+ ? new URL(getRelativeUrlByFilePath(_image.src), Astro.site)
+ : null;
---
@@ -39,7 +39,7 @@ const image =
{canonical && }
-
+
diff --git a/src/components/core/Picture.astro b/src/components/core/Picture.astro
index 621c102..d4efe61 100644
--- a/src/components/core/Picture.astro
+++ b/src/components/core/Picture.astro
@@ -1,39 +1,43 @@
---
-import { getPicture } from "@astrojs/image";
+import { getPicture } from '@astrojs/image';
const {
- src,
- alt,
- sizes,
- widths,
- aspectRatio = 1,
- formats = ["avif", "webp"],
- loading = "lazy",
- decoding = "async",
- class: className = "",
- ...attrs
+ src,
+ alt,
+ sizes,
+ widths,
+ aspectRatio = 1,
+ formats = ['avif', 'webp'],
+ loading = 'lazy',
+ decoding = 'async',
+ class: className = '',
+ ...attrs
} = Astro.props;
let picture = null;
try {
- picture = src && await getPicture({
- src,
- widths,
- formats,
- aspectRatio,
- })
-}
-catch (e) {
- // continue regardless of error
+ picture =
+ src &&
+ (await getPicture({
+ src,
+ widths,
+ formats,
+ aspectRatio,
+ }));
+} catch (e) {
+ // continue regardless of error
}
-const { image = {}, sources = [] } = picture || {}
+const { image = {}, sources = [] } = picture || {};
---
-{ (src && image?.src) &&
-
- {sources.map((attrs) =>
- )}
-
-
-}
\ No newline at end of file
+{
+ src && image?.src && (
+
+ {sources.map((attrs) => (
+
+ ))}
+
+
+ )
+}
diff --git a/src/components/core/ToggleMenu.astro b/src/components/core/ToggleMenu.astro
index 9682ddb..63b5b32 100644
--- a/src/components/core/ToggleMenu.astro
+++ b/src/components/core/ToggleMenu.astro
@@ -1,15 +1,15 @@
---
-import { Icon } from "astro-icon";
+import { Icon } from 'astro-icon';
const {
- label = "Toggle Menu",
- class:
- className = "ml-1.5 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center transition",
- iconClass = "w-6 h-6",
- iconName = "tabler:menu",
+ label = 'Toggle Menu',
+ class:
+ className = 'ml-1.5 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center transition',
+ iconClass = 'w-6 h-6',
+ iconName = 'tabler:menu',
} = Astro.props;
---
-
-
\ No newline at end of file
+
+
diff --git a/src/components/core/ToggleTheme.astro b/src/components/core/ToggleTheme.astro
index a6680f4..b59d1f9 100644
--- a/src/components/core/ToggleTheme.astro
+++ b/src/components/core/ToggleTheme.astro
@@ -1,15 +1,15 @@
---
-import { Icon } from "astro-icon";
+import { Icon } from 'astro-icon';
const {
- label = "Toggle between Dark and Light mode",
- class:
- className = "text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center",
- iconClass = "w-6 h-6",
- iconName = "tabler:sun",
+ label = 'Toggle between Dark and Light mode',
+ class:
+ className = 'text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5 inline-flex items-center',
+ iconClass = 'w-6 h-6',
+ iconName = 'tabler:sun',
} = Astro.props;
---
-
+
diff --git a/src/components/widgets/CallToAction.astro b/src/components/widgets/CallToAction.astro
index e27bcb5..aebf4ca 100644
--- a/src/components/widgets/CallToAction.astro
+++ b/src/components/widgets/CallToAction.astro
@@ -1,30 +1,30 @@
---
-import { Icon } from "astro-icon";
+import { Icon } from 'astro-icon';
---
-
-
-
-
- Astro + Tailwind CSS
-
-
- Be very surprised by these huge fake numbers you are seeing on this page. Don't
- waste more time! :P
-
+
+
+
+
+ Astro + Tailwind CSS
+
+
+ Be very surprised by these huge fake numbers you are seeing on this page. Don't
+ waste more time! :P
+
-
-
-
-
+
+
+
+
diff --git a/src/components/widgets/Error404.astro b/src/components/widgets/Error404.astro
index d4ce3d5..25260ee 100644
--- a/src/components/widgets/Error404.astro
+++ b/src/components/widgets/Error404.astro
@@ -1,24 +1,24 @@
---
-import { getHomePermalink } from "~/utils/permalinks";
+import { getHomePermalink } from '~/utils/permalinks';
---
-
-
-
- Error
- 404
-
-
Sorry, we couldn't find this page.
-
- But dont worry, you can find plenty of other things on our homepage.
-
-
Back to homepage
-
-
-
+
+
+
+ Error
+ 404
+
+
Sorry, we couldn't find this page.
+
+ But dont worry, you can find plenty of other things on our homepage.
+
+
Back to homepage
+
+
diff --git a/src/components/widgets/FAQs.astro b/src/components/widgets/FAQs.astro
index fa79bc3..d6d3a91 100644
--- a/src/components/widgets/FAQs.astro
+++ b/src/components/widgets/FAQs.astro
@@ -1,71 +1,71 @@
---
-import { Icon } from "astro-icon";
+import { Icon } from 'astro-icon';
const items = [
- [
- {
- question: "What do I need to start?",
- answer: `Space, the final frontier. These are the voyages of the Starship Enterprise. Its five-year mission: to explore strange new worlds.
+ [
+ {
+ question: 'What do I need to start?',
+ answer: `Space, the final frontier. These are the voyages of the Starship Enterprise. Its five-year mission: to explore strange new worlds.
Many say exploration is part of our destiny, but itβs actually our duty to future generations.`,
- },
- {
- question: "How to install the Astro + Tailwind CSS template?",
- answer: `Well, the way they make shows is, they make one show. That show's called a pilot.
+ },
+ {
+ question: 'How to install the Astro + Tailwind CSS template?',
+ answer: `Well, the way they make shows is, they make one show. That show's called a pilot.
Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing.`,
- },
- {
- question: "What's something that you completely don't understand?",
- answer: `A flower in my garden, a mystery in my panties. Heart attack never stopped old Big Bear. I didn't even know we were calling him Big Bear.`,
- },
- ],
- [
- {
- question: "What's an example of when you changed your mind?",
- answer: `Michael Knight a young loner on a crusade to champion the cause of the innocent. The helpless. The powerless in a world of criminals who operate above the law. Here he comes Here comes Speed Racer. He's a demon on wheels.`,
- },
- {
- question: "What is something that you would really like to try again?",
- answer: `A business big enough that it could be listed on the NASDAQ goes belly up. Disappears!
+ },
+ {
+ question: "What's something that you completely don't understand?",
+ answer: `A flower in my garden, a mystery in my panties. Heart attack never stopped old Big Bear. I didn't even know we were calling him Big Bear.`,
+ },
+ ],
+ [
+ {
+ question: "What's an example of when you changed your mind?",
+ answer: `Michael Knight a young loner on a crusade to champion the cause of the innocent. The helpless. The powerless in a world of criminals who operate above the law. Here he comes Here comes Speed Racer. He's a demon on wheels.`,
+ },
+ {
+ question: 'What is something that you would really like to try again?',
+ answer: `A business big enough that it could be listed on the NASDAQ goes belly up. Disappears!
It ceases to exist without me. No, you clearly don't know who you're talking to, so let me clue you in.`,
- },
- {
- question: "If you could only ask one question to each person you meet, what would that question be?",
- answer: `This is not about revenge. This is about justice. A lot of things can change in twelve years, Admiral. Well, that's certainly good to know. About four years. I got tired of hearing how young I looked.`,
- },
- ],
+ },
+ {
+ question: 'If you could only ask one question to each person you meet, what would that question be?',
+ answer: `This is not about revenge. This is about justice. A lot of things can change in twelve years, Admiral. Well, that's certainly good to know. About four years. I got tired of hearing how young I looked.`,
+ },
+ ],
];
---
-
-
-
- Frequently Asked Questions
-
-
-
-
-
- {
- items.map((subitems) => (
-
- {subitems.map(({ question, answer }) => (
-
-
-
- {question}
-
- {answer.split("\n\n").map((paragraph) => (
-
- ))}
-
- ))}
-
- ))
- }
-
-
+
+
+
+ Frequently Asked Questions
+
+
+
+
+
+ {
+ items.map((subitems) => (
+
+ {subitems.map(({ question, answer }) => (
+
+
+
+ {question}
+
+ {answer.split('\n\n').map((paragraph) => (
+
+ ))}
+
+ ))}
+
+ ))
+ }
+
+
diff --git a/src/components/widgets/Features.astro b/src/components/widgets/Features.astro
index da6f040..f93ae74 100644
--- a/src/components/widgets/Features.astro
+++ b/src/components/widgets/Features.astro
@@ -1,73 +1,73 @@
---
-import { Icon } from "astro-icon";
+import { Icon } from 'astro-icon';
const items = [
- {
- title: "Headers",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.",
- icon: "flat-color-icons:home",
- },
- {
- title: "Footers",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.",
- icon: "flat-color-icons:faq",
- },
- {
- title: "Features",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.",
- icon: "flat-color-icons:video-projector",
- },
- {
- title: "Call-to-Action",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.",
- icon: "flat-color-icons:video-projector",
- },
- {
- title: "Pricing",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.",
- icon: "flat-color-icons:calculator",
- },
- {
- title: "Testimonial",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.",
- icon: "flat-color-icons:voice-presentation",
- },
+ {
+ title: 'Headers',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.',
+ icon: 'flat-color-icons:home',
+ },
+ {
+ title: 'Footers',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.',
+ icon: 'flat-color-icons:faq',
+ },
+ {
+ title: 'Features',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.',
+ icon: 'flat-color-icons:video-projector',
+ },
+ {
+ title: 'Call-to-Action',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.',
+ icon: 'flat-color-icons:video-projector',
+ },
+ {
+ title: 'Pricing',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.',
+ icon: 'flat-color-icons:calculator',
+ },
+ {
+ title: 'Testimonial',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.',
+ icon: 'flat-color-icons:voice-presentation',
+ },
];
---
-
-
-
-
-
Components
-
- Most used widgets
-
-
- Provides frequently used components for building websites using Tailwind CSS
-
-
-
- {
- items.map(({ title, description, icon }) => (
-
-
-
+
+
+
+
+
Components
+
+ Most used widgets
+
+
+ Provides frequently used components for building websites using Tailwind CSS
+
+
+
+ {
+ items.map(({ title, description, icon }) => (
+
- ))
- }
-
-
-
+
{title}
+
+
{description}
+
+ ))
+ }
+
+
+
diff --git a/src/components/widgets/Features2.astro b/src/components/widgets/Features2.astro
index 1f62be3..de9b426 100644
--- a/src/components/widgets/Features2.astro
+++ b/src/components/widgets/Features2.astro
@@ -1,88 +1,88 @@
---
const items = [
- [
- {
- title: "Integration with Tailwind CSS",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.",
- },
- {
- title: "Ready-to-use Components",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.",
- },
- {
- title: "Best Practices",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.",
- },
- ],
- [
- {
- title: "Excellent Page Speed",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.",
- },
- {
- title: "Frequently updated",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.",
- },
- {
- title: "Open to new ideas and contributions",
- description:
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.",
- },
- ],
+ [
+ {
+ title: 'Integration with Tailwind CSS',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
+ },
+ {
+ title: 'Ready-to-use Components',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
+ },
+ {
+ title: 'Best Practices',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
+ },
+ ],
+ [
+ {
+ title: 'Excellent Page Speed',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
+ },
+ {
+ title: 'Frequently updated',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
+ },
+ {
+ title: 'Open to new ideas and contributions',
+ description:
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi risus tempus nulla.',
+ },
+ ],
];
---
diff --git a/src/components/widgets/Features3.astro b/src/components/widgets/Features3.astro
index a89aff6..3381e6a 100644
--- a/src/components/widgets/Features3.astro
+++ b/src/components/widgets/Features3.astro
@@ -1,90 +1,90 @@
---
-import { Icon } from "astro-icon";
+import { Icon } from 'astro-icon';
---
-
-
-
-
-
-
-
- Sed ac magna sit amet risus tristique interdum, at vel velit in hac habitasse platea dictumst.
-
+
+
+
+
+
+
+
+ Sed ac magna sit amet risus tristique interdum, at vel velit in hac habitasse platea dictumst.
+
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi
- risus tempus nulla, sed porttitor est nibh at nulla. Praesent placerat enim ut ex tincidunt vehicula.
- Fusce sit amet dui tellus.
-
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi
+ risus tempus nulla, sed porttitor est nibh at nulla. Praesent placerat enim ut ex tincidunt vehicula.
+ Fusce sit amet dui tellus.
+
-
-
-
-
-
-
-
-
- 1
-
-
-
-
Responsive Elements
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis
- lobortis, mi risus tempus nulla.
-
-
-
-
-
-
- 2
-
-
-
-
Flexible Team
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis
- lobortis, mi risus tempus nulla.
-
-
-
-
-
-
- 3
-
-
-
-
Ecologic Software
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis
- lobortis, mi risus tempus nulla.
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 1
+
+
+
Responsive Elements
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis
+ lobortis, mi risus tempus nulla.
+
+
+
+
+
+
+ 2
+
+
+
Flexible Team
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis
+ lobortis, mi risus tempus nulla.
+
+
+
+
+
+
+ 3
+
+
+
Ecologic Software
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis
+ lobortis, mi risus tempus nulla.
+
+
+
+
+
+
+
+
+
diff --git a/src/components/widgets/Footer.astro b/src/components/widgets/Footer.astro
index 13e2684..17494f3 100644
--- a/src/components/widgets/Footer.astro
+++ b/src/components/widgets/Footer.astro
@@ -1,225 +1,223 @@
---
-import { Icon } from "astro-icon";
-import { getHomePermalink } from "~/utils/permalinks";
+import { Icon } from 'astro-icon';
+import { getHomePermalink } from '~/utils/permalinks';
---
-
-
-
-
-
-
-
-
- Made by
onWidget Β·
- All rights reserved.
-
-
-
+
+
+
+
+
+
+
+
+ Made by
onWidget Β·
+ All rights reserved.
+
+
+
diff --git a/src/components/widgets/Header.astro b/src/components/widgets/Header.astro
index f662a42..1be50e3 100644
--- a/src/components/widgets/Header.astro
+++ b/src/components/widgets/Header.astro
@@ -1,81 +1,79 @@
---
-import { Icon } from "astro-icon";
-import Logo from "~/components/atoms/Logo.astro";
-import ToggleTheme from "~/components/core/ToggleTheme.astro";
-import ToggleMenu from "~/components/core/ToggleMenu.astro";
+import { Icon } from 'astro-icon';
+import Logo from '~/components/atoms/Logo.astro';
+import ToggleTheme from '~/components/core/ToggleTheme.astro';
+import ToggleMenu from '~/components/core/ToggleMenu.astro';
-import { getPermalink, getBlogPermalink, getHomePermalink } from "~/utils/permalinks";
+import { getPermalink, getBlogPermalink, getHomePermalink } from '~/utils/permalinks';
---
diff --git a/src/components/widgets/Hero.astro b/src/components/widgets/Hero.astro
index 47e7067..38840d9 100644
--- a/src/components/widgets/Hero.astro
+++ b/src/components/widgets/Hero.astro
@@ -1,59 +1,60 @@
---
-import { Icon } from "astro-icon";
-import Picture from "~/components/core/Picture.astro";
+import { Icon } from 'astro-icon';
+import Picture from '~/components/core/Picture.astro';
---
-
-
-
-
- Your website with
- Astro +
- Tailwind CSS
-
-
-
-
- AstroWind is a production ready template to start your new website using Astro + Tailwind CSS. It has been
- designed following Best Practices, SEO, Accessibility, ... Dark Mode, Great Page Speed, image optimization,
- sitemap generation and more.
-
-
-
-
-
-
-
+
+
+
+
+ Your website with
+ Astro +
+ Tailwind CSS
+
+
+
+ AstroWind is a production ready template to start your new website using Astro + Tailwind CSS. It has been
+ designed following Best Practices, SEO, Accessibility, ... Dark Mode, Great Page Speed, image optimization, sitemap generation and more.
+
+
+
+
+
+
+
diff --git a/src/components/widgets/Stats.astro b/src/components/widgets/Stats.astro
index d51654b..9d13308 100644
--- a/src/components/widgets/Stats.astro
+++ b/src/components/widgets/Stats.astro
@@ -2,24 +2,24 @@
---
diff --git a/src/components/widgets/Steps.astro b/src/components/widgets/Steps.astro
index df52b36..3ee8b5f 100644
--- a/src/components/widgets/Steps.astro
+++ b/src/components/widgets/Steps.astro
@@ -1,89 +1,89 @@
---
-import { Icon } from "astro-icon";
-import Picture from "~/components/core/Picture.astro";
+import { Icon } from 'astro-icon';
+import Picture from '~/components/core/Picture.astro';
---
-
-
-
- Sed ac magna sit amet risus tristique interdum. hac.
-
-
-
-
-
Step 1
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi
- risus tempus nulla, sed porttitor est nibh at nulla. Praesent placerat enim ut ex tincidunt vehicula. Fusce
- sit amet dui tellus.
-
-
-
-
-
-
-
Step 2
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi
- risus tempus nulla, sed porttitor est nibh at nulla.
-
-
-
-
-
-
-
Step 3
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi
- risus tempus nulla, sed porttitor est nibh at nulla.
-
-
-
-
-
-
-
+
+
+
+ Sed ac magna sit amet risus tristique interdum. hac.
+
+
+
+
+
Step 1
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi
+ risus tempus nulla, sed porttitor est nibh at nulla. Praesent placerat enim ut ex tincidunt vehicula. Fusce
+ sit amet dui tellus.
+
+
+
+
+
+
+
Step 2
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi
+ risus tempus nulla, sed porttitor est nibh at nulla.
+
+
+
+
+
+
+
Step 3
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sagittis, quam nec venenatis lobortis, mi
+ risus tempus nulla, sed porttitor est nibh at nulla.
+
+
+
+
+
+
+
diff --git a/src/config.mjs b/src/config.mjs
index 7c23e9e..a219428 100644
--- a/src/config.mjs
+++ b/src/config.mjs
@@ -1,30 +1,30 @@
export const SITE = {
- name: "AstroWind",
+ name: 'AstroWind',
- origin: "https://astrowind.vercel.app",
- basePathname: "/",
+ origin: 'https://astrowind.vercel.app',
+ basePathname: '/',
- title: "AstroWind β Your website with Astro + Tailwind CSS",
- description: "π AstroWind is a free and ready to start template to make your website using Astro and Tailwind CSS.",
+ title: 'AstroWind β Your website with Astro + Tailwind CSS',
+ description: 'π AstroWind is a free and ready to start template to make your website using Astro and Tailwind CSS.',
- googleAnalyticsId: false, // or "G-XXXXXXXXXX",
- googleSiteVerificationId: "orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M",
+ googleAnalyticsId: false, // or "G-XXXXXXXXXX",
+ googleSiteVerificationId: 'orcPxI47GSa-cRvY11tUe6iGg2IO_RPvnA1q95iEM3M',
};
export const BLOG = {
- disabled: false,
- slug: "blog",
+ disabled: false,
+ slug: 'blog',
- postsWithoutBlogSlug: true,
- postsPerPage: 6,
+ postsWithoutBlogSlug: true,
+ postsPerPage: 6,
- category: {
- disabled: false,
- slug: "category", // set empty to change from /category/some-slug to /some-slug
- },
+ category: {
+ disabled: false,
+ slug: 'category', // set empty to change from /category/some-slug to /some-slug
+ },
- tag: {
- disabled: false,
- slug: "tag",
- },
+ tag: {
+ disabled: false,
+ slug: 'tag',
+ },
};
diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro
index b6fe1dc..a563c08 100644
--- a/src/layouts/BaseLayout.astro
+++ b/src/layouts/BaseLayout.astro
@@ -1,26 +1,25 @@
---
-import "~/assets/styles/base.css";
+import '~/assets/styles/base.css';
-import MetaTags from "~/components/core/MetaTags.astro";
-import BasicScripts from "~/components/core/BasicScripts.astro";
+import MetaTags from '~/components/core/MetaTags.astro';
+import BasicScripts from '~/components/core/BasicScripts.astro';
const { meta = {} } = Astro.props;
---
-
-
-
+
+
+
-
-
-
-
+
+
+
+
+
-
-
diff --git a/src/layouts/BlogLayout.astro b/src/layouts/BlogLayout.astro
index cde38e1..93f1911 100644
--- a/src/layouts/BlogLayout.astro
+++ b/src/layouts/BlogLayout.astro
@@ -1,18 +1,18 @@
---
-import Layout from "~/layouts/PageLayout.astro";
+import Layout from '~/layouts/PageLayout.astro';
const { meta } = Astro.props;
---
-
-
+
+
diff --git a/src/layouts/PageLayout.astro b/src/layouts/PageLayout.astro
index 9a984b5..b7924d1 100644
--- a/src/layouts/PageLayout.astro
+++ b/src/layouts/PageLayout.astro
@@ -1,15 +1,15 @@
---
-import Layout from "~/layouts/BaseLayout.astro";
-import Header from "~/components/widgets/Header.astro";
-import Footer from "~/components/widgets/Footer.astro";
+import Layout from '~/layouts/BaseLayout.astro';
+import Header from '~/components/widgets/Header.astro';
+import Footer from '~/components/widgets/Footer.astro';
const { meta } = Astro.props;
---
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/src/pages/404.astro b/src/pages/404.astro
index fc7bd97..ee6319d 100644
--- a/src/pages/404.astro
+++ b/src/pages/404.astro
@@ -1,11 +1,11 @@
---
-import Layout from "~/layouts/BaseLayout.astro";
-import { SITE } from "~/config.mjs";
-import Error404 from "~/components/widgets/Error404.astro";
+import Layout from '~/layouts/BaseLayout.astro';
+import { SITE } from '~/config.mjs';
+import Error404 from '~/components/widgets/Error404.astro';
const title = `Error 404 β ${SITE.name}`;
---
-
+
diff --git a/src/pages/[...blog]/[...page].astro b/src/pages/[...blog]/[...page].astro
index 343f28a..cb893be 100644
--- a/src/pages/[...blog]/[...page].astro
+++ b/src/pages/[...blog]/[...page].astro
@@ -1,39 +1,39 @@
---
-import { SITE, BLOG } from "~/config.mjs";
+import { SITE, BLOG } from '~/config.mjs';
-import Layout from "~/layouts/BlogLayout.astro";
-import BlogList from "~/components/blog/List.astro";
-import Pagination from "~/components/atoms/Pagination.astro";
+import Layout from '~/layouts/BlogLayout.astro';
+import BlogList from '~/components/blog/List.astro';
+import Pagination from '~/components/atoms/Pagination.astro';
-import { fetchPosts } from "~/utils/posts";
-import { getCanonical, getPermalink, BLOG_BASE } from "~/utils/permalinks";
+import { fetchPosts } from '~/utils/posts';
+import { getCanonical, getPermalink, BLOG_BASE } from '~/utils/permalinks';
export async function getStaticPaths({ paginate }) {
- if (BLOG?.disabled) return [];
+ if (BLOG?.disabled) return [];
- const posts = await fetchPosts();
+ const posts = await fetchPosts();
- return paginate(posts, {
- params: { blog: BLOG_BASE || undefined },
- pageSize: BLOG.postsPerPage,
- });
+ return paginate(posts, {
+ params: { blog: BLOG_BASE || undefined },
+ pageSize: BLOG.postsPerPage,
+ });
}
const { page } = Astro.props;
const currentPage = page.currentPage ?? 1;
const meta = {
- title: `Blog ${currentPage > 1 ? `β Page ${currentPage} ` : ""}β ${SITE.name}`,
- description: SITE.description,
- canonical: getCanonical(getPermalink(page.url.current)),
+ title: `Blog ${currentPage > 1 ? `β Page ${currentPage} ` : ''}β ${SITE.name}`,
+ description: SITE.description,
+ canonical: getCanonical(getPermalink(page.url.current)),
};
---
-
-
- News and step-by-step guides about
- AstroWind
-
-
-
+
+
+ News and step-by-step guides about
+ AstroWind
+
+
+
diff --git a/src/pages/[...blog]/[slug].astro b/src/pages/[...blog]/[slug].astro
index 3e023e9..243490c 100644
--- a/src/pages/[...blog]/[slug].astro
+++ b/src/pages/[...blog]/[slug].astro
@@ -1,34 +1,37 @@
---
-import { SITE, BLOG } from "~/config.mjs";
+import { SITE, BLOG } from '~/config.mjs';
-import Layout from "~/layouts/PageLayout.astro";
-import SinglePost from "~/components/blog/SinglePost.astro";
+import Layout from '~/layouts/PageLayout.astro';
+import SinglePost from '~/components/blog/SinglePost.astro';
-import { getCanonical, getPermalink, cleanSlug, BLOG_BASE } from "~/utils/permalinks";
-import { fetchPosts } from "~/utils/posts";
-import { findImage } from "~/utils/images";
+import { getCanonical, getPermalink, cleanSlug, BLOG_BASE } from '~/utils/permalinks';
+import { fetchPosts } from '~/utils/posts';
+import { findImage } from '~/utils/images';
export async function getStaticPaths() {
- if (BLOG?.disabled) return [];
+ if (BLOG?.disabled) return [];
- const posts = await fetchPosts();
+ const posts = await fetchPosts();
- return posts.map((post) => ({
- params: { slug: cleanSlug(post.slug), blog: BLOG.postsWithoutBlogSlug ? undefined : BLOG_BASE || undefined },
- props: { post },
- }));
+ return posts.map((post) => ({
+ params: {
+ slug: cleanSlug(post.slug),
+ blog: BLOG.postsWithoutBlogSlug ? undefined : BLOG_BASE || undefined,
+ },
+ props: { post },
+ }));
}
const { post } = Astro.props;
const meta = {
- title: `${post.title} β ${SITE.name}`,
- description: post.description,
- canonical: post.canonical || getCanonical(getPermalink(post.slug, "post")),
- image: await findImage(post.image),
+ title: `${post.title} β ${SITE.name}`,
+ description: post.description,
+ canonical: post.canonical || getCanonical(getPermalink(post.slug, 'post')),
+ image: await findImage(post.image),
};
---
-
-
+
+
diff --git a/src/pages/[...categories]/[category]/[...page].astro b/src/pages/[...categories]/[category]/[...page].astro
index a1bbaf0..93901e6 100644
--- a/src/pages/[...categories]/[category]/[...page].astro
+++ b/src/pages/[...categories]/[category]/[...page].astro
@@ -1,33 +1,33 @@
---
-import { SITE, BLOG } from "~/config.mjs";
+import { SITE, BLOG } from '~/config.mjs';
-import Layout from "~/layouts/BlogLayout.astro";
-import BlogList from "~/components/blog/List.astro";
-import Pagination from "~/components/atoms/Pagination.astro";
+import Layout from '~/layouts/BlogLayout.astro';
+import BlogList from '~/components/blog/List.astro';
+import Pagination from '~/components/atoms/Pagination.astro';
-import { fetchPosts } from "~/utils/posts";
-import { getCanonical, getPermalink, cleanSlug, CATEGORY_BASE } from "~/utils/permalinks";
+import { fetchPosts } from '~/utils/posts';
+import { getCanonical, getPermalink, cleanSlug, CATEGORY_BASE } from '~/utils/permalinks';
export async function getStaticPaths({ paginate }) {
- if (BLOG?.disabled || BLOG?.category?.disabled) return [];
+ if (BLOG?.disabled || BLOG?.category?.disabled) return [];
- const posts = await fetchPosts();
+ const posts = await fetchPosts();
- const categories = new Set();
- posts.map((post) => {
- typeof post.category === "string" && categories.add(post.category.toLowerCase());
- });
+ const categories = new Set();
+ posts.map((post) => {
+ typeof post.category === 'string' && categories.add(post.category.toLowerCase());
+ });
- return Array.from(categories).map((category) =>
- paginate(
- posts.filter((post) => typeof post.category === "string" && category === post.category.toLowerCase()),
- {
- params: { category: cleanSlug(category), categories: CATEGORY_BASE || undefined },
- pageSize: BLOG.postsPerPage,
- props: { category },
- }
- )
- );
+ return Array.from(categories).map((category) =>
+ paginate(
+ posts.filter((post) => typeof post.category === 'string' && category === post.category.toLowerCase()),
+ {
+ params: { category: cleanSlug(category), categories: CATEGORY_BASE || undefined },
+ pageSize: BLOG.postsPerPage,
+ props: { category },
+ }
+ )
+ );
}
const { page, category } = Astro.props;
@@ -35,16 +35,16 @@ const { page, category } = Astro.props;
const currentPage = page.currentPage ?? 1;
const meta = {
- title: `Category '${category}' ${currentPage > 1 ? `β Page ${currentPage} ` : ""}β ${SITE.name}`,
- description: SITE.description,
- canonical: getCanonical(getPermalink(page.url.current)),
+ title: `Category '${category}' ${currentPage > 1 ? `β Page ${currentPage} ` : ''}β ${SITE.name}`,
+ description: SITE.description,
+ canonical: getCanonical(getPermalink(page.url.current)),
};
---
-
- Category: {category}
-
-
-
+
+ Category: {category}
+
+
+
diff --git a/src/pages/[...tags]/[tag]/[...page].astro b/src/pages/[...tags]/[tag]/[...page].astro
index 5623a47..893052f 100644
--- a/src/pages/[...tags]/[tag]/[...page].astro
+++ b/src/pages/[...tags]/[tag]/[...page].astro
@@ -1,33 +1,33 @@
---
-import { SITE, BLOG } from "~/config.mjs";
+import { SITE, BLOG } from '~/config.mjs';
-import Layout from "~/layouts/BlogLayout.astro";
-import BlogList from "~/components/blog/List.astro";
-import Pagination from "~/components/atoms/Pagination.astro";
+import Layout from '~/layouts/BlogLayout.astro';
+import BlogList from '~/components/blog/List.astro';
+import Pagination from '~/components/atoms/Pagination.astro';
-import { fetchPosts } from "~/utils/posts";
-import { getCanonical, getPermalink, cleanSlug, TAG_BASE } from "~/utils/permalinks";
+import { fetchPosts } from '~/utils/posts';
+import { getCanonical, getPermalink, cleanSlug, TAG_BASE } from '~/utils/permalinks';
export async function getStaticPaths({ paginate }) {
- if (BLOG?.disabled || BLOG?.tag?.disabled) return [];
+ if (BLOG?.disabled || BLOG?.tag?.disabled) return [];
- const posts = await fetchPosts();
+ const posts = await fetchPosts();
- const tags = new Set();
- posts.map((post) => {
- Array.isArray(post.tags) && post.tags.map((tag) => tags.add(tag.toLowerCase()));
- });
+ const tags = new Set();
+ posts.map((post) => {
+ Array.isArray(post.tags) && post.tags.map((tag) => tags.add(tag.toLowerCase()));
+ });
- return Array.from(tags).map((tag) =>
- paginate(
- posts.filter((post) => Array.isArray(post.tags) && post.tags.includes(tag)),
- {
- params: { tag: cleanSlug(tag), tags: TAG_BASE || undefined },
- pageSize: BLOG.postsPerPage,
- props: { tag },
- }
- )
- );
+ return Array.from(tags).map((tag) =>
+ paginate(
+ posts.filter((post) => Array.isArray(post.tags) && post.tags.includes(tag)),
+ {
+ params: { tag: cleanSlug(tag), tags: TAG_BASE || undefined },
+ pageSize: BLOG.postsPerPage,
+ props: { tag },
+ }
+ )
+ );
}
const { page, tag } = Astro.props;
@@ -35,16 +35,16 @@ const { page, tag } = Astro.props;
const currentPage = page.currentPage ?? 1;
const meta = {
- title: `Posts by tag '${tag}' ${currentPage > 1 ? `β Page ${currentPage} ` : ""}β ${SITE.name}`,
- description: SITE.description,
- canonical: getCanonical(getPermalink(page.url.current)),
+ title: `Posts by tag '${tag}' ${currentPage > 1 ? `β Page ${currentPage} ` : ''}β ${SITE.name}`,
+ description: SITE.description,
+ canonical: getCanonical(getPermalink(page.url.current)),
};
---
-
- Tag: {tag}
-
-
-
+
+ Tag: {tag}
+
+
+
diff --git a/src/pages/index.astro b/src/pages/index.astro
index ae07f94..6b3ac33 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,33 +1,33 @@
---
-import { SITE } from "~/config.mjs";
-import { getCanonical, getHomePermalink } from "~/utils/permalinks";
-import Layout from "~/layouts/PageLayout.astro";
+import { SITE } from '~/config.mjs';
+import { getCanonical, getHomePermalink } from '~/utils/permalinks';
+import Layout from '~/layouts/PageLayout.astro';
-import Hero from "~/components/widgets/Hero.astro";
-import Features from "~/components/widgets/Features.astro";
-import Features2 from "~/components/widgets/Features2.astro";
-import Steps from "~/components/widgets/Steps.astro";
-import Features3 from "~/components/widgets/Features3.astro";
-import HighlightedPosts from "~/components/blog/HighlightedPosts.astro";
-import FAQs from "~/components/widgets/FAQs.astro";
-import Stats from "~/components/widgets/Stats.astro";
-import CallToAction from "~/components/widgets/CallToAction.astro";
+import Hero from '~/components/widgets/Hero.astro';
+import Features from '~/components/widgets/Features.astro';
+import Features2 from '~/components/widgets/Features2.astro';
+import Steps from '~/components/widgets/Steps.astro';
+import Features3 from '~/components/widgets/Features3.astro';
+import HighlightedPosts from '~/components/blog/HighlightedPosts.astro';
+import FAQs from '~/components/widgets/FAQs.astro';
+import Stats from '~/components/widgets/Stats.astro';
+import CallToAction from '~/components/widgets/CallToAction.astro';
const meta = {
- title: SITE.title,
- description: SITE.description,
- canonical: getCanonical(getHomePermalink()),
+ title: SITE.title,
+ description: SITE.description,
+ canonical: getCanonical(getHomePermalink()),
};
---
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js
index a643d9d..7958586 100644
--- a/src/pages/rss.xml.js
+++ b/src/pages/rss.xml.js
@@ -1,29 +1,29 @@
-import rss from "@astrojs/rss";
+import rss from '@astrojs/rss';
-import { SITE, BLOG } from "~/config.mjs";
-import { fetchPosts } from "~/utils/posts";
-import { getPermalink } from "~/utils/permalinks";
+import { SITE, BLOG } from '~/config.mjs';
+import { fetchPosts } from '~/utils/posts';
+import { getPermalink } from '~/utils/permalinks';
export const get = async () => {
- if (BLOG.disabled) {
- return new Response(null, {
- status: 404,
- statusText: 'Not found'
- });
- }
+ if (BLOG.disabled) {
+ return new Response(null, {
+ status: 404,
+ statusText: 'Not found',
+ });
+ }
- const posts = await fetchPosts();
+ const posts = await fetchPosts();
- return rss({
- title: `${SITE.name}βs Blog`,
- description: SITE.description,
- site: import.meta.env.SITE,
+ return rss({
+ title: `${SITE.name}βs Blog`,
+ description: SITE.description,
+ site: import.meta.env.SITE,
- items: posts.map((post) => ({
- link: getPermalink(post.slug, "post"),
- title: post.title,
- description: post.description,
- pubDate: post.pubDate,
- })),
- });
-}
\ No newline at end of file
+ items: posts.map((post) => ({
+ link: getPermalink(post.slug, 'post'),
+ title: post.title,
+ description: post.description,
+ pubDate: post.pubDate,
+ })),
+ });
+};
diff --git a/src/utils/directories.js b/src/utils/directories.js
index 9470ffb..6d37296 100644
--- a/src/utils/directories.js
+++ b/src/utils/directories.js
@@ -1,22 +1,22 @@
-import path from "path";
-import { fileURLToPath } from "url";
+import path from 'path';
+import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** */
export const getProjectRootDir = () => {
- const mode = import.meta.env.MODE;
+ const mode = import.meta.env.MODE;
- return mode === "production" ? path.join(__dirname, "../") : path.join(__dirname, "../../");
+ return mode === 'production' ? path.join(__dirname, '../') : path.join(__dirname, '../../');
};
-const __srcFolder = path.join(getProjectRootDir(), "/src");
+const __srcFolder = path.join(getProjectRootDir(), '/src');
/** */
export const getRelativeUrlByFilePath = (filepath) => {
- if (filepath) {
- return filepath.replace(__srcFolder, "");
- }
+ if (filepath) {
+ return filepath.replace(__srcFolder, '');
+ }
- return null;
+ return null;
};
diff --git a/src/utils/images.js b/src/utils/images.js
index e331d20..676820a 100644
--- a/src/utils/images.js
+++ b/src/utils/images.js
@@ -1,37 +1,37 @@
const load = async function () {
- let images = [];
- try {
- images = import.meta.glob("~/assets/images/**");
- } catch (e) {
- // continue regardless of error
- }
- return images;
+ let images = [];
+ try {
+ images = import.meta.glob('~/assets/images/**');
+ } catch (e) {
+ // continue regardless of error
+ }
+ return images;
};
let _images;
/** */
export const fetchLocalImages = async () => {
- _images = _images || load();
- return await _images;
+ _images = _images || load();
+ return await _images;
};
/** */
export const findImage = async (imagePath) => {
- if (typeof imagePath !== "string") {
- return null;
- }
+ if (typeof imagePath !== 'string') {
+ return null;
+ }
- if (imagePath.startsWith("http://") || imagePath.startsWith("https://")) {
- return imagePath;
- }
+ if (imagePath.startsWith('http://') || imagePath.startsWith('https://')) {
+ return imagePath;
+ }
- if (!imagePath.startsWith("~/assets")) {
- return null;
- } // For now only consume images using ~/assets alias (or absolute)
+ if (!imagePath.startsWith('~/assets')) {
+ return null;
+ } // For now only consume images using ~/assets alias (or absolute)
- const images = await fetchLocalImages();
- const key = imagePath.replace("~/", "/src/");
+ const images = await fetchLocalImages();
+ const key = imagePath.replace('~/', '/src/');
- return typeof images[key] === "function" ? (await images[key]())["default"] : null;
+ return typeof images[key] === 'function' ? (await images[key]())['default'] : null;
};
diff --git a/src/utils/permalinks.js b/src/utils/permalinks.js
index 5ac0f16..170f438 100644
--- a/src/utils/permalinks.js
+++ b/src/utils/permalinks.js
@@ -1,17 +1,17 @@
-import slugify from "limax";
+import slugify from 'limax';
-import { SITE, BLOG } from "~/config.mjs";
+import { SITE, BLOG } from '~/config.mjs';
const trim = (str, ch) => {
- let start = 0,
- end = str.length;
- while (start < end && str[start] === ch) ++start;
- while (end > start && str[end - 1] === ch) --end;
- return start > 0 || end < str.length ? str.substring(start, end) : str;
+ let start = 0,
+ end = str.length;
+ while (start < end && str[start] === ch) ++start;
+ while (end > start && str[end - 1] === ch) --end;
+ return start > 0 || end < str.length ? str.substring(start, end) : str;
};
-const trimSlash = (s) => trim(trim(s, "/"));
-const createPath = (...params) => "/" + params.filter((el) => !!el).join("/");
+const trimSlash = (s) => trim(trim(s, '/'));
+const createPath = (...params) => '/' + params.filter((el) => !!el).join('/');
const basePathname = trimSlash(SITE.basePathname);
@@ -22,26 +22,26 @@ export const CATEGORY_BASE = cleanSlug(BLOG?.category?.slug);
export const TAG_BASE = cleanSlug(BLOG?.tag?.slug);
/** */
-export const getCanonical = (path = "") => new URL(path, SITE.origin);
+export const getCanonical = (path = '') => new URL(path, SITE.origin);
/** */
-export const getPermalink = (slug = "", type = "page") => {
- const _slug = cleanSlug(slug);
+export const getPermalink = (slug = '', type = 'page') => {
+ const _slug = cleanSlug(slug);
- switch (type) {
- case "category":
- return createPath(basePathname, CATEGORY_BASE, _slug);
+ switch (type) {
+ case 'category':
+ return createPath(basePathname, CATEGORY_BASE, _slug);
- case "tag":
- return createPath(basePathname, TAG_BASE, _slug);
+ case 'tag':
+ return createPath(basePathname, TAG_BASE, _slug);
- case "post":
- return createPath(basePathname, BLOG.postsWithoutBlogSlug ? "" : BLOG_BASE, _slug);
+ case 'post':
+ return createPath(basePathname, BLOG.postsWithoutBlogSlug ? '' : BLOG_BASE, _slug);
- case "page":
- default:
- return createPath(basePathname, _slug);
- }
+ case 'page':
+ default:
+ return createPath(basePathname, _slug);
+ }
};
/** */
@@ -49,6 +49,6 @@ export const getBlogPermalink = () => getPermalink(BLOG_BASE);
/** */
export const getHomePermalink = () => {
- const permalink = getPermalink();
- return permalink !== "/" ? permalink + "/" : permalink;
+ const permalink = getPermalink();
+ return permalink !== '/' ? permalink + '/' : permalink;
};
diff --git a/src/utils/posts.js b/src/utils/posts.js
index bdef8f3..85c1749 100644
--- a/src/utils/posts.js
+++ b/src/utils/posts.js
@@ -1,66 +1,66 @@
-import getReadingTime from "reading-time";
+import getReadingTime from 'reading-time';
const getNormalizedPost = async (post) => {
- const { frontmatter, compiledContent, rawContent, file } = post;
- const ID = file.split("/").pop().split(".").shift();
+ const { frontmatter, compiledContent, rawContent, file } = post;
+ const ID = file.split('/').pop().split('.').shift();
- return {
- id: ID,
+ return {
+ id: ID,
- pubDate: frontmatter.pubDate,
- draft: frontmatter.draft,
+ pubDate: frontmatter.pubDate,
+ draft: frontmatter.draft,
- canonical: frontmatter.canonical,
- slug: frontmatter.slug || ID,
+ canonical: frontmatter.canonical,
+ slug: frontmatter.slug || ID,
- title: frontmatter.title,
- description: frontmatter.description,
- body: compiledContent(),
- image: frontmatter.image,
+ title: frontmatter.title,
+ description: frontmatter.description,
+ body: compiledContent(),
+ image: frontmatter.image,
- excerpt: frontmatter.excerpt,
- authors: frontmatter.authors,
- category: frontmatter.category,
- tags: frontmatter.tags,
- readingTime: Math.ceil(getReadingTime(rawContent()).minutes),
- };
+ excerpt: frontmatter.excerpt,
+ authors: frontmatter.authors,
+ category: frontmatter.category,
+ tags: frontmatter.tags,
+ readingTime: Math.ceil(getReadingTime(rawContent()).minutes),
+ };
};
const load = async function () {
- const posts = import.meta.glob("~/data/posts/**/*.md", {
- eager: true,
- });
+ const posts = import.meta.glob('~/data/posts/**/*.md', {
+ eager: true,
+ });
- const normalizedPosts = Object.keys(posts).map(async (key) => {
- const post = await posts[key];
- return await getNormalizedPost(post);
- });
+ const normalizedPosts = Object.keys(posts).map(async (key) => {
+ const post = await posts[key];
+ return await getNormalizedPost(post);
+ });
- const results = (await Promise.all(normalizedPosts))
- .sort((a, b) => new Date(b.pubDate).valueOf() - new Date(a.pubDate).valueOf())
- .filter((post) => !post.draft);
- return results;
+ const results = (await Promise.all(normalizedPosts))
+ .sort((a, b) => new Date(b.pubDate).valueOf() - new Date(a.pubDate).valueOf())
+ .filter((post) => !post.draft);
+ return results;
};
let _posts;
/** */
export const fetchPosts = async () => {
- _posts = _posts || load();
+ _posts = _posts || load();
- return await _posts;
+ return await _posts;
};
/** */
export const findPostsByIds = async (ids) => {
- if (!Array.isArray(ids)) return [];
+ if (!Array.isArray(ids)) return [];
- const posts = await fetchPosts();
+ const posts = await fetchPosts();
- return ids.reduce(function (r, id) {
- posts.some(function (post) {
- return id === post.id && r.push(post);
- });
- return r;
- }, []);
+ return ids.reduce(function (r, id) {
+ posts.some(function (post) {
+ return id === post.id && r.push(post);
+ });
+ return r;
+ }, []);
};
diff --git a/src/utils/utils.js b/src/utils/utils.js
index aae0b67..a873d1a 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -1,9 +1,9 @@
/** */
export const getFormattedDate = (date) =>
- date
- ? new Date(date).toLocaleDateString("en-us", {
- year: "numeric",
- month: "short",
- day: "numeric",
- })
- : "";
+ date
+ ? new Date(date).toLocaleDateString('en-us', {
+ year: 'numeric',
+ month: 'short',
+ day: 'numeric',
+ })
+ : '';
diff --git a/tailwind.config.cjs b/tailwind.config.cjs
index 6dc0f05..c3b2e83 100644
--- a/tailwind.config.cjs
+++ b/tailwind.config.cjs
@@ -1,21 +1,21 @@
-const defaultTheme = require("tailwindcss/defaultTheme");
-const colors = require("tailwindcss/colors")
+const defaultTheme = require('tailwindcss/defaultTheme');
+const colors = require('tailwindcss/colors');
module.exports = {
- content: ["./src/**/*.{astro,html,js,jsx,md,svelte,ts,tsx,vue}"],
- theme: {
- extend: {
- colors: {
- primary: colors.blue,
- secondary: colors.pink,
- },
- fontFamily: {
- sans: ["'InterVariable'", ...defaultTheme.fontFamily.sans],
- },
- },
- },
- plugins: [require("@tailwindcss/typography")],
- darkMode: "class",
+ content: ['./src/**/*.{astro,html,js,jsx,md,svelte,ts,tsx,vue}'],
+ theme: {
+ extend: {
+ colors: {
+ primary: colors.blue,
+ secondary: colors.pink,
+ },
+ fontFamily: {
+ sans: ["'InterVariable'", ...defaultTheme.fontFamily.sans],
+ },
+ },
+ },
+ plugins: [require('@tailwindcss/typography')],
+ darkMode: 'class',
};
/*
@@ -24,7 +24,7 @@ module.exports = {
NOTE: Add this fonts to
-*/
+*/
// module.exports = {
// content: ["./src/**/*.{astro,html,js,jsx,md,svelte,ts,tsx,vue}"],
@@ -41,4 +41,4 @@ module.exports = {
// },
// plugins: [require("@tailwindcss/typography")],
// darkMode: "class",
-// };
\ No newline at end of file
+// };