mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-10 05:39:11 +00:00
Standardize loading fonts locally across pages on web app
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Noto_Sans } from "next/font/google";
|
import { noto_sans, noto_sans_arabic } from "@/app/fonts";
|
||||||
import "../globals.css";
|
import "../globals.css";
|
||||||
|
|
||||||
const inter = Noto_Sans({ subsets: ["latin"] });
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Khoj AI - Agents",
|
title: "Khoj AI - Agents",
|
||||||
description: "Find a specialized agent that can help you address more specific needs.",
|
description: "Find a specialized agent that can help you address more specific needs.",
|
||||||
@@ -33,7 +31,7 @@ export default function RootLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en" className={`${noto_sans.variable} ${noto_sans_arabic.variable}`}>
|
||||||
<meta
|
<meta
|
||||||
httpEquiv="Content-Security-Policy"
|
httpEquiv="Content-Security-Policy"
|
||||||
content="default-src 'self' https://assets.khoj.dev;
|
content="default-src 'self' https://assets.khoj.dev;
|
||||||
@@ -46,7 +44,7 @@ export default function RootLayout({
|
|||||||
child-src 'none';
|
child-src 'none';
|
||||||
object-src 'none';"
|
object-src 'none';"
|
||||||
></meta>
|
></meta>
|
||||||
<body className={inter.className}>{children}</body>
|
<body>{children}</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Noto_Sans } from "next/font/google";
|
import { noto_sans, noto_sans_arabic } from "@/app/fonts";
|
||||||
import "../globals.css";
|
import "../globals.css";
|
||||||
|
|
||||||
const inter = Noto_Sans({ subsets: ["latin"] });
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Khoj AI - Chat",
|
title: "Khoj AI - Chat",
|
||||||
description:
|
description:
|
||||||
@@ -34,7 +32,7 @@ export default function RootLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en" className={`${noto_sans.variable} ${noto_sans_arabic.variable}`}>
|
||||||
<meta
|
<meta
|
||||||
httpEquiv="Content-Security-Policy"
|
httpEquiv="Content-Security-Policy"
|
||||||
content="default-src 'self' https://assets.khoj.dev;
|
content="default-src 'self' https://assets.khoj.dev;
|
||||||
@@ -47,7 +45,7 @@ export default function RootLayout({
|
|||||||
child-src 'none';
|
child-src 'none';
|
||||||
object-src 'none';"
|
object-src 'none';"
|
||||||
></meta>
|
></meta>
|
||||||
<body className={inter.className}>
|
<body>
|
||||||
{children}
|
{children}
|
||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
|
|||||||
13
src/interface/web/app/fonts.ts
Normal file
13
src/interface/web/app/fonts.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { Noto_Sans, Noto_Sans_Arabic } from "next/font/google";
|
||||||
|
|
||||||
|
export const noto_sans = Noto_Sans({
|
||||||
|
subsets: ["latin", "latin-ext", "cyrillic", "cyrillic-ext", "devanagari", "vietnamese"],
|
||||||
|
display: "swap",
|
||||||
|
variable: "--font-noto-sans",
|
||||||
|
});
|
||||||
|
|
||||||
|
export const noto_sans_arabic = Noto_Sans_Arabic({
|
||||||
|
subsets: ["arabic"],
|
||||||
|
display: "swap",
|
||||||
|
variable: "--font-noto-sans-arabic",
|
||||||
|
});
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap");
|
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
:root {
|
:root {
|
||||||
@@ -25,7 +24,7 @@
|
|||||||
--input: 220 13% 91%;
|
--input: 220 13% 91%;
|
||||||
--ring: 24.6 95% 53.1%;
|
--ring: 24.6 95% 53.1%;
|
||||||
--radius: 0.5rem;
|
--radius: 0.5rem;
|
||||||
--font-family: "Noto Sans", "Noto Sans Arabic", sans-serif !important;
|
--font-family: var(--font-noto-sans), var(--font-noto-sans-arabic), sans-serif !important;
|
||||||
|
|
||||||
/* Khoj Custom Colors */
|
/* Khoj Custom Colors */
|
||||||
--frosted-background-color: 20 13% 95%;
|
--frosted-background-color: 20 13% 95%;
|
||||||
@@ -188,7 +187,7 @@
|
|||||||
--border: 0 0% 9%;
|
--border: 0 0% 9%;
|
||||||
--input: 0 0% 9%;
|
--input: 0 0% 9%;
|
||||||
--ring: 20.5 90.2% 48.2%;
|
--ring: 20.5 90.2% 48.2%;
|
||||||
--font-family: "Noto Sans", "Noto Sans Arabic", sans-serif !important;
|
--font-family: var(--font-noto-sans), var(--font-noto-sans-arabic), sans-serif !important;
|
||||||
|
|
||||||
/* Imported from highlight.js */
|
/* Imported from highlight.js */
|
||||||
pre code.hljs {
|
pre code.hljs {
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Noto_Sans } from "next/font/google";
|
import { noto_sans, noto_sans_arabic } from "@/app/fonts";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
|
||||||
const inter = Noto_Sans({ subsets: ["latin"] });
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Khoj AI - Home",
|
title: "Khoj AI - Home",
|
||||||
description: "Your Second Brain.",
|
description: "Your Second Brain.",
|
||||||
@@ -39,7 +37,7 @@ export default function RootLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en" className={`${noto_sans.variable} ${noto_sans_arabic.variable}`}>
|
||||||
<meta
|
<meta
|
||||||
httpEquiv="Content-Security-Policy"
|
httpEquiv="Content-Security-Policy"
|
||||||
content="default-src 'self' https://assets.khoj.dev;
|
content="default-src 'self' https://assets.khoj.dev;
|
||||||
@@ -52,7 +50,7 @@ export default function RootLayout({
|
|||||||
child-src 'none';
|
child-src 'none';
|
||||||
object-src 'none';"
|
object-src 'none';"
|
||||||
></meta>
|
></meta>
|
||||||
<body className={inter.className}>{children}</body>
|
<body>{children}</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Noto_Sans } from "next/font/google";
|
import { noto_sans, noto_sans_arabic } from "@/app/fonts";
|
||||||
import "../globals.css";
|
import "../globals.css";
|
||||||
import { Toaster } from "@/components/ui/toaster";
|
import { Toaster } from "@/components/ui/toaster";
|
||||||
|
|
||||||
const inter = Noto_Sans({ subsets: ["latin"] });
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Khoj AI - Settings",
|
title: "Khoj AI - Settings",
|
||||||
description: "Configure Khoj to get personalized, deeper assistance.",
|
description: "Configure Khoj to get personalized, deeper assistance.",
|
||||||
@@ -34,7 +32,7 @@ export default function RootLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en" className={`${noto_sans.variable} ${noto_sans_arabic.variable}`}>
|
||||||
<meta
|
<meta
|
||||||
httpEquiv="Content-Security-Policy"
|
httpEquiv="Content-Security-Policy"
|
||||||
content="default-src 'self' https://assets.khoj.dev;
|
content="default-src 'self' https://assets.khoj.dev;
|
||||||
@@ -46,7 +44,7 @@ export default function RootLayout({
|
|||||||
child-src 'none';
|
child-src 'none';
|
||||||
object-src 'none';"
|
object-src 'none';"
|
||||||
></meta>
|
></meta>
|
||||||
<body className={inter.className}>
|
<body>
|
||||||
{children}
|
{children}
|
||||||
<Toaster />
|
<Toaster />
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Noto_Sans } from "next/font/google";
|
import { noto_sans, noto_sans_arabic } from "@/app/fonts";
|
||||||
import "../../globals.css";
|
import "../../globals.css";
|
||||||
|
|
||||||
const inter = Noto_Sans({ subsets: ["latin"] });
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Khoj AI - Chat",
|
title: "Khoj AI - Chat",
|
||||||
description: "Use this page to view a chat with Khoj AI.",
|
description: "Use this page to view a chat with Khoj AI.",
|
||||||
@@ -15,7 +13,7 @@ export default function RootLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en" className={`${noto_sans.variable} ${noto_sans_arabic.variable}`}>
|
||||||
<meta
|
<meta
|
||||||
httpEquiv="Content-Security-Policy"
|
httpEquiv="Content-Security-Policy"
|
||||||
content="default-src 'self' https://assets.khoj.dev;
|
content="default-src 'self' https://assets.khoj.dev;
|
||||||
@@ -27,7 +25,7 @@ export default function RootLayout({
|
|||||||
child-src 'none';
|
child-src 'none';
|
||||||
object-src 'none';"
|
object-src 'none';"
|
||||||
></meta>
|
></meta>
|
||||||
<body className={inter.className}>
|
<body>
|
||||||
{children}
|
{children}
|
||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ const config = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
extend: {
|
extend: {
|
||||||
|
fontFamily: {
|
||||||
|
sans: ["var(--font-noto-sans)", "var(--font-noto-sans-arabic)"],
|
||||||
|
},
|
||||||
colors: {
|
colors: {
|
||||||
border: "hsl(var(--border))",
|
border: "hsl(var(--border))",
|
||||||
input: "hsl(var(--input))",
|
input: "hsl(var(--input))",
|
||||||
|
|||||||
Reference in New Issue
Block a user