Added the lang attribute to the tag

This commit is contained in:
Al Murad Uzzaman
2024-08-26 17:04:55 +06:00
parent 25cc4c533e
commit 1fb605ad85
4 changed files with 31 additions and 32 deletions
+6 -6
View File
@@ -46,7 +46,7 @@ const language = lang || getLangFromUrl(Astro.url);
---
<!doctype html>
<html lang={lang}>
<html lang={language}>
<head>
<!-- favicon -->
<link rel="shortcut icon" href={config.site.favicon} />
@@ -111,7 +111,7 @@ const language = lang || getLangFromUrl(Astro.url);
<meta
name="description"
content={plainify(
description ? description : config.metadata.meta_description
description ? description : config.metadata.meta_description,
)}
/>
@@ -124,7 +124,7 @@ const language = lang || getLangFromUrl(Astro.url);
<meta
property="og:title"
content={plainify(
meta_title ? meta_title : title ? title : config.site.title
meta_title ? meta_title : title ? title : config.site.title,
)}
/>
@@ -132,7 +132,7 @@ const language = lang || getLangFromUrl(Astro.url);
<meta
property="og:description"
content={plainify(
description ? description : config.metadata.meta_description
description ? description : config.metadata.meta_description,
)}
/>
<meta property="og:type" content="website" />
@@ -145,7 +145,7 @@ const language = lang || getLangFromUrl(Astro.url);
<meta
name="twitter:title"
content={plainify(
meta_title ? meta_title : title ? title : config.site.title
meta_title ? meta_title : title ? title : config.site.title,
)}
/>
@@ -153,7 +153,7 @@ const language = lang || getLangFromUrl(Astro.url);
<meta
name="twitter:description"
content={plainify(
description ? description : config.metadata.meta_description
description ? description : config.metadata.meta_description,
)}
/>
+3 -5
View File
@@ -1,10 +1,8 @@
---
import config from "@/config/config.json";
const {
theme_switcher,
default_theme,
}: { theme_switcher: boolean; default_theme: string } = config.settings;
const { theme_switcher }: { theme_switcher: boolean; default_theme: string } =
config.settings;
const { className }: { className?: string } = Astro.props;
---
@@ -49,7 +47,7 @@ const { className }: { className?: string } = Astro.props;
const matchMedia = window.matchMedia("(prefers-color-scheme: dark)");
matchMedia.addEventListener("change", () =>
toggleTheme(document.querySelectorAll("[data-theme-switcher]"))
toggleTheme(document.querySelectorAll("[data-theme-switcher]")),
);
function toggleTheme(themeSwitch: NodeListOf<Element>) {
+1 -2
View File
@@ -2,7 +2,6 @@
import Logo from "@/components/Logo.astro";
import ThemeSwitcher from "@/components/ThemeSwitcher.astro";
import config from "@/config/config.json";
import languages from "@/config/language.json";
import LanguageSwitcher from "@/helpers/LanguageSwitcher";
import {
getLangFromUrl,
@@ -64,7 +63,7 @@ if (disabledLanguages.includes(lang)) {
class={`nav-link inline-flex items-center ${
menu.children
?.map(({ url }: { url: string }) =>
slugSelector(url, lang)
slugSelector(url, lang),
)
.includes(pathname)
? "active"