Skip to content

Commit

Permalink
feat: embedd yt, fix footer and toc extra
Browse files Browse the repository at this point in the history
  • Loading branch information
Firgrep committed Sep 25, 2024
1 parent 3e89dc8 commit 6b7bde4
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 5 deletions.
47 changes: 47 additions & 0 deletions src/components/EmbedYT.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
export const EmbedYT = (props: any) => {
const {
children,
src,
minWidth = "400px",
maxWidth = "800px",
...otherProps
} = props;

return (
<section
style={{ width: "100%", minWidth: minWidth, maxWidth: maxWidth }}
aria-label="YouTube video"
>
<div
style={{
position: "relative",
width: "100%",
overflow: "hidden",
paddingTop: "56.25%",
}}
>
<div>
<iframe
style={{
position: "absolute",
top: "0",
left: "0",
right: "0",
width: "100%",
height: "100%",
border: "none",
}}
width="560"
height="315"
src={src}
title="Video player"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
{...otherProps}
>
{children}
</iframe>
</div>
</div>
</section>
);
};
10 changes: 9 additions & 1 deletion src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ function FooterHeader({ children }: { children: ReactNode }) {

const navigation = {
general: [
{ name: "Blog", href: "/blog" },
{
name: "Discussion",
href: "https://github.com/systemphil/sphil/discussions",
},
{ name: "Symposia", href: "https://symposia.sphil.xyz" },
{ name: "Acknowledgements", href: "/acknowledgements" },
],
Expand All @@ -57,6 +60,11 @@ const navigation = {
support: [
{ name: "GitHub", href: "https://github.com/systemphil/" },
{ name: "YouTube", href: "https://www.youtube.com/@systemphil" },
{ name: "Twitter", href: "https://twitter.com/sphildotxyz" },
{
name: "Facebook",
href: "https://www.facebook.com/profile.php?id=61564840656103",
},
],
};

Expand Down
26 changes: 26 additions & 0 deletions src/components/TableOfContentsExtra.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use client";

import { SymposiaCard } from "./SymposiaCard";

export function TableOfContentsExtra() {
return (
<>
<LinkToDiscussion />
<SymposiaCard />
</>
);
}

function LinkToDiscussion() {
return (
<a
className="nx-text-xs nx-font-medium nx-text-gray-500 hover:nx-text-gray-900 dark:nx-text-gray-400 dark:hover:nx-text-gray-100 contrast-more:nx-text-gray-800 contrast-more:dark:nx-text-gray-50"
target="_blank"
href="https://github.com/systemphil/sphil/discussions"
>
Share your thoughts 💬{" "}
</a>
);
}

// Question? Give us feedback →
11 changes: 10 additions & 1 deletion src/pages/contributing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ started contributing ideas or code to sPhil as well as a
[Code of Conduct](/contributing/code-of-conduct) for contributing to the
development of sPhil.

We warmly encourage you to join our community on the [discussion boards]().
We warmly encourage you to join our community on the
[discussion boards](https://github.com/systemphil/sphil/discussions).

<br/ >

import { EmbedYT } from "../../components/EmbedYT";

<EmbedYT src="https://www.youtube.com/embed/hZVStcn2750?si=P1K7e2btT9Cwe5xO">
How to contribute to sPhil on GitHub
</EmbedYT>

### General Division of the Encyclopaedia

Expand Down
6 changes: 3 additions & 3 deletions theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import Navigation from "@/components/Navigation";
import Footer from "@/components/Footer";
import { useRouter } from "next/router";
import { type DocsThemeConfig, useConfig } from "nextra-theme-docs";
import { SymposiaCard } from "@/components/SymposiaCard";
import { ArticleWrapper } from "@/components/ArticleWrapper";
import { TableOfContentsExtra } from "@/components/TableOfContentsExtra";

const SITE_ROOT = process.env.NEXT_PUBLIC_SITE_ROOT;

const config: DocsThemeConfig = {
docsRepositoryBase: "https://github.com/systemphil/sphil/tree/dev", // root for every edit link
editLink: {
text: "Edit this page on GitHub",
text: "Edit this page on GitHub ✏️",
},
footer: {
component: Footer,
Expand Down Expand Up @@ -105,7 +105,7 @@ const config: DocsThemeConfig = {
},
toc: {
backToTop: true,
extraContent: <SymposiaCard />,
extraContent: <TableOfContentsExtra />,
},
useNextSeoProps: function SEO() {
const router = useRouter();
Expand Down

0 comments on commit 6b7bde4

Please sign in to comment.