Skip to content

Commit

Permalink
rewrite to full astro
Browse files Browse the repository at this point in the history
  • Loading branch information
kharann committed Nov 20, 2023
1 parent 9962d70 commit 8798899
Show file tree
Hide file tree
Showing 58 changed files with 1,672 additions and 1,075 deletions.
1,155 changes: 1,104 additions & 51 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions web/.eslintrc.cjs → web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const config = require("../.eslintrc.cjs")

module.exports = {
...config,
// ...
extends: [
...config.extends,
// ...
"plugin:astro/recommended",
],
// ...
overrides: [
{
// Define the configuration for `.astro` file.
Expand All @@ -23,6 +22,6 @@ module.exports = {
// "astro/no-set-html-directive": "error"
},
},
// ...
],
ignorePatterns: ['**/*.js']
}
3 changes: 2 additions & 1 deletion web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# build output
dist/
.output/
# generated types
.astro/

# dependencies
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion web/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"],
"unwantedRecommendations": []
}
3 changes: 0 additions & 3 deletions web/.vscode/settings.json

This file was deleted.

64 changes: 41 additions & 23 deletions web/README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,68 @@
# Welcome to [Astro](https://astro.build)
# Astro Starter Kit: Blog

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/s/github/withastro/astro/tree/latest/examples/basics)
```sh
npm create astro@latest -- --template blog
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/blog)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/blog)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/blog/devcontainer.json)

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
![basics](https://user-images.githubusercontent.com/4677417/186188965-73453154-fdec-4d6b-9c34-cb35c248ae5b.png)
![blog](https://github.com/withastro/astro/assets/2244813/ff10799f-a816-4703-b967-c78997e8323d)

Features:

- ✅ Minimal styling (make it your own!)
- ✅ 100/100 Lighthouse performance
- ✅ SEO-friendly with canonical URLs and OpenGraph data
- ✅ Sitemap support
- ✅ RSS Feed support
- ✅ Markdown & MDX support

## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

```
/
```text
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
│   ├── components/
│   ├── content/
│   ├── layouts/
│   └── pages/
├── astro.config.mjs
├── README.md
├── package.json
└── tsconfig.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

The `src/content/` directory contains "collections" of related Markdown and MDX documents. Use `getCollection()` to retrieve posts from `src/content/blog/`, and type-check your frontmatter using an optional schema. See [Astro's Content Collections docs](https://docs.astro.build/en/guides/content-collections/) to learn more.

Any static assets, like images, can be placed in the `public/` directory.

## 🧞 Commands

All commands are run from the root of the project, from a terminal:

| 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 astro ...` | Run CLI commands like `astro add`, `astro preview` |
| `npm run astro --help` | Get help using the Astro CLI |
| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## 👀 Want to learn more?

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).

## Credit

This theme is based off of the lovely [Bear Blog](https://github.com/HermanMartinus/bearblog/).
25 changes: 7 additions & 18 deletions web/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import { defineConfig } from 'astro/config'
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';

// https://astro.build/config
import tailwind from '@astrojs/tailwind'
import svelte from '@astrojs/svelte'

// https://astro.build/config
import mdx from '@astrojs/mdx'
import { remarkReadingTime } from './src/lib/remark-reading-time'
import tailwind from "@astrojs/tailwind";

// https://astro.build/config
export default defineConfig({
integrations: [
tailwind({
applyBaseStyles: false
}),
svelte(),
mdx({
remarkPlugins: [remarkReadingTime]
})
]
})
site: 'https://example.com',
integrations: [mdx(), sitemap(), tailwind({configFile: "./tailwind.config.cjs"})]
});
Binary file added web/bun.lockb
Binary file not shown.
79 changes: 33 additions & 46 deletions web/package.json
Original file line number Diff line number Diff line change
@@ -1,47 +1,34 @@
{
"name": "@kharann/web",
"type": "module",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"lint": "eslint --max-warnings 0 .",
"lint:fix": "eslint --fix .",
"astro": "astro"
},
"dependencies": {
"@astrojs/mdx": "^1.1.0",
"@astrojs/partytown": "^2.0.0",
"@astrojs/svelte": "^4.0.2",
"@astrojs/tailwind": "^5.0.0",
"@portabletext/svelte": "2.0.0",
"@sanity/client": "^6.4.12",
"@tailwindcss/typography": "^0.5.10",
"astro": "^3.1.2",
"astro-icon": "^0.8.1",
"astro-seo": "^0.8.0",
"clsx": "^2.0.0",
"date-fns": "^2.30.0",
"eslint-plugin-astro": "^0.29.0",
"feather-icons": "^4.29.1",
"groq": "^3.16.7",
"iconify-icon": "^1.0.8",
"mdast-util-to-string": "^4.0.0",
"prism-svelte": "^0.5.0",
"prismjs": "^1.29.0",
"reading-time": "^1.5.0",
"sharp": "^0.32.6",
"svelte": "^4.2.1",
"tailwindcss": "^3.3.3"
},
"devDependencies": {
"@radix-ui/colors": "3.0.0-rc.5",
"@types/prismjs": "^1.26.0"
},
"volta": {
"node": "18.17.1"
}
}
"name": "web-reforged",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.3.1",
"@astrojs/mdx": "^1.1.4",
"@astrojs/rss": "^3.0.0",
"@astrojs/sitemap": "^3.0.3",
"@astrojs/tailwind": "^5.0.2",
"@radix-ui/colors": "^3.0.0",
"@tailwindcss/typography": "^0.5.10",
"astro": "^3.5.0",
"astro-icon": "^0.8.1",
"clsx": "^2.0.0",
"iconify-icon": "^1.0.8",
"tailwind-merge": "^2.0.0",
"tailwindcss": "^3.0.24",
"typescript": "^5.2.2"
},
"devDependencies": {
"@typescript-eslint/parser": "^6.10.0",
"eslint": "^8.53.0",
"eslint-plugin-astro": "^0.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0"
}
}
6 changes: 1 addition & 5 deletions web/prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
module.exports = {
useTabs: true,
trailingComma: 'none',
semi: false,
printWidth: 100,
bracketSpacing: true,
printWidth: 120,
singleQuote: true
}
1 change: 0 additions & 1 deletion web/public/analytics.js

This file was deleted.

Binary file added web/public/fonts/atkinson-bold.woff
Binary file not shown.
Binary file added web/public/fonts/atkinson-regular.woff
Binary file not shown.
1 change: 0 additions & 1 deletion web/public/umami.js

This file was deleted.

58 changes: 0 additions & 58 deletions web/src/api/frontpage.ts

This file was deleted.

Loading

0 comments on commit 8798899

Please sign in to comment.