Skip to content

Commit

Permalink
add canonical link
Browse files Browse the repository at this point in the history
  • Loading branch information
pveyes committed Oct 5, 2023
1 parent b2a3855 commit e817ebd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface Props {
onShowHelp?: () => void;
onShowSettings?: () => void;
onSendEmoji?: (emoji: string) => void;
path?: string;
}

export default function Header(props: Props) {
Expand Down Expand Up @@ -52,6 +53,7 @@ export default function Header(props: Props) {
isLiveMode,
themeColor = "#15803D",
showLiarOption,
path = "/",
} = props;

return (
Expand All @@ -66,6 +68,7 @@ export default function Header(props: Props) {
<meta property="og:description" content={description} />
<meta property="og:keywords" content={keywords.join(", ")} />
<meta property="og:image" content={ogImage} />
<link rel="canonical" href={"https://katla.id/" + path} />

<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:domain" content="katla.vercel.app" />
Expand Down
1 change: 1 addition & 0 deletions pages/arsip/[num].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default function Arsip(props: Props) {
const headerProps: ComponentProps<typeof Header> = {
title: `Katla | Arsip #${props.num}`,
customHeading: <HeadingWithNum num={props.num} />,
path: `/arsip/${props.num}`,
ogImage: "https://katla.vercel.app/og-arsip.png",
themeColor: game.state.enableHighContrast ? "#f5793a" : "#15803D",
onShowHelp: () => setModalState("help"),
Expand Down
1 change: 1 addition & 0 deletions pages/arsip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function Arsip() {
return (
<Container>
<Header
path="/arsip"
title="Katla | Arsip"
keywords={[
"arsip",
Expand Down
5 changes: 4 additions & 1 deletion pages/lawan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ export default function Lawan({ words }: Props) {
}

export const getStaticProps: GetStaticProps<Props> = async () => {
const words = await fetcher("https://cdn.statically.io/gh/pveyes/makna/main/words.json");
const words = await fetcher(
"https://cdn.statically.io/gh/pveyes/makna/main/words.json"
);
return {
props: {
words,
Expand Down Expand Up @@ -195,6 +197,7 @@ function Main({ words, config }: MainProps) {
);

const headerProps: ComponentProps<typeof Header> = {
path: "/lawan",
onSendEmoji: others.count > 0 ? handleSendEmoji : undefined,
customHeading: (
<div className="dark:text-gray-300 text-gray-700 flex relative">
Expand Down

1 comment on commit e817ebd

@vercel
Copy link

@vercel vercel bot commented on e817ebd Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

katla – ./

katla-katla.vercel.app
katla.vercel.app
katla-git-main-katla.vercel.app
katla.id

Please sign in to comment.