Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Add data-backend and data-frontend attributes to HTML element https://github.com/siyuan-note/siyuan/issues/12549 (#16812)

Jeffrey Chenbafb045143ae
diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts
index 5cfaefe833..4ec68c3c70 100644
--- a/app/src/util/assets.ts
+++ b/app/src/util/assets.ts
@@ -8,10 +8,13 @@ import {exportLayout} from "../layout/util";
import {fetchPost} from "./fetch";
import {isInAndroid, isInHarmony, isInIOS, isIPad, isIPhone, isMac, isWin11} from "../protyle/util/compatibility";
import {setCodeTheme} from "../protyle/render/util";
+import {getBackend, getFrontend} from "./functions";
export const loadAssets = (data: Config.IAppearance) => {
const htmlElement = document.getElementsByTagName("html")[0];
htmlElement.setAttribute("lang", window.siyuan.config.appearance.lang);
+ htmlElement.setAttribute("data-frontend", getFrontend()); // https://github.com/siyuan-note/siyuan/issues/12549
+ htmlElement.setAttribute("data-backend", getBackend());
htmlElement.setAttribute("data-theme-mode", getThemeMode());
htmlElement.setAttribute("data-light-theme", window.siyuan.config.appearance.themeLight);
htmlElement.setAttribute("data-dark-theme", window.siyuan.config.appearance.themeDark);