From 44b7ed59a54123a4cbb4975276ce2fcdd998c729 Mon Sep 17 00:00:00 2001 From: Devin <40843522+devthedevel@users.noreply.github.com> Date: Sat, 13 Jan 2024 22:42:42 -0330 Subject: [PATCH] Ran prettier --- .github/workflows/deploy.yml | 10 +- astro.config.mjs | 8 +- src/components/BaseHead.astro | 56 +++-- src/components/Footer.astro | 101 ++++---- src/components/FormattedDate.astro | 16 +- src/components/Header.astro | 132 +++++----- src/components/HeaderLink.astro | 18 +- src/consts.ts | 3 +- src/content/blog/_exploring-ruby-part-1.md | 8 +- .../blog/developing_devthedevel_part_1.md | 6 +- src/content/config.ts | 18 +- src/layouts/BlogPost.astro | 146 +++++------ src/pages/404.astro | 37 +-- src/pages/about.astro | 78 +++--- src/pages/blog/[...slug].astro | 19 +- src/pages/blog/index.astro | 235 +++++++++--------- src/pages/index.astro | 97 ++++---- src/pages/rss.xml.js | 22 +- src/styles/global.css | 174 ++++++------- tsconfig.json | 2 +- 20 files changed, 622 insertions(+), 564 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9b3b66a..4f4766c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,7 +4,7 @@ on: # Trigger the workflow every time you push to the `main` branch # Using a different branch name? Replace `main` with your branch’s name push: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab on GitHub. workflow_dispatch: @@ -23,9 +23,9 @@ jobs: - name: Install, build, and upload your site uses: withastro/action@v0 # with: - # path: . # The root location of your Astro project inside the repository. (optional) - # node-version: 16 # The specific version of Node that should be used to build your site. Defaults to 16. (optional) - # package-manager: yarn # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) + # path: . # The root location of your Astro project inside the repository. (optional) + # node-version: 16 # The specific version of Node that should be used to build your site. Defaults to 16. (optional) + # package-manager: yarn # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) deploy: needs: build @@ -36,4 +36,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 \ No newline at end of file + uses: actions/deploy-pages@v1 diff --git a/astro.config.mjs b/astro.config.mjs index 7bf8947..facd438 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,9 +1,9 @@ -import { defineConfig } from "astro/config"; -import mdx from "@astrojs/mdx"; -import sitemap from "@astrojs/sitemap"; +import { defineConfig } from 'astro/config'; +import mdx from '@astrojs/mdx'; +import sitemap from '@astrojs/sitemap'; // https://astro.build/config export default defineConfig({ - site: "https://www.devthedevel.xyz/", + site: 'https://www.devthedevel.xyz/', integrations: [mdx(), sitemap()], }); diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 3441240..2d5c024 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -4,9 +4,9 @@ import '../styles/global.css'; interface Props { - title: string; - description: string; - image?: string; + title: string; + description: string; + image?: string; } const canonicalURL = new URL(Astro.url.pathname, Astro.site); @@ -15,33 +15,45 @@ const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props; --- - - - - + + + + - - + + - + {title} - - + + - - - - - + + + + + - - - - - + + + + + diff --git a/src/components/Footer.astro b/src/components/Footer.astro index a549546..647dc48 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -3,54 +3,61 @@ const today = new Date(); --- diff --git a/src/components/FormattedDate.astro b/src/components/FormattedDate.astro index 1bcce73..60b112c 100644 --- a/src/components/FormattedDate.astro +++ b/src/components/FormattedDate.astro @@ -1,17 +1,17 @@ --- interface Props { - date: Date; + date: Date; } const { date } = Astro.props; --- diff --git a/src/components/Header.astro b/src/components/Header.astro index 1702395..499f577 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -4,73 +4,73 @@ import { SITE_TITLE } from '../consts'; ---
- +
diff --git a/src/components/HeaderLink.astro b/src/components/HeaderLink.astro index 3dd439b..187891f 100644 --- a/src/components/HeaderLink.astro +++ b/src/components/HeaderLink.astro @@ -10,15 +10,15 @@ const isActive = href === pathname || href === pathname.replace(/\/$/, ''); --- - + diff --git a/src/consts.ts b/src/consts.ts index 22c751d..811943e 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -2,4 +2,5 @@ // You can import this data from anywhere in your site by using the `import` keyword. export const SITE_TITLE = 'devthedevel'; -export const SITE_DESCRIPTION = 'Welcome to my little slice of the internet where I talk about my projects, things in the tech world, or just rant about things. Enjoy!'; +export const SITE_DESCRIPTION = + 'Welcome to my little slice of the internet where I talk about my projects, things in the tech world, or just rant about things. Enjoy!'; diff --git a/src/content/blog/_exploring-ruby-part-1.md b/src/content/blog/_exploring-ruby-part-1.md index 10e830a..4799fab 100644 --- a/src/content/blog/_exploring-ruby-part-1.md +++ b/src/content/blog/_exploring-ruby-part-1.md @@ -7,13 +7,13 @@ heroImage: '/blog/chris-ried-ieic5Tq8YMk-unsplash.jpg' ## Intro -Its been awhile since I played around with another language besides Typescript. Everything I have done professionally in the last 5 years has been Typescript and its my go-to language for any silly side projects I do. Some of those side projects are in different languages but I've never treated them as serious projects to learn something new with. +Its been awhile since I played around with another language besides Typescript. Everything I have done professionally in the last 5 years has been Typescript and its my go-to language for any silly side projects I do. Some of those side projects are in different languages but I've never treated them as serious projects to learn something new with. -The main issue with the majority of my side projects (and I'm sure you agree) is that there's no _motivation_ to continue working on them once the honeymoon phase is over. Once I'm done checking out new tech, I usually just forget about the project. I'm not sure why: perhaps its because I have no real use for the project. Or maybe I just didn't like it. Whatever the reasons are for dropping side projects, its always saddens me to get excited about something new and then do _nothing_ with it. +The main issue with the majority of my side projects (and I'm sure you agree) is that there's no _motivation_ to continue working on them once the honeymoon phase is over. Once I'm done checking out new tech, I usually just forget about the project. I'm not sure why: perhaps its because I have no real use for the project. Or maybe I just didn't like it. Whatever the reasons are for dropping side projects, its always saddens me to get excited about something new and then do _nothing_ with it. So I'm going to try something new. I'm going to learn a new language, and write blogs about my journey. This should motivate me... right? -But what language should I learn? I've always leaned towards backend development so why not find a language thats popular for backend? It just so happens a friend told me about Ruby not too long ago and that I should give it a try. Why not? Ruby is popular for backend development, and comparable to Javascript which should make an easy transition. +But what language should I learn? I've always leaned towards backend development so why not find a language thats popular for backend? It just so happens a friend told me about Ruby not too long ago and that I should give it a try. Why not? Ruby is popular for backend development, and comparable to Javascript which should make an easy transition. So I've decided to learn Ruby! @@ -25,4 +25,4 @@ Now I got a new language, and a project. All I need to do is get started! Uhh... _how_ do I get started? -Starting projects are always the hardest part in my opinion. Theres always so much to do, especially if you are starting out with a completely new tech stack. So I started at step 0: installing Ruby. \ No newline at end of file +Starting projects are always the hardest part in my opinion. Theres always so much to do, especially if you are starting out with a completely new tech stack. So I started at step 0: installing Ruby. diff --git a/src/content/blog/developing_devthedevel_part_1.md b/src/content/blog/developing_devthedevel_part_1.md index ad66f17..476db51 100644 --- a/src/content/blog/developing_devthedevel_part_1.md +++ b/src/content/blog/developing_devthedevel_part_1.md @@ -11,7 +11,7 @@ First of all if you are reading this then welcome to my site! Thanks for being h I created this site way back in the summer of 2023, just for something to do. I wanted to learn Astro, and I wanted to get some more experience building frontends. I also wanted my own _semi_-professional website. So I started a new Astro project, bought a new domain, and got to work. -And at some point while I was setting up, I realized that I wanted to make a blog about my journey developing this actual site. Which sounds like a great re-occuring blog segment in my opinion! +And at some point while I was setting up, I realized that I wanted to make a blog about my journey developing this actual site. Which sounds like a great re-occuring blog segment in my opinion! The goal of this blog is to hopefully educate and entertain newer software developers. Another goal is to help me build up my own site and portfolio. And yet another goal is to keep me busy learning new things. And even yet another goal is to motivate me to actually stick to a project (instead of working on a project for a couple days and then throwing it into the abyss that is my 'backlog' 😩). @@ -84,7 +84,7 @@ If you have been paying attention you may be wondering how blogs within `content Astro supports _dynamic routing_: all you need to do is name the file correctly and tell Astro how to generate the static paths for a page. -Step one: naming the file. Naming a file `[...path].astro` will tell Astro to pass the path into the component script. You can access the path via `Astro.params` in the component script. +Step one: naming the file. Naming a file `[...path].astro` will tell Astro to pass the path into the component script. You can access the path via `Astro.params` in the component script. Step two: generating static paths. Within the component script you can export a function called `getStaticPaths()`. This function should return an array of objects that define static paths for the page. This allows you to generate pages that have different contents based on its path. This lets me write as many blogs I want in `content/blog/` and never have to write an individual corresponding page in `pages/blog`. @@ -154,4 +154,4 @@ I'll also leave a link to the [repo](https://github.com/devthedevel/personal_web Well that was waaay longer than I expected. I'm proud that I returned to this project and even prouder that I actually wrote a blog post! I hope you enjoyed reading this more than I enjoyed getting this site to its current stage. -Cheers 🍺 \ No newline at end of file +Cheers 🍺 diff --git a/src/content/config.ts b/src/content/config.ts index f041922..a801152 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -1,15 +1,15 @@ import { defineCollection, z } from 'astro:content'; const blog = defineCollection({ - // Type-check frontmatter using a schema - schema: z.object({ - title: z.string(), - description: z.string(), - // Transform string to Date object - pubDate: z.coerce.date(), - updatedDate: z.coerce.date().optional(), - heroImage: z.string().optional(), - }), + // Type-check frontmatter using a schema + schema: z.object({ + title: z.string(), + description: z.string(), + // Transform string to Date object + pubDate: z.coerce.date(), + updatedDate: z.coerce.date().optional(), + heroImage: z.string().optional(), + }), }); export const collections = { blog }; diff --git a/src/layouts/BlogPost.astro b/src/layouts/BlogPost.astro index e67b2b3..c5b56e5 100644 --- a/src/layouts/BlogPost.astro +++ b/src/layouts/BlogPost.astro @@ -10,76 +10,80 @@ type Props = CollectionEntry<'blog'>['data']; const { title, description, pubDate, updatedDate, heroImage } = Astro.props; --- - - - - - + + + + + - -
-
-
-
- {heroImage && } -
-
-
-
- - { - updatedDate && ( -
- Last updated on -
- ) - } -
-

{title}

-
-
- -
-
-
-