forked from hackclub/sprig
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sprikipedia, The Sprig wiki and encyclopedia - Under development (3) (h…
…ackclub#1131) * Update global.css * updates * fix links * fix * thanks marios (starting) * back * Update PT.json * updates * fix things * add images (content) * no more author * more translations * feat: Upodated translation removed fetch * Update en_US.json * fixes * Update EN.json * Update EN.json test --------- Co-authored-by: Marios Mitsios <[email protected]> Co-authored-by: graham <[email protected]>
- Loading branch information
1 parent
3c8ebda
commit f851be0
Showing
24 changed files
with
426 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
declare module 'astro:content' { | ||
export { z } from 'astro/zod'; | ||
export type CollectionEntry<C extends keyof typeof entryMap> = | ||
(typeof entryMap)[C][keyof (typeof entryMap)[C]] & Render; | ||
|
||
type BaseSchemaWithoutEffects = | ||
| import('astro/zod').AnyZodObject | ||
| import('astro/zod').ZodUnion<import('astro/zod').AnyZodObject[]> | ||
| import('astro/zod').ZodDiscriminatedUnion<string, import('astro/zod').AnyZodObject[]> | ||
| import('astro/zod').ZodIntersection< | ||
import('astro/zod').AnyZodObject, | ||
import('astro/zod').AnyZodObject | ||
>; | ||
|
||
type BaseSchema = | ||
| BaseSchemaWithoutEffects | ||
| import('astro/zod').ZodEffects<BaseSchemaWithoutEffects>; | ||
|
||
type BaseCollectionConfig<S extends BaseSchema> = { | ||
schema?: S; | ||
slug?: (entry: { | ||
id: CollectionEntry<keyof typeof entryMap>['id']; | ||
defaultSlug: string; | ||
collection: string; | ||
body: string; | ||
data: import('astro/zod').infer<S>; | ||
}) => string | Promise<string>; | ||
}; | ||
export function defineCollection<S extends BaseSchema>( | ||
input: BaseCollectionConfig<S> | ||
): BaseCollectionConfig<S>; | ||
|
||
type EntryMapKeys = keyof typeof entryMap; | ||
type AllValuesOf<T> = T extends any ? T[keyof T] : never; | ||
type ValidEntrySlug<C extends EntryMapKeys> = AllValuesOf<(typeof entryMap)[C]>['slug']; | ||
|
||
export function getEntryBySlug< | ||
C extends keyof typeof entryMap, | ||
E extends ValidEntrySlug<C> | (string & {}) | ||
>( | ||
collection: C, | ||
// Note that this has to accept a regular string too, for SSR | ||
entrySlug: E | ||
): E extends ValidEntrySlug<C> | ||
? Promise<CollectionEntry<C>> | ||
: Promise<CollectionEntry<C> | undefined>; | ||
export function getCollection<C extends keyof typeof entryMap, E extends CollectionEntry<C>>( | ||
collection: C, | ||
filter?: (entry: CollectionEntry<C>) => entry is E | ||
): Promise<E[]>; | ||
export function getCollection<C extends keyof typeof entryMap>( | ||
collection: C, | ||
filter?: (entry: CollectionEntry<C>) => unknown | ||
): Promise<CollectionEntry<C>[]>; | ||
|
||
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer< | ||
Required<ContentConfig['collections'][C]>['schema'] | ||
>; | ||
|
||
type Render = { | ||
render(): Promise<{ | ||
Content: import('astro').MarkdownInstance<{}>['Content']; | ||
headings: import('astro').MarkdownHeading[]; | ||
remarkPluginFrontmatter: Record<string, any>; | ||
}>; | ||
}; | ||
|
||
const entryMap: { | ||
"translations": { | ||
}, | ||
|
||
}; | ||
|
||
type ContentConfig = never; | ||
} |
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,11 @@ | ||
# This configuration file was automatically generated by Gitpod. | ||
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) | ||
# and commit this file to your remote git repository to share the goodness with others. | ||
|
||
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart | ||
|
||
tasks: | ||
- init: yarn install && yarn run build | ||
command: yarn run start | ||
|
||
|
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
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 |
---|---|---|
@@ -1,22 +1,21 @@ | ||
--- | ||
import '../global.css' | ||
import '../pages/sprikipedia/global.css' | ||
import StandardHead from '../components/standard-head.astro' | ||
import Navspriki from '../components/spriki-components/Navspriki.astro' | ||
const { frontmatter } = Astro.props | ||
const { dspriki, dtitle } = Astro.props | ||
--- | ||
|
||
<html lang="en"> | ||
<head> | ||
<StandardHead title={frontmatter.spriki} /> | ||
<StandardHead title={dspriki} /> | ||
</head> | ||
<body> | ||
<Navspriki /> | ||
<div class="main-spriki"> | ||
<h1>{frontmatter.title}</h1> | ||
<p>by {frontmatter.author}</p> | ||
<h1>{dtitle}</h1> | ||
<article> | ||
<slot /> | ||
</article> | ||
</div> | ||
</body> | ||
</html> | ||
</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
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
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
Oops, something went wrong.