diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 40f3adb..a5f055a 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - name: Checkout 🛎️ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6bb13c4..d93323c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,14 +5,25 @@ on: branches: - main +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: build: - runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - name: Checkout 🛎️ @@ -36,10 +47,12 @@ jobs: npx next build && npx next export touch out/.nojekyll # CI: false # true -> fails on warning - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages # The branch the action should deploy to. - folder: out # The folder the action should deploy. - clean: true # Automatically remove deleted files from the deploy branch + path: "out" + - name: Deploy to GitHub Pages 🚀 + id: deployment + uses: actions/deploy-pages@v4 diff --git a/components/PublicationCard/0_Bqr-dMZplB-namyY.jpg b/components/PublicationCard/0_Bqr-dMZplB-namyY.jpg new file mode 100644 index 0000000..562e27a Binary files /dev/null and b/components/PublicationCard/0_Bqr-dMZplB-namyY.jpg differ diff --git a/components/PublicationCard/0_gTl35Xy5zRcgu5wJ.png b/components/PublicationCard/0_gTl35Xy5zRcgu5wJ.png new file mode 100644 index 0000000..0343598 Binary files /dev/null and b/components/PublicationCard/0_gTl35Xy5zRcgu5wJ.png differ diff --git a/components/PublicationCard/0_o9UzuQyUwobacrCt.jpg b/components/PublicationCard/0_o9UzuQyUwobacrCt.jpg new file mode 100644 index 0000000..2060cf1 Binary files /dev/null and b/components/PublicationCard/0_o9UzuQyUwobacrCt.jpg differ diff --git a/components/PublicationCard/2_1JTGoMi8_nuGQVO1EoItXg.png b/components/PublicationCard/2_1JTGoMi8_nuGQVO1EoItXg.png new file mode 100644 index 0000000..38c3597 Binary files /dev/null and b/components/PublicationCard/2_1JTGoMi8_nuGQVO1EoItXg.png differ diff --git a/components/PublicationCard/2_k7vMxGfKwfqJ86TcprDA_Q.jpg b/components/PublicationCard/2_k7vMxGfKwfqJ86TcprDA_Q.jpg new file mode 100644 index 0000000..2711f08 Binary files /dev/null and b/components/PublicationCard/2_k7vMxGfKwfqJ86TcprDA_Q.jpg differ diff --git a/components/PublicationCard/PublicationCard.module.scss b/components/PublicationCard/PublicationCard.module.scss index fbe16a5..33dcbe9 100644 --- a/components/PublicationCard/PublicationCard.module.scss +++ b/components/PublicationCard/PublicationCard.module.scss @@ -23,14 +23,13 @@ } h2 { - font-family: "Conduit ITC W04 Regular", 'system-ui'; + font-family: "Conduit ITC W04 Regular", "system-ui"; font-size: 180%; } } .publication-card--avatar { background-color: $red; - background-size: 50px; border-radius: 50%; color: black; height: 50px; @@ -39,6 +38,16 @@ text-align: center; font-size: 40px; font-family: "Righteous", sans-serif; + + .publication-card--avatar-img { + border-radius: 50%; + height: 50px; + width: 50px; + position: absolute; + top: 0; + background-size: 50px; + overflow: hidden; + } } .publication-card--author { diff --git a/components/PublicationCard/PublicationCard.tsx b/components/PublicationCard/PublicationCard.tsx index c7e206e..5d84bda 100644 --- a/components/PublicationCard/PublicationCard.tsx +++ b/components/PublicationCard/PublicationCard.tsx @@ -3,41 +3,19 @@ import { formatDate } from "../../lib/formatDate"; import { IPublication } from "../../lib/publications/publications.types"; // import SanitizedHTML from 'react-sanitized-html'; import styles from "./PublicationCard.module.scss"; +import { PublicationCardAvatar } from "./PublicationCardAvatar"; interface IPublicationCardProps { publication: IPublication; } -const avatars: Record = { - mdworld: "https://miro.medium.com/fit/c/176/176/0*gTl35Xy5zRcgu5wJ.png", - "nathan perdijk": - "https://miro.medium.com/fit/c/88/88/0*Bqr-dMZplB-namyY.jpg", - "bjorn ‘bjeaurn’": - "https://miro.medium.com/fit/c/176/176/0*o9UzuQyUwobacrCt.jpeg", - "hamza haiken": - "https://miro.medium.com/fit/c/176/176/2*1JTGoMi8_nuGQVO1EoItXg.png", - "nick ten veen": - "https://miro.medium.com/fit/c/88/88/2*k7vMxGfKwfqJ86TcprDA_Q.jpeg", -}; - const PublicationCard: FC = ({ publication }) => { const { title, author, uniqueSlug, latestPublishedAt } = publication; - const avatar = avatars[author.toLowerCase()]; + return (
-
- {avatar ? "" : author.slice(0, 1).toUpperCase()} -
+

{author}

diff --git a/components/PublicationCard/PublicationCardAvatar.tsx b/components/PublicationCard/PublicationCardAvatar.tsx new file mode 100644 index 0000000..db281ca --- /dev/null +++ b/components/PublicationCard/PublicationCardAvatar.tsx @@ -0,0 +1,30 @@ +import { FC } from "react"; +import styles from "./PublicationCard.module.scss"; +import nathanImg from "./0_Bqr-dMZplB-namyY.jpg"; +import mdworldImg from "./0_gTl35Xy5zRcgu5wJ.png"; +import nickImg from "./2_k7vMxGfKwfqJ86TcprDA_Q.jpg"; +import hamzaImg from "./2_1JTGoMi8_nuGQVO1EoItXg.png"; +import bjornImg from "./0_o9UzuQyUwobacrCt.jpg"; +import Image, { StaticImageData } from "next/image"; + +const avatars: Record = { + mdworld: mdworldImg, + "nathan perdijk": nathanImg, + "bjorn ‘bjeaurn’": bjornImg, + "hamza haiken": hamzaImg, + "nick ten veen": nickImg, +}; + +export const PublicationCardAvatar: FC<{ author: string }> = ({ author }) => { + const avatar = avatars[author.toLowerCase()]; + + return ( +

+
{author.slice(0, 1).toUpperCase()}
+ +
+ {avatar && avatar} +
+
+ ); +}; diff --git a/components/TopBar/TopBar.module.scss b/components/TopBar/TopBar.module.scss index 959dfaf..f0c700e 100644 --- a/components/TopBar/TopBar.module.scss +++ b/components/TopBar/TopBar.module.scss @@ -30,6 +30,7 @@ a { border-radius: 4px; padding: 10px; + color: var(--cs-brutalist-creme); &:hover { background-color: #222; diff --git a/components/TopBar/TopBar.tsx b/components/TopBar/TopBar.tsx index 6e78e0e..b94c7e6 100644 --- a/components/TopBar/TopBar.tsx +++ b/components/TopBar/TopBar.tsx @@ -18,7 +18,9 @@ const TopBar: FC = () => {
  • Codelancer
  • */}
  • - Contact + + Contact +
  • diff --git a/lib/publications/publications.types.ts b/lib/publications/publications.types.ts index 05075b6..e5320c4 100644 --- a/lib/publications/publications.types.ts +++ b/lib/publications/publications.types.ts @@ -17,6 +17,7 @@ export interface IMediumRSSResponse { id: string; title: string; author: string; + avatar?: string; latestPublishedAt: string; uniqueSlug: string; paragraphs: string;