Skip to content

Commit

Permalink
Merge pull request #5 from tex0l/astro
Browse files Browse the repository at this point in the history
Astro
  • Loading branch information
tex0l authored Feb 21, 2024
2 parents 24ecc04 + 050fd97 commit 3f4e93e
Show file tree
Hide file tree
Showing 76 changed files with 10,963 additions and 9,602 deletions.
75 changes: 75 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
module.exports = {
overrides: [
{
env: {
node: true
},
files: ['.eslintrc.{js,cjs}'],
extends: 'standard',
parserOptions: {
sourceType: 'script'
}
},
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro'],
sourceType: 'module'
},
plugins: ['astro'],
env: {
// Enables global variables available in Astro components.
node: true,
'astro/astro': true,
es2020: true
},
extends: [
'plugin:astro/recommended',
'standard-with-typescript'
],
processor: 'astro/client-side-ts',
rules: {
semi: 'off', // Don't need ESLint's semi, so turn it off. see https://github.com/ota-meshi/eslint-plugin-astro/issues/165
'astro/semi': [
'error',
'never'
]
}
},
{
files: ['*.client.ts', '**/*.astro/*.ts', '*.astro/*.ts'],
extends: 'standard-with-typescript',
env: {
browser: true,
es2020: true
}
},
{
files: ['*.ts'],
extends: 'standard-with-typescript',
env: {
es2020: true,
node: true
}
},
{
files: ['*.mjs', '*.cjs', '*.js'],
extends: 'standard',
env: {
es2020: true,
node: true
}
},
{
files: ['*.client.mjs', '*.client.cjs', '*.client.js', '**/*.astro/*.js', '*.astro/*.js'],
extends: 'standard',
env: {
browser: true,
es2020: true
}
}
],
ignorePatterns: ['dist/**/*']
}
70 changes: 12 additions & 58 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,35 @@
# Sample workflow for building and deploying a Nuxt site to GitHub Pages
#
# To get started with Nuxt see: https://nuxtjs.org/docs/get-started/installation
#
name: Deploy Nuxt site to Pages
name: Deploy to GitHub Pages

on:
# Runs on pushes targeting the default branch
# 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"]

# Allows you to run this workflow manually from the Actions tab
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine packager manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Restore cache
uses: actions/cache@v3
with:
path: |
dist
.nuxt
key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }}
restore-keys: |
${{ runner.os }}-nuxt-build-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Static HTML export with Nuxt
run: ${{ steps.detect-package-manager.outputs.manager }} run generate
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./.output/public
- name: Install, build, and upload your site
uses: withastro/action@v1

# Deployment job
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v1
34 changes: 25 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
node_modules
*.log*
.nuxt
.nitro
.cache
.output
# build output
dist/

# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# environment variables
.env
dist
.idea
.env.production

# macOS-specific files
.DS_Store
public_to_encrypt

# Jetbrains-sepcific files
.idea/*

# Specific to the project
public_to_encrypt/*
66 changes: 39 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,54 @@
# Nuxt 3 Minimal Starter
# Astro Starter Kit: Basics

Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
```sh
npm create astro@latest -- --template basics
```

## Setup
[![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/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)

Make sure to install the dependencies:
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
```bash
# yarn
yarn install
![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554)

# npm
npm install
## 🚀 Project Structure

# pnpm
pnpm install --shamefully-hoist
```
Inside of your Astro project, you'll see the following folders and files:

## Development Server
```text
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
```

Start the development server on http://localhost:3000
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

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

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

Build the application for production:
## 🧞 Commands

```bash
npm run build
```
All commands are run from the root of the project, from a terminal:

Locally preview production build:
| 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 |

```bash
npm run preview
```
## 👀 Want to learn more?

Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
14 changes: 0 additions & 14 deletions app.vue

This file was deleted.

33 changes: 33 additions & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { defineConfig } from 'astro/config'
import vue from '@astrojs/vue'
import tailwind from '@astrojs/tailwind'
import mdx from '@astrojs/mdx'
import sitemap from '@astrojs/sitemap'
import AutoImport from 'astro-auto-import'
import icon from 'astro-icon'
import asides, { asideAutoImport } from './integrations/asides'

// https://astro.build/config
export default defineConfig({
integrations: [AutoImport({
imports: [asideAutoImport]
}), asides(), vue(), tailwind(), mdx(), sitemap({
i18n: {
defaultLocale: 'en',
locales: {
en: 'en-US',
fr: 'fr-FR'
}
}
}), icon()],
trailingSlash: 'always',
i18n: {
defaultLocale: 'en',
locales: ['en', 'fr'],
routing: {
prefixDefaultLocale: true,
redirectToDefaultLocale: false
}
},
site: 'https://tex0l.github.io'
})
Empty file removed components/content/.gitkeep
Empty file.
39 changes: 0 additions & 39 deletions components/content/Mermaid.vue

This file was deleted.

4 changes: 0 additions & 4 deletions components/content/ProseImg.vue

This file was deleted.

Loading

0 comments on commit 3f4e93e

Please sign in to comment.