Compare commits
7 Commits
6dd2209e21
...
2.17.0
| Author | SHA1 | Date | |
|---|---|---|---|
| d19433ae4e | |||
| 7498870d92 | |||
| d7d43369dc | |||
| 5b94283498 | |||
| 4c1da43c68 | |||
| 6cddae61ed | |||
| 890dbdf313 |
@@ -22,7 +22,7 @@ WORKDIR /app
|
||||
COPY --from=prod-deps /app/node_modules /app/node_modules
|
||||
COPY --from=build /app/dist /app/dist
|
||||
|
||||
LABEL version="2.16.0"
|
||||
LABEL version="2.17.0"
|
||||
LABEL description="Astro based personal website"
|
||||
|
||||
ENV HOST=0.0.0.0
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
Personal site used for information about myself and blog.
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
With dependencies installed, you can utilize the following npm scripts to manage your project's development lifecycle:
|
||||
@@ -12,9 +13,13 @@ With dependencies installed, you can utilize the following npm scripts to manage
|
||||
|
||||
For detailed help with Astro CLI commands, visit [Astro's documentation](https://docs.astro.build/en/reference/cli-reference/).
|
||||
|
||||
|
||||
## Thanks
|
||||
|
||||
Thanks https://github.com/godruoyi/gblog/tree/gblog-template, https://github.com/mearashadowfax/ScrewFast,
|
||||
Based the site on: [gblog-template](https://github.com/godruoyi/gblog/tree/gblog-template) and [ScrewFast](https://github.com/mearashadowfax/ScrewFast)
|
||||
|
||||
Using Icons from [Icons8](https://icons8.com/)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "site-profile",
|
||||
"type": "module",
|
||||
"version": "2.16.0",
|
||||
"version": "2.17.0",
|
||||
"homepage": "https://www.alexlebens.dev",
|
||||
"bugs": {
|
||||
"url": "https://gitea.alexlebens.dev/alexlebens/site-profile/issues",
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
---
|
||||
import Logo from '@components/images/Logo.astro';
|
||||
import { getDirectusImageURL } from '@/support/url';
|
||||
|
||||
interface Props {
|
||||
slug: string;
|
||||
title: string;
|
||||
description: string;
|
||||
logoLight: string;
|
||||
logoDark?: string;
|
||||
count: number;
|
||||
publishDate: string;
|
||||
}
|
||||
|
||||
const { slug, title, description, count, publishDate } = Astro.props;
|
||||
const { slug, title, description, logoLight, logoDark, count, publishDate } = Astro.props;
|
||||
---
|
||||
|
||||
<div class="smooth-reveal-cards group h-full">
|
||||
@@ -18,10 +23,19 @@ const { slug, title, description, count, publishDate } = Astro.props;
|
||||
>
|
||||
<div class="relative grow overflow-hidden">
|
||||
<div class="absolute inset-1 flex flex-col p-3 md:p-4 lg:p-5">
|
||||
<div class="overflow-hidden">
|
||||
<h3 class="card-text-title-major card-hover-text-title whitespace-nowrap mb-4">
|
||||
<div class="flex flex-row items-center mb-4">
|
||||
<div class="card-hover-icon-scale shrink-0 mr-3">
|
||||
<Logo
|
||||
srcLight={getDirectusImageURL(logoLight)}
|
||||
srcDark={getDirectusImageURL(logoDark!)}
|
||||
alt={`Logo of ${title}`}
|
||||
/>
|
||||
</div>
|
||||
<h3 class="card-text-title-major card-hover-text-title whitespace-nowrap">
|
||||
{title}
|
||||
</h3>
|
||||
</div>
|
||||
<div>
|
||||
<p class="card-text-description mb-4">
|
||||
{description}
|
||||
</p>
|
||||
|
||||
@@ -51,11 +51,12 @@ const categories = (await directus.request(readItems('categories')))
|
||||
.map((c, index) => {
|
||||
const posts = postMap.get(c.slug);
|
||||
const pattern = layoutPattern[index % layoutPattern.length];
|
||||
const smColSpan = Math.min(pattern.col, 2);
|
||||
const mdColSpan = Math.min(pattern.col, 4);
|
||||
const smColSpan = Math.min(pattern.col, 1);
|
||||
const mdColSpan = Math.min(pattern.col, 2);
|
||||
const lgColSpan = Math.min(pattern.col, 4);
|
||||
const rowSpan = pattern.row;
|
||||
const rowSpanClass = rowSpan > 1 ? `row-span-${rowSpan}` : 'row-span-1';
|
||||
const gridItemClass = `col-span-${smColSpan} md:col-span-${mdColSpan} ${rowSpanClass}`;
|
||||
const gridItemClass = `col-span-${smColSpan} md:col-span-${mdColSpan} lg:col-span-${lgColSpan} ${rowSpanClass}`;
|
||||
return {
|
||||
...c,
|
||||
posts,
|
||||
@@ -63,6 +64,7 @@ const categories = (await directus.request(readItems('categories')))
|
||||
layoutPattern: {
|
||||
smCol: smColSpan,
|
||||
mdCol: mdColSpan,
|
||||
lgCol: lgColSpan,
|
||||
row: rowSpan,
|
||||
index,
|
||||
},
|
||||
@@ -71,7 +73,7 @@ const categories = (await directus.request(readItems('categories')))
|
||||
---
|
||||
|
||||
<section class="mx-auto px-4 py-10 sm:px-6 lg:px-8 lg:py-14 lg:pt-10 2xl:max-w-full">
|
||||
<div class="grid grid-flow-row-dense grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<div class="grid grid-flow-row-dense grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
{categories.map((category) => {
|
||||
return (
|
||||
<div
|
||||
@@ -82,6 +84,8 @@ const categories = (await directus.request(readItems('categories')))
|
||||
slug={category.slug}
|
||||
title={category.title}
|
||||
description={category.description}
|
||||
logoLight={category.logoLight}
|
||||
logoDark={category.logoDark}
|
||||
count={postMap.get(category.slug)?.length ?? 0}
|
||||
publishDate={timeago(postMap.get(category.slug)?.[0]?.published_date)}
|
||||
/>
|
||||
|
||||
@@ -1,23 +1,39 @@
|
||||
---
|
||||
import GoLinkPrimaryButton from '@components/buttons/GoLinkPrimaryButton.astro';
|
||||
import Logo from '@components/images/Logo.astro';
|
||||
import { getDirectusImageURL } from '@/support/url';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
subTitle: string;
|
||||
logoExists?: boolean;
|
||||
logoLight?: string;
|
||||
logoDark?: string;
|
||||
btnExists?: boolean;
|
||||
btnTitle?: string;
|
||||
btnURL?: string;
|
||||
}
|
||||
|
||||
const { title, subTitle, btnExists, btnTitle, btnURL } = Astro.props;
|
||||
const { title, subTitle, logoExists, logoLight, logoDark, btnExists, btnTitle, btnURL } = Astro.props;
|
||||
---
|
||||
|
||||
<section class="mx-auto mt-10 px-4 sm:px-6 lg:px-8 lg:pt-10 2xl:max-w-full">
|
||||
<div class="flex-wrap md:flex md:items-center md:justify-between">
|
||||
<div class="w-full md:w-auto">
|
||||
<h1 class="smooth-reveal card-text-header block lg:text-6xl">
|
||||
{title}
|
||||
</h1>
|
||||
<div class="smooth-reveal flex flex-row items-center mb-4">
|
||||
{logoExists ? (
|
||||
<div class="shrink-0 mr-5">
|
||||
<Logo
|
||||
srcLight={getDirectusImageURL(logoLight!)}
|
||||
srcDark={getDirectusImageURL(logoDark!)}
|
||||
alt={`Logo of ${title}`}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
<h1 class="card-text-header block lg:text-6xl">
|
||||
{title}
|
||||
</h1>
|
||||
</div>
|
||||
<p class="smooth-reveal card-text-header-description mt-4">
|
||||
{subTitle}
|
||||
</p>
|
||||
|
||||
@@ -120,7 +120,7 @@ const normalizeTitle = !title ? global.name : `${title} | ${global.name}`;
|
||||
to bottom,
|
||||
transparent 0px,
|
||||
transparent 16px,
|
||||
black 80px,
|
||||
black 60px,
|
||||
black 100%
|
||||
);
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@ export type Category = {
|
||||
slug: string;
|
||||
title: string;
|
||||
description: string;
|
||||
logoLight: string;
|
||||
logoDark: string;
|
||||
};
|
||||
|
||||
export type Application = {
|
||||
|
||||
@@ -7,9 +7,8 @@ import markedShiki from 'marked-shiki';
|
||||
import { createHighlighter } from 'shiki';
|
||||
import { readItems, readSingleton } from '@directus/sdk';
|
||||
|
||||
import type { Category } from '@lib/directusTypes';
|
||||
|
||||
import SocialShareButton from '@components/buttons/SocialShareButton.astro';
|
||||
import Logo from '@components/images/Logo.astro';
|
||||
import BaseLayout from '@layouts/BaseLayout.astro';
|
||||
import directus from '@lib/directus';
|
||||
import { formatDate } from '@support/time';
|
||||
@@ -112,7 +111,18 @@ const content = marked.parse(post.content || '');
|
||||
href=`/categories/${category.slug}`
|
||||
data-astro-prefetch
|
||||
>
|
||||
{category.title}
|
||||
<div class="flex flex-row items-center shrink-0">
|
||||
<div class="mr-2">
|
||||
<Logo
|
||||
srcLight={getDirectusImageURL(category.logoLight)}
|
||||
srcDark={getDirectusImageURL(category.logoDark)}
|
||||
alt={`Logo of ${category.title}`}
|
||||
width = 18,
|
||||
height = 18,
|
||||
/>
|
||||
</div>
|
||||
{category.title}
|
||||
</div>
|
||||
</a>
|
||||
<span class="shrink-0 text-secondary text-sm mx-2 sm:mx-4">
|
||||
/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import { readItems, readSingleton } from '@directus/sdk';
|
||||
|
||||
import type { Post, Category } from '@lib/directusTypes';
|
||||
import type { Post } from '@lib/directusTypes';
|
||||
|
||||
import HeaderSection from '@components/sections/HeaderSection.astro';
|
||||
import BlogCard from '@components/cards/BlogCard.astro';
|
||||
@@ -54,8 +54,11 @@ const categoriesPosts = posts
|
||||
>
|
||||
|
||||
<HeaderSection
|
||||
title={category.title}
|
||||
title=`${category.title}`
|
||||
subTitle={category.description}
|
||||
logoExists
|
||||
logoLight={category.logoLight}
|
||||
logoDark={category.logoDark}
|
||||
btnExists
|
||||
btnTitle="Back to Categories"
|
||||
btnURL="/categories"
|
||||
|
||||
Reference in New Issue
Block a user