Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/johnzanussi/johnzanussi.com

My personal website built with Astro.
https://github.com/johnzanussi/johnzanussi.com

astro astrojs bootstrap javascript sass typescript

Last synced: about 20 hours ago
JSON representation

My personal website built with Astro.

Awesome Lists containing this project

README

        

# johnzanussi.com
A place where I write about technology, 3D Printing, and other hobby projects I have going on.

[johnzanussi.com](https://johnzanussi.com)

Built with [Astro](https://astro.build/). Hosted on [Vercel](https://vercel.com/).

## Table of Contents
* [Project Structure](#-project-structure)
* [Commands](#-commands)
* [Built With](#-built-with)
* [Libraries](#-libraries)
* [Services](#-services)
* [Writing Content](#-writing-content)
* [Content Frontmatter](#-content-frontmatter)
* [Pages](#-pages)
* [Posts](#-posts)
* [MDX Components](#-mdx-components)
* [Image Shortcut](#-image-shortcut)

## ๐Ÿš€ Project Structure

```text
/
โ”œโ”€โ”€ public/
โ”œโ”€โ”€ src/
โ””โ”€โ”€ assets/
โ”‚ โ””โ”€โ”€ image.png
โ””โ”€โ”€ components/
โ”‚ โ””โ”€โ”€ Component.astro
โ””โ”€โ”€ content/
โ”‚ โ””โ”€โ”€ pages
โ”‚ | โ””โ”€โ”€ page-title
โ”‚ | โ””โ”€โ”€ index.mdx
โ”‚ | โ””โ”€โ”€ image.jpg
โ”‚ โ””โ”€โ”€ posts
โ”‚ โ””โ”€โ”€ post-slug
โ”‚ โ””โ”€โ”€ index.mdx
โ”‚ โ””โ”€โ”€ image.jpg
โ””โ”€โ”€ layouts/
โ”‚ โ””โ”€โ”€ Layout.astro
โ””โ”€โ”€ pages/
โ”‚ โ””โ”€โ”€ posts
โ”‚ โ””โ”€โ”€ [slug].astro
โ”‚ โ””โ”€โ”€ index.astro
โ”‚ โ””โ”€โ”€ [page].astro
โ””โ”€โ”€ scripts/
โ”‚ โ””โ”€โ”€ script.ts
โ””โ”€โ”€ styles/
โ”‚ โ””โ”€โ”€ styles.scss
โ””โ”€โ”€ utils/
โ”‚ โ””โ”€โ”€ util.ts
โ””โ”€โ”€ package.json
```

## ๐Ÿงž Commands

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run check` | Shortcut for `astro check` |
| `npm run update` | Shortcut for `npx npm-check-updates` |
| `npm run ts` | Shortcut for `tsc --noEmit` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## ๐Ÿšง Built With
Read more about why I chose these libraries and services on the [Built With](https://johnzanussi.com/built-with) page.

### ๐Ÿ“š Libraries

* [Astro](https://astro.build/)
* [Bootstrap](https://getbootstrap.com/)
* [Font Awesome](https://fontawesome.com/)

### ๐Ÿ› ๏ธ Services

* [Vercel](https://vercel.com/)
* [FastComments](https://fastcomments.com/)
* [Plausible](https://plausible.io/)

## ๐Ÿ“ Writing Content
1. Create a new directory in either `src/content/pages` or `src/content/posts`. The directory name will be used for the generated URL of the content.
2. Create an `index.mdx` file within the directory. This is where the page or post content lives.
3. Add any images or other files specific to that content within the directory.

### ๐ŸŽ›๏ธ Content Frontmatter

#### ๐Ÿ“„ Pages
| Property | Type | Required | Notes |
| :-- | :-- | :-- | :-- |
| `title` | `String` | Yes | |
| `excerpt` | `String` | No | | Used on [/pages](https://johnzanussi.com/pages) and in meta tags description. |
| `cover` | `ImageMetaData` | Yes | Image should be 16x9 ratio |
| `draft` | `Boolean` | No | Setting to `true` only displays the page in dev environments |

#### ๐Ÿ—’๏ธ Posts
| Property | Type | Required | Notes |
| :-- | :-- | :-- | :-- |
| `title` | `String` | Yes | |
| `excerpt` | `String` | No | Used on [/posts](https://johnzanussi.com/posts) and in meta tags description. |
| `cover` | `ImageMetaData` | Yes | Image should be 16x9 ratio |
| `date` | `String` | Yes | Value is passed to `new Date()` |
| `hasAmazonLinks` | `Boolean` | No | Default `false`. If `true` the [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/AmazonDisclosure.astro) component will be rendered at the bottom of the post. |
| `hiddenIntro` | `Boolean` | No | Default `false`. If `true` and the post contains `## Intro` the resulting heading will be removed from the rendered page but the `Intro` link will remain in the table of contents. |
| `draft` | `Boolean` | No | Setting to `true` only displays the page in dev environments |

### ๐Ÿงฉ MDX Components
The following components are made available in all `.mdx` files without the need to explicitly import.

* [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/Aside.astro)
* [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/AmazonProducts.astro)
* [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/Markdown/Math.astro)
* [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/Markdown/Wire.astro)
* [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/Markdown/Columns.astro)
* [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/Grid.Markdown/astro)
* [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/WorkHistory.astro)
* [``](https://github.com/johnzanussi/johnzanussi.com/blob/main/src/components/YouTubeEmbed.astro)

### โคด๏ธ Image Shortcut

When writing post content in any `src/posts/[post-slug]/index.mdx` file you can type `img` followed by a `tab` to auto-create the following code.

```markdown
img โžก๏ธ
```

```markdown
![](@/content/posts/post-slug/)
```

This behavior lives in `.vscode/MDX Image Paths.code-snippets`.