Skip to content

Commit

Permalink
try out astro 5
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Oct 1, 2024
1 parent 563b3cd commit 2f9dbc6
Show file tree
Hide file tree
Showing 16 changed files with 2,594 additions and 1,083 deletions.
3,272 changes: 2,376 additions & 896 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions sites/configs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"include": [".astro/types.d.ts", "**/*"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
Expand All @@ -15,8 +16,5 @@
},
"strictNullChecks": true
},
"exclude": [
"node_modules",
"dist",
]
"exclude": ["node_modules", "dist"]
}
3 changes: 2 additions & 1 deletion sites/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"test": "playwright test"
},
"dependencies": {
"@astrojs/mdx": "^3.1.3",
"astro": "5.0.0-beta.2",
"@astrojs/mdx": "4.0.0-beta.1",
"@astrojs/netlify": "^5.4.0",
"@iconify-json/fa": "^1.1.8",
"@iconify-json/fa-brands": "^1.1.8",
Expand Down
6 changes: 2 additions & 4 deletions sites/docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": "astro/tsconfigs/base",
"include": [".astro/types.d.ts", "**/*"],
"compilerOptions": {
"baseUrl": ".",
"paths": {
Expand All @@ -15,8 +16,5 @@
},
"strictNullChecks": true
},
"exclude": [
"node_modules",
"dist",
]
"exclude": ["node_modules", "dist"]
}
4 changes: 2 additions & 2 deletions sites/main-site/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pipelines_json.remote_workflows.map((pipeline) => {
// https://astro.build/config
export default defineConfig({
site: 'https://nf-co.re/',
output: 'hybrid',
output: 'static',
adapter: netlify(),
prefetch: false,
redirects: {
Expand Down Expand Up @@ -82,7 +82,7 @@ export default defineConfig({
'tools-16',
],
'simple-icons': ['bluesky'],
'ri': ['open-source-line'],
ri: ['open-source-line'],
},
}),
sitemap(),
Expand Down
6 changes: 3 additions & 3 deletions sites/main-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@astro-community/astro-embed-youtube": "^0.5.2",
"@astrojs/internal-helpers": "^0.4.1",
"@astrojs/markdown-remark": "^5.2.0",
"@astrojs/mdx": "^3.1.3",
"@astrojs/mdx": "4.0.0-beta.1",
"@astrojs/netlify": "^5.4.0",
"@astrojs/partytown": "^2.1.1",
"@astrojs/rss": "^4.0.7",
Expand All @@ -38,7 +38,7 @@
"@iconify/utils": "^2.1.25",
"@nanostores/persistent": "^0.10.1",
"@octokit/types": "^13.5.0",
"astro": "^4.12.2",
"astro": "5.0.0-beta.2",
"astro-icon": "^1.1.0",
"astro-remark-description": "^1.1.2",
"bootstrap": "^5.3.3",
Expand Down Expand Up @@ -89,7 +89,7 @@
"svelte": "^4.2.18",
"svelte-confetti": "^1.4.0",
"svelte-exmarkdown": "^3.0.5",
"svelte-fast-marquee": "^0.7.0",
"svelte-fast-marquee": "^0.8.0",
"ts-dedent": "^2.2.0",
"typescript": "^5.5.3",
"unist-util-visit": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions sites/main-site/src/components/BaseHead.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { ViewTransitions } from 'astro:transitions';
import { ClientRouter } from 'astro:transitions';
export interface Props {
title: string;
description: string;
Expand Down Expand Up @@ -52,7 +52,7 @@ const { title, description, image = '/social_img.png', docSearchTags = [], viewT
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={new URL(image, Astro.url)} />

{viewTransitions && <ViewTransitions fallback="none" />}
{viewTransitions && <ClientRouter fallback="none" />}

<!-- DocSearch -->
{docSearchTags.map(({ name, content }) => <meta name={'docsearch:' + name} content={content} />)}
Expand Down
6 changes: 5 additions & 1 deletion sites/main-site/src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z, defineCollection } from 'astro:content';

import { pipelinesLoader } from '../loaders/pipelines.ts';
const events = defineCollection({
type: 'content',
schema: z
Expand Down Expand Up @@ -175,6 +175,9 @@ const specialInterestGroups = defineCollection({
});

const pipelines = defineCollection({});
const readmes = defineCollection({
loader: pipelinesLoader,
});

const api_reference = defineCollection({});

Expand All @@ -183,6 +186,7 @@ export const collections = {
docs: docs,
about: about,
pipelines: pipelines,
readmes: readmes,
blog: blog,
api_reference: api_reference,
'special-interest-groups': specialInterestGroups,
Expand Down
22 changes: 22 additions & 0 deletions sites/main-site/src/loaders/pipelines.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { Loader } from 'astro/loaders';
import pipelines_json from '@public/pipelines.json';
import { render } from 'astro:content';

export const pipelinesLoader: Loader = {
name: 'pipelines',
load: async (context) => {
pipelines_json.remote_workflows.map(async (pipeline) => {
const readmeUrl = `https://raw.githubusercontent.com/${pipeline.full_name}/dev/README.md`;
const response = await fetch(readmeUrl);
const content = await response.text();

context.store.set({
id: pipeline.name + '-dev',
data: {
name: pipeline.name,
content,
},
});
});
},
};
Loading

0 comments on commit 2f9dbc6

Please sign in to comment.