Browse Source

Add friend links

master
Menci 7 years ago
parent
commit
a4f090d299
  1. 6
      config-example.json
  2. 3
      modules/index.js
  3. 10
      views/index.ejs

6
config-example.json

@ -141,6 +141,12 @@
"comment": "Specify the url and date if you want to show any link" "comment": "Specify the url and date if you want to show any link"
} }
], ],
"links": [
{
"title": "LibreOJ",
"url": "https://loj.ac/"
}
],
"announcement": "Here is the announcement", "announcement": "Here is the announcement",
"session_secret": "233", "session_secret": "233",
"judge_token": "233" "judge_token": "233"

3
modules/index.js

@ -62,7 +62,8 @@ app.get('/', async (req, res) => {
notices: notices, notices: notices,
fortune: fortune, fortune: fortune,
contests: contests, contests: contests,
hitokoto: hitokoto hitokoto: hitokoto,
links: syzoj.config.links
}); });
} catch (e) { } catch (e) {
syzoj.log(e); syzoj.log(e);

10
views/index.ejs

@ -177,6 +177,16 @@
<p><%- syzoj.config.announcement %></p> <p><%- syzoj.config.announcement %></p>
<% } %> <% } %>
</div> </div>
<% if (links) { %>
<h4 class="ui top attached block header font-content">友情链接</h4>
<div class="ui bottom attached <% if (!syzoj.config.announcement) { %>center aligned <% } %>segment">
<ul style="margin: 0; padding-left: 20px; ">
<% for (let link of links) { %>
<li><a href="<%= link.url %>"><%= link.title %></a></li>
<% } %>
</ul>
</div>
<% } %>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save