mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-01 04:09:12 +01:00
* feat: add server settings for default board, default color scheme and default locale * chore: address pull request feedback * test: adjust unit tests to match requirements * fix: deepsource issue * chore: add deepsource as dependency to translation library * refactor: restructure language-combobox, adjust default locale for next-intl * chore: change cookie keys prefix from homarr- to homarr.
34 lines
886 B
TypeScript
34 lines
886 B
TypeScript
import { db } from "@homarr/db";
|
|
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
|
|
|
|
export const SearchEngineOptimization = async () => {
|
|
const crawlingAndIndexingSetting = await getServerSettingByKeyAsync(db, "crawlingAndIndexing");
|
|
|
|
const robotsAttributes: string[] = [];
|
|
|
|
if (crawlingAndIndexingSetting.noIndex) {
|
|
robotsAttributes.push("noindex");
|
|
}
|
|
|
|
if (crawlingAndIndexingSetting.noFollow) {
|
|
robotsAttributes.push("nofollow");
|
|
}
|
|
|
|
const googleAttributes: string[] = [];
|
|
|
|
if (crawlingAndIndexingSetting.noSiteLinksSearchBox) {
|
|
googleAttributes.push("nositelinkssearchbox");
|
|
}
|
|
|
|
if (crawlingAndIndexingSetting.noTranslate) {
|
|
googleAttributes.push("notranslate");
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<meta name="robots" content={robotsAttributes.join(",")} />
|
|
<meta name="google" content={googleAttributes.join(",")} />
|
|
</>
|
|
);
|
|
};
|