Skip to content

Commit

Permalink
feat: complete rewrite, full restyle, astro upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-salvagni committed Jul 11, 2024
1 parent fbb166e commit f66432e
Show file tree
Hide file tree
Showing 143 changed files with 6,028 additions and 8,976 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*]
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/
Expand All @@ -17,6 +19,3 @@ pnpm-debug.log*

# macOS-specific files
.DS_Store

# vscode
# .vscode
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"tabWidth": 2,
"requireConfig": false,
"useTabs": false,
"trailingComma": "none",
"trailingComma": "all",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"semi": true
Expand Down
6 changes: 0 additions & 6 deletions .stackblitzrc

This file was deleted.

4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
84 changes: 15 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,69 +1,15 @@
<p align="center">
<img height="100" src="https://user-images.githubusercontent.com/6751621/184249262-808f34be-5142-4fd9-a5b9-ffb617fe8dae.png">
</p><br/>

This website is statically generated thanks to **Astro**, a new (1.0.0-rc.1 at
the moment) all-in-one web framework for building fast, content-focused
websites. Here are some of its features:

- **Component Islands**: Interactive UI component on an otherwise static page of
HTML.
- **Server-first API design**: Astro renders directly to HTML & CSS, eliminating
heavy JavaScript automatically.
- **Zero JS, by default**: No JavaScript runtime overhead.
- **Edge-ready**: Deploy anywhere, even a global edge runtime like Deno or
Cloudflare.
- **UI-agnostic**: Supports React, Preact, Svelte, Vue, Solid, Lit and more.

The folder structure of this website looks something like this:

```
.
├── public/
│ └── assets
└── src/
├── components/
├── layouts/
├── pages/
├── scripts/
└── style/
```

[Astro](https://astro.build/) looks for `.astro` or `.md` files in the
`/src/pages/` directory. Each page is exposed as a route based on its file name.
If the page has [brackets] in it's name it's a
[dynamic route](https://docs.astro.build/en/core-concepts/routing/).

Page layouts are in the `src/layouts` folder while `src/components/` is where I
put anything that I want to re-use inside pages. All client side JS is put into
the `src/scripts/` folder.

All global styles are in `src/styles/` and written with
[SASS](https://sass-lang.com/). Individual page or component styles are in each
page or component file inside the `<style>` tags.

Every time a commit is pushed,
[GitHub Actions](https://github.com/features/actions) will build and deploy this
website to an [AWS S3](https://aws.amazon.com/s3/) bucket.

-----

### ⌛ Old stack

The stack mentioned above is replacing the following one:

> [Gulp](http://gulpjs.com/) is used to automate the build process. The base of
> the site generator is [Metalsmith](http://www.metalsmith.io/), the stylesheets
> are compiled from SASS using the [Bourbon](http://bourbon.io/) library and
> [Neat](https://neat.bourbon.io/) for the responsive grid. Templates are
> written with [Handlebars](http://handlebarsjs.com/) and the content in
> Markdown with YAML frontmatter. Comments to the blog posts are retrieved from
> this repository's issue page using GitHub's API and rendered using
> [Vue.js](https://vuejs.org).
>
> After a succesful build the website is automatically deployed by
> [Travis](https://travis-ci.org/) on an [AWS S3](https://aws.amazon.com/s3/)
> bucket.
>
> Last commit with the old stack on Github:
> [49d02f4](https://github.com/daniele-salvagni/dan.salvagni.io/tree/8683abe17b23604994093feea37b9d0b1656da4d)
# dan.salvagni.io

Static site generator for my personal website. Built with Astro and continuously
deployed to AWS.

```sh
npm run dev
npm run devhost
```

<br /><br />

<p align="center">
<img height="100" src="public/duck.png">
</p>
28 changes: 22 additions & 6 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import vue from '@astrojs/vue';
import sitemap from '@astrojs/sitemap';
import theme from 'shiki/themes/github-light.json';
import alpinejs from '@astrojs/alpinejs';
const customizedTheme = {
...theme,
colors: {
...theme.colors,
'editor.background': '#fafafa',
},
};

// https://astro.build/config
export default defineConfig({
markdown: {
shikiConfig: {
theme: 'material-lighter',
wrap: false
}
// Choose from Shiki's built-in themes (or add your own)
// https://github.com/shikijs/shiki/blob/main/docs/themes.md
theme: customizedTheme,
// Add custom languages
// Note: Shiki has countless langs built-in, including .astro!
// https://github.com/shikijs/shiki/blob/main/docs/languages.md
langs: [],
// Enable word wrap to prevent horizontal scrolling
wrap: false,
},
},
integrations: [mdx(), vue()],
site: `http://localhost:3000`
site: 'https://dan.salvagni.io',
integrations: [mdx(), sitemap(), alpinejs()],
});
Loading

0 comments on commit f66432e

Please sign in to comment.