diff --git a/config-example.json b/config-example.json index 5600eb3..802aa60 100644 --- a/config-example.json +++ b/config-example.json @@ -141,6 +141,12 @@ "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", "session_secret": "233", "judge_token": "233" diff --git a/modules/index.js b/modules/index.js index 7d1c76a..a7eb8ab 100644 --- a/modules/index.js +++ b/modules/index.js @@ -62,7 +62,8 @@ app.get('/', async (req, res) => { notices: notices, fortune: fortune, contests: contests, - hitokoto: hitokoto + hitokoto: hitokoto, + links: syzoj.config.links }); } catch (e) { syzoj.log(e); diff --git a/views/index.ejs b/views/index.ejs index 5260c5f..db76b2b 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -177,6 +177,16 @@

<%- syzoj.config.announcement %>

<% } %> + <% if (links) { %> +

友情链接

+
+ +
+ <% } %>