Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moving all tutorials and examples onto one page #1203

Merged
merged 5 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add video
  • Loading branch information
thisisjofrank committed Nov 28, 2024
commit 27b63d2451c8ac37f22a21a8faca68a4e2f3e016
32 changes: 32 additions & 0 deletions learn/_components/VideoIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export function VideoIcon(props: { color: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 445 348"
className="inline mr-2"
width="1rem"
>
<rect
x="15"
y="15"
width="415.3"
height="318"
rx="56.7"
ry="56.7"
fill="none"
stroke={props.color}
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="30"
/>
<path
fill="none"
stroke={props.color}
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="30"
d="M15 95h415M67 18l74 75m165-78 72 73M228 15l70 70M145 15l77 77m-31 165v-92l98 46-98 46z"
/>
</svg>
);
}
2 changes: 2 additions & 0 deletions learn/_pages/ExamplePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { CopyButton } from "../_components/CopyButton.tsx";
import SnippetComponent from "../_components/SnippetComponent.tsx";
import { ExampleFromFileSystem } from "../types.ts";

export const layout = "doc.tsx";

type Props = { example: ExampleFromFileSystem };

export default function ExamplePage({ example }: Props) {
Expand Down
23 changes: 20 additions & 3 deletions learn/_pages/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { SectionTeaser } from "../_components/SectionTeaser.tsx";
import { LearningList } from "../_components/LearningList.tsx";
import { sidebar } from "../tutorials/_data.ts";

Expand All @@ -17,7 +16,7 @@ export default function LandingPage() {
id="content"
className="w-full px-8 pt-6 mt-16 max-w-screen-xl mx-auto mb-20"
>
<div className="pb-16 md:pb-0 w-full mb-6">
<div className="w-full mb-8">
<h1 className="text-2xl font-semibold sm:text-3xl md:text-4xl mb-3">
Learning hub
</h1>
Expand All @@ -26,9 +25,27 @@ export default function LandingPage() {
runtime <br />and how to use it with your favorite tools.
</p>
</div>
<div className="columns-3 gap-8">
<div className="columns-1 sm:columns-2 lg:columns-3 gap-8">
{componentsPerSidebarItem}
</div>
<p class="max-w-prose mx-auto text-center">
Need an example that isn't here? Or want to add one of your own?<br />
{" "}
We welcome contributions!{" "}
<br />You can request more examples, or add your own at our{" "}
<a
href="https://github.com/denoland/deno-docs?tab=readme-ov-file#examples"
class="text-primary hover:underline focus:underline"
>
GitHub repository
</a>
</p>
<a
href="/runtime/contributing/examples/"
class="homepage-link runtime-link text-center mt-4"
>
Commit an example and we'll send you some stickers!
</a>
</main>
);
}