Skip to content

Commit

Permalink
suport BaseHead.astro
Browse files Browse the repository at this point in the history
  • Loading branch information
torn4dom4n authored Mar 13, 2023
1 parent 765b46a commit 5a27d75
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 10 deletions.
Binary file added public/og.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://astro-multiverse.netlify.app/sitemap-index.xml
38 changes: 38 additions & 0 deletions src/components/BaseHead.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
interface Props {
title?: string | undefined;
description?: string | undefined;
author?: string | undefined;
og?: string | undefined;
}
const { title, description, author, og } = Astro.props;
---

<head>
<meta charset="utf-8" />
<meta name="robots" content="index, follow" />
<meta
name="googlebot"
content="index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"
/>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="generator" content={Astro.generator} />
<link rel="shortcut icon" type="image/png" href="/favicon.ico" />
<link rel="sitemap" type="application/xml" href="/sitemap-index.xml">
<title>{title}</title>
<meta name="title" content={title} />
<meta name="description" content={description} />
<meta name="author" content={author} />
<meta property="og:type" content="website" />
<meta property="og:url" content={Astro.url} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={new URL(og, Astro.url)} />
<meta name="twitter:url" content={Astro.url} />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={new URL(og, Astro.url)} />
<meta name="twitter:card" content="summary_large_image" />
<link rel="stylesheet" href="css/main.css" />
</head>
17 changes: 7 additions & 10 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import BaseHead from "../components/BaseHead.astro";
import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
import Thumb from "../components/Thumb.astro";
Expand All @@ -11,16 +12,12 @@ let description = "Say hello to Multiverse, a slick, one-page gallery design wit

<!DOCTYPE html>
<html lang="en">
<head>
<title>{title}</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content={description} />
<meta property="og:image" content="https://html5up.net/uploads/cards/multiverse.jpg" />

<link href="./favicon.ico" rel="shortcut icon" />
<link rel="stylesheet" href="css/main.css" />
</head>
<BaseHead
title={title}
description={description}
author={"AREA44"}
og={"og.jpg"}
/>

<body class="is-preload">
<div id="wrapper">
Expand Down

0 comments on commit 5a27d75

Please sign in to comment.