🚸 增强面板自定义CSS功能

This commit is contained in:
naiba
2020-12-24 09:54:17 +08:00
parent bb3829462d
commit 76c789efd8
7 changed files with 44 additions and 20 deletions

View File

@@ -19,8 +19,8 @@
</select>
</div>
<div class="field">
<label>自定义CSS</label>
<textarea name="CustomCSS">{{.Conf.Site.CustomCSS}}</textarea>
<label>自定义代码(style、script 都可以)</label>
<textarea name="CustomCode">{{.Conf.Site.CustomCode}}</textarea>
</div>
<button class="ui button" type="submit">保存</button>
</form>

View File

@@ -1,9 +1,7 @@
{{define "theme-default/home"}}
{{template "common/header" .}}
{{if ts .CustomCSS}}
{{tag "style"}}
{{.CustomCSS|safe}}
{{tag "/style"}}
{{if ts .CustomCode}}
{{.CustomCode|safe}}
{{end}}
{{template "common/menu" .}}
<div class="nb-container">

View File

@@ -19,10 +19,8 @@
<link rel="stylesheet" href="/static/theme-hotaru/css/core.css?v202012121912" type="text/css">
<link rel="stylesheet" href="/static/theme-hotaru/css/main.css?v202012202312" type="text/css">
<link rel="stylesheet" href="/static/theme-hotaru/css/darkmode.css?v202012121912" type="text/css">
{{if ts .CustomCSS}}
{{tag "style"}}
{{.CustomCSS|safe}}
{{tag "/style"}}
{{if ts .CustomCode}}
{{.CustomCode|safe}}
{{end}}
</head>