|
1 | 1 | import React from 'react' |
2 | | -import Layout from './layout' |
3 | | -import { ArrowCircleDown } from '@phosphor-icons/react/dist/ssr' |
4 | | -import { tutorials } from '../data/tutorials' |
5 | | -import { TutorialCard } from '../components/tutorials/tutorial-card' |
6 | | -import { motion } from 'motion/react' |
7 | | - |
8 | | -import Rocket from '@site/static/img/rocket.svg' |
9 | | -import { Button } from '../components/ui/button' |
10 | | -import Link from '@docusaurus/Link' |
11 | | -import useBaseUrl from '@docusaurus/useBaseUrl' |
12 | | -import { StarryBackground } from '../components/starry-background' |
13 | | -import { useCurrentVersion } from '../hooks/use-current-version' |
14 | | -const head = ( |
15 | | - <> |
16 | | - <title>Tutorials | ink!</title> |
17 | | - <meta |
18 | | - name="description" |
19 | | - content="Access tutorials to help you get started with ink! smart contracts and deploy them on Polkadot and beyond." |
20 | | - /> |
21 | | - <meta name="keywords" content="tutorials, learning, ink!, guides, Polkadot" /> |
22 | | - <meta name="author" content="ink! Alliance" /> |
23 | | - <meta property="og:title" content="Tutorials | ink!" /> |
24 | | - <meta |
25 | | - property="og:description" |
26 | | - content="Access tutorials to help you get started with ink! smart contracts and deploy them on Polkadot and beyond." |
27 | | - /> |
28 | | - <meta property="og:image" content="https://use-ink.com/img/opengraph-home.png" /> |
29 | | - <meta property="og:url" content="https://use-ink.com" /> |
30 | | - <meta property="og:type" content="website" /> |
31 | | - <meta property="og:site_name" content="ink!" /> |
32 | | - <meta property="og:locale" content="en_US" /> |
33 | | - <meta property="og:image:width" content="1200" /> |
34 | | - <meta property="og:image:height" content="630" /> |
35 | | - <meta property="og:image:alt" content="ink! logo" /> |
36 | | - <meta property="og:image:type" content="image/png" /> |
37 | | - </> |
38 | | -) |
39 | | - |
40 | | -export default function PageTutorials() { |
41 | | - const currentVersion = useCurrentVersion() |
42 | | - const versionedTutorials = tutorials.map((tutorial) => { |
43 | | - return { |
44 | | - ...tutorial, |
45 | | - link: tutorial.link.replace('docs/', `docs/${currentVersion?.label ?? 'v5'}/`), |
46 | | - } |
47 | | - }) |
| 2 | +import { Redirect } from '@docusaurus/router' |
| 3 | +import Head from '@docusaurus/Head' |
48 | 4 |
|
| 5 | +export default function TutorialsRedirect() { |
49 | 6 | return ( |
50 | | - <Layout className="container overflow-hidden" head={head}> |
51 | | - <div |
52 | | - style={{ |
53 | | - width: '100vw', |
54 | | - height: '200vh', |
55 | | - position: 'absolute', |
56 | | - top: 0, |
57 | | - left: 0, |
58 | | - zIndex: -1, |
59 | | - overflow: 'hidden', |
60 | | - }} |
61 | | - > |
62 | | - <StarryBackground /> |
63 | | - </div> |
64 | | - <div className="flex flex-col items-center justify-center max-w-[540px] mx-auto text-center mt-[10vh]"> |
65 | | - <img |
66 | | - src={useBaseUrl('/img/Constellation.svg')} |
67 | | - alt="constellation" |
68 | | - className="w-[246px] h-[246px] lg:w-[450px] lg:h-[450px] absolute left-[2vw] lg:left-[18vw] top-10" |
69 | | - /> |
70 | | - <motion.div |
71 | | - className="w-[246px] h-[246px] rotate-[25deg]" |
72 | | - initial={{ opacity: 0, scale: 0.7, translateY: 200, translateX: -100, rotate: 30 }} |
73 | | - animate={{ opacity: 1, scale: 1, translateY: 0, translateX: 0, rotate: 25 }} |
74 | | - transition={{ |
75 | | - duration: 1, |
76 | | - opacity: { visualDuration: 0.1 }, |
77 | | - translateY: { type: 'spring', visualDuration: 0.9, bounce: 0.5 }, |
78 | | - translateX: { type: 'spring', visualDuration: 0.9, bounce: 0.5 }, |
79 | | - rotate: { type: 'tween', duration: 2 }, |
80 | | - }} |
81 | | - > |
82 | | - <Rocket style={{ filter: 'drop-shadow(0 10px 10px #0005' }} className="w-full h-full animate-float" /> |
83 | | - </motion.div> |
84 | | - <motion.div |
85 | | - initial={{ opacity: 0, translateY: 100 }} |
86 | | - animate={{ opacity: 1, translateY: 0 }} |
87 | | - transition={{ duration: 1.5 }} |
88 | | - > |
89 | | - <h1 className="font-bold text-[64px]">ink! Tutorials</h1> |
90 | | - </motion.div> |
91 | | - <motion.div |
92 | | - initial={{ opacity: 0, translateY: 100 }} |
93 | | - animate={{ opacity: 1, translateY: 0 }} |
94 | | - transition={{ duration: 1.2, delay: 0.4 }} |
95 | | - > |
96 | | - <p className="text-[18px] font-semibold"> |
97 | | - Explore step-by-step tutorials and learn how to build a dApp with ink! smart contracts. |
98 | | - </p> |
99 | | - </motion.div> |
100 | | - <motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 1, delay: 1 }}> |
101 | | - <a href="#tutorials" className="scroll-m-60"> |
102 | | - <ArrowCircleDown size={32} weight="duotone" fill="rgb(140, 124, 247)" /> |
103 | | - </a> |
104 | | - </motion.div> |
105 | | - </div> |
106 | | - <section id="tutorials" className="flex flex-col items-center justify-center max-w-[900px] mx-auto pt-20"> |
107 | | - <div className="grid grid-cols-1 gap-[36px] md:grid-cols-2"> |
108 | | - {versionedTutorials.map((tutorial) => ( |
109 | | - <TutorialCard key={tutorial.title} {...tutorial} /> |
110 | | - ))} |
111 | | - </div> |
112 | | - <div className="flex flex-col items-center justify-center gap-4 my-16 md:flex-row"> |
113 | | - <p className="m-0">Do you have an idea or need for a tutorial?</p> |
114 | | - <Link href="https://t.me/inkathon" className="text-blue-500"> |
115 | | - <Button size="lg" variant="secondary"> |
116 | | - Request a topic |
117 | | - </Button> |
118 | | - </Link> |
119 | | - </div> |
120 | | - </section> |
121 | | - </Layout> |
| 7 | + <> |
| 8 | + <Head> |
| 9 | + <link rel="canonical" href={'https://use.ink/tutorials/guide'} /> |
| 10 | + <meta name="robots" content="noindex, follow" /> |
| 11 | + </Head> |
| 12 | + <Redirect to={'/tutorials/guide'} /> |
| 13 | + </> |
122 | 14 | ) |
123 | 15 | } |
0 commit comments