refactor: enable scroll-smooth only in post detail page

This commit is contained in:
satnaing
2023-12-31 12:10:05 +06:30
committed by Sat Naing
parent 20536b0562
commit e7c9a56722
3 changed files with 7 additions and 4 deletions
+6 -1
View File
@@ -13,6 +13,7 @@ export interface Props {
canonicalURL?: string;
pubDatetime?: Date;
modDatetime?: Date;
scrollSmooth?: boolean;
}
const {
@@ -23,6 +24,7 @@ const {
canonicalURL = new URL(Astro.url.pathname, Astro.site).href,
pubDatetime,
modDatetime,
scrollSmooth = false,
} = Astro.props;
const socialImageURL = new URL(
@@ -32,7 +34,10 @@ const socialImageURL = new URL(
---
<!doctype html>
<html lang=`${LOCALE.lang ?? "en"}`>
<html
lang=`${LOCALE.lang ?? "en"}`
class={`${scrollSmooth && "scroll-smooth"}`}
>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
+1
View File
@@ -40,6 +40,7 @@ const layoutProps = {
modDatetime,
canonicalURL,
ogImage: ogUrl,
scrollSmooth: true,
};
---