Compare commits

..

No commits in common. "main" and "v1.22.0-beta.1" have entirely different histories.

56 changed files with 7286 additions and 11264 deletions

View File

@ -1,256 +0,0 @@
declare module 'astro:content' {
interface Render {
'.mdx': Promise<{
Content: import('astro').MarkdownInstance<{}>['Content'];
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}>;
}
}
declare module 'astro:content' {
interface RenderResult {
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}
interface Render {
'.md': Promise<RenderResult>;
}
export interface RenderedContent {
html: string;
metadata?: {
imagePaths: Array<string>;
[key: string]: unknown;
};
}
}
declare module 'astro:content' {
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
export type CollectionKey = keyof AnyEntryMap;
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
export type ContentCollectionKey = keyof ContentEntryMap;
export type DataCollectionKey = keyof DataEntryMap;
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
ContentEntryMap[C]
>['slug'];
/** @deprecated Use `getEntry` instead. */
export function getEntryBySlug<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
entrySlug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
/** @deprecated Use `getEntry` instead. */
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
collection: C,
entryId: E,
): Promise<CollectionEntry<C>>;
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
collection: C,
filter?: (entry: CollectionEntry<C>) => entry is E,
): Promise<E[]>;
export function getCollection<C extends keyof AnyEntryMap>(
collection: C,
filter?: (entry: CollectionEntry<C>) => unknown,
): Promise<CollectionEntry<C>[]>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(entry: {
collection: C;
slug: E;
}): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(entry: {
collection: C;
id: E;
}): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
slug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(
collection: C,
id: E,
): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
/** Resolve an array of entry references from the same collection */
export function getEntries<C extends keyof ContentEntryMap>(
entries: {
collection: C;
slug: ValidContentEntrySlug<C>;
}[],
): Promise<CollectionEntry<C>[]>;
export function getEntries<C extends keyof DataEntryMap>(
entries: {
collection: C;
id: keyof DataEntryMap[C];
}[],
): Promise<CollectionEntry<C>[]>;
export function render<C extends keyof AnyEntryMap>(
entry: AnyEntryMap[C][string],
): Promise<RenderResult>;
export function reference<C extends keyof AnyEntryMap>(
collection: C,
): import('astro/zod').ZodEffects<
import('astro/zod').ZodString,
C extends keyof ContentEntryMap
? {
collection: C;
slug: ValidContentEntrySlug<C>;
}
: {
collection: C;
id: keyof DataEntryMap[C];
}
>;
// Allow generic `string` to avoid excessive type errors in the config
// if `dev` is not running to update as you edit.
// Invalid collection names will be caught at build time.
export function reference<C extends string>(
collection: C,
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
>;
type ContentEntryMap = {
"blog": {
"10-essential-web-development-tools-for-building-stunning-websites.mdx": {
id: "10-essential-web-development-tools-for-building-stunning-websites.mdx";
slug: "10-essential-web-development-tools-for-building-stunning-websites";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"benefits-of-headless-cms-development-with-directus.mdx": {
id: "benefits-of-headless-cms-development-with-directus.mdx";
slug: "benefits-of-headless-cms-development-with-directus";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"comparing-mvc-frameworks.mdx": {
id: "comparing-mvc-frameworks.mdx";
slug: "comparing-mvc-frameworks";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"debugging-tips-for-astrojs.mdx": {
id: "debugging-tips-for-astrojs.mdx";
slug: "debugging-tips-for-astrojs";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"dockerizing-front-end-development.mdx": {
id: "dockerizing-front-end-development.mdx";
slug: "dockerizing-front-end-development";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"essential-frontend-tools-for-astro-js-developers.mdx": {
id: "essential-frontend-tools-for-astro-js-developers.mdx";
slug: "essential-frontend-tools-for-astro-js-developers";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"exploring-nodejs-development-trends-2024.mdx": {
id: "exploring-nodejs-development-trends-2024.mdx";
slug: "exploring-nodejs-development-trends-2024";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"getting-started-with-astrojs.mdx": {
id: "getting-started-with-astrojs.mdx";
slug: "getting-started-with-astrojs";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"mastering-markdown.mdx": {
id: "mastering-markdown.mdx";
slug: "mastering-markdown";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"modern-web-frameworks-introduction.mdx": {
id: "modern-web-frameworks-introduction.mdx";
slug: "modern-web-frameworks-introduction";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"this-is-a-draft.mdx": {
id: "this-is-a-draft.mdx";
slug: "this-is-a-draft";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"top-10-ides-for-astrojs.mdx": {
id: "top-10-ides-for-astrojs.mdx";
slug: "top-10-ides-for-astrojs";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"unleasing-the-power-of-astro-js-for-better-web-development.mdx": {
id: "unleasing-the-power-of-astro-js-for-better-web-development.mdx";
slug: "unleasing-the-power-of-astro-js-for-better-web-development";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
};
};
type DataEntryMap = {
};
type AnyEntryMap = ContentEntryMap & DataEntryMap;
export type ContentConfig = typeof import("../../src/content/config.js");
}

1625
.astro/icon.d.ts vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
{
"_variables": {
"lastUpdateCheck": 1741386617926
}
}

208
.astro/types.d.ts vendored
View File

@ -1,2 +1,206 @@
/// <reference types="astro/client" />
/// <reference path="content.d.ts" />
declare module 'astro:content' {
interface Render {
'.mdx': Promise<{
Content: import('astro').MarkdownInstance<{}>['Content'];
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}>;
}
}
declare module 'astro:content' {
interface Render {
'.md': Promise<{
Content: import('astro').MarkdownInstance<{}>['Content'];
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}>;
}
}
declare module 'astro:content' {
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
export type CollectionKey = keyof AnyEntryMap;
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
export type ContentCollectionKey = keyof ContentEntryMap;
export type DataCollectionKey = keyof DataEntryMap;
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
ContentEntryMap[C]
>['slug'];
export function getEntryBySlug<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
entrySlug: E
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
collection: C,
entryId: E
): Promise<CollectionEntry<C>>;
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
collection: C,
filter?: (entry: CollectionEntry<C>) => entry is E
): Promise<E[]>;
export function getCollection<C extends keyof AnyEntryMap>(
collection: C,
filter?: (entry: CollectionEntry<C>) => unknown
): Promise<CollectionEntry<C>[]>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(entry: {
collection: C;
slug: E;
}): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(entry: {
collection: C;
id: E;
}): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
slug: E
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(
collection: C,
id: E
): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
/** Resolve an array of entry references from the same collection */
export function getEntries<C extends keyof ContentEntryMap>(
entries: {
collection: C;
slug: ValidContentEntrySlug<C>;
}[]
): Promise<CollectionEntry<C>[]>;
export function getEntries<C extends keyof DataEntryMap>(
entries: {
collection: C;
id: keyof DataEntryMap[C];
}[]
): Promise<CollectionEntry<C>[]>;
export function reference<C extends keyof AnyEntryMap>(
collection: C
): import('astro/zod').ZodEffects<
import('astro/zod').ZodString,
C extends keyof ContentEntryMap
? {
collection: C;
slug: ValidContentEntrySlug<C>;
}
: {
collection: C;
id: keyof DataEntryMap[C];
}
>;
// Allow generic `string` to avoid excessive type errors in the config
// if `dev` is not running to update as you edit.
// Invalid collection names will be caught at build time.
export function reference<C extends string>(
collection: C
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
>;
type ContentEntryMap = {
"blog": {
"10-essential-web-development-tools-for-building-stunning-websites.mdx": {
id: "10-essential-web-development-tools-for-building-stunning-websites.mdx";
slug: "10-essential-web-development-tools-for-building-stunning-websites";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"benefits-of-headless-cms-development-with-directus.mdx": {
id: "benefits-of-headless-cms-development-with-directus.mdx";
slug: "benefits-of-headless-cms-development-with-directus";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"comparing-mvc-frameworks.mdx": {
id: "comparing-mvc-frameworks.mdx";
slug: "comparing-mvc-frameworks";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"dockerizing-front-end-development.mdx": {
id: "dockerizing-front-end-development.mdx";
slug: "dockerizing-front-end-development";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"essential-frontend-tools-for-astro-js-developers.mdx": {
id: "essential-frontend-tools-for-astro-js-developers.mdx";
slug: "essential-frontend-tools-for-astro-js-developers";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"exploring-nodejs-development-trends-2024.mdx": {
id: "exploring-nodejs-development-trends-2024.mdx";
slug: "exploring-nodejs-development-trends-2024";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"modern-web-frameworks-introduction.mdx": {
id: "modern-web-frameworks-introduction.mdx";
slug: "modern-web-frameworks-introduction";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
"unleasing-the-power-of-astro-js-for-better-web-development.mdx": {
id: "unleasing-the-power-of-astro-js-for-better-web-development.mdx";
slug: "unleasing-the-power-of-astro-js-for-better-web-development";
body: string;
collection: "blog";
data: InferEntrySchema<"blog">
} & { render(): Render[".mdx"] };
};
};
type DataEntryMap = {
};
type AnyEntryMap = ContentEntryMap & DataEntryMap;
export type ContentConfig = typeof import("../src/content/config.js");
}

View File

@ -1 +1 @@
{ "src": { "assets": { "images": {} }, "pages": { "blog": {} } } }
{ "src": { "assets": { "images": {} } } }

View File

@ -1,150 +1,3 @@
# [1.29.0](https://github.com/deployn/astro-deploy/compare/v1.28.0...v1.29.0) (2025-03-08)
### Features
* add 404 page ([04cba4f](https://github.com/deployn/astro-deploy/commit/04cba4fa051b1c8958aa4dfe99266c56d0e8cf0b))
* **blog:** add redirect to 404 page if entry is not found ([6cd32df](https://github.com/deployn/astro-deploy/commit/6cd32df0eeadad3094cc35724961a4bbd5541eb0))
* **Dockerfile:** use Alpine base image and add healthcheck ([02e218d](https://github.com/deployn/astro-deploy/commit/02e218d1853c3c06d48bb3f8811564d910c61837))
# [1.29.0-beta.3](https://github.com/deployn/astro-deploy/compare/v1.29.0-beta.2...v1.29.0-beta.3) (2024-10-05)
### Features
* **blog:** add redirect to 404 page if entry is not found ([6cd32df](https://github.com/deployn/astro-deploy/commit/6cd32df0eeadad3094cc35724961a4bbd5541eb0))
# [1.29.0-beta.2](https://github.com/deployn/astro-deploy/compare/v1.29.0-beta.1...v1.29.0-beta.2) (2024-10-05)
### Features
* add 404 page ([04cba4f](https://github.com/deployn/astro-deploy/commit/04cba4fa051b1c8958aa4dfe99266c56d0e8cf0b))
# [1.29.0-beta.1](https://github.com/deployn/astro-deploy/compare/v1.28.0...v1.29.0-beta.1) (2024-10-04)
### Features
* **Dockerfile:** use Alpine base image and add healthcheck ([02e218d](https://github.com/deployn/astro-deploy/commit/02e218d1853c3c06d48bb3f8811564d910c61837))
# [1.28.0](https://github.com/deployn/astro-deploy/compare/v1.27.0...v1.28.0) (2024-09-13)
### Features
* **header:** improve mobile menu functionality and add navigation rail ([6fdffbe](https://github.com/deployn/astro-deploy/commit/6fdffbe5c631935cf79d8bf8b7d89df143bc4111))
# [1.27.0](https://github.com/deployn/astro-deploy/compare/v1.26.0...v1.27.0) (2024-04-12)
### Features
* **blog:** add additional frontmatter fields for dates, authors, image, draft ([6c81e94](https://github.com/deployn/astro-deploy/commit/6c81e942a6f78f999a81410c2e1494c0b72a58a7))
# [1.26.0](https://github.com/deployn/astro-deploy/compare/v1.25.3...v1.26.0) (2024-04-07)
### Features
* **blog:** add custom prose styling ([9a6ad69](https://github.com/deployn/astro-deploy/commit/9a6ad6937800c5b65f7c4b231eff07704f59153b))
## [1.25.3](https://github.com/deployn/astro-deploy/compare/v1.25.2...v1.25.3) (2024-04-06)
### Bug Fixes
* **index:** update index page ([665da2a](https://github.com/deployn/astro-deploy/commit/665da2a1a6572af3da63a6c584a3dcb17f781f89))
## [1.25.2](https://github.com/deployn/astro-deploy/compare/v1.25.1...v1.25.2) (2024-04-06)
### Bug Fixes
* **footer:** update footer ([96595ff](https://github.com/deployn/astro-deploy/commit/96595ff3d12407a32fe863cb7244dfcef3e8a136))
* **header:** remove logic to open menu automatically on wider screens ([7d7ee86](https://github.com/deployn/astro-deploy/commit/7d7ee869aea6b93c70e09f348f3e8c689abcbee6))
* **header:** update header ([10b42cd](https://github.com/deployn/astro-deploy/commit/10b42cd2ff717aa7896416989a89aac383482021))
## [1.25.1](https://github.com/deployn/astro-deploy/compare/v1.25.0...v1.25.1) (2024-03-20)
### Bug Fixes
* **layout:** Change default index and follow behavior ([63c4358](https://github.com/deployn/astro-deploy/commit/63c435809e64cfa7ef6ac66201cf1799194b7795))
# [1.25.0](https://github.com/deployn/astro-deploy/compare/v1.24.4...v1.25.0) (2024-03-15)
### Features
* **layout:** add noindex, nofollow options ([1730207](https://github.com/deployn/astro-deploy/commit/1730207b88eff59f9866339d66c34a905164ec45))
## [1.24.4](https://github.com/deployn/astro-deploy/compare/v1.24.3...v1.24.4) (2024-03-13)
### Bug Fixes
* **index:** fix sidescroll ([d7ba632](https://github.com/deployn/astro-deploy/commit/d7ba632d5d7339753f25bfb4ec16b13b950caa81))
## [1.24.3](https://github.com/deployn/astro-deploy/compare/v1.24.2...v1.24.3) (2024-03-12)
### Bug Fixes
* **blog:** avoid redirects in pagination ([76d8bec](https://github.com/deployn/astro-deploy/commit/76d8becfb31765546842f77a68458871fc21dddc))
* **blog:** show page in title ([d0d5552](https://github.com/deployn/astro-deploy/commit/d0d55524bae98becbd9cd16343f6823b2a75745f))
## [1.24.2](https://github.com/deployn/astro-deploy/compare/v1.24.1...v1.24.2) (2024-03-10)
### Bug Fixes
* add margin to recipe site ([02a3b86](https://github.com/deployn/astro-deploy/commit/02a3b86651289c264f3d6827ec6fd989c8aba494))
## [1.24.1](https://github.com/deployn/astro-deploy/compare/v1.24.0...v1.24.1) (2024-03-10)
### Bug Fixes
* **blog:** fix pagination for index blog page ([58b63fd](https://github.com/deployn/astro-deploy/commit/58b63fd69cb453f00a4012329547b8c3d7e498e6))
# [1.24.0](https://github.com/deployn/astro-deploy/compare/v1.23.1...v1.24.0) (2024-03-10)
### Features
* **blog:** add pagination ([e3c5b3f](https://github.com/deployn/astro-deploy/commit/e3c5b3f31fbf622afb31e74c4cf05591371b743b))
* **pagefind:** add search support to blog ([b18424b](https://github.com/deployn/astro-deploy/commit/b18424b921345f803f3575ebf550c6629c498737))
## [1.23.1](https://github.com/deployn/astro-deploy/compare/v1.23.0...v1.23.1) (2024-03-10)
### Bug Fixes
* fix darkmode after page transitions ([488fea3](https://github.com/deployn/astro-deploy/commit/488fea300ce3cc5dac625bb3d8f311dca1479b19))
# [1.23.0](https://github.com/deployn/astro-deploy/compare/v1.22.0...v1.23.0) (2024-03-10)
### Features
* **blog:** use expressive code ([4ced8dc](https://github.com/deployn/astro-deploy/commit/4ced8dc0f8baf66402812132b5b1b0cc6d7b96d8))
# [1.22.0](https://github.com/deployn/astro-deploy/compare/v1.21.0...v1.22.0) (2024-03-08)
### Features
* add view transitions ([769ccc4](https://github.com/deployn/astro-deploy/commit/769ccc451cdb99d7091d4a8951044b1336426fbe))
* **blog:** transition blogpost titles ([aece417](https://github.com/deployn/astro-deploy/commit/aece417bff6717db76e7db95d20f4fe222b3b4eb))
# [1.22.0-beta.2](https://github.com/deployn/astro-deploy/compare/v1.22.0-beta.1...v1.22.0-beta.2) (2024-03-08)
### Features
* **blog:** transition blogpost titles ([aece417](https://github.com/deployn/astro-deploy/commit/aece417bff6717db76e7db95d20f4fe222b3b4eb))
# [1.22.0-beta.1](https://github.com/deployn/astro-deploy/compare/v1.21.0...v1.22.0-beta.1) (2024-03-08)

View File

@ -1,15 +1,19 @@
# Build Stage
FROM node:22-slim AS build
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base AS build-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
FROM build-deps AS build
COPY . .
ARG SITE_URL
ENV SITE_URL=${SITE_URL}
@ -17,21 +21,10 @@ ARG DIRECTUS_URL
ENV DIRECTUS_URL=${DIRECTUS_URL}
RUN pnpm run build
# Runtime Stage
FROM nginx:1.25-alpine AS runtime
# Copy custom nginx config
COPY nginx/nginx.conf /etc/nginx/nginx.conf
# Copy built assets from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Add curl for healthchecks
RUN apk add --no-cache curl
# Healthcheck
HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/ || exit 1
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

21
LICENSE
View File

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

View File

@ -6,66 +6,49 @@ A custom Astro.js template
## Features
- 🚀 Astro.js 5 for modern web development.
- 🐳 Docker integration for consistent environments and easy deployment.
- 🍃 Tailwind CSS for utility-first styling and rapid UI development.
- ⚛️ React.js integration, enabling complex UI construction with ease.
- 🏔️ Alpine.js integration, bringing reactive and declarative magic to your markup.
- 📘 TypeScript support for safer code through static typing.
- 🖊️ MDX Blog, allowing JSX in markdown for interactive and dynamic content.
- 📄 Pagination for easier navigation through content.
- 🔍 Pagefind for quick and efficient search functionality within the project.
- 🔖 Frontmatter CMS for easy content management.
- 🐇 Directus CMS support, providing a headless CMS for flexible content management.
- ✒️ Expressive Code Blocks, enhancing readability and maintainability of code snippets.
- 🌓 Dark Mode support, offering seamless user experience between light and dark themes.
- 🌟 View Transitions, ensuring smooth navigation and enhanced user experience.
- 🛠 Custom Nginx Configuration, enabling advanced hosting and performance optimizations.
- 🎨 Shadcn/UI support for crafting beautiful, interactive UI components easily.
- 🗺 Dynamic Sitemap Generation, boosting SEO by ensuring all pages are discoverable.
- 📱 PWA Assets Generation for an app-like experience on mobile devices, including offline support.
- 💅 Prettier integration for consistent code formatting, ensuring a uniform coding style across the project.
- 🚀 Astro.js 4
- 🐳 Docker integration
- 🍃 Tailwind CSS
- 🖊️ MDX Blog
- 🐇 Directus CMS support
- ⚛️ React.js
- 🏔️ Alpine.js integration
- 📘 TypeScript
## Prerequisites
- Node.js (version 20 recommended)
- Docker (for deployment)
## Getting Started with This Template
## How to use this template
```sh
git clone https://github.com/deployn/astro-deploy new-astro-project
cd new-astro-project
```
To personalize:
- Update /public/logo.svg
- Update /public/site.webmanifest
- Update astro.config.mjs
- Update colors in tailwind.config.mjs
- Update /src/\*
- Replace `/public/logo.svg`
- Update `/public/site.webmanifest`
- Configure `astro.config.mjs`
- Customize colors in `tailwind.config.mjs`
- Modify content in `/src/\*` as needed
### Directus
### Opting Out of Directus
If you don't want to use Directus CMS:
If not using Directus CMS:
- Delete /src/lib/directus.ts
- Delete /src/pages/recipes.astro
- `pnpm remove @directus/sdk`
- Remove `/src/lib/directus.ts` and `/src/pages/recipes.astro`
- Run `pnpm remove @directus/sdk`
For Directus usage, ensure public view permission for necessary collections and `directus_fields` via the Directus dashboard and adjust `/src/lib/directus.ts` accordingly.
If you want to use Directus, make sure to grant the view permission to the public for the collection(s) you want to use and `directus_fields` in your Directus dashboard. Adjust the /src/lib/directus for your content.
### Add shadcn/ui components
Visit <https://ui.shadcn.com/docs/> for component documentation and the list of components
Visit <https://ui.shadcn.com/docs/> for a list of components
```sh
pnpm dlx shadcn-ui@latest add componentName
```
## Development & Deployment
### Start the Server
### Start the Development Server
Development Server:
```sh
npm i -g pnpm
@ -73,7 +56,7 @@ pnpm install
pnpm dev
```
### Production Build & Run
Production Build:
```sh
sudo docker build . --build-arg SITE_URL=https://example.com --build-arg DIRECTUS_URL=https://example.directus.com -t astro-deploy
@ -96,13 +79,10 @@ All commands are run from the root of the project, from a terminal:
| `pnpm run format` | Formats codebase using Prettier |
| `pnpm run commit` | Commits changes to version control |
## Acknowledgements & Resources
This project draws inspiration and knowledge from a wide array of sources:
## Acknowledgements
- [Astro.js Basic Example](https://github.com/withastro/astro/tree/main/examples/basics)
- [Astro.js Docs](https://docs.astro.build/)
- [Astro Cactus](https://github.com/chrismwilliams/astro-theme-cactus)
- [Astro Starter Kit](https://github.com/zankhq/astro-starter)
- [Directus](https://directus.io/)
- [Docker](https://www.docker.com/)
@ -119,14 +99,3 @@ This project draws inspiration and knowledge from a wide array of sources:
- [Tailwind CSS Docs](https://tailwindcss.com/docs/)
- [Typescipt](https://www.typescriptlang.org/)
- [Visual Studio Code](https://code.visualstudio.com/)
## Contributing
Any contributions you make are **greatly appreciated**.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue.
Don't forget to give the project a star! Thanks again!
## Demo
Live Demo: [Astro Deploy](https://astro.deployn.de)

View File

@ -4,7 +4,6 @@ import mdx from '@astrojs/mdx';
import react from '@astrojs/react';
import sitemap from '@astrojs/sitemap';
import tailwind from '@astrojs/tailwind';
import expressiveCode from 'astro-expressive-code';
import icon from 'astro-icon';
const SITE_URL = process.env.SITE_URL || 'https://astro.deployn.de';
const DIRECTUS_URL = process.env.DIRECTUS_URL || 'https://directus.astro.deployn.de';
@ -17,9 +16,6 @@ export default defineConfig({
},
integrations: [
alpinejs(),
expressiveCode({
themes: ['dracula', 'github-light'],
}),
icon(),
mdx(),
react(),

View File

@ -1,28 +1,26 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_vary on;
@ -34,33 +32,26 @@ http {
listen 80;
listen [::]:80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
port_in_redirect off;
location / {
try_files $uri $uri/ /index.html;
}
root /usr/share/nginx/html;
index index.html index.htm;
rewrite ^([^.]*[^/])$ $1/ permanent;
try_files $uri $uri/ $uri/index.html =404;
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff|woff2|eot|ttf|webp)$ {
expires 30d;
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|webp)$ {
expires 60d;
add_header Cache-Control "public, no-transform";
}
error_page 404 /404.html;
location = /404.html {
internal;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
internal;
root /usr/share/nginx/html;
}
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()";
}
}

View File

@ -1,13 +1,13 @@
{
"name": "astro-deploy",
"type": "module",
"version": "1.29.0",
"version": "1.22.0-beta.1",
"description": "A custom Astro.js template",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && pnpm run pwa:generate-assets && astro build && pagefind --site dist",
"build": "astro check && pnpm run pwa:generate-assets && astro build",
"preview": "astro preview",
"astro": "astro",
"pwa:generate-assets": "pwa-assets-generator --preset minimal-2023 public/logo.svg",
@ -15,53 +15,49 @@
"upgrade": "pnpm update --interactive --latest",
"commit": "cz"
},
"packageManager": "pnpm@9.8.0",
"dependencies": {
"@astrojs/alpinejs": "^0.4.0",
"@astrojs/check": "^0.9.4",
"@astrojs/mdx": "^4.1.0",
"@astrojs/react": "^4.2.1",
"@astrojs/sitemap": "^3.2.1",
"@astrojs/tailwind": "^5.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-slot": "^1.1.0",
"astro": "^5.4.2",
"astro-expressive-code": "^0.40.2",
"astro-icon": "^1.1.1"
"@astrojs/check": "^0.5.6",
"@astrojs/mdx": "^2.1.1",
"@astrojs/react": "^3.0.10",
"@astrojs/sitemap": "^3.1.1",
"@astrojs/tailwind": "^5.1.0",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-slot": "^1.0.2",
"astro": "^4.4.15",
"astro-icon": "^1.1.0"
},
"devDependencies": {
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/cz-commitlint": "^19.5.0",
"@directus/sdk": "^19.0.1",
"@iconify-json/line-md": "^1.2.1",
"@pagefind/default-ui": "^1.1.1",
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"@commitlint/cz-commitlint": "^19.0.3",
"@directus/sdk": "^15.0.2",
"@iconify-json/line-md": "^1.1.36",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@tailwindcss/typography": "^0.5.15",
"@types/alpinejs": "^3.13.10",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@vite-pwa/assets-generator": "^0.2.6",
"alpinejs": "^3.14.1",
"@tailwindcss/typography": "^0.5.10",
"@types/alpinejs": "^3.13.6",
"@types/react": "^18.2.64",
"@types/react-dom": "^18.2.21",
"@vite-pwa/assets-generator": "^0.2.4",
"alpinejs": "^3.13.6",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"commitizen": "^4.3.1",
"clsx": "^2.1.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"lucide-react": "^0.479.0",
"pagefind": "^1.1.1",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.6.8",
"pwa-asset-generator": "^6.3.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"semantic-release": "^24.1.1",
"sharp": "0.32.6",
"tailwind-merge": "^3.0.2",
"tailwindcss": "^3.4.11",
"lucide-react": "^0.350.0",
"prettier": "^3.2.5",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.12",
"pwa-asset-generator": "^6.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"semantic-release": "^23.0.2",
"sharp": "^0.33.2",
"tailwind-merge": "^2.2.1",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.6.2"
"typescript": "^5.4.2"
},
"config": {
"commitizen": {

14275
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
---
import { Image } from 'astro:assets';
interface Props {
title: string;
description: string;
image: ImageMetadata;
isReversed?: boolean;
}
const { title, description, image, isReversed = false } = Astro.props;
---
<section class="mx-auto max-w-7xl px-8 py-16 lg:py-24">
<div
class={`grid grid-cols-1 gap-12 lg:grid-cols-2 lg:gap-24 ${isReversed ? 'lg:flex-row-reverse' : ''}`}>
<div class={`flex items-center justify-center ${isReversed ? 'lg:order-2' : ''}`}>
<Image class="mx-auto max-h-96 w-full rounded-xl shadow-lg" src={image} alt={title} />
</div>
<div class={`flex flex-col gap-y-4 ${isReversed ? 'lg:order-1' : ''}`}>
<h2 class="text-center text-3xl font-bold text-zinc-900 dark:text-zinc-100 lg:text-left">
{title}
</h2>
<p class="text-lg text-zinc-800 dark:text-zinc-300">
{description}
</p>
</div>
</div>
</section>

View File

@ -22,7 +22,6 @@ export function ModeToggle() {
theme === 'dark' ||
(theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
document.documentElement.classList[isDark ? 'add' : 'remove']('dark');
document.documentElement.setAttribute('data-theme', isDark ? 'dracula' : 'github-light');
}, [theme]);
return (

View File

@ -1,185 +0,0 @@
---
import '@pagefind/default-ui/css/ui.css';
---
<site-search id="search" class="ms-auto">
<button
data-open-modal
disabled
class="flex h-9 w-9 items-center justify-center rounded-md ring-zinc-400 transition-all hover:ring-2">
<svg
aria-label="search"
class="h-7 w-7"
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="1.5">
<path stroke="none" d="M0 0h24v24H0z"></path>
<path d="M3 10a7 7 0 1 0 14 0 7 7 0 1 0-14 0M21 21l-6-6"></path>
</svg>
</button>
<dialog
aria-label="search"
class="bg-bgColor h-full max-h-full w-full max-w-full border border-zinc-400 shadow backdrop:backdrop-blur sm:mx-auto sm:mb-auto sm:mt-16 sm:h-max sm:max-h-[calc(100%-8rem)] sm:min-h-[15rem] sm:w-5/6 sm:max-w-[48rem] sm:rounded-md">
<div class="dialog-frame flex flex-col gap-4 p-6 pt-12 sm:pt-6">
<button
data-close-modal
class="ms-auto cursor-pointer rounded-md bg-zinc-200 p-2 font-semibold">
Close
</button>
{
import.meta.env.DEV ? (
<div class="mx-auto text-center">
<p>
Search is only available in production builds. <br />
Try building and previewing the site to test it out locally.
</p>
</div>
) : (
<div class="search-container">
<div id="deploy__search" />
</div>
)
}
</div>
</dialog>
</site-search>
<script>
class SiteSearch extends HTMLElement {
private openBtn: HTMLButtonElement;
private closeBtn: HTMLButtonElement;
private dialog: HTMLDialogElement;
private dialogFrame: HTMLDivElement;
constructor() {
super();
this.openBtn = this.querySelector<HTMLButtonElement>('button[data-open-modal]')!;
this.closeBtn = this.querySelector<HTMLButtonElement>('button[data-close-modal]')!;
this.dialog = this.querySelector('dialog')!;
this.dialogFrame = this.querySelector('.dialog-frame')!;
this.openBtn.addEventListener('click', this.openModal);
this.openBtn.disabled = false;
this.closeBtn.addEventListener('click', this.closeModal);
}
connectedCallback() {
// Listen for keyboard shortcut
window.addEventListener('keydown', this.onWindowKeydown);
// only add pagefind in production
if (import.meta.env.DEV) return;
const onIdle = window.requestIdleCallback || ((cb) => setTimeout(cb, 1));
onIdle(async () => {
const { PagefindUI } = await import('@pagefind/default-ui');
new PagefindUI({
element: '#deploy__search',
baseUrl: import.meta.env.BASE_URL,
bundlePath: import.meta.env.BASE_URL.replace(/\/$/, '') + '/pagefind/',
showImages: false,
showSubResults: true,
});
});
}
disconnectedCallback() {
window.removeEventListener('keydown', this.onWindowKeydown);
}
onWindowClick = (event: MouseEvent) => {
// check if it's a link
const isLink = 'href' in (event.target || {});
// make sure the click is either a link or outside of the dialog
if (
isLink ||
(document.body.contains(event.target as Node) &&
!this.dialogFrame.contains(event.target as Node))
)
this.closeModal();
};
onWindowKeydown = (e: KeyboardEvent) => {
// check if it's the / key
if (e.key === '/' && !this.dialog.open) {
this.openModal();
e.preventDefault();
}
};
openModal = (event?: MouseEvent) => {
this.dialog.showModal();
this.querySelector('input')?.focus();
event?.stopPropagation();
window.addEventListener('click', this.onWindowClick);
};
closeModal = () => {
if (this.dialog.open) {
this.dialog.close();
window.removeEventListener('click', this.onWindowClick);
}
};
}
customElements.define('site-search', SiteSearch);
</script>
<style is:global>
:root {
--pagefind-ui-font: inherit;
}
#deploy__search .pagefind-ui__search-clear {
width: calc(60px * var(--pagefind-ui-scale));
padding: 0;
background-color: transparent;
overflow: hidden;
}
#deploy__search .pagefind-ui__search-clear:focus {
outline: 1px solid;
}
#deploy__search .pagefind-ui__search-clear::before {
content: '';
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' %3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'%3E%3C/path%3E%3C/svg%3E")
center / 60% no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' %3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'%3E%3C/path%3E%3C/svg%3E")
center / 60% no-repeat;
display: block;
width: 100%;
height: 100%;
}
#deploy__search .pagefind-ui__result {
border: 0;
}
#search .pagefind-ui__result-link {
background-size: 100% 6px;
background-position: bottom;
background-repeat: repeat-x;
background-image: linear-gradient(transparent, transparent 5px);
}
#deploy__search .pagefind-ui__result-link:hover {
text-decoration: none;
background-image: linear-gradient(transparent, transparent 4px);
}
#search mark {
background-color: transparent;
font-weight: 600;
}
</style>
<style>
#deploy__search {
--pagefind-ui-border: theme('colors.zinc.400');
--pagefind-ui-border-width: 1px;
}
</style>

View File

@ -2,37 +2,20 @@
import { Icon } from 'astro-icon/components';
---
<footer class="bg-gray-100 py-12 pb-20 dark:bg-gray-800 sm:pb-12">
<div class="mx-auto w-full max-w-7xl px-8">
<div class="flex flex-col items-center justify-between gap-8 md:flex-row">
<div>
<p
class="mb-2 text-center text-base font-normal text-zinc-900 antialiased dark:text-zinc-100 md:text-left">
© 2024
<a href="/" class="hover:text-blue-500">Astro Deploy</a>. All Rights Reserved.
</p>
<nav class="flex flex-wrap justify-center gap-4 md:justify-start">
<a href="/sitemap-index.xml" class="text-zinc-900 hover:text-blue-500 dark:text-zinc-100">
Sitemap
</a>
</nav>
</div>
<div class="flex flex-col items-center gap-4 md:flex-row">
<div class="flex gap-4 text-zinc-900 dark:text-zinc-100">
<a
href="mailto:astro@deployn.de"
class="block text-base font-light leading-relaxed text-inherit antialiased opacity-80 transition-opacity hover:opacity-100"
aria-label="Email">
<Icon name="line-md:email" class="size-5" fill="currentColor" aria-hidden="true" />
</a>
<a
href="https://github.com/deployn/astro-deploy"
class="block text-base font-light leading-relaxed text-inherit antialiased opacity-80 transition-opacity hover:opacity-100"
aria-label="GitHub Repository">
<Icon name="line-md:github" class="size-5" fill="currentColor" aria-hidden="true" />
</a>
</div>
</div>
<div class="mx-auto w-full max-w-7xl px-8">
<div
class="flex w-full flex-col items-center justify-center border-t border-zinc-50 py-4 dark:border-zinc-900 md:flex-row md:justify-between">
<p
class="mb-4 block text-center font-sans text-sm font-normal leading-normal text-zinc-900 antialiased dark:text-zinc-100 md:mb-0">
© 2024
<a href="/">Astro Deploy</a>. All Rights Reserved.
</p><div class="flex gap-4 text-zinc-900 dark:text-zinc-100 sm:justify-center">
<a
href="https://github.com/deployn/astro-deploy"
class="block font-sans text-base font-light leading-relaxed text-inherit antialiased opacity-80 transition-opacity hover:opacity-100"
aria-label="GitHub Repository">
<Icon name="line-md:github" class="size-5" fill="currentColor" aria-hidden="true" />
</a>
</div>
</div>
</footer>
</div>

View File

@ -2,33 +2,25 @@
import { Image } from 'astro:assets';
import { ModeToggle } from '@/components/ModeToggle';
import HeaderLink from './HeaderLink.astro';
import { Icon } from 'astro-icon/components';
import logoImage from '@/assets/images/logo.png';
const navLinks = [
{ href: '/', label: 'Home', icon: 'line-md:home' },
{ href: '/blog/', label: 'Blog', icon: 'line-md:document-list' },
{ href: '/recipes/', label: 'Recipes', icon: 'line-md:clipboard-list' },
{ href: '/', label: 'Home' },
{ href: '/blog/', label: 'Blog' },
{ href: '/recipes/', label: 'Recipes' },
];
const getThemePreference = () => {
if (typeof localStorage !== 'undefined' && localStorage.getItem('theme')) {
return localStorage.getItem('theme');
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
};
const setTheme = (document: Document) => {
const theme = getThemePreference();
document.documentElement.setAttribute('data-theme', theme ?? '');
document.documentElement.classList.toggle('dark', theme === 'dark');
};
---
<script define:vars={{ setTheme }} is:inline>
<script is:inline>
const getThemePreference = () => {
if (typeof localStorage !== 'undefined' && localStorage.getItem('theme')) {
return localStorage.getItem('theme');
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
};
const isDark = getThemePreference() === 'dark';
document.documentElement.classList.toggle('dark', isDark);
document.documentElement.classList[isDark ? 'add' : 'remove']('dark');
if (typeof localStorage !== 'undefined') {
const observer = new MutationObserver(() => {
@ -37,113 +29,102 @@ const setTheme = (document: Document) => {
});
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] });
}
setTheme(document);
document.addEventListener('astro:before-swap', (ev) => {
setTheme(ev.newDocument);
});
</script>
<header
class="sticky top-0 z-10 block h-16 w-full max-w-full rounded-none border border-white/80 bg-opacity-80 px-4 text-black shadow-md backdrop-blur-2xl backdrop-saturate-200 dark:border-black/80 dark:bg-zinc-900 lg:px-8">
<div class="flex h-full items-center justify-between text-zinc-900 dark:text-zinc-100">
<button id="navToggle" class="hidden sm:block md:hidden" aria-label="Toggle navigation">
<Icon name="line-md:menu" class="h-6 w-6" />
</button>
x-data={`{
open: window.innerWidth < 640 ? false : true,
windowWidth: window.innerWidth,
init() {
this.$watch('windowWidth', value => {
this.open = value < 640 ? false : true;
});
window.addEventListener('resize', () => {
this.$nextTick(() => {
this.windowWidth = window.innerWidth;
});
});
}
}`}
x-init="init()"
class="sticky top-0 z-10 block h-max w-full max-w-full rounded-none border border-white/80 bg-opacity-80 px-4 py-2 text-black shadow-md backdrop-blur-2xl backdrop-saturate-200 dark:border-black/80 dark:bg-zinc-900 lg:px-8 lg:py-4">
<div class="flex items-center justify-between text-zinc-900 dark:text-zinc-100">
<a
href="/"
class="mr-4 block cursor-pointer py-1.5 font-sans text-base font-semibold leading-relaxed text-inherit antialiased lg:ml-2">
<div class="flex items-center gap-2 lg:gap-4">
<Image src={logoImage} alt="Astro Deploy" class="size-10 lg:size-14" loading="eager" />
<span class="hidden sm:inline">Astro Deploy</span>
<Image
src={logoImage}
alt="Astro Deploy"
class="-my-2 size-10 lg:-my-4 lg:size-14"
loading="eager"
/>
Astro Deploy
</div>
</a>
<nav class="hidden items-center space-x-4 md:flex">
<div class="hidden sm:block">
<nav
class="mb-6 mt-4 flex min-w-60 flex-col gap-1 p-0 font-sans text-base font-normal text-zinc-700 dark:text-zinc-300 sm:mb-0 sm:mt-0 sm:flex-row sm:p-1">
{
navLinks.map(({ href, label }) => (
<HeaderLink
href={href}
class="block w-full rounded-lg px-4 py-2 text-center font-sans text-sm leading-normal text-zinc-900 antialiased transition-all hover:bg-zinc-50 dark:text-zinc-100 dark:hover:bg-zinc-950 md:text-xl">
{label}
</HeaderLink>
))
}
</nav>
</div>
<div class="flex">
<button
class="relative h-10 w-10 text-gray-500 focus:outline-none sm:hidden"
aria-controls="menu"
@click="open = !open">
<span class="sr-only">Open main menu</span>
<span
class="absolute left-1/2 top-1/2 block w-5 -translate-x-1/2 -translate-y-1/2 transform">
<span
aria-hidden="true"
class="absolute block h-0.5 w-5 transform bg-current transition duration-200 ease-in-out"
:class="{'rotate-45': open,' -translate-y-1.5': !open }">
</span>
<span
aria-hidden="true"
class="absolute block h-0.5 w-5 transform bg-current transition duration-200 ease-in-out"
:class="{'opacity-0': open } ">
</span>
<span
aria-hidden="true"
class="absolute block h-0.5 w-5 transform bg-current transition duration-200 ease-in-out"
:class="{'-rotate-45': open, ' translate-y-1.5': !open}">
</span>
</span>
</button>
<ModeToggle client:load />
</div>
</div>
<div class="block w-full basis-full overflow-hidden sm:hidden">
<nav
id="menu"
:class="{'flex': open, 'hidden': !open}"
x-show="open"
x-transition:enter="transition ease-out duration-200"
x-transition:enter-start="opacity-0 transform scale-90"
x-transition:enter-end="opacity-100 transform scale-100"
x-transition:leave="transition ease-in duration-200"
x-transition:leave-start="opacity-100 transform scale-100"
x-transition:leave-end="opacity-0 transform scale-90"
class="mb-6 mt-4 hidden min-w-60 flex-col gap-1 p-0 font-sans text-base font-normal text-zinc-700 dark:text-zinc-300 sm:mb-0 sm:mt-0 sm:block sm:flex-row sm:p-1">
{
navLinks.map(({ href, label }) => (
<HeaderLink
href={href}
class="block rounded-lg px-4 py-2 text-center font-sans text-sm leading-normal text-zinc-900 antialiased transition-all hover:bg-zinc-50 dark:text-zinc-100 dark:hover:bg-zinc-950 md:text-xl">
class="flex w-full items-center gap-2 rounded-lg p-3 py-2 pr-4 text-start font-sans text-sm font-medium leading-tight text-zinc-900 antialiased outline-none transition-all hover:bg-zinc-50 hover:bg-opacity-80 hover:text-zinc-900 focus:bg-zinc-50 focus:bg-opacity-80 focus:text-zinc-900 active:bg-zinc-50 active:bg-opacity-80 active:text-zinc-900 dark:text-zinc-100">
{label}
</HeaderLink>
))
}
</nav>
<div class="flex items-center">
<ModeToggle client:load />
</div>
</div>
</header>
<!-- Navigation Rail -->
<nav
id="navRail"
class="fixed bottom-0 left-0 top-16 z-40 hidden w-16 flex-col items-center justify-start space-y-4 bg-white pt-4 shadow-md transition-transform duration-300 ease-in-out dark:bg-zinc-900 sm:flex md:hidden">
{
navLinks.map(({ href, label, icon }) => (
<HeaderLink
href={href}
class="group flex flex-col items-center justify-center p-2 hover:bg-gray-100 dark:hover:bg-zinc-800">
<Icon
name={icon}
class="mb-1 h-6 w-6 text-gray-500 group-hover:text-blue-600 dark:text-gray-400 dark:group-hover:text-blue-500"
/>
<span class="text-xs text-gray-500 group-hover:text-blue-600 dark:text-gray-400 dark:group-hover:text-blue-500">
{label}
</span>
</HeaderLink>
))
}
</nav>
<!-- Mobile Bottom Navigation -->
<nav
class="fixed bottom-0 left-0 z-50 h-16 w-full border-t border-gray-200 bg-white dark:border-gray-600 dark:bg-zinc-900 sm:hidden">
<div class="mx-auto grid h-full max-w-lg grid-cols-3">
{
navLinks.map(({ href, label, icon }) => (
<HeaderLink
href={href}
class="group inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-zinc-800">
<Icon
name={icon}
class="mb-1 h-6 w-6 text-gray-500 group-hover:text-blue-600 dark:text-gray-400 dark:group-hover:text-blue-500"
/>
<span class="text-xs text-gray-500 group-hover:text-blue-600 dark:text-gray-400 dark:group-hover:text-blue-500">
{label}
</span>
</HeaderLink>
))
}
</div>
</nav>
<script>
function setupNavigation() {
const navToggle = document.getElementById('navToggle');
const navRail = document.getElementById('navRail');
const mainContent = document.querySelector('main');
function toggleNavRail() {
navRail?.classList.toggle('-translate-x-full');
mainContent?.classList.toggle('sm:pl-16');
mainContent?.classList.toggle('sm:pl-0');
}
navToggle?.addEventListener('click', toggleNavRail);
// Check if we're on a secondary page and hide the rail if necessary
if (document.body.classList.contains('secondary-page')) {
navRail?.classList.add('-translate-x-full');
mainContent?.classList.remove('sm:pl-16');
mainContent?.classList.add('sm:pl-0');
}
}
// Run the setup on initial load
setupNavigation();
// Re-run the setup after each navigation
document.addEventListener('astro:after-swap', setupNavigation);
</script>

View File

@ -1,15 +1,8 @@
---
const { pathname } = Astro.url;
const { class: className = '', href, ...props } = Astro.props;
function isActiveLink(linkPath: string, currentPath: string) {
return (
linkPath === currentPath ||
linkPath === (currentPath.endsWith('/') ? currentPath.slice(0, -1) : currentPath)
);
}
const isActive = isActiveLink(href, pathname);
const isActive =
href === pathname || href === (pathname.endsWith('/') ? pathname.slice(0, -1) : pathname);
---
<a

View File

@ -1,95 +0,0 @@
import * as React from 'react';
import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
import { cn } from '@/lib/utils';
import { type ButtonProps, buttonVariants } from '@/components/ui/button';
const Pagination = ({ className, ...props }: React.ComponentProps<'nav'>) => (
<nav
role="navigation"
aria-label="pagination"
className={cn('mx-auto flex w-full justify-center', className)}
{...props}
/>
);
Pagination.displayName = 'Pagination';
const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'>>(
({ className, ...props }, ref) => (
<ul ref={ref} className={cn('flex flex-row items-center gap-1', className)} {...props} />
)
);
PaginationContent.displayName = 'PaginationContent';
const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(
({ className, ...props }, ref) => <li ref={ref} className={cn('', className)} {...props} />
);
PaginationItem.displayName = 'PaginationItem';
type PaginationLinkProps = {
isActive?: boolean;
} & Pick<ButtonProps, 'size'> &
React.ComponentProps<'a'>;
const PaginationLink = ({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) => (
<a
aria-current={isActive ? 'page' : undefined}
className={cn(
buttonVariants({
variant: isActive ? 'outline' : 'ghost',
size,
}),
className
)}
{...props}
/>
);
PaginationLink.displayName = 'PaginationLink';
const PaginationPrevious = ({
className,
...props
}: React.ComponentProps<typeof PaginationLink>) => (
<PaginationLink
aria-label="Go to previous page"
size="default"
className={cn('gap-1 pl-2.5', className)}
{...props}>
<ChevronLeft className="h-4 w-4" />
<span>Previous</span>
</PaginationLink>
);
PaginationPrevious.displayName = 'PaginationPrevious';
const PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
<PaginationLink
aria-label="Go to next page"
size="default"
className={cn('gap-1 pr-2.5', className)}
{...props}>
<span>Next</span>
<ChevronRight className="h-4 w-4" />
</PaginationLink>
);
PaginationNext.displayName = 'PaginationNext';
const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
<span
aria-hidden
className={cn('flex h-9 w-9 items-center justify-center', className)}
{...props}>
<MoreHorizontal className="h-4 w-4" />
<span className="sr-only">More pages</span>
</span>
);
PaginationEllipsis.displayName = 'PaginationEllipsis';
export {
Pagination,
PaginationContent,
PaginationEllipsis,
PaginationItem,
PaginationLink,
PaginationNext,
PaginationPrevious,
};

View File

@ -1,10 +1,6 @@
---
title: '10 Essential Web Development Tools'
description: 'Discover the must-have tools that will take your web development skills to the next level and help you create websites that shine in the digital landscape.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-03'
dateModified: '2024-03-04'
image: './10-essential-web-development-tools-for-building-stunning-websites.png'
---
Are you ready to elevate your web development game and build stunning websites that captivate your audience? In this blog post, we're diving into the world of web development tools that are essential for creating top-notch websites. From front-end tools that help you craft interactive user interfaces to backend tools that ensure seamless functionality, we've got you covered. Discover how optimization tools can boost your website's performance, visual design tools can make your site stand out, and collaborative tools can streamline your projects for maximum efficiency. Stay tuned as we unveil the must-have tools that will take your web development skills to the next level and help you create websites that shine in the digital landscape

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,9 +1,6 @@
---
title: 'Benefits of Headless CMS: Development with Directus'
description: 'Discover how Directus flexibility, scalability, and omnichannel content delivery can enhance your web projects.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-08'
image: './benefits-of-headless-cms-development-with-directus.png'
---
In the ever-evolving world of web development, finding the right tools to streamline content management while delivering a seamless user experience is paramount. Enter the realm of Headless Content Management Systems (CMS), where Directus stands out as a beacon of flexibility and efficiency. This blog post delves into the myriad benefits of adopting Directus for your headless CMS needs.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,9 +1,6 @@
---
title: 'Comparing MVC Frameworks'
description: 'A detailed comparison of popular MVC frameworks and their use cases in web development.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-04'
image: './comparing-mvc-frameworks.png'
---
When it comes to web development, choosing the right framework can make all the difference. MVC (Model-View-Controller) frameworks have become a popular choice due to their structured approach to building applications. This blog post dives into some of the most popular MVC frameworks, comparing their features, performance, and use cases to help you make an informed decision.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,46 +0,0 @@
---
title: Debugging Tips for Astro.js Applications
description: 'Learn efficient debugging techniques tailored for Astro.js apps.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-10'
image: './debugging-tips-for-astrojs.png'
---
Debugging is an essential skill for developers, and when working with Astro.js applications, having efficient debugging techniques can save you time and frustration. In this blog post, we will explore some valuable tips to help you debug your Astro.js projects effectively.
## Key Takeaways
| Tip | Description |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Utilize Astro Devtools | Use Astro Devtools to inspect components, track state changes, and debug your application easily. |
| Console.log Strategically | Place strategic console.log statements in your code to track variables, function outputs, and pinpoint issues quickly. |
| Check Dependencies Versions | Ensure your package dependencies are up to date to avoid compatibility issues that could lead to bugs in your Astro.js app. |
| Use Breakpoints in VS Code | Leverage breakpoints in VS Code to pause execution at specific points in your code and analyze the program's state during runtime. |
| Test with Different Browsers | Test your Astro.js app on various browsers to catch any browser-specific bugs that may arise and ensure cross-browser compatibility. |
## 1. Utilize Astro Devtools
Astro Devtools is a powerful tool that allows you to inspect components, track state changes, and debug your Astro.js application effectively. By utilizing Astro Devtools, you can streamline the debugging process and gain insights into the inner workings of your app.
## 2. Console.log Strategically
Strategic placement of console.log statements can be a lifesaver when debugging your Astro.js application. By logging variables, function outputs, or specific states, you can trace the flow of your code and identify potential issues swiftly.
```javascript
// Example of using console.log to debug
console.log('Variable x:', x);
```
## 3. Check Dependencies Versions
Keeping your package dependencies up to date is crucial to prevent compatibility issues that could introduce bugs into your Astro.js project. Regularly check for updates and ensure all dependencies are compatible with the latest version of Astro.js.
## 4. Use Breakpoints in VS Code
VS Code offers a powerful debugging feature with breakpoints that allow you to pause execution at specific points in your code. By setting breakpoints strategically, you can analyze the program's state at runtime and pinpoint bugs more efficiently.
## 5. Test with Different Browsers
Testing your Astro.js application on various browsers is essential to ensure cross-browser compatibility and catch any browser-specific bugs that may arise. By testing on different browsers, you can identify and resolve issues before they impact the user experience.
By incorporating these debugging tips into your workflow, you can enhance your debugging skills and troubleshoot your Astro.js applications more effectively. Remember, debugging is a fundamental aspect of software development, and mastering these techniques will make you a more efficient and productive developer. Happy debugging!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,9 +1,6 @@
---
title: 'Dockerizing Front-End Development'
description: 'A comprehensive guide on Dockerizing front-end development environments for consistent and portable setups.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-04'
image: './dockerizing-front-end-development.png'
---
In the dynamic world of front-end development, ensuring consistency and portability across different environments can often be a challenge. Docker, a powerful tool for creating, deploying, and running applications by using containers, offers a solution to this problem. This blog post delves into the nitty-gritty of dockerizing your front-end development environment to enhance productivity and ensure a seamless workflow.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,10 +1,6 @@
---
title: 'Essential Frontend Tools for Astro.js Developers'
description: 'Discover the essential frontend tools every Astro.js developer should consider integrating into their development process.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-03'
dateModified: '2024-03-04'
image: './essential-frontend-tools-for-astro-js-developers.png'
---
Astro.js has rapidly become a favorite among developers for building fast, modern web applications. Its unique approach to loading only the necessary JavaScript has paved the way for optimized performance and better user experiences. As an Astro.js developer, having a toolkit filled with essential frontend tools can significantly streamline your workflow and enhance your project's quality. In this blog post, we'll explore those indispensable tools every Astro.js developer should consider integrating into their development process.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,10 +1,6 @@
---
title: 'Exploring the Latest Node.js Development Trends in 2024'
description: 'Explore the latest trends in Node.js development that are shaping the future of web and application development.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-03'
dateModified: '2024-03-04'
image: './exploring-nodejs-development-trends-2024.png'
---
The landscape of Node.js development is always evolving, with each year bringing new trends, tools, and best practices. As we delve into 2024, it's crucial for developers and businesses alike to stay ahead of the curve. In this blog post, we'll explore the latest trends in Node.js development that are shaping the future of web and application development.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,112 +0,0 @@
---
title: Getting Started with Astro.js
description: An introductory guide to Astro.js, setting up your development environment.
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-10'
image: './getting-started-with-astrojs.png'
---
Welcome to the world of Astro.js, where building fast, modern websites is more accessible than ever before! Whether you're a seasoned web developer or just dipping your toes into web development, Astro.js offers a unique approach to building websites that are performant, SEO-friendly, and enjoyable to create. In this beginner's guide, we'll walk you through the basics of Astro.js, setting up your development environment, and crafting your first page. Let's dive in!
## Key Takeaways
| Key Points | Details |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| What is Astro.js? | A modern frontend framework for building fast, static websites using components from your favorite JavaScript frameworks. |
| Installation Requirements | Node.js version 18.14.1 or higher. |
| Creating Your First Project | Use `npm create astro@latest` command in your terminal. |
| Development Server | Run `npm start` to launch a local development server. |
| Building Your Site | Execute `npm run build` to generate a static build of your site. |
| Adding Framework Components | Astro supports React, Vue, Svelte, and more with easy integration. |
| Styling Options | Utilize Tailwind CSS, vanilla CSS, or pre-processors like SCSS. |
Astro.js is designed with performance and developer experience in mind. It allows you to write your UI using components from various frameworks (or none at all!) and render them to static HTML at build time.
## Setting Up Your Development Environment
To get started with Astro.js, you'll need Node.js installed on your computer. If you haven't already, download and install Node.js (version 14.15.0 or higher) from [nodejs.org](https://nodejs.org).
Once Node.js is installed, open your terminal and run the following command to create a new Astro project:
```bash
npm create astro@latest
```
Follow the prompts in your terminal to customize your new project.
## Launching Your Development Server
Navigate into your new project directory and start the development server:
```bash
cd my-astro-project
npm install
npm start
```
This command will compile your project and serve it on a local development server, usually at `http://localhost:4321`. You can view your site by opening this URL in a web browser.
## Building Your First Page
Astro uses a file-based routing system. To create a new page, simply add a `.astro` file in the `src/pages/` directory. Here's a quick example:
**src/pages/index.astro**
```astro
---
// Frontmatter script space
---
<html>
<head>
<title>My Astro Website</title>
</head>
<body>
<h1>Hello, Astro!</h1>
</body>
</html>
```
This code defines a basic HTML structure for your home page with a greeting message.
## Adding Components
Astro allows you to integrate components from other frameworks like React or Vue easily. For example, to use React components, first install the necessary dependencies:
```bash
npx astro add react
```
Then, you can import React components into your .astro files and use them alongside traditional HTML elements.
**Example:**
```astro
---
import MyReactComponent from '../components/MyReactComponent.jsx';
---
<div>
<MyReactComponent />
</div>
```
## Styling Your Site
Astro supports various styling options, including Tailwind CSS, which can be easily integrated into your project for rapid styling development.
To add Tailwind CSS, first install the necessary dependencies:
```bash
npx astro add tailwind
```
Then follow the setup instructions in the Astro documentation to configure Tailwind CSS for your project.
## Conclusion
Congratulations! You've just set up your development environment and created your first page with Astro.js. From here, you can explore adding more pages, integrating components from your favorite JavaScript frameworks, and experimenting with different styling options to make your website uniquely yours.
Astro.js offers an exciting approach to building modern websites that are optimized for performance right out of the box. With its support for various front-end frameworks and styling solutions, Astro.js provides the flexibility to build websites that meet today's standards for speed, SEO, and user experience.
Start building with Astro.js today and see what you can create!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,263 +0,0 @@
---
title: 'Mastering Markdown: A Guide to Essential Elements'
description: 'Master the essential Markdown elements to create engaging, well-structured content. Learn headings, emphasis, lists, links, and more.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-04-07'
dateModified: '2024-04-14'
image: './mastering-markdown.png'
---
## Introduction to Markdown
Markdown is a lightweight markup language that allows you to format text easily and quickly. It's widely used for creating web content, documentation, and even e-books. In this article, we'll dive deep into the world of Markdown and explore its many features and benefits.
Markdown was created by John Gruber in 2004 with the goal of making it easy to write and read formatted text. It has since become a popular choice for writers, developers, and content creators due to its simplicity and versatility.
## Why Use Markdown?
There are many reasons why you should consider using Markdown for your writing needs:
1. It's easy to learn and use
2. It's portable and can be used across different platforms
3. It produces clean and readable output
4. It's fast and efficient
5. It's widely supported by many applications and tools
Markdown allows you to focus on writing your content without worrying about complex formatting or layout. You can quickly add headings, lists, links, images, and more with just a few simple characters.
## Basic Markdown Syntax
To get started with Markdown, you need to know some basic syntax. Here are some of the most commonly used Markdown elements:
| Element | Syntax |
| -------------- | ---------------------------------- |
| Heading | `# H1, ## H2, ### H3` |
| Bold | `**bold text**` |
| Italic | `_italicized text_` |
| Link | `[link text](https://example.com)` |
| Image | `![alt text](image.jpg)` |
| Blockquote | `> blockquote` |
| Ordered List | `1. First item` |
| Unordered List | `- First item` |
| Code | `` `code` `` |
These are just a few examples of what you can do with Markdown. As you become more comfortable with the syntax, you'll discover many more ways to format your text and create rich, engaging content.
## Headings
Headings are used to create a hierarchy in your document. In Markdown, you can create headings using the `#` symbol followed by a space and the heading text. The number of `#` symbols determines the level of the heading. For example:
```text
# Heading 1
## Heading 2
### Heading 3
```
## Emphasis
To emphasize text, you can use asterisks or underscores. A single asterisk or underscore will create _italic_ text, while double asterisks or underscores will create **bold** text. For example:
```markdown
_This text is italic_
**This text is bold**
```
## Lists
Markdown supports both ordered and unordered lists. To create an unordered list, use asterisks, plus signs, or hyphens. For an ordered list, use numbers followed by periods. For example:
```markdown
- Item 1
- Item 2
- Item 3
1. First item
2. Second item
3. Third item
```
Unordered list:
- Item 1
- Item 2
- Item 3
Ordered list:
1. First item
2. Second item
3. Third item
## Links
To create a link, enclose the link text in square brackets and the URL in parentheses. You can create internal links to other sections of your document by using the following syntax:
```markdown
[link text](#section-id)
```
For example, if you have a section with the heading "## Advanced Markdown techniques", you can create a link to it like this:
```markdown
[Go to Advanced Markdown techniques](#advanced-markdown-techniques)
```
This will create a clickable link that will take the reader directly to that section of the document.
You can also add a title for the link by enclosing it in quotes after the URL. For example:
```markdown
[Visit GitHub](https://github.com/deployn/astro-deploy 'GitHub')
```
This will render as [Visit GitHub](https://github.com/deployn/astro-deploy 'GitHub').
## Images
To insert an image, use an exclamation mark followed by the alt text in square brackets and the image URL in parentheses. You can also add a title for the image by enclosing it in quotes after the URL. For example:
```markdown
![A beautiful sunset](https://example.com/sunset.jpg 'Sunset')
```
## Code
To display inline code, enclose it in backticks. For code blocks, use triple backticks before and after the code. You can also specify the language of the code block for syntax highlighting. For example:
Inline code: `console.log('Hello, World!')`
Code block:
```javascript
function greet(name) {
return `Hello, ${name}!`;
}
```
## Blockquotes
To create a blockquote, use the > symbol followed by a space and the quote text. For example:
> The best way to predict the future is to invent it. - Alan Kay
## Tables
You can create tables in Markdown by using pipes `|` and hyphens `-` to define the structure. For example:
```markdown
| Header 1 | Header 2 | Header 3 |
| -------- | -------- | -------- |
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
```
This will render as:
| Header 1 | Header 2 | Header 3 |
| -------- | -------- | -------- |
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
## Footnotes
You can add footnotes to your content by using square brackets with a caret and an identifier `[^1]`. Then, at the bottom of your document, define the footnote content using the same identifier. For example:
```markdown
This is some text with a footnote.[^1]
[^1]: This is the footnote content.
```
This will render as: This is some text with a footnote.[^1]
[^1]: This is the footnote content.
## Task Lists
You can create task lists by using square brackets with a space `[ ]` for an incomplete task and `[x]` for a completed task. For example:
```markdown
- [x] Complete task
- [ ] Incomplete task
```
This will render as:
- [x] Complete task
- [ ] Incomplete task
## Strikethrough
To create strikethrough text, use two tildes `~~` before and after the text. For example:
```markdown
~~This text is strikethrough~~
```
This will render as: ~~This text is strikethrough~~
## Horizontal Rules
To create a horizontal rule, use three or more asterisks, hyphens, or underscores on a line by themselves. For example:
---
## Markdown Editors and Tools
While you can write Markdown in any text editor, there are many specialized Markdown editors and tools available that can make your life easier. Here are a few popular options:
- [Typora](https://typora.io/) - A minimalist Markdown editor for Windows, Mac, and Linux
- [Visual Studio Code](https://code.visualstudio.com/) - A powerful code editor with built-in Markdown support
- [Dillinger](https://dillinger.io/) - An online Markdown editor with live preview
- [StackEdit](https://stackedit.io/) - An online Markdown editor with real-time collaboration
- [Bear](https://bear.app/) - A note-taking app for macOS and iOS with Markdown support
- [Obsidian](https://obsidian.md/) - A powerful note-taking app with Markdown support and backlinking features
- [Notion](https://www.notion.so/) - A versatile productivity tool with Markdown support and database features
- [HackMD](https://hackmd.io/) - An online Markdown editor with real-time collaboration and version control
- [Joplin](https://joplinapp.org/) - An open-source note-taking app with Markdown support and end-to-end encryption
- [iA Writer](https://ia.net/writer) - A distraction-free writing app for Mac, iOS, and Android
- [Markdown Monster](https://markdownmonster.west-wind.com/) - A powerful Markdown editor for Windows
- [Github](https://github.com) - A web-based platform for version control and collaboration that supports Markdown
These are just a few examples of the many Markdown editors and tools available. Choose the one that best fits your needs and workflow.
## Markdown for Different Use Cases
Markdown is a versatile language that can be used for many different purposes. Here are a few examples:
### Blogging
Many blogging platforms, such as [Ghost](https://ghost.org/), [Hashnode](https://hashnode.com/), [Dev.to](https://dev.to/), [Medium](https://medium.com/), and [WordPress](https://wordpress.com/), support Markdown. You can write your blog posts in Markdown and easily convert them to HTML for publishing.\_createMdxContent
### Documentation
Markdown is a popular choice for creating documentation, especially for software projects. Tools like [GitBook](https://www.gitbook.com/), [Read the Docs](https://readthedocs.org/), [MkDocs](https://www.mkdocs.org/), [Docusaurus](https://docusaurus.io/), [Docz](https://www.docz.site/) and [Sphinx](https://www.sphinx-doc.org/) allow you to create beautiful documentation from Markdown files.
### E-books
You can use Markdown to write and format e-books. Tools like [Pandoc](https://pandoc.org/), [Calibre](https://calibre-ebook.com/), and [Leanpub](https://leanpub.com/) can convert your Markdown files into various e-book formats, such as EPUB and MOBI.
### Presentations
Believe it or not, you can even create presentations using Markdown. Tools like [reveal.js](https://revealjs.com/), [Marp](https://marp.app/), [Remark](https://remarkjs.com/), and [GitPitch](https://gitpitch.com/) allow you to create slideshows using Markdown syntax.
## Conclusion
Markdown is a powerful and versatile language that can help you create beautiful and functional content quickly and easily. Whether you're a writer, developer, or content creator, learning Markdown is a valuable skill that can save you time and effort.
In this article, we've covered the basics of Markdown syntax, as well as some advanced techniques and tools. We've also explored some of the many use cases for Markdown, from blogging and documentation to e-books and presentations.
If you're new to Markdown, don't be intimidated by the syntax. Start with the basics and gradually work your way up to more advanced techniques. With practice and patience, you'll soon be a Markdown master!
## Additional Resources
If you want to learn more about Markdown, here are some additional resources to check out:
- [Markdown Guide](https://www.markdownguide.org/) - A comprehensive guide to Markdown syntax and best practices
- [CommonMark Spec](https://spec.commonmark.org/) - A standardized specification for Markdown
- [GitHub Markdown Guide](https://guides.github.com/features/mastering-markdown/) - A guide to using Markdown on GitHub
- [Markdown Cheatsheet](https://www.markdownguide.org/cheat-sheet/) - A quick reference guide to Markdown syntax
- [Markdown Tutorial](https://www.markdowntutorial.com/) - An interactive tutorial for learning Markdown
- [Awesome Markdown](https://github.com/mundimark/awesome-markdown) - A curated list of Markdown tools, libraries, and resources
With these resources and the knowledge you've gained from this article, you'll be well on your way to mastering Markdown and creating amazing content. Happy writing!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,9 +1,6 @@
---
title: 'Introduction to Modern Web Frameworks'
description: "A beginner's guide to understanding the purpose and advantages of modern web frameworks."
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-04'
image: './modern-web-frameworks-introduction.png'
---
Welcome to the world of web development, where the landscape is constantly evolving, and the tools at a developer's disposal are more powerful than ever. If you're just starting out, or if you're curious about what modern web frameworks have to offer, you've come to the right place.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,10 +0,0 @@
---
title: 'Untitled'
description: 'Untitled'
datePublished: '2024-04-11'
isDraft: true
---
# Untitled
The `isDraft` field is a boolean field that you can use to mark a post as a draft. When set to `true` , the post won't be rendered in production. This is useful when you're working on a post and you don't want it to be published yet.

View File

@ -1,83 +0,0 @@
---
title: 'Top 10 IDEs for Astro.js Development'
description: 'Explore the best integrated development environments for Astro.js projects.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-10'
image: './top-10-ides-for-astrojs.png'
---
When working on Astro.js projects, having the right Integrated Development Environment (IDE) can significantly boost productivity and streamline the development process. In this blog post, we will explore the top 10 IDEs that are well-suited for Astro.js development.
## Key Takeaways
| IDE | Features | Compatibility |
| ------------------ | ---------------------------------------------------------- | --------------------- |
| Visual Studio Code | Intuitive interface, extensive extensions, Git integration | Windows, macOS, Linux |
| WebStorm | Smart code completion, powerful refactoring tools | Windows, macOS, Linux |
| Sublime Text | Lightweight, customizable, multiple selections | Windows, macOS, Linux |
| Nova | Modern code editor, advanced code editing capabilities | macOS |
| Cursor | AI-first code editor, designed to help developers | Windows, macOS, Linux |
| Vim | Highly customizable, modal editing | Windows, macOS, Linux |
| Eclipse | Rich ecosystem, Java-based | Windows, macOS, Linux |
| Brackets | Live preview, preprocessor support | Windows, macOS, Linux |
| CodeSandbox | Online IDE with collaboration features | Web-based |
| Repl.it | Online IDE supporting multiple languages | Web-based |
Choosing the right IDE can make a world of difference in your development workflow. Let's dive into each of these IDEs in more detail.
## 1. Visual Studio Code
[Visual Studio Code](https://code.visualstudio.com/) (VS Code) is a popular choice among developers for its user-friendly interface and a plethora of extensions that cater to various needs. It offers seamless Git integration and is compatible with Windows, macOS, and Linux.
## 2. WebStorm
[WebStorm](https://www.jetbrains.com/webstorm/) is known for its intelligent code completion and robust refactoring tools. It provides a smooth development experience and supports Windows, macOS, and Linux platforms.
## 3. Sublime Text
[Sublime Text](https://www.sublimetext.com/) is a lightweight yet powerful IDE that allows for extensive customization. Its multiple selections feature is a favorite among developers working on Astro.js projects.
## 4. Nova
[Nova](https://nova.app/) is a powerful and modern code editor designed for macOS by Panic. With its intuitive interface, robust features, and extensions, Nova provides an excellent environment for Astro.js development. It offers advanced code editing capabilities, seamless Git integration, and a customizable workspace to cater to developers' needs. Consider exploring Nova as a versatile IDE option for enhancing your Astro.js projects on macOS.
## 5. Cursor
[Cursor](https://cursor.sh/) is a AI-first code editor that is designed to help developers write code faster and more efficiently. Cursor is installable on Windows, macOS and Linux, making it a versatile choice for Astro.js development.
## 6. Vim
[Vim](https://www.vim.org/) is a highly customizable IDE known for its modal editing capabilities. It is compatible with Windows, macOS, and Linux.
## 7. Eclipse
[Eclipse](https://www.eclipse.org/) boasts a rich ecosystem and is Java-based. It supports development on Windows, macOS, and Linux.
## 8. Brackets
[Brackets](https://brackets.io/) stands out for its live preview feature and robust preprocessor support. It is available for Windows, macOS, and Linux platforms.
## 9. CodeSandbox
[CodeSandbox](https://codesandbox.io/) is an online IDE that offers collaboration features for seamless team projects. It is accessible via web browsers.
## 10. Repl.it
[Repl.it](https://repl.it/) is an online IDE that supports multiple languages and provides a versatile development environment online.
## My Top Pick: Visual Studio Code
I personally recommend Visual Studio Code for Astro.js development due to its user-friendly interface, extensive extensions, and seamless Git integration. It has been my go-to IDE for Astro.js projects.
If you need a CDE (Cloud Development Environment) for Astro.js, you can use [Code Server](https://docs.linuxserver.io/images/docker-code-server/) to run Visual Studio Code in a Docker container.
Choosing the right IDE ultimately depends on your preferences and workflow requirements. Experiment with a few options to find the one that best suits your Astro.js development needs.
Happy coding! 🚀
```javascript
const helloAstro = () => {
console.log('Hello Astro.js!');
};
helloAstro();
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -1,97 +1,44 @@
---
title: 'Unleashing the Power of Astro.js'
description: 'Explore the wonders of Astro.js, a transformative tool reshaping web development.'
author: [{ type: 'Person', name: 'Jewgeni', url: 'https://deployn.de' }]
datePublished: '2024-03-03'
dateModified: '2024-04-11'
image: './unleasing-the-power-of-astro-js-for-better-web-development.png'
---
## Introduction
Welcome to an exciting exploration of Astro.js, a transformative tool reshaping web development. This blog post takes you through the wonders of Astro.js, showcasing its ability to boost website performance and introduce unparalleled versatility in modern applications.
Welcome to an exciting and immersive exploration of Astro.js, a transformative tool that is revolutionizing the world of web development. In this comprehensive blog post, we will take you on a deep dive into the wonders of Astro.js, showcasing its remarkable ability to supercharge website performance and introduce unparalleled versatility in modern applications.
Whether you're a seasoned developer with years of experience under your belt or just embarking on your web development journey, this guide will illuminate the incredible potential of Astro.js and how it can streamline and enhance your development process.
Whether you're deep into development or just starting, this guide illuminates Astro.js's potential to refine your web development process.
## Understanding the Magic Behind Astro.js
What sets Astro.js apart from other web development tools is its unique ability to seamlessly merge static and dynamic content, enabling instant loading while still providing dynamic capabilities. This powerful blend not only optimizes performance but also simplifies the development process, allowing you to focus on crafting exceptional user interfaces without compromising on speed.
Astro.js stands out by merging static and dynamic content, enabling instant loading with dynamic capabilities. This blend not only optimizes performance but simplifies development, focusing on user interface excellence without sacrificing speed.
By leveraging server-side pre-rendering, Astro.js significantly reduces the burden on the client-side, resulting in lightning-fast, responsive websites. Its flexible architecture supports a wide range of front-end frameworks, giving you the freedom to unleash your creativity while still harnessing the benefits of Astro.js.
Here's a simple example of how you can create a basic Astro.js component:
```astro
---
const name = 'John Doe';
---
<h1>Hello, {name}!</h1>
```
By pre-rendering pages server-side, Astro reduces client-side load, offering swift, responsive websites. Its flexible architecture supports various front-end frameworks, allowing for creative freedom while leveraging Astro.jss benefits.
## Optimizing Website Performance with Astro.js
One of the key strengths of Astro.js lies in its ability to dramatically improve website loading times by pre-rendering pages and efficiently serving static assets. This approach minimizes server load and bandwidth usage, ultimately enhancing the user experience and ensuring a smooth, seamless browsing experience.
Astro.js excels in speeding up loading times by pre-rendering pages and serving static assets. This approach minimizes server load and bandwidth, enhancing user experience.
Astro.js's component-based architecture promotes modularity and reusability, streamlining the development process and boosting overall performance. The hybrid rendering model strikes the perfect balance between speed and interactivity, delivering users a fast and engaging experience across all devices.
Its component-based architecture ensures modularity and reusability, streamlining development and boosting performance. The hybrid rendering model strikes a balance between speed and interactivity, providing users with a seamless browsing experience.
## Harnessing the Benefits of Astro.js for Web Development
Astro.js is a game-changer when it comes to optimizing workflows and maximizing performance. By avoiding the pitfalls of heavy JavaScript frameworks, Astro.js ensures quick loading times and smooth operation across a wide range of devices, from desktop computers to mobile phones.
Astro.js optimizes workflows with its focus on performance. It avoids the pitfalls of heavy JavaScript frameworks, ensuring quick loads and smooth operation across devices.
The modular, component-based design of Astro.js encourages code reusability and maintains consistency throughout your projects, simplifying maintenance and reducing development time. Additionally, Astro.js offers a unified build system that reduces complexity and minimizes potential errors arising from disparate technologies.
Here's an example of how you can import and use components in Astro.js:
```astro
---
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
---
<html>
<body>
<Header />
<main>
<!-- Page content goes here -->
</main>
<Footer />
</body>
</html>
```
Its modular, component-based design encourages reusability and consistency, simplifying maintenance. Astro.js also offers a unified build system, reducing complexity and potential errors from disparate technologies.
## Exploring the Versatility of Astro.js in Modern Applications
One of the standout features of Astro.js is its incredible versatility. Its modular architecture allows it to seamlessly adapt to various project requirements and use cases, whether you're building web applications, mobile apps, or anything in between. With a rich set of features and a well-documented API, Astro.js empowers developers to create highly functional and interactive applications.
Astro.js's modular architecture fits various projects and adapts to different use cases, from web applications to mobile apps. Its rich feature set supports a broad range of functionalities, enhanced by a well-documented API and plugin library.
Performance and optimization are at the core of Astro.js, ensuring that your applications are fast, responsive, and lightweight. The extensive plugin library further expands the capabilities of Astro.js, enabling you to integrate additional functionalities and tailor your projects to specific needs.
Here's an example of how you can use Astro.js with a popular front-end framework like React:
```astro
---
import { ReactComponent } from '../components/ReactComponent.jsx';
---
<html>
<body>
<ReactComponent client:load />
</body>
</html>
```
Performance and optimization are central to Astro.js, ensuring applications are fast, responsive, and lightweight.
## Pro Tips for Maximizing the Potential of Astro.js
- **Optimize Your Build Process**: Utilize partial hydration and code splitting techniques to create efficient builds that load only the necessary components, reducing overall bundle size and improving performance.
- **Utilize Static Site Generation**: For content-heavy websites, take advantage of Astro.js's static site generation capabilities. By pre-rendering pages at build time, you can achieve lightning-fast loading speeds and optimize performance.
- **Experiment with Component Composition**: Astro.js allows you to mix and match components from different libraries and frameworks. Don't be afraid to experiment with component composition to find the perfect combination that meets your project's unique requirements.
- **Implement Server-Side Rendering**: When dealing with dynamic content or components that require server-side rendering for SEO purposes, Astro.js has you covered. Utilize server-side rendering to ensure that your pages are properly indexed by search engines and provide a seamless user experience.
- **Stay Updated with the Latest Features**: Astro.js is constantly evolving, with new features and improvements being added regularly. Keep yourself informed about the latest updates and explore how you can leverage them to enhance your projects and stay ahead of the curve.
- **Optimize Your Build Process**: Utilize partial hydration and code splitting for efficient builds.
- **Utilize Static Site Generation**: Leverage static generation for performance optimization in content-heavy sites.
- **Experiment with Component Composition**: Mix components from different libraries to meet project needs.
- **Implement Server-Side Rendering**: Use server-side rendering for SEO and interactive components.
- **Stay Updated with the Latest Features**: Keep abreast of Astro.js updates to fully utilize its capabilities.
## Conclusion
Astro.js is a transformative tool that is revolutionizing the world of web development. By enhancing performance, offering versatile solutions for modern applications, and simplifying the development process, Astro.js empowers developers to create exceptional digital experiences.
Through this immersive exploration, we have shed light on the incredible potential of Astro.js and how it can streamline your workflow, boost website speed, and introduce unparalleled flexibility in your projects. Armed with this knowledge and the pro tips provided, you are now equipped to leverage the full power of Astro.js and take your web development skills to new heights.
Embrace the future of web development with Astro.js and embark on a journey of innovation, performance optimization, and boundless creativity. The possibilities are endless, and the impact you can make is truly remarkable.
Astro.js is a transformative tool for web developers, enhancing performance and offering versatile solutions for modern applications. This exploration has shown how Astro.js can streamline your development process, encouraging you to leverage its full potential for greater project success.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -2,30 +2,10 @@ import { z, defineCollection } from 'astro:content';
const blogCollection = defineCollection({
type: 'content',
schema: ({ image }) =>
z.object({
isDraft: z.boolean().optional(),
title: z.string(),
description: z.string(),
author: z
.array(
z.object({
type: z.string().default('Person'),
name: z.string(),
url: z.string().url().optional(),
})
)
.optional(),
datePublished: z
.string()
.transform((str) => new Date(str))
.optional(),
dateModified: z
.string()
.transform((str) => new Date(str))
.optional(),
image: image().optional(),
}),
schema: z.object({
title: z.string(),
description: z.string(),
}),
});
export const collections = {

View File

@ -7,24 +7,17 @@ import Footer from '@/components/layout/Footer.astro';
interface Props {
title: string;
description: string;
lang?: string;
noindex?: boolean;
nofollow?: boolean;
}
const { title, description, lang = 'en', noindex, nofollow } = Astro.props as Props;
const { title, description } = Astro.props as Props;
---
<html lang={lang}>
<html lang="en">
<head>
<title>{title}</title>
<meta name="description" content={description} />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#61a8e1" />
<meta
name="robots"
content={`${noindex ? 'noindex' : 'index'}, ${nofollow ? 'nofollow' : 'follow'}`}
/>
<link rel="icon" href="/favicon.ico" sizes="48x48" />
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" />
<link rel="manifest" href="/site.webmanifest" />
@ -33,8 +26,7 @@ const { title, description, lang = 'en', noindex, nofollow } = Astro.props as Pr
</head>
<body class="flex min-h-screen flex-col dark:bg-secondary">
<Header />
<main class="flex-grow pb-20 sm:pb-0 sm:pl-16 md:pl-0">
<!-- Added padding-left for sm screens -->
<main class="flex-grow">
<slot />
</main>
<Footer />

View File

@ -1 +0,0 @@
declare module '@pagefind/default-ui';

View File

@ -1,12 +0,0 @@
---
import BaseLayout from '@/layouts/BaseLayout.astro';
---
<BaseLayout title="Astro Deploy 404" description="404: Page not found.">
<header class="mx-auto px-4 pb-20 pt-28 sm:px-6 lg:px-8">
<h1 class="text-center text-zinc-900 dark:text-zinc-200">404: Page Not Found</h1>
<p class="mx-auto mt-6 max-w-3xl text-center text-lg text-zinc-900/70 dark:text-zinc-400">
The page you are looking for does not exist. Please check the URL or return to the home page.
</p>
</header>
</BaseLayout>

37
src/pages/blog.astro Normal file
View File

@ -0,0 +1,37 @@
---
import { getCollection } from 'astro:content';
import BaseLayout from '@/layouts/BaseLayout.astro';
import Heading from '@/components/ui/Heading.astro';
const allBlogposts = await getCollection('blog');
---
<BaseLayout
title="Blog | Astro Deploy"
description="Explore insightful articles on our Blog: Dive into a world of knowledge through posts crafted with expertise. Discover, learn, and grow with us.">
<div class="container mx-auto px-4 py-16 sm:py-24 lg:px-8 lg:py-32 xl:max-w-7xl">
<div class="mb-12 text-center text-zinc-900 dark:text-zinc-200">
<Heading level={1}>Blog</Heading>
<p>Here are some blogposts, they are located in the repository as mdx files.</p>
</div>
<hr class="mb-12 dark:border-zinc-700/75" />
<div class="grid grid-cols-1 gap-8 md:grid-cols-2">
{
allBlogposts.map((post) => (
<div class="flex flex-col space-y-4">
<h2 class="text-lg font-semibold text-zinc-800 hover:text-zinc-600 dark:text-zinc-200 dark:hover:text-zinc-400 sm:text-xl">
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
</h2>
<p class="text-sm leading-relaxed text-zinc-600 dark:text-zinc-400">
{post.data.description}
</p>
<a
class="text-sm font-medium text-primary-600 hover:text-primary-400 dark:text-primary-400 dark:hover:text-primary-300"
href={`/blog/${post.slug}/`}>
Read more
</a>
</div>
))
}
</div>
</div>
</BaseLayout>

View File

@ -1,194 +0,0 @@
---
import { getCollection } from 'astro:content';
import BaseLayout from '@/layouts/BaseLayout.astro';
import Heading from '@/components/ui/Heading.astro';
import Search from '@/components/blog/Search.astro';
import {
Pagination,
PaginationContent,
PaginationItem,
PaginationLink,
PaginationNext,
PaginationPrevious,
} from '@/components/ui/pagination';
import { Image } from 'astro:assets';
interface BlogPost {
data: {
title: string;
description: string;
datePublished?: string;
dateModified?: string;
author?: [
{
type?: string;
name: string;
url?: string;
},
];
image?: string;
isDraft?: boolean;
};
slug: string;
}
export async function getStaticPaths({ paginate }: { paginate: Function }) {
const allBlogposts = await getCollection('blog');
const publishedBlogPosts: any = (post: BlogPost) => !post.data.isDraft;
const sortedPosts = allBlogposts.filter(publishedBlogPosts).sort((a, b) => {
const dateA = a.data.dateModified
? new Date(a.data.dateModified)
: a.data.datePublished
? new Date(a.data.datePublished)
: new Date(0);
const dateB = b.data.dateModified
? new Date(b.data.dateModified)
: b.data.datePublished
? new Date(b.data.datePublished)
: new Date(0);
return dateB.getTime() - dateA.getTime();
});
const postsPerPage = 6;
return paginate(sortedPosts, {
pageSize: postsPerPage,
});
}
const {
page,
}: {
page: {
data: BlogPost[];
url: { prev: string; current: string; next: string };
currentPage: number;
lastPage: number;
};
} = Astro.props;
---
<BaseLayout
title={`Blog Page ${page.currentPage} | Astro Deploy`}
description="Explore insightful articles on our Blog: Dive into a world of knowledge through posts crafted with expertise. Discover, learn, and grow with us.">
<div class="container mx-auto max-w-6xl px-4 py-12 sm:px-6 lg:px-8 lg:py-16">
<div class="mb-12 text-center">
<Heading level={1}>Blog</Heading>
<Search />
<p class="mt-4 text-xl text-zinc-600 dark:text-zinc-400">
Here are some blogposts, they are located in the repository as mdx files.
</p>
</div>
<hr class="my-8 border-t border-zinc-300 dark:border-zinc-700" />
<div class="grid grid-cols-1 gap-8 md:grid-cols-2 xl:grid-cols-3">
{
page.data.map((post) => (
<div class="overflow-hidden rounded-lg bg-white p-6 shadow-lg transition duration-500 ease-in-out hover:-translate-y-1 hover:shadow-2xl dark:bg-zinc-800">
{post.data.image && (
<a href={`/blog/${post.slug}/`}>
<Image
src={post.data.image}
alt={post.data.title}
inferSize
class="h-48 w-full object-cover transition duration-500 ease-in-out hover:scale-105"
/>
</a>
)}
<div class="p-6">
<h2
transition:name={post.data.title}
class="mb-3 text-2xl font-bold leading-tight text-zinc-800 transition duration-300 ease-in-out hover:text-primary-600 dark:text-zinc-100 dark:hover:text-primary-400">
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
</h2>
<div class="mb-4 text-sm text-zinc-600 dark:text-zinc-400">
<div class="mb-2 flex flex-wrap items-center">
{post.data.author && (
<>
<span class="mr-2">By</span>
{post.data.author.map((author, index) => (
<span class="mr-2">
{author.url ? (
<a
href={author.url}
class="font-medium text-primary-600 underline hover:text-primary-500 dark:text-primary-400 dark:hover:text-primary-300">
{author.name}
</a>
) : (
<span class="font-medium text-primary-600 dark:text-primary-400">
{author.name}
</span>
)}
{post.data.author && index < post.data.author.length - 1 && (
<span>, </span>
)}
</span>
))}
</>
)}
</div>
<div class="flex flex-wrap items-center">
{post.data.datePublished && (
<time datetime={post.data.datePublished} class="mr-4">
<span class="mr-1">Published:</span>
{new Date(post.data.datePublished).toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
})}
</time>
)}
{post.data.dateModified && (
<time datetime={post.data.dateModified}>
<span class="mr-1">Updated:</span>
{new Date(post.data.dateModified).toLocaleDateString('en-US', {
year: 'numeric',
month: 'short',
day: 'numeric',
})}
</time>
)}
</div>
</div>
<p class="text-zinc-600 dark:text-zinc-400">{post.data.description}</p>
</div>
</div>
))
}
</div>
<div class="mt-12 text-center text-black dark:text-white">
<Pagination>
<PaginationContent>
{
page.currentPage > 1 && (
<>
<PaginationItem>
<PaginationPrevious href={`${page.url.prev}/`} />
</PaginationItem>
<PaginationItem>
<PaginationLink href="/blog/">1</PaginationLink>
</PaginationItem>
</>
)
}
<PaginationItem>
<PaginationLink href={`${page.url.current}/`} isActive
>{page.currentPage}
</PaginationLink>
</PaginationItem>
{
page.currentPage < page.lastPage && (
<>
<PaginationItem>
<PaginationLink href={`/blog/${page.lastPage}/`}>{page.lastPage}</PaginationLink>
</PaginationItem>
<PaginationItem>
<PaginationNext href={`${page.url.next}/`} />
</PaginationItem>
</>
)
}
</PaginationContent>
</Pagination>
</div>
</div>
</BaseLayout>

View File

@ -3,17 +3,13 @@ import { getCollection } from 'astro:content';
import type { CollectionEntry } from 'astro:content';
import BaseLayout from '@/layouts/BaseLayout.astro';
import Table from '@/components/blog/Table.astro';
import '@/styles/prose.css';
import { Image } from 'astro:assets';
export async function getStaticPaths() {
const blogEntries = await getCollection('blog');
return blogEntries
.filter((entry) => !entry.data.isDraft)
.map((entry) => ({
params: { slug: entry.slug },
props: { entry },
}));
return blogEntries.map((entry) => ({
params: { slug: entry.slug },
props: { entry },
}));
}
interface Props {
@ -21,84 +17,17 @@ interface Props {
}
const { entry } = Astro.props as Props;
if (!entry) {
return Astro.redirect('/404');
}
const { Content } = await entry.render();
const components = { table: Table };
const {
title = '',
description = '',
author = [],
datePublished = '',
dateModified = '',
image = '',
} = entry.data;
const formatDate = (dateString: string) => {
const date = new Date(dateString);
return date.toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric',
});
};
const { title, description } = entry.data;
const descriptionMeta =
description.length > 158 ? description.substring(0, 155) + '...' : description;
---
<BaseLayout title={title} description={descriptionMeta}>
<div
class="container prose mx-auto px-4 py-16 dark:prose-invert lg:px-8 lg:py-32 xl:max-w-7xl"
data-pagefind-body>
<div class="container prose mx-auto px-4 py-16 dark:prose-invert lg:px-8 lg:py-32 xl:max-w-7xl">
<h1 class="text-4xl font-bold">{title}</h1>
<div class="mt-2 text-sm text-gray-600">
{
author.length > 0 && (
<span>
By{' '}
{author.map((a, index) => (
<span>
{a.url ? (
<a href={a.url} target="_blank" rel="noopener noreferrer">
{a.name}
</a>
) : (
a.name
)}
{index < author.length - 1 ? ', ' : ''}
</span>
))}
</span>
)
}
{
datePublished && (
<span class="ml-2">Published on {formatDate(datePublished.toString())}</span>
)
}
{
dateModified && (
<span class="ml-2">Last updated on {formatDate(dateModified.toString())}</span>
)
}
</div>
{
image && (
<Image
src={image as unknown as string}
alt={title}
inferSize
class="mt-8 h-96 w-full rounded-lg object-cover"
/>
)
}
<div class="mt-8">
<Content components={components} />
</div>
<Content components={components} />
</div>
</BaseLayout>

View File

@ -1,66 +1,34 @@
---
import { Image } from 'astro:assets';
import { Icon } from 'astro-icon/components';
import BaseLayout from '@/layouts/BaseLayout.astro';
import Heading from '@/components/ui/Heading.astro';
import FeatureSection from '@/components/FeatureSection.astro';
import index1 from '@/assets/images/index-1.png';
import index2 from '@/assets/images/index-2.png';
import index3 from '@/assets/images/index-3.png';
import index4 from '@/assets/images/index-4.png';
import index5 from '@/assets/images/index-5.png';
const features = [
{
title: 'Revolutionize Website Development',
description:
'Astro Deploy revolutionizes development with Astro.js 4 and Docker for scalable solutions.',
image: index1,
},
{
title: 'Accelerate Website Development with Astro Deploy',
description:
'Astro Deploy expedites website development with pre-configured Astro.js boilerplate, Docker, and Tailwind CSS, enabling businesses to launch their online presence swiftly and engage customers effectively.',
image: index2,
},
{
title: 'Docker Integration',
description:
'The Docker integration ensures smooth deployment and scalability of your Astro.js 4 project. Embrace containerization technology to streamline your development process and enhance efficiency.',
image: index3,
},
{
title: 'Tailwind CSS Styling',
description:
'Utilizing the power of Tailwind CSS, crafting visually appealing designs that are responsive and user-friendly. Bring your vision to life with customizable styles that reflect your brand identity.',
image: index4,
},
{
title: 'MDX Blog Setup',
description:
"Enhance your website's content management capabilities with MDX Blog integration. Set up an MDX-powered blog for seamless content creation and management, empowering you to engage your audience effectively.",
image: index5,
},
];
---
<BaseLayout
title="Astro Deploy"
description="Launch your site with Astro Deploy: A cutting-edge solution featuring Astro.js, Docker, and Tailwind CSS for seamless, scalable web development.">
<header class="mx-auto px-4 pb-20 pt-28 sm:px-6 lg:px-8">
<div class="mx-auto px-4 pb-20 pt-28 sm:px-6 lg:px-8">
<Heading level={1} classes="text-center text-zinc-900 dark:text-zinc-200">
Deploy Your
<span
class="bg-gradient-to-r from-accent-600 via-accent-600 to-zinc-900 bg-clip-text text-transparent dark:from-accent dark:to-zinc-200">
Astro.js
</span>
Site!
</Heading>
Site!</Heading
>
<p class="mx-auto mt-6 max-w-3xl text-center text-lg text-zinc-900/70 dark:text-zinc-400">
Supercharge your website with the Astro Deploy boilerplate with Docker support for
out-of-this-world web experiences. Launch today!
</p>
<div class="mt-8 flex justify-center">
<div class="mt-8 grid w-full gap-3 sm:inline-flex sm:justify-center">
<a
href="https://github.com/deployn/astro-deploy"
class="inline-flex items-center justify-center gap-x-3 rounded-full bg-primary-600 px-8 py-4 text-center text-base text-sm font-medium ring-4 ring-transparent focus:outline-none focus:ring-2 focus:ring-primary-700 focus:ring-offset-base-50 dark:focus:ring-offset-zinc-800">
@ -68,9 +36,8 @@ const features = [
<Icon name="line-md:chevron-right" class="size-3" />
</a>
</div>
</header>
<section
</div>
<div
class="mx-auto max-w-6xl px-8 py-12 text-base-900 dark:text-base-100 sm:px-6 lg:px-8 lg:py-16">
<Heading
level={2}
@ -81,43 +48,126 @@ const features = [
Empower your success with Astro Deploy. Leverage cutting-edge technologies for seamless
experiences.
</p>
</section>
{
features.map((feature, index) => (
<FeatureSection
title={feature.title}
description={feature.description}
image={feature.image}
isReversed={index % 2 !== 0}
</div>
<div
class="mx-auto flex max-w-7xl flex-col items-center gap-x-12 gap-y-8 px-8 py-16 lg:flex-row lg:py-24">
<div class="lg:flex-1">
<Image
class="mx-auto max-h-96 w-full rounded-xl shadow-lg"
src={index1}
alt="Abstract Tech"
/>
))
}
<section class="container relative mx-auto px-4 py-16 lg:px-8 lg:py-32 xl:max-w-6xl">
</div>
<div class="flex flex-col gap-y-4 lg:flex-1">
<h2 class="text-center text-3xl font-bold text-zinc-900 dark:text-zinc-100 lg:text-left">
Revolutionize Website Development
</h2>
<p class="text-lg text-zinc-800 dark:text-zinc-300">
Astro Deploy revolutionizes development with Astro.js 4 and Docker for scalable solutions.
</p>
</div>
</div>
<div
class="mx-auto flex max-w-7xl flex-col items-center gap-x-12 gap-y-8 px-8 py-16 lg:flex-row-reverse lg:py-24">
<div class="lg:flex-1">
<Image
class="mx-auto max-h-96 w-full rounded-xl shadow-lg"
src={index2}
alt="Abstract Tech"
/>
</div>
<div class="flex flex-col gap-y-4 lg:flex-1">
<h2 class="text-center text-3xl font-bold text-zinc-900 dark:text-zinc-100 lg:text-left">
Accelerate Website Development with Astro Deploy
</h2>
<p class="text-lg text-zinc-800 dark:text-zinc-300">
Astro Deploy expedites website development with pre-configured Astro.js boilerplate, Docker,
and Tailwind CSS, enabling businesses to launch their online presence swiftly and engage
customers effectively.
</p>
</div>
</div>
<div
class="mx-auto flex max-w-7xl flex-col items-center gap-x-12 gap-y-8 px-8 py-16 lg:flex-row lg:py-24">
<div class="lg:flex-1">
<Image
class="mx-auto max-h-96 w-full rounded-xl shadow-lg"
src={index3}
alt="Abstract Tech"
/>
</div>
<div class="flex flex-col gap-y-4 lg:flex-1">
<h2 class="text-center text-3xl font-bold text-zinc-900 dark:text-zinc-100 lg:text-left">
Docker Integration
</h2>
<p class="text-lg text-zinc-800 dark:text-zinc-300">
Te Docker integration ensures smooth deployment and scalability of your Astro.js 4 project.
Embrace containerization technology to streamline your development process and enhance
efficiency.
</p>
</div>
</div>
<div
class="mx-auto flex max-w-7xl flex-col items-center gap-x-12 gap-y-8 px-8 py-16 lg:flex-row-reverse lg:py-24">
<div class="lg:flex-1">
<Image
class="mx-auto max-h-96 w-full rounded-xl shadow-lg"
src={index4}
alt="Abstract Tech"
/>
</div>
<div class="flex flex-col gap-y-4 lg:flex-1">
<h2 class="text-center text-3xl font-bold text-zinc-900 dark:text-zinc-100 lg:text-left">
Tailwind CSS Styling
</h2>
<p class="text-lg text-zinc-800 dark:text-zinc-300">
Utilizing the power of Tailwind CSS, crafting visually appealing designs that are responsive
and user-friendly. Bring your vision to life with customizable styles that reflect your
brand identity.
</p>
</div>
</div>
<div
class="mx-auto flex max-w-7xl flex-col items-center gap-x-12 gap-y-8 px-8 py-16 lg:flex-row lg:py-24">
<div class="lg:flex-1">
<Image
class="mx-auto max-h-96 w-full rounded-xl shadow-lg"
src={index5}
alt="Abstract Tech"
/>
</div>
<div class="flex flex-col gap-y-4 lg:flex-1">
<h2 class="text-center text-3xl font-bold text-zinc-900 dark:text-zinc-100 lg:text-left">
MDX Blog Setup
</h2>
<p class="text-lg text-zinc-800 dark:text-zinc-300">
Enhance your website's content management capabilities with MDX Blog integration. Set up an
MDX-powered blog for seamless content creation and management, empowering you to engage your
audience effectively.
</p>
</div>
</div>
<div class="container relative mx-auto px-4 py-16 lg:px-8 lg:py-32 xl:max-w-6xl">
<div class="absolute inset-0 -mx-2 my-6 rotate-2 -skew-y-1 rounded bg-gray-800 lg:my-20"></div>
<div
class="absolute inset-0 my-6 rounded bg-gray-800 lg:-skew-y-1 xl:-mx-2 xl:my-20 xl:rotate-2">
class="absolute left-6 top-3 size-12 rotate-45 -skew-y-3 rounded-full bg-primary-400 lg:left-6 lg:top-14">
</div>
<div
class="absolute left-6 top-3 size-12 rotate-45 -skew-y-3 rounded-full bg-primary-400 lg:left-6 xl:top-14">
class="absolute -left-6 top-2 size-16 rotate-45 -skew-y-3 bg-primary-600 transition-all duration-500 hover:rounded-3xl lg:top-12">
</div>
<div
class="absolute -left-6 top-2 size-16 rotate-45 -skew-y-3 bg-primary-600 transition-all duration-500 hover:rounded-3xl xl:top-12">
</div>
<div class="relative flex flex-col items-center gap-8 md:flex-row md:gap-16">
<div class="text-center md:w-7/12 md:text-left">
<div class="relative flex flex-col items-center space-y-8 md:flex-row md:space-y-0">
<div class="py-5 text-center md:w-7/12 md:p-5 md:text-left">
<h2 class="mb-4 text-4xl font-black text-white">Deploy your site</h2>
<p class="text-xl leading-relaxed text-gray-300">Start building amazing sites, today.</p>
<h3 class="text-xl leading-relaxed text-gray-300">Start building amazing sites, today.</h3>
</div>
<div class="flex justify-center md:w-5/12">
<div class="grow md:p-5 md:text-center">
<a
href="https://github.com/deployn/astro-deploy"
class="inline-flex items-center justify-center gap-2 rounded-full border border-primary-700 bg-primary-700 px-8 py-4 font-semibold leading-6 text-white hover:border-primary-600 hover:bg-primary-600 focus:ring focus:ring-primary-400 focus:ring-opacity-50 active:border-primary-700 active:bg-primary-700">
class="inline-flex items-center justify-center space-x-2 rounded-full border border-primary-700 bg-primary-700 px-8 py-4 font-semibold leading-6 text-white hover:border-primary-600 hover:bg-primary-600 hover:text-white focus:ring focus:ring-primary-400 focus:ring-opacity-50 active:border-primary-700 active:bg-primary-700">
<span>Get Started</span>
<Icon name="line-md:chevron-right" class="size-3" />
</a>
</div>
</div>
</section>
</div>
</BaseLayout>

View File

@ -23,9 +23,7 @@ const recipes = await directus.request(
<div class="container mx-auto px-4 py-16 sm:py-24 lg:px-8 lg:py-32 xl:max-w-7xl">
<div class="mb-12 text-center text-zinc-900 dark:text-zinc-200">
<Heading level={1}>Recipes</Heading>
<p class="mt-5">
Here are some of my favorite recipes. They are fetched through Directus CMS.
</p>
<p>Here are some of my favorite recipes. They are fetched through Directus CMS.</p>
</div>
<hr class="mb-12 dark:border-zinc-700/75" />
<ul class="grid gap-y-12 sm:grid-cols-2 sm:gap-x-6 lg:grid-cols-3 xl:gap-x-8">

View File

@ -1,18 +0,0 @@
.prose {
@apply break-words;
@apply prose-a:text-primary-600 prose-a:underline prose-a:transition prose-a:duration-150 prose-a:ease-in-out prose-a:hover:text-primary-500 prose-a:focus:outline-none prose-a:focus:ring-2 prose-a:focus:ring-primary-500 prose-a:dark:text-primary-400 prose-a:dark:hover:text-primary-300;
@apply prose-ul:mb-4 prose-ul:ml-8;
@apply prose-ol:mb-4 prose-ol:ml-8;
@apply prose-li:mb-2;
@apply prose-code:rounded prose-code:bg-gray-100 prose-code:px-1 prose-code:py-0.5 prose-code:text-sm prose-code:text-base-600 prose-code:dark:bg-gray-800 prose-code:dark:text-base-400;
code::before {
content: '';
}
code::after {
content: '';
}
pre code {
@apply block overflow-auto rounded bg-gray-800 p-4 text-white;
}
@apply prose-blockquote:my-4 prose-blockquote:border-l-4 prose-blockquote:border-secondary-300 prose-blockquote:pl-4 prose-blockquote:dark:border-secondary-600;
}

View File

@ -4,24 +4,11 @@ export default {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
prefix: '',
theme: {
screens: {
xs: { max: '600px' },
sm: '600px',
md: '840px',
lg: '1200px',
xl: '1600px',
'h-xs': { raw: '(max-height: 600px)' },
'h-sm': { raw: '(min-height: 600px)' },
'h-md': { raw: '(min-height: 840px)' },
'h-lg': { raw: '(min-height: 1200px)' },
'h-xl': { raw: '(min-height: 1600px)' },
},
container: {
center: true,
padding: '2rem',
screens: {
xl: '1600px',
'2xl': '1400px',
},
},
extend: {