mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
This commit is contained in:
parent
d4c3fd0db3
commit
bdf7d172da
1 changed files with 4 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ import {getThemeMode, setInlineStyle} from "../../util/assets";
|
||||||
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
import {fetchPost, fetchSyncPost} from "../../util/fetch";
|
||||||
import {Dialog} from "../../dialog";
|
import {Dialog} from "../../dialog";
|
||||||
import {replaceLocalPath} from "../../editor/rename";
|
import {replaceLocalPath} from "../../editor/rename";
|
||||||
import {getScreenWidth, isInAndroid, isInHarmony, setStorageVal} from "../util/compatibility";
|
import {getScreenWidth, isInAndroid, isInHarmony, isInIOS, setStorageVal} from "../util/compatibility";
|
||||||
import {getFrontend} from "../../util/functions";
|
import {getFrontend} from "../../util/functions";
|
||||||
|
|
||||||
const getPluginStyle = async () => {
|
const getPluginStyle = async () => {
|
||||||
|
|
@ -705,13 +705,14 @@ export const onExport = async (data: IWebSocketData, filePath: string, servePath
|
||||||
themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`;
|
themeStyle = `<link rel="stylesheet" type="text/css" id="themeStyle" href="${servePath}appearance/themes/${themeName}/theme.css?${Constants.SIYUAN_VERSION}"/>`;
|
||||||
}
|
}
|
||||||
const screenWidth = getScreenWidth();
|
const screenWidth = getScreenWidth();
|
||||||
const mobileHtml = isInAndroid() || isInHarmony() ? {
|
const isInMobile = isInAndroid() || isInHarmony() || isInIOS();
|
||||||
|
const mobileHtml = isInMobile ? {
|
||||||
js: `document.body.style.minWidth = "${screenWidth}px";`,
|
js: `document.body.style.minWidth = "${screenWidth}px";`,
|
||||||
css: `@page { size: A4; margin: 10mm 0 10mm 0; }
|
css: `@page { size: A4; margin: 10mm 0 10mm 0; }
|
||||||
.protyle-wysiwyg {padding: 0; margin: 0;}`
|
.protyle-wysiwyg {padding: 0; margin: 0;}`
|
||||||
} : {js: "", css: ""};
|
} : {js: "", css: ""};
|
||||||
const html = `<!DOCTYPE html>
|
const html = `<!DOCTYPE html>
|
||||||
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">
|
<html lang="${window.siyuan.config.appearance.lang}" data-theme-mode="${isInMobile ? "light" : getThemeMode()}" data-light-theme="${window.siyuan.config.appearance.themeLight}" data-dark-theme="${window.siyuan.config.appearance.themeDark}">
|
||||||
<head>
|
<head>
|
||||||
<base href="${servePath}">
|
<base href="${servePath}">
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue