Skip to content

Commit

Permalink
Add SEO (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anvaqta Tangguh Wisesa authored Oct 7, 2020
1 parent 7e38161 commit 41e1744
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 66 deletions.
1 change: 1 addition & 0 deletions data/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export default {
title: "Artificial Intelligence Laboratory",
desc:
"AI Lab is a research laboratory under the Intelligence, Computing and Multimedia (ICM) research group. We stand in the Informatics Faculty at Telkom University.",
url: "https://ailabtelkom.github.io",
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"next-compose-plugins": "^2.2.0",
"next-mdx-remote": "^1.0.0",
"next-optimized-images": "^2.6.2",
"next-seo": "^4.11.0",
"nprogress": "^0.2.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
Expand Down
30 changes: 28 additions & 2 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,46 @@ import "nprogress/nprogress.css";
import "../assets/css/style.css";
import Navbar from "../components/Navbar";
import siteConfig from "../data/siteConfig";
import { DefaultSeo } from "next-seo";

NProgress.configure({ showSpinner: false });
Router.events.on("routeChangeStart", () => NProgress.start());
Router.events.on("routeChangeComplete", () => NProgress.done());
Router.events.on("routeChangeError", () => NProgress.done());

function CustomApp({ Component, pageProps }) {
function CustomApp({ Component, pageProps, router }) {
const color = useColorModeValue("yellow", "red");
return (
<ChakraProvider resetCSS>
<Head>
<title>{siteConfig.title}</title>
<link rel="icon" href="/img/favicon.ico" />
</Head>
<DefaultSeo
description={siteConfig.desc}
title="Welcome"
titleTemplate={`%s · ${siteConfig.title}`}
canonical={siteConfig.url + (router.asPath || "")}
openGraph={{
title: siteConfig.title,
description: siteConfig.desc,
type: "website",
site_name: siteConfig.title,
images: [
{
url: `${siteConfig.url}/img/og.jpg`,
width: 1024,
height: 512,
alt: siteConfig.title,
},
{
url: `${siteConfig.url}/img/og.png`,
width: 1024,
height: 512,
alt: siteConfig.title,
},
],
}}
/>
<Stack minH="100vh" w="full" spacing={0}>
<Navbar />
<Box flexGrow={1} _selection={{ color }}>
Expand Down
5 changes: 5 additions & 0 deletions pages/about.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Link from "../components/Link";
import { FaGithub, FaInstagram, FaLinkedin } from "react-icons/fa";
import activities from "../data/activities";
import teams from "../data/aslab";
import { NextSeo } from "next-seo";
const about = () => {
const MotionBox = motion.custom(Box);
const bgColor = useColorModeValue("white", "gray.700");
Expand All @@ -38,6 +39,10 @@ const about = () => {

return (
<React.Fragment>
<NextSeo
title="About"
description="About Artificial Intelligence Laboratory Telkom University"
/>
<MotionBox
initial="start"
animate="end"
Expand Down
133 changes: 71 additions & 62 deletions pages/playground/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Button,
} from "@chakra-ui/core";
import { motion } from "framer-motion";
import { NextSeo } from "next-seo";
import React from "react";
import { FaArrowRight, FaBook } from "react-icons/fa";
import playgrounds from "../../data/playground";
Expand All @@ -34,76 +35,84 @@ const index = () => {
};

return (
<MotionBox
exit={{ opacity: 0, transition: { duration: 0.1 } }}
initial="start"
animate="end"
exit="exit"
variants={containerVariant}
transition={{ delay: 0.1 }}
maxW={[null, null, "2xl", "5xl"]}
m="auto"
my="40px"
px={{ default: 6, md: 0 }}
>
<Stack pt={{ default: "1em", lg: "2em" }}>
<Heading fontSize={{ default: "2xl", lg: "3xl" }}>
Hey, are you curious about "What AI Looks like" IRL?
</Heading>
<Text mb="6">We have something for you to play with 😁</Text>
<Grid templateColumns={["repeat(1, 1fr)", "repeat(3, 1fr)"]} gap={6}>
{playgrounds.map((data, index) => {
return (
<MotionBox key={index} variants={itemVariant} borderWidth="1px">
<Link isExternal={data.isExternal} href={data.url}>
<Image
width="350px"
height="200px"
fit="cover"
src={data.image}
fallbackSrc={data.fallbackImg}
alt={data.name}
/>
</Link>
<Box p={2}>
<Link
isExternal={data.isExternal}
href={data.url}
fontWeight="bold"
fontSize={20}
mt={2}
>
{data.name}
<React.Fragment>
<NextSeo
title="Playground"
description={`Hey, are you curious about "What AI Looks like" IRL?
We have something for you to play with 😁`}
/>

<MotionBox
exit={{ opacity: 0, transition: { duration: 0.1 } }}
initial="start"
animate="end"
exit="exit"
variants={containerVariant}
transition={{ delay: 0.1 }}
maxW={[null, null, "2xl", "5xl"]}
m="auto"
my="40px"
px={{ default: 6, md: 0 }}
>
<Stack pt={{ default: "1em", lg: "2em" }}>
<Heading fontSize={{ default: "2xl", lg: "3xl" }}>
Hey, are you curious about "What AI Looks like" IRL?
</Heading>
<Text mb="6">We have something for you to play with 😁</Text>
<Grid templateColumns={["repeat(1, 1fr)", "repeat(3, 1fr)"]} gap={6}>
{playgrounds.map((data, index) => {
return (
<MotionBox key={index} variants={itemVariant} borderWidth="1px">
<Link isExternal={data.isExternal} href={data.url}>
<Image
width="350px"
height="200px"
fit="cover"
src={data.image}
fallbackSrc={data.fallbackImg}
alt={data.name}
/>
</Link>
<Text>{data.desc}</Text>
<Stack mt={4} direction="row">
<Button
as={Link}
<Box p={2}>
<Link
isExternal={data.isExternal}
href={data.url}
colorScheme="yellow"
size="sm"
leftIcon={<FaArrowRight />}
fontWeight="bold"
fontSize={20}
mt={2}
>
Visit
</Button>
{data.detail && (
{data.name}
</Link>
<Text>{data.desc}</Text>
<Stack mt={4} direction="row">
<Button
as={Link}
href={data.detail}
href={data.url}
colorScheme="yellow"
size="sm"
leftIcon={<FaBook />}
leftIcon={<FaArrowRight />}
>
Details
Visit
</Button>
)}
</Stack>
</Box>
</MotionBox>
);
})}
</Grid>
</Stack>
</MotionBox>
{data.detail && (
<Button
as={Link}
href={data.detail}
size="sm"
leftIcon={<FaBook />}
>
Details
</Button>
)}
</Stack>
</Box>
</MotionBox>
);
})}
</Grid>
</Stack>
</MotionBox>
</React.Fragment>
);
};

Expand Down
7 changes: 6 additions & 1 deletion pages/playground/posenet.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { NextSeo } from "next-seo";
import React from "react";

const posenet = () => {
return (
<div>
<NextSeo
title="Posenet"
description={`PoseNet is a vision model that can be used to estimate the pose of a person in an image or video by estimating where key body joints are.`}
/>
<iframe
className="full"
src="https://storage.googleapis.com/tfjs-models/demos/posenet/camera.html"
Expand All @@ -16,7 +21,7 @@ const posenet = () => {
height: 90vh;
}
@media screen and (max-width: 800px) {
.full{
.full {
width: 100vw;
}
}
Expand Down
4 changes: 3 additions & 1 deletion pages/research.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { motion } from "framer-motion";
import { Box, Heading, Text } from "@chakra-ui/core";
import Link from "../components/Link";
import data from "../data/research";
import { NextSeo } from "next-seo";
const research = () => {
const MotionBox = motion.custom(Box);
const containerVariant = {
Expand All @@ -28,8 +29,9 @@ const research = () => {
py="50px"
>
<Box px={{ default: 6, md: 0 }}>
<NextSeo title="Research" description="Past resesearch by our member" />
<Heading mt="2" fontSize={{ default: "2xl", lg: "3xl" }}>
Reasearch
Research
</Heading>
<Text>Past resesearch by our member</Text>
<Box overflow="auto" mt="6">
Expand Down
5 changes: 5 additions & 0 deletions pages/resources/image.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getCvData } from "../../utils/resourceHooks";
import Markdown from "react-markdown";
import { contentRenderer } from "../../utils/renderer";
import { FaGithub } from "react-icons/fa";
import { NextSeo } from "next-seo";
const cv = () => {
const { data, isLoading } = getCvData();
const { colorMode } = useColorMode();
Expand All @@ -15,6 +16,10 @@ const cv = () => {
m="auto"
px={{ default: 6, md: 0 }}
>
<NextSeo
title="CV Resources"
description="Data resources Computer Vision. This was made for student, researcher, who else that was doing a research or anything about Image Processing and Computer Vision."
/>
{isLoading ? (
<Spinner />
) : (
Expand Down
2 changes: 2 additions & 0 deletions pages/resources/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { useEffect } from "react";
import { useRouter } from "next/router";
import Link from "../../components/Link";
import { Code, Box } from "@chakra-ui/core";
import { NextSeo } from "next-seo";
const index = () => {
const router = useRouter();
useEffect(() => {
router.push("/resources/nlp");
}, []);
return (
<Box pt="80px" px={{ default: 6, md: 0 }}>
<NextSeo title="Resources" />
<Link href="/resources/nlp" route>
Redirecting to <Code>/resources/nlp</Code>
</Link>
Expand Down
5 changes: 5 additions & 0 deletions pages/resources/nlp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { getNlpData } from "../../utils/resourceHooks";
import Markdown from "react-markdown";
import { contentRenderer } from "../../utils/renderer";
import { FaGithub } from "react-icons/fa";
import { NextSeo } from "next-seo";
const nlp = () => {
const { data, isLoading } = getNlpData();
const { colorMode } = useColorMode();
Expand All @@ -15,6 +16,10 @@ const nlp = () => {
m="auto"
px={{ default: 6, md: 0 }}
>
<NextSeo
title="Bahasa Indonesia NLP Resources"
description="Kumpulan resource untuk Pemrosesan bahasa alami Bahasa Indonesia. Repository ini dibuat untuk membantu Researcher/Mahasiswa yang sedang membuat tugas akhir atau penelitian tentang pemrosesan bahasa alami yang menggunakan Bahasa Indonesia."
/>
{isLoading ? (
<Spinner />
) : (
Expand Down
Binary file added public/img/og.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6457,6 +6457,11 @@ next-optimized-images@^2.6.2:
raw-loader "^2.0.0"
url-loader "^1.1.2"

next-seo@^4.11.0:
version "4.11.0"
resolved "https://registry.yarnpkg.com/next-seo/-/next-seo-4.11.0.tgz#b4f160414b49e6e3dc7791df25e29b50550ebb67"
integrity sha512-JrrGA+wD20ArI5jTqbLE2jipmA5VCCcjBlb1ZI2lKktd7lCXNs/IIvwkNfJPPK0vFp/ewwylA6kO5CyX2fflig==

next-tick@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
Expand Down

0 comments on commit 41e1744

Please sign in to comment.