Browse Source

Make logo image configurable

master
Menci 6 years ago
parent
commit
2927adb126
  1. 5
      config-example.json
  2. 8
      views/header.ejs

5
config-example.json

@ -8,6 +8,11 @@
"password": null,
"host": "127.0.0.1"
},
"logo": {
"url": null,
"width": null,
"height": null
},
"register_mail": false,
"email": {
"method": "aliyundm",

8
views/header.ejs

@ -33,7 +33,15 @@
<body>
<div class="ui fixed borderless menu" style="position: fixed; ">
<div class="ui container">
<%
if (syzoj.config.logo.url) {
let width = syzoj.config.logo.width ? syzoj.config.logo.width + 'px' : 'auto';
let height = syzoj.config.logo.height ? syzoj.config.logo.height + 'px' : 'auto';
%>
<a class="header item" href="/"><img src="<%= syzoj.config.logo.url %>" style="width: <%= width %>; height: <%= height %>; "></a>
<% } else { %>
<a class="header item" href="/"><span style="font-family: 'Exo 2'; font-size: 1.5em; font-weight: 600; "><%= syzoj.config.title %></span></a>
<% } %>
<a class="item<% if (active === '') { %> active<% } %>" href="/"><i class="home icon"></i> 首页</a>
<a class="item<% if (active.startsWith('problem')) { %> active<% } %>" href="/problems"><i class="list icon"></i> 题库</a>
<a class="item<% if (active.startsWith('contest')) { %> active<% } %>" href="/contests"><i class="calendar icon"></i> 比赛</a>

Loading…
Cancel
Save