Skip to content

Commit

Permalink
v1.3.0 (#2)
Browse files Browse the repository at this point in the history
- Add astro-compress lib;
- Update `host` to true, now `yarn dev` will run on local network;
- Update `paths` from `tsconfig`;
- Move `/layouts` to `/components`;
- Move `Card.astro` to `/components/core`;
- Update imports;
- Update README.
  • Loading branch information
LucJosin authored Aug 26, 2022
1 parent 948f06a commit bae413f
Show file tree
Hide file tree
Showing 8 changed files with 551 additions and 59 deletions.
55 changes: 26 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
# Welcome to [Astro](https://astro.build)
# Welcome to [Astro](https://astro.build) boilerplate

## 🚀 Project Structure
## Usage

Inside of your Astro project, you'll see the following folders and files:
- [Fork](https://github.com/LucJosin/astro-init/fork)
- [Download](https://github.com/LucJosin/astro-init/archive/refs/heads/main.zip)
- [Degit](https://github.com/Rich-Harris/degit)
- ```
degit LucJosin/astro-init
```
```
/
├── public/
│ └── favicon.ico
├── src/
│ ├── components/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```
## Dependencies
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
See more Astro [integrations](https://astro.build/integrations/)
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components or layouts.
- [@astrojs/sitemap](https://www.npmjs.com/package/@astrojs/sitemap)
- [astro](https://www.npmjs.com/package/astro)
- [astro-compress](https://www.npmjs.com/package/astro-compress)
- [eslint](https://www.npmjs.com/package/eslint)
- [prettier](https://www.npmjs.com/package/prettier)
Any static assets, like images, can be placed in the `public/` directory.

## 🧞 Commands
## 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 |
| :------------------ | :------------------------------------------------- |
| `yarn install` | Installs dependencies |
| `yarn dev` | Starts local dev server at `localhost:3000` |
| `yarn build` | Build your production site to `./dist/` |
| `yarn preview` | Preview your build locally, before deploying |
| `yarn astro ...` | Run CLI commands like `astro add`, `astro preview` |
| `yarn astro --help` | Get help using the Astro CLI |
## 👀 Want to learn more?
## Want to learn more?
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
Feel free check the [documentation](https://docs.astro.build).
15 changes: 10 additions & 5 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import { defineConfig } from "astro/config";
import sitemap from '@astrojs/sitemap';
import { defineConfig } from 'astro/config';

import sitemap from "@astrojs/sitemap";
import compress from 'astro-compress';

// https://astro.build/config
export default defineConfig({
// Your final, deployed URL.
//
// Astro uses this full URL to generate your sitemap
// and canonical URLs in your final build.
site: "https://www.my-site.dev",
site: 'https://www.my-site.dev',
// Specifies the output target for builds.s
//
// ‘static’ - Building a static site to be deploy to any static host.
output: "static",
output: 'static',
// Astro sitemap.
//
// Ref: https://docs.astro.build/en/guides/integrations-guide/sitemap/
integrations: [sitemap()],
integrations: [sitemap(), compress()],
// Listen on all addresses, including LAN and public addresses.
//
// Ref: https://docs.astro.build/en/reference/configuration-reference/#serverhost
server: { host: true },
});
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lucjosin/astro-init",
"version": "1.2.0",
"version": "1.3.0",
"private": true,
"scripts": {
"dev": "astro dev",
Expand All @@ -14,6 +14,7 @@
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"astro": "^1.0.6",
"astro-compress": "^1.0.5",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-astro": "^0.17.1",
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Card from '../components/Card.astro';
import Layout from '../layouts/Layout.astro';
import Card from '@components/core/Card.astro';
import Layout from '@components/layouts/Layout.astro';
---

<Layout title="Welcome to Astro.">
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"baseUrl": "./src",
"paths": {
"@components/*": ["components/*"],
"@layouts/*": ["layouts/*"],
"@models/*": ["models/*"],
"@constants/*": ["constants/*"],
"@utils/*": ["utils/*"]
}
}
Expand Down
Loading

0 comments on commit bae413f

Please sign in to comment.