mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-15 04:36:41 +09:00
Added the lang attribute to the tag
This commit is contained in:
@@ -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,
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
@@ -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>) {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user