Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7806fba
feat: add test content
stefanprobst Feb 26, 2025
c9664fe
fix: add placeholder components
stefanprobst Feb 27, 2025
42e2c11
chore: rename resource to avoid naming collision
stefanprobst Feb 27, 2025
25c8c2f
style: don't treat lesson intro and lesson page intro and assign intr…
stefanprobst Feb 27, 2025
7047cc6
fix: enable toc
stefanprobst Feb 27, 2025
2970f58
fix: render video component when iframe has youtube link
stefanprobst Feb 27, 2025
afe5787
fix: don't display section titles twice
stefanprobst Feb 27, 2025
4cf8fc0
fix: remove markdown h1, hide resources title
stefanprobst Feb 27, 2025
88dc5b2
chore: update deps
babslgam May 6, 2025
a82134c
chore: exclude vendor dir from static analysis and compiling
babslgam May 6, 2025
c41fc9d
feat: add h5p wrapper
babslgam May 6, 2025
38e2c2d
feat: add h5p vendor files
babslgam May 6, 2025
9b48ce4
feat: add h5p module
babslgam May 6, 2025
4169f05
content: add resources "Social Justice in the Digital Humanities"
babslgam May 6, 2025
ce7bdee
refactor: update h5pwrapper
babslgam May 7, 2025
7354030
refactor: preload h5p
babslgam May 7, 2025
986f35a
refactor: transform mdx
babslgam May 8, 2025
d51accf
content: update 'Social Justice in the Digital Humanities'
babslgam May 8, 2025
94d2ca1
refactor: regarding https://github.com/DARIAH-ERIC/dariah-teach-migra…
babslgam May 27, 2025
ab73e2b
fix: update lockfile
babslgam May 27, 2025
d8d38d1
fix: make H5P available upon navigation
babslgam May 27, 2025
cbb9de1
Merge remote-tracking branch 'origin/main' into content/dh-teach/soci…
stefanprobst Aug 31, 2025
8a08be5
chore: lint
stefanprobst Aug 31, 2025
5328acd
chore: remove stylelintignore
stefanprobst Aug 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions components/content/embed.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ReactNode } from "react";

interface EmbedProps {
children: ReactNode;
children?: ReactNode;
src: string;
/** Added by `with-iframe-titles` mdx plugin. */
title?: string;
Expand All @@ -20,7 +20,7 @@ export function Embed(props: Readonly<EmbedProps>): ReactNode {
src={src}
title={title}
/>
<figcaption>{children}</figcaption>
{children != null && children !== "" ? <figcaption>{children}</figcaption> : null}
</figure>
);
}
4 changes: 2 additions & 2 deletions components/content/figure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface FigureProps {
/** @default "stretch" */
alignment?: FigureAlignment;
alt?: string;
children: ReactNode;
children?: ReactNode;
/** Maybe added by `with-image-sizes` mdx plugin. */
height?: number;
src: string;
Expand All @@ -22,7 +22,7 @@ export function Figure(props: Readonly<FigureProps>): ReactNode {
return (
<figure className={cn("flex flex-col", alignment === "center" ? "justify-center" : undefined)}>
<Image alt={alt} height={height} src={src} width={width} />
<figcaption>{children}</figcaption>
{children != null && children !== "" ? <figcaption>{children}</figcaption> : null}
</figure>
);
}
87 changes: 87 additions & 0 deletions components/content/h5p-wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
"use client";

import Script from "next/script";
import { Fragment, type ReactNode, useEffect, useRef } from "react";

interface H5PWrapperProps {
path: string;
}

type H5PConstructor = new (
container: HTMLElement,
options: {
h5pJsonPath: string;
frameJs?: string;
frameCss?: string;
embedType?: string;
id?: string;
preventH5PInit?: boolean;
},
) => {
destroy?: () => void;
[key: string]: unknown;
};

interface H5PModule {
H5P: H5PConstructor;
}

declare global {
interface Window {
H5PPlayer?: H5PConstructor;
H5PStandalone?: H5PModule;
H5P?: unknown;
}
}

export function H5PWrapper(props: Readonly<H5PWrapperProps>): ReactNode {
const { path } = props;

const ref = useRef<HTMLDivElement | null>(null);

useEffect(() => {
const container = ref.current;

if (!((window.H5PStandalone?.H5P || window.H5PPlayer) && container)) return;

if (window.H5PStandalone?.H5P) {
window.H5PPlayer = window.H5PStandalone.H5P;
}

const { H5PPlayer } = window;

const loadH5P = () => {
const options = {
h5pJsonPath: `/vendor/h5p-content/${path}`,
librariesPath: "/vendor/h5p-shared-libraries",
frameJs: "/vendor/h5p-standalone/frame.bundle.js",
frameCss: "/vendor/h5p-standalone/styles/h5p.css",
};

try {
if (H5PPlayer) {
new H5PPlayer(container, options);
}
} catch (error: unknown) {
console.error("Error loading H5P content", error);
}
};

loadH5P();

return () => {
container.innerHTML = "";
};
}, [path]);

return (
<Fragment>
<div ref={ref} />
<Script
id="h5p-script"
src="/vendor/h5p-standalone/main.bundle.js"
strategy="beforeInteractive"
/>
</Fragment>
);
}
4 changes: 2 additions & 2 deletions components/content/video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { VideoProvider } from "@/lib/content/options";
import { createVideoUrl } from "@/lib/navigation/create-video-url";

interface VideoProps {
children: ReactNode;
children?: ReactNode;
id: string;
provider: VideoProvider;
startTime?: number | null;
Expand All @@ -27,7 +27,7 @@ export function Video(props: Readonly<VideoProps>): ReactNode {
src={src}
title={title}
/>
<figcaption>{children}</figcaption>
{children != null && children !== "" ? <figcaption>{children}</figcaption> : null}
</figure>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: 'Social Justice in the Digital Humanities'
locale: en
publication-date: '2022-10-31'
version: '1.0'
editors:
- dariah-teach
tags:
- dh
resources:
- discriminant: resources-hosted
value: social-justice-in-the-digital-humanities-introduction
- discriminant: resources-hosted
value: social-justice-in-the-digital-humanities-unit-i-introduction-to-social-justice-in-the-digital-humanities
- discriminant: resources-hosted
value: social-justice-in-the-digital-humanities-unit-ii-ethics-legal-and-moral-frameworks
- discriminant: resources-hosted
value: social-justice-in-the-digital-humanities-unit-iii-social-justice-in-digital-humanities-practice
- discriminant: resources-hosted
value: social-justice-in-the-digital-humanities-toolkit
summary:
content: 'No summary content available.'

---
5 changes: 5 additions & 0 deletions content/en/people/dariah-teach/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: DARIAH Teach
image: /assets/images/default-avatar.svg
social: []
---
Loading