Skip to content

Commit

Permalink
docs: add astro demo
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianCataldo committed Feb 8, 2024
1 parent 3e91bd9 commit ccbf2aa
Show file tree
Hide file tree
Showing 44 changed files with 7,260 additions and 2 deletions.
10 changes: 10 additions & 0 deletions demos/__common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "example-config",
"type": "module",
"version": "0.0.0",
"private": true,
"scripts": {},
"dependencies": {
"og-images-generator": "link:../.."
}
}
10 changes: 10 additions & 0 deletions demos/__common/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions demos/__common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "ESNext",
"target": "ES2022",

"lib": ["ES2022", "DOM"],

"noEmit": true,

"outDir": "types",

"strict": true,

"allowJs": true,
"checkJs": true,
"skipLibCheck": true,

"moduleResolution": "Bundler",

"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true
},

"include": ["./*.js"]
}
21 changes: 21 additions & 0 deletions demos/astro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
.env.production

# macOS-specific files
.DS_Store
12 changes: 12 additions & 0 deletions demos/astro/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import("prettier").Config} */
export default {
plugins: ["prettier-plugin-astro"],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
};
4 changes: 4 additions & 0 deletions demos/astro/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"],
"unwantedRecommendations": []
}
14 changes: 14 additions & 0 deletions demos/astro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# og-images-generator — Astro Starter Kit: Blog

## 🧞 Commands

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

| Command | Action |
| :-------------- | :------------------------------------------ |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |

## 👀 Want to learn more?

Check out [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
17 changes: 17 additions & 0 deletions demos/astro/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from "astro/config";
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";

import { astroOgImagesGenerator } from "og-images-generator/astro";

// https://astro.build/config
export default defineConfig({
site: "http://localhost:4321",

integrations: [
mdx(),
sitemap(),
//
astroOgImagesGenerator(),
],
});
2 changes: 2 additions & 0 deletions demos/astro/og-images.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @ts-nocheck
export * from "../__common/og-images.example-config.js";
25 changes: 25 additions & 0 deletions demos/astro/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "astro",
"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.4.1",
"@astrojs/mdx": "^2.1.1",
"@astrojs/rss": "^4.0.5",
"@astrojs/sitemap": "^3.0.5",
"astro": "^4.3.5",
"og-images-generator": "link:../..",
"typescript": "^5.3.3",
"vite": "^5.0.12"
},
"devDependencies": {
"prettier-plugin-astro": "^0.13.0"
}
}
Loading

0 comments on commit ccbf2aa

Please sign in to comment.