Announcements are properly implemented (yay)
This commit is contained in:
parent
8e703ecd3f
commit
312089c58d
4 changed files with 12 additions and 2 deletions
5
index.js
5
index.js
|
@ -14,6 +14,7 @@ const assetPath = path.join(__dirname, "assets")
|
|||
const configPath = path.join(__dirname, 'config')
|
||||
|
||||
const configFile = path.join(configPath, "config.json")
|
||||
const announcementFile = path.join(configPath, "announcement.html")
|
||||
|
||||
if (!fs.existsSync(configPath)) {
|
||||
fs.mkdirSync(configPath)
|
||||
|
@ -23,6 +24,10 @@ if (!fs.existsSync(configFile)) {
|
|||
fs.writeFileSync(configFile, fs.readFileSync(path.join(assetPath, "defaults/config.json")))
|
||||
}
|
||||
|
||||
if (!fs.existsSync(announcementFile)) {
|
||||
fs.writeFileSync(announcementFile, ``)
|
||||
}
|
||||
|
||||
var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json')))
|
||||
|
||||
app.listen(PORT, () => {
|
||||
|
|
|
@ -111,7 +111,8 @@ function converter(html, query) {
|
|||
"UPTIME": timeFormatter((Date.now() - uptime) / 1000),
|
||||
"RELOAD_COUNT": reloads,
|
||||
"WEATHER_MODIFIER": "",
|
||||
"WEATHER_TEXT": ""
|
||||
"WEATHER_TEXT": "",
|
||||
"ANNOUNCEMENT": fs.readFileSync(path.join(__dirname, "config/announcement.html"))
|
||||
}
|
||||
|
||||
replacers.ALL_KEYWORDS = "{" + Object.keys(replacers).join("}{") + "} "
|
||||
|
|
|
@ -69,6 +69,8 @@
|
|||
{ACTIVITIES}
|
||||
</div>
|
||||
|
||||
{ANNOUNCEMENT}
|
||||
|
||||
<h2><hr>Services</h2>
|
||||
<p>List of services for public use hosted on Violet's Purgatory.</p>
|
||||
<a href="https://sxng.violets-purgatory.dev" class="chip">SearXNG: sxng.violets-purgatory.dev</a>
|
||||
|
@ -83,6 +85,8 @@
|
|||
<h1><hr>FAQ</h1>
|
||||
{PATH_FAQ}
|
||||
|
||||
{SELECTED_VIDEO}
|
||||
|
||||
{PATH_STATS}
|
||||
|
||||
<p>{WEATHER_TEXT}</p>
|
||||
|
|
Loading…
Reference in a new issue