Skip to content

Commit

Permalink
(build) fixed use of page.slug which should now be page.id
Browse files Browse the repository at this point in the history
  • Loading branch information
akollegger committed Jan 17, 2025
1 parent 86344cc commit cb5a619
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 42 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"@astrojs/starlight": "^0.31.0",
"@astrojs/starlight-tailwind": "^3.0.0",
"@astrojs/tailwind": "^5.1.4",
"@effect/platform-node": "^0.68.2",
"astro": "^5.1.6",
"@effect/platform-node": "^0.70.0",
"astro": "^5.1.7",
"date-fns": "^4.1.0",
"effect": "^3.12.2",
"effect": "^3.12.5",
"sharp": "^0.33.5",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3",
"vitest": "^2.1.8",
"vitest": "^3.0.2",
"xml-js": "^1.6.11"
}
}
3 changes: 0 additions & 3 deletions src/components/GrArxivPage.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import { format } from 'date-fns';

import {extractArxivID, getPaper} from '../lib/arxiv'

import LinkSpan from './LinkSpan.astro'

import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
import { Icon } from '@astrojs/starlight/components';

const props = Astro.props;

Expand Down
3 changes: 0 additions & 3 deletions src/components/GrSiteFooter.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
import type { Props } from '@astrojs/starlight/props';
import EditLink from '@astrojs/starlight/components/EditLink.astro';
import LastUpdated from '@astrojs/starlight/components/LastUpdated.astro';
import Pagination from '@astrojs/starlight/components/Pagination.astro';
import { Image } from 'astro:assets';
import neo4jLogoImage from "../assets/images/neo4j-logo-white.png";
---
Expand Down
4 changes: 2 additions & 2 deletions src/components/NamedIcon.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ interface Props {
class?: string;
}
const { name, label, size = '1em', color } = Astro.props;
const a11yAttrs = label ? ({ 'aria-label': label } as const) : ({ 'aria-hidden': 'true' } as const);
const { name } = Astro.props;
// const a11yAttrs = label ? ({ 'aria-label': label } as const) : ({ 'aria-hidden': 'true' } as const);
---

{localIconNames.includes(name) ? (<GrIcon name={name as LocalIconNames} />) : (<SlIcon name={name as SlIconNames}/>)}
31 changes: 21 additions & 10 deletions src/content/config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
import { z, defineCollection } from 'astro:content';
import { defineCollection } from 'astro:content';
import { docsSchema } from '@astrojs/starlight/schema';
import { docsLoader } from '@astrojs/starlight/loaders';
// import { file } from "astro/loaders";

// const researchCollection = defineCollection({
// loader: file("src/data/papers.json"),
// schema: z.object({
// title: z.string(),
// canonicalURL: z.string().url()
// })
// })

const researchCollection = defineCollection({
type: 'data',
schema: z.object({
title: z.string(),
canonicalURL: z.string().url()
})
})

export const collections = {
docs: defineCollection({ loader: docsLoader(),schema: docsSchema() }),
research: researchCollection
docs: defineCollection({
loader: docsLoader(),
schema: docsSchema()
}),
// research: defineCollection({
// loader: file("src/data/papers.json"),
// schema: z.object({
// title: z.string(),
// canonicalURL: z.string().url()
// })
// })
};
12 changes: 6 additions & 6 deletions src/content/docs/reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ Finding the perfect GraphRAG pattern for your application isn’t straightforwar
### GraphRAG Patterns

<ul>
{pages.filter(page => page.slug.indexOf("/graphrag/")!=-1).map(page => (
<li key={page.slug}>
<a href={"/"+page.slug}>{page.data.title}</a>
{pages.filter(page => page.id.indexOf("/graphrag/")!=-1).map(page => (
<li key={page.id}>
<a href={"/"+page.id}>{page.data.title}</a>
</li>
))}
</ul>

### Knowledge Graph Models

<ul>
{pages.filter(page => page.slug.indexOf("/knowledge-graph/")!=-1).map(page => (
<li key={page.slug}>
<a href={"/"+page.slug}>{page.data.title}</a>
{pages.filter(page => page.id.indexOf("/knowledge-graph/")!=-1).map(page => (
<li key={page.id}>
<a href={"/"+page.id}>{page.data.title}</a>
</li>
))}
</ul>
Expand Down
3 changes: 1 addition & 2 deletions src/lib/arxiv.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { assert, expect, test } from 'vitest';
import { expect, test } from 'vitest';

import { Effect, Either } from "effect"
import { FetchHttpClient } from "@effect/platform"

import { getArxivDetails } from './arxiv'
import { type ArxivEntry } from './arxiv'

test('arxiv fetch well-known entry', async () => {
const arxivid = '2402.07630';
Expand Down
8 changes: 1 addition & 7 deletions src/lib/arxiv.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import {
HttpClient,
HttpClientRequest,
HttpClientResponse,
HttpClientError
HttpClient
} from "@effect/platform"
import type { Cause } from "effect"
import { Effect, Either } from "effect"
import * as convert from 'xml-js';

import { Schema } from "effect"
import type { ParseError } from "effect/ParseResult";
import type { ParseOptions } from "effect/SchemaAST";

import papers from '../data/papers.json';

Expand Down
1 change: 0 additions & 1 deletion src/pages/appendices/research/[paper].astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
import { Code } from 'astro:components';
import { Effect, Either, ParseResult } from "effect"
import { FetchHttpClient } from "@effect/platform"
Expand Down
4 changes: 0 additions & 4 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@
import { getViteConfig } from 'astro/config';

export default getViteConfig({
test: {
/* for example, use global to avoid globals imports (describe, test, expect): */
// globals: true,
},
});

0 comments on commit cb5a619

Please sign in to comment.