add external content

This commit is contained in:
Alexander Navarro 2023-06-26 17:27:50 -04:00
parent e515ed76a2
commit 0d876f50a9
8 changed files with 94 additions and 6 deletions

16
.prettierrc.cjs Normal file
View file

@ -0,0 +1,16 @@
module.exports = {
tabWidth: 2,
singleQuote: true,
endOfLine: 'auto',
'eol-last': 2,
trailingComma: 'all',
plugins: [require.resolve("prettier-plugin-astro")],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
};

View file

@ -28,6 +28,8 @@
"eslint-plugin-promise": "^6.0.0", "eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.32.2", "eslint-plugin-react": "^7.32.2",
"gh-pages": "^5.0.0", "gh-pages": "^5.0.0",
"prettier": "^2.8.8",
"prettier-plugin-astro": "^0.10.0",
"typescript": "*" "typescript": "*"
} }
} }

18
pnpm-lock.yaml generated
View file

@ -14,6 +14,8 @@ specifiers:
eslint-plugin-promise: ^6.0.0 eslint-plugin-promise: ^6.0.0
eslint-plugin-react: ^7.32.2 eslint-plugin-react: ^7.32.2
gh-pages: ^5.0.0 gh-pages: ^5.0.0
prettier: ^2.8.8
prettier-plugin-astro: ^0.10.0
react: ^18.0.0 react: ^18.0.0
react-dom: ^18.0.0 react-dom: ^18.0.0
typescript: '*' typescript: '*'
@ -36,6 +38,8 @@ devDependencies:
eslint-plugin-promise: 6.1.1_eslint@8.43.0 eslint-plugin-promise: 6.1.1_eslint@8.43.0
eslint-plugin-react: 7.32.2_eslint@8.43.0 eslint-plugin-react: 7.32.2_eslint@8.43.0
gh-pages: 5.0.0 gh-pages: 5.0.0
prettier: 2.8.8
prettier-plugin-astro: 0.10.0
typescript: 5.1.3 typescript: 5.1.3
packages: packages:
@ -50,7 +54,6 @@ packages:
/@astrojs/compiler/1.5.1: /@astrojs/compiler/1.5.1:
resolution: {integrity: sha512-iIGKu/uzB8sJ5VveQf0eHrVPPFEcrvSlp4qShYMOuY2aMmK2RVXQlX9dUjtmBQ+NAokfIOb7fwCutvH+p13l+g==} resolution: {integrity: sha512-iIGKu/uzB8sJ5VveQf0eHrVPPFEcrvSlp4qShYMOuY2aMmK2RVXQlX9dUjtmBQ+NAokfIOb7fwCutvH+p13l+g==}
dev: false
/@astrojs/internal-helpers/0.1.0: /@astrojs/internal-helpers/0.1.0:
resolution: {integrity: sha512-OSwvoFkTqVowiyP+codQeQZWoq/HOwY32x17NxDglWoCx2sdyXzplDZoVV4/3odmSEY6/A+48WMl5qkjmP1CXw==} resolution: {integrity: sha512-OSwvoFkTqVowiyP+codQeQZWoq/HOwY32x17NxDglWoCx2sdyXzplDZoVV4/3odmSEY6/A+48WMl5qkjmP1CXw==}
@ -3663,6 +3666,15 @@ packages:
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
dev: true dev: true
/prettier-plugin-astro/0.10.0:
resolution: {integrity: sha512-dPzop0gKZyVGpTDQmfy+e7FKXC9JT3mlpfYA2diOVz+Ui+QR1U4G/s+OesKl2Hib2JJOtAYJs/l+ovgT0ljlFA==}
engines: {node: ^14.15.0 || >=16.0.0, pnpm: '>=7.14.0'}
dependencies:
'@astrojs/compiler': 1.5.1
prettier: 2.8.8
sass-formatter: 0.7.6
dev: true
/prettier-plugin-astro/0.9.1: /prettier-plugin-astro/0.9.1:
resolution: {integrity: sha512-pYZXSbdq0eElvzoIMArzv1SBn1NUXzopjlcnt6Ql8VW32PjC12NovwBjXJ6rh8qQLi7vF8jNqAbraKW03UPfag==} resolution: {integrity: sha512-pYZXSbdq0eElvzoIMArzv1SBn1NUXzopjlcnt6Ql8VW32PjC12NovwBjXJ6rh8qQLi7vF8jNqAbraKW03UPfag==}
engines: {node: ^14.15.0 || >=16.0.0, pnpm: '>=7.14.0'} engines: {node: ^14.15.0 || >=16.0.0, pnpm: '>=7.14.0'}
@ -3677,7 +3689,6 @@ packages:
resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}
hasBin: true hasBin: true
dev: false
/prismjs/1.29.0: /prismjs/1.29.0:
resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==}
@ -3934,7 +3945,6 @@ packages:
/s.color/0.0.15: /s.color/0.0.15:
resolution: {integrity: sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==} resolution: {integrity: sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==}
dev: false
/sade/1.8.1: /sade/1.8.1:
resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==}
@ -3959,7 +3969,6 @@ packages:
resolution: {integrity: sha512-hXdxU6PCkiV3XAiSnX+XLqz2ohHoEnVUlrd8LEVMAI80uB1+OTScIkH9n6qQwImZpTye1r1WG1rbGUteHNhoHg==} resolution: {integrity: sha512-hXdxU6PCkiV3XAiSnX+XLqz2ohHoEnVUlrd8LEVMAI80uB1+OTScIkH9n6qQwImZpTye1r1WG1rbGUteHNhoHg==}
dependencies: dependencies:
suf-log: 2.5.3 suf-log: 2.5.3
dev: false
/scheduler/0.23.0: /scheduler/0.23.0:
resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==}
@ -4182,7 +4191,6 @@ packages:
resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==} resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==}
dependencies: dependencies:
s.color: 0.0.15 s.color: 0.0.15
dev: false
/supports-color/5.5.0: /supports-color/5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}

@ -1 +1 @@
Subproject commit 758b5cabb6f4924cbe85a554547c21d58d3448e1 Subproject commit ed0d837f9fd2dd3b86903ef46666eff7b82b1856

1
src/env.d.ts vendored
View file

@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" /> /// <reference types="astro/client" />

View file

View file

@ -0,0 +1,46 @@
---
import {
InferGetStaticParamsType,
InferGetStaticPropsType,
GetStaticPaths,
} from 'astro';
import { getCollection } from 'astro:content';
export const getStaticPaths = (async () => {
const games = await getCollection('games');
return games.map((entry) => ({
params: { slug: entry.slug },
props: entry,
}));
}) satisfies GetStaticPaths;
type Props = InferGetStaticPropsType<typeof getStaticPaths>;
const entry = Astro.props;
const { Content, headings } = await entry.render();
---
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<ul>
{
headings.map((header) => (
<li>
<a href={`#${header.slug}`}>
{header.depth} - {header.text}
</a>
</li>
))
}
</ul>
<Content />
</body>
</html>

View file

@ -0,0 +1,15 @@
---
import { getCollection } from 'astro:content';
const games = await getCollection('games');
---
<h1>Games</h1>
<ul>
{games.map(item => (
<li>
<a href={`games/${item.slug}`}>{item.data.Title}</a>
</li>
))}
</ul>