-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add Astro + Vue docs and example (#343)
- Loading branch information
Showing
11 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { promises as fsPromises } from 'node:fs' | ||
|
||
updatePackageJson() | ||
|
||
async function updatePackageJson() { | ||
const filename = './package.json' | ||
try { | ||
const contents = await fsPromises.readFile(filename, 'utf-8') | ||
const updatedContent = contents.replace('workspace:*', 'latest') | ||
await fsPromises.writeFile(filename, updatedContent) | ||
} | ||
catch (err) { | ||
console.error(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { defineConfig } from 'astro/config' | ||
import Vue from '@astrojs/vue' | ||
import Icons from 'unplugin-icons/vite' | ||
|
||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [ | ||
Vue() | ||
], | ||
vite: { | ||
plugins: [ | ||
Icons({ | ||
compiler: 'vue3', | ||
}), | ||
], | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"dependencies": { | ||
"@astrojs/vue": "^4.0.8", | ||
"astro": "^4.2.6" | ||
}, | ||
"description": "unplugin-icons + Astro", | ||
"devDependencies": { | ||
"@iconify/json": "^2.2.141", | ||
"unplugin-icons": "workspace:*" | ||
}, | ||
"name": "astro-example", | ||
"private": true, | ||
"scripts": { | ||
"astro": "astro", | ||
"build": "astro build", | ||
"dev": "astro dev", | ||
"preview": "astro preview", | ||
"start": "astro dev" | ||
}, | ||
"stackblitz": { | ||
"installDependencies": false, | ||
"startCommand": "node .stackblitz.js && npm install && npm run dev" | ||
}, | ||
"type": "module", | ||
"version": "0.0.1" | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script lang="ts" setup> | ||
import IconParkOutlineHome from '~icons/icon-park-outline/home'; | ||
</script> | ||
|
||
<script lang="ts"> | ||
export default { | ||
name: 'HomeLink' | ||
} | ||
</script> | ||
|
||
<template> | ||
<a | ||
aria-label="Go Home" | ||
href="/"> | ||
<IconParkOutlineHome /> | ||
</a> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="astro/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
export interface Props { | ||
title: string; | ||
} | ||
const { title } = Astro.props; | ||
--- | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<title>{title}</title> | ||
</head> | ||
<body> | ||
<slot /> | ||
<style is:global> | ||
html { | ||
font-family: system-ui, sans-serif; | ||
background-color: #f6f6f6; | ||
} | ||
</style> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
import Layout from "../layouts/Layout.astro"; | ||
import IconParkAbnormal from "~icons/icon-park/abnormal"; | ||
import HomeLink from "../components/HomeLink.vue"; | ||
--- | ||
|
||
<Layout title="Welcome to Astro."> | ||
<main> | ||
<HomeLink /> | ||
<br /> | ||
<IconParkAbnormal /> | ||
</main> | ||
</Layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "astro/tsconfigs/strict", | ||
"compilerOptions": { | ||
"types": ["unplugin-icons/types/vue"] | ||
} | ||
} |