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

attempt fix og title #378

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 8 additions & 8 deletions apps/playground/src/components/site/metatags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export default function Metatags({
description =
"Intuitive and easy-to-use Web3 development framework to build amazing applications on Cardano.";
}

if (keywords === undefined) {
keywords =
"developer, tools, cardano, blockchain, sdk, plutus, crypto, web3, metaverse, gaming, ecommerce, nfts, apis, aiken";
}

let _title = title;
if (title === undefined) {
_title = "Mesh JS - Cardano Web3 TypeScript SDK & Off-Chain Framework";
title = "Mesh JS - Cardano Web3 TypeScript SDK & Off-Chain Framework";
} else {
title = title + " - Mesh JS";
}
Expand All @@ -32,12 +32,12 @@ export default function Metatags({
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charSet="utf-8" />

<title>{title ? title : _title}</title>
{title && <title>{title}</title>}
<meta name="description" content={description} />
<meta name="keywords" content={keywords} />

<meta property="og:title" content={_title} />
<meta property="og:site_name" content={_title} />
{title && <meta property="og:title" content={title} />}
{title && <meta property="og:site_name" content={title} />}
<meta property="og:type" content="website" />
<meta property="og:description" content={description} />
{image && (
Expand All @@ -49,11 +49,11 @@ export default function Metatags({
content={`https://meshjs.dev/api/og?title=${title}`}
/>
)}
<meta property="og:image:alt" content={_title} />
{title && <meta property="og:image:alt" content={title} />}

<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@meshsdk" />
<meta name="twitter:title" content={_title} />
{title && <meta name="twitter:title" content={title} />}
<meta name="twitter:description" content={description} />
<meta name="twitter:creator" content="@meshsdk" />
{image && (
Expand All @@ -65,7 +65,7 @@ export default function Metatags({
content={`https://meshjs.dev/api/og?title=${title}`}
/>
)}
<meta name="twitter:image:alt" content={_title} />
{title && <meta name="twitter:image:alt" content={title} />}

<link
rel="apple-touch-icon"
Expand Down
2 changes: 0 additions & 2 deletions apps/playground/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Toaster } from "react-hot-toast";
import { MeshProvider } from "@meshsdk/react";

import Footer from "~/components/site/footer";
import Metatags from "~/components/site/metatags";
import Navbar from "~/components/site/navbar";
import Providers from "~/contexts/providers";

Expand All @@ -19,7 +18,6 @@ export default function App({ Component, pageProps }: AppProps) {
return (
<MeshProvider>
<Providers>
<Metatags />
<div className="cursor-default">
<header>
<Navbar />
Expand Down
2 changes: 2 additions & 0 deletions apps/playground/src/pages/about/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Metatags from "~/components/site/metatags";
import AboutHero from "./about-us/hero";
import AboutIncorporation from "./about-us/incorporation";
import AboutMeeting from "./about-us/meeting";
Expand All @@ -8,6 +9,7 @@ import AboutWhatWorkingOn from "./about-us/what-working-on";
export default function AboutPage() {
return (
<>
<Metatags title="About Mesh SDK" />
<AboutHero />
<AboutTeam />
<AboutMeeting />
Expand Down
85 changes: 46 additions & 39 deletions apps/playground/src/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { DocumentCheckIcon } from "@heroicons/react/24/solid";

import Link from "~/components/link";
import HeroTwoSections from "~/components/sections/hero-two-sections";
import Metatags from "~/components/site/metatags";

export default function HomePage() {
const [isSSR, setIsSSR] = useState(true);
Expand All @@ -11,44 +12,50 @@ export default function HomePage() {
}, []);

return (
<div className="flex flex-col gap-4">
<HeroTwoSections
title="Web3 TypeScript SDK & off-chain Framework"
description="Mesh is a TypeScript open-source library providing numerous tools to easily build powerful dApps on the Cardano blockchain."
link={{ label: "Get started", href: "/getting-started" }}
image={
<div className="col-span-6 hidden h-96 lg:block">
{!isSSR ? (
<video className="w-full" autoPlay muted>
<source src="/home/starter-template-cli.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
) : (
<>
<img
src="/logo-mesh/black/logo-mesh-black-512x512.png"
className="dark:hidden"
alt="mockup"
/>
<img
src="/logo-mesh/white/logo-mesh-white-512x512.png"
className="hidden dark:block"
alt="mockup dark"
/>
</>
)}
</div>
}
children={
<Link
href={`/about/catalyst`}
className="mr-3 inline-flex items-center justify-center rounded-lg bg-gray-700 px-5 py-3 text-center text-base font-medium text-white hover:bg-gray-800"
>
Catalyst Proposals
<DocumentCheckIcon className="-mr-1 ml-2 h-5 w-5" />
</Link>
}
/>
</div>
<>
<Metatags />
<div className="flex flex-col gap-4">
<HeroTwoSections
title="Web3 TypeScript SDK & off-chain Framework"
description="Mesh is a TypeScript open-source library providing numerous tools to easily build powerful dApps on the Cardano blockchain."
link={{ label: "Get started", href: "/getting-started" }}
image={
<div className="col-span-6 hidden h-96 lg:block">
{!isSSR ? (
<video className="w-full" autoPlay muted>
<source
src="/home/starter-template-cli.mp4"
type="video/mp4"
/>
Your browser does not support the video tag.
</video>
) : (
<>
<img
src="/logo-mesh/black/logo-mesh-black-512x512.png"
className="dark:hidden"
alt="mockup"
/>
<img
src="/logo-mesh/white/logo-mesh-white-512x512.png"
className="hidden dark:block"
alt="mockup dark"
/>
</>
)}
</div>
}
children={
<Link
href={`/about/catalyst`}
className="mr-3 inline-flex items-center justify-center rounded-lg bg-gray-700 px-5 py-3 text-center text-base font-medium text-white hover:bg-gray-800"
>
Catalyst Proposals
<DocumentCheckIcon className="-mr-1 ml-2 h-5 w-5" />
</Link>
}
/>
</div>
</>
);
}
10 changes: 0 additions & 10 deletions packages/mesh-provider/src/blockfrost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,16 +473,6 @@ export class BlockfrostProvider
}
}

async fetchUTxO(hash: string, index?: number): Promise<UTxO | undefined> {
try {
const utxos = await this.fetchUTxOs(hash);
const utxo = utxos.find((utxo) => utxo.input.outputIndex === index);
return utxo;
} catch (error) {
throw parseHttpError(error);
}
}

async fetchUTxOs(hash: string, index?: number): Promise<UTxO[]> {
try {
const { data, status } = await this._axiosInstance.get(
Expand Down