Skip to content

Commit

Permalink
feat(BaseHead, Layout): Add ViewTransitions component
Browse files Browse the repository at this point in the history
- Added import statement for `ViewTransitions` in `BaseHead.astro` and `Layout.astro`
- Added `<ViewTransitions />` component in the HTML structure of both files
  • Loading branch information
SakuraIsayeki committed Jun 23, 2024
1 parent 64b9afc commit f1f937f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions nodsoft_moltenobsidian_web/src/components/BaseHead.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
import { ViewTransitions } from 'astro:transitions';
// const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const defaultProps = {
Expand Down Expand Up @@ -26,6 +29,8 @@ const base = import.meta.env.BASE_URL ?? "/";
<meta name="theme-color" content="#ffffff" />
<meta name="generator" content={Astro.generator} />

<ViewTransitions />

<!-- Preconnects -->
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin="anonymous" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
Expand Down
6 changes: 4 additions & 2 deletions nodsoft_moltenobsidian_web/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import "../styles/_global.scss"
import BaseHead from "../components/BaseHead.astro";
import Sidebar from "../components/Sidebar.astro";
import { SITE_TITLE } from "../consts";
import { ViewTransitions } from "astro:transitions";
interface Props {
title: string;
Expand All @@ -15,7 +17,7 @@ const baseHeadTitle = title ? `${title} - ${SITE_TITLE}` : SITE_TITLE;
---

<!DOCTYPE html>
<html lang="en">
<html lang="en" transition:animate="none">
<!--suppress HtmlRequiredTitleElement, included in BaseHead -->
<head>
<BaseHead title={baseHeadTitle} description={description} />
Expand All @@ -24,7 +26,7 @@ const baseHeadTitle = title ? `${title} - ${SITE_TITLE}` : SITE_TITLE;
<body class="flex-row-lg">
<Sidebar />

<main>
<main transition:animate="initial">
<slot />
</main>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"canvas",
"outgoing-link",
"tag-pane",
"properties",
"page-preview",
"daily-notes",
"templates",
Expand Down

0 comments on commit f1f937f

Please sign in to comment.