Skip to content

Commit aaf3d32

Browse files
committed
feat: hide unfinished pages and add ExternalLink component
1 parent ddca021 commit aaf3d32

File tree

21 files changed

+442
-198
lines changed

21 files changed

+442
-198
lines changed

.astro/content.d.ts

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
declare module 'astro:content' {
2+
interface Render {
3+
'.mdx': Promise<{
4+
Content: import('astro').MarkdownInstance<{}>['Content'];
5+
headings: import('astro').MarkdownHeading[];
6+
remarkPluginFrontmatter: Record<string, any>;
7+
components: import('astro').MDXInstance<{}>['components'];
8+
}>;
9+
}
10+
}
11+
12+
declare module 'astro:content' {
13+
export interface RenderResult {
14+
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
15+
headings: import('astro').MarkdownHeading[];
16+
remarkPluginFrontmatter: Record<string, any>;
17+
}
18+
interface Render {
19+
'.md': Promise<RenderResult>;
20+
}
21+
22+
export interface RenderedContent {
23+
html: string;
24+
metadata?: {
25+
imagePaths: Array<string>;
26+
[key: string]: unknown;
27+
};
28+
}
29+
}
30+
31+
declare module 'astro:content' {
32+
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;
33+
34+
export type CollectionKey = keyof AnyEntryMap;
35+
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;
36+
37+
export type ContentCollectionKey = keyof ContentEntryMap;
38+
export type DataCollectionKey = keyof DataEntryMap;
39+
40+
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
41+
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
42+
ContentEntryMap[C]
43+
>['slug'];
44+
45+
export type ReferenceDataEntry<
46+
C extends CollectionKey,
47+
E extends keyof DataEntryMap[C] = string,
48+
> = {
49+
collection: C;
50+
id: E;
51+
};
52+
export type ReferenceContentEntry<
53+
C extends keyof ContentEntryMap,
54+
E extends ValidContentEntrySlug<C> | (string & {}) = string,
55+
> = {
56+
collection: C;
57+
slug: E;
58+
};
59+
60+
/** @deprecated Use `getEntry` instead. */
61+
export function getEntryBySlug<
62+
C extends keyof ContentEntryMap,
63+
E extends ValidContentEntrySlug<C> | (string & {}),
64+
>(
65+
collection: C,
66+
// Note that this has to accept a regular string too, for SSR
67+
entrySlug: E,
68+
): E extends ValidContentEntrySlug<C>
69+
? Promise<CollectionEntry<C>>
70+
: Promise<CollectionEntry<C> | undefined>;
71+
72+
/** @deprecated Use `getEntry` instead. */
73+
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
74+
collection: C,
75+
entryId: E,
76+
): Promise<CollectionEntry<C>>;
77+
78+
export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
79+
collection: C,
80+
filter?: (entry: CollectionEntry<C>) => entry is E,
81+
): Promise<E[]>;
82+
export function getCollection<C extends keyof AnyEntryMap>(
83+
collection: C,
84+
filter?: (entry: CollectionEntry<C>) => unknown,
85+
): Promise<CollectionEntry<C>[]>;
86+
87+
export function getEntry<
88+
C extends keyof ContentEntryMap,
89+
E extends ValidContentEntrySlug<C> | (string & {}),
90+
>(
91+
entry: ReferenceContentEntry<C, E>,
92+
): E extends ValidContentEntrySlug<C>
93+
? Promise<CollectionEntry<C>>
94+
: Promise<CollectionEntry<C> | undefined>;
95+
export function getEntry<
96+
C extends keyof DataEntryMap,
97+
E extends keyof DataEntryMap[C] | (string & {}),
98+
>(
99+
entry: ReferenceDataEntry<C, E>,
100+
): E extends keyof DataEntryMap[C]
101+
? Promise<DataEntryMap[C][E]>
102+
: Promise<CollectionEntry<C> | undefined>;
103+
export function getEntry<
104+
C extends keyof ContentEntryMap,
105+
E extends ValidContentEntrySlug<C> | (string & {}),
106+
>(
107+
collection: C,
108+
slug: E,
109+
): E extends ValidContentEntrySlug<C>
110+
? Promise<CollectionEntry<C>>
111+
: Promise<CollectionEntry<C> | undefined>;
112+
export function getEntry<
113+
C extends keyof DataEntryMap,
114+
E extends keyof DataEntryMap[C] | (string & {}),
115+
>(
116+
collection: C,
117+
id: E,
118+
): E extends keyof DataEntryMap[C]
119+
? string extends keyof DataEntryMap[C]
120+
? Promise<DataEntryMap[C][E]> | undefined
121+
: Promise<DataEntryMap[C][E]>
122+
: Promise<CollectionEntry<C> | undefined>;
123+
124+
/** Resolve an array of entry references from the same collection */
125+
export function getEntries<C extends keyof ContentEntryMap>(
126+
entries: ReferenceContentEntry<C, ValidContentEntrySlug<C>>[],
127+
): Promise<CollectionEntry<C>[]>;
128+
export function getEntries<C extends keyof DataEntryMap>(
129+
entries: ReferenceDataEntry<C, keyof DataEntryMap[C]>[],
130+
): Promise<CollectionEntry<C>[]>;
131+
132+
export function render<C extends keyof AnyEntryMap>(
133+
entry: AnyEntryMap[C][string],
134+
): Promise<RenderResult>;
135+
136+
export function reference<C extends keyof AnyEntryMap>(
137+
collection: C,
138+
): import('astro/zod').ZodEffects<
139+
import('astro/zod').ZodString,
140+
C extends keyof ContentEntryMap
141+
? ReferenceContentEntry<C, ValidContentEntrySlug<C>>
142+
: ReferenceDataEntry<C, keyof DataEntryMap[C]>
143+
>;
144+
// Allow generic `string` to avoid excessive type errors in the config
145+
// if `dev` is not running to update as you edit.
146+
// Invalid collection names will be caught at build time.
147+
export function reference<C extends string>(
148+
collection: C,
149+
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;
150+
151+
type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
152+
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
153+
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
154+
>;
155+
156+
type ContentEntryMap = {
157+
158+
};
159+
160+
type DataEntryMap = {
161+
162+
};
163+
164+
type AnyEntryMap = ContentEntryMap & DataEntryMap;
165+
166+
export type ContentConfig = typeof import("../src/content.config.mjs");
167+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"fix:prettier": "prettier -w ."
2323
},
2424
"dependencies": {
25-
"@astrojs/node": "^9.1.2",
25+
"@astrojs/node": "^9.1.3",
2626
"@astrojs/react": "^4.2.1",
2727
"@astrojs/rss": "^4.0.11",
2828
"@astrojs/sitemap": "^3.2.1",
184 KB
Loading
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
const { href, text } = Astro.props;
3+
---
4+
5+
<style>
6+
.external-link {
7+
display: inline-flex;
8+
align-items: center;
9+
gap: 0.3rem;
10+
text-decoration: none;
11+
}
12+
.external-link svg {
13+
width: 1em;
14+
height: 1em;
15+
}
16+
</style>
17+
18+
<a href={href} target="_blank" rel="noopener noreferrer" class="external-link">
19+
{text}
20+
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
21+
<path
22+
fill="currentColor"
23+
d="M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83l1.41 1.41L19 6.41V10h2V3z"
24+
></path>
25+
</svg>
26+
</a>

src/navigation.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@ export const headerData = {
6868
text: 'Coding in famiglia',
6969
href: getPermalink(`${appPath}/coding-in-famiglia`),
7070
},
71-
{
72-
text: 'Progetti Scratch',
73-
href: getPermalink(`${appPath}/progetti-scratch`),
74-
},
75-
{
76-
text: 'Videolezioni',
77-
href: getPermalink(`${appPath}/videolezioni`),
78-
},
71+
// {
72+
// text: 'Progetti Scratch',
73+
// href: getPermalink(`${appPath}/progetti-scratch`),
74+
// },
75+
// {
76+
// text: 'Videolezioni',
77+
// href: getPermalink(`${appPath}/videolezioni`),
78+
// },
7979
{
8080
text: 'Post e Webinar',
8181
href: getPermalink(`${appPath}/post-e-webinar`),
8282
},
8383
],
8484
},
85-
{ text: 'Community', href: getPermalink(`${basePath}/community`) },
85+
// { text: 'Community', href: getPermalink(`${basePath}/community`) },
8686
{
8787
text: 'Academy',
8888
href: 'https://academy.codyroby.it/',
@@ -96,7 +96,6 @@ export const headerData = {
9696
],
9797
},
9898
],
99-
/*actions: [{text: 'Download', href: 'https://github.com/onwidget/astrowind', target: '_blank'}],*/
10099
};
101100

102101
export const footerData = {

src/pages/index.astro

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ const toolkit = [
7979
description:
8080
'Segui questo link se vuoi applicare il coding unplugged nella scuola primaria. Scoprirai che CodyRoby e CodyColor sono gli strumenti più adatti e che possono essere utilizzati per introdurre concetti sempre più evoluti e concepire attività sempre nuove.',
8181
},
82-
{
83-
src: secondaria,
84-
alt: 'secondaria',
85-
link: `${toolkitPath}/secondaria`,
86-
description:
87-
'Segui questo link per scoprire in quanti modi il coding unplugged possa essere applicato nella scuola secondaria, per dare rigore alla descrizione di procedimenti evoluti che sfruttano i costrutti di programmazione di CodyRoby strutturato.',
88-
},
82+
// {
83+
// src: secondaria,
84+
// alt: 'secondaria',
85+
// link: `${toolkitPath}/secondaria`,
86+
// description:
87+
// 'Segui questo link per scoprire in quanti modi il coding unplugged possa essere applicato nella scuola secondaria, per dare rigore alla descrizione di procedimenti evoluti che sfruttano i costrutti di programmazione di CodyRoby strutturato.',
88+
// },
8989
];
9090
---
9191

src/pages/metodi/altri-metodi/dresscode.astro

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ const challengeCards = [
7171
<Fragment slot="title"> {metadata.title} </Fragment>
7272
<Fragment slot="subtitle">{metadata.subtitle}</Fragment>
7373
</Hero>
74-
<AnimateText>
75-
<div class="prose-page">
74+
75+
<div class="prose-page">
76+
<AnimateText>
7677
<p>
7778
<strong>DressCode</strong> è il nuovo gioco di CodeMOOC, concepito per abbassare ancora le barriere di accesso al
7879
coding unplugged. È ispirato al classico gioco di vestire una bambola con sagome di carta, già collegato al coding
@@ -104,7 +105,9 @@ const challengeCards = [
104105
>
105106
</iframe>
106107
</div>
107-
</div>
108+
</AnimateText>
109+
</div>
110+
<AnimateText>
108111
<div class="prose-page mt-11 flex flex-col gap-6">
109112
<h2>Materiale</h2>
110113
<p>
@@ -128,6 +131,8 @@ const challengeCards = [
128131
</div>
129132
</div>
130133
</div>
134+
</AnimateText>
135+
<AnimateText>
131136
<div class="prose-page mt-11 flex flex-col gap-6">
132137
<h2>Sfide</h2>
133138

src/pages/prodotti-e-pubblicazioni/prodotti.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
import Layout from '~/layouts/PageLayout.astro';
3-
import Grid from '~/components/blog/Grid.astro';
43
import ProductItem from '~/components/common/ProductItem.astro';
54
import type { ProductPublication } from '~/types';
65

0 commit comments

Comments
 (0)