IT CAN NOW COMPILE!

main
nightly 2022-10-19 13:07:30 +02:00
parent 26fdd9e57c
commit a1957ff4b7
16 changed files with 993 additions and 60 deletions

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
{% include "head" %} {% block head %} {% endblock %}
</head>
<body>
<!-- Main content -->
{% block content %} {% endblock %}
<!-- Footer -->
{% include "footer" %}
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<title>{{ error }}</title>
</head>
<body>
{% block content %} {% endblock %}
</body>
</html>

View File

@ -0,0 +1,12 @@
<!-- Metadata -->
<meta charset="utf-8" />
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<!-- Resources -->
<link rel="stylesheet" href="/public/global.css" type="text/css" />
<!-- Metadata -->
/>
<title>{{ pageTitle }}</title>

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{title}}</title>
</head>
<body>
<h1>{{title}}</h1>
{% block %}{% endblock %}
<footer> {% block footer %}{% endblock %} </footer>
</body>
</html>

View File

@ -1 +0,0 @@
{{id}} - {{todo}}

View File

@ -0,0 +1,3 @@
body {
background-color: darkcyan;
}

View File

@ -0,0 +1,3 @@
body {
background-color: darkcyan;
}

View File

@ -8,7 +8,6 @@ import express from "express";
import rateLimit from "express-rate-limit";
const router = express.Router();
const indexRateLimit = rateLimit({
windowMs: 1 * 60 * 1000,
max: 50,
@ -18,14 +17,14 @@ const indexRateLimit = rateLimit({
export function indexRoutes() {
// Index
router.get("/", indexRateLimit, async (req, res) => {
const todos = ['fork and clone', 'make it better', 'make a pull request']
const todos = ["fork and clone", "make it better", "make a pull request"];
res.render("index", {
//locales: getWebLocale(bot, locale),
todos: todos,
page: req.url,
//user: user,
});
})
});
// Gitea
router.get("/gitea/", async (_req, res) => {
@ -39,4 +38,4 @@ export function indexRoutes() {
});
return router;
};
}

View File

@ -6,6 +6,4 @@
{% endfor %}
</ul>
{% block 'footer' %}
Copyright @ 2016, Harttle
{% endblock %}
{% block 'footer' %} Copyright @ 2016, Harttle {% endblock %}

View File

@ -0,0 +1 @@
{}

884
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,10 +4,19 @@
"description": "A recipe manager with nextjs",
"main": "index.js",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"build": "tsc",
"build:purgecss": "cross-env purgecss -c purgecss.config.js -o ./Source/Webserver/public/css/",
"build:scss": "cross-env sass --no-source-map ./Source/Webserver/public/scss/:./Source/Webserver/public/css/ && npm run build:purgecss",
"build:static": "cross-env copyfiles './Source/Webserver/**/**/*.{css,liquid,jpg,js,png}' './dist/'",
"dev": "cross-env concurrently \"cross-env sass ./Source/Webserver/public/scss/:./Source/Webserver/public/css/ --watch\" \"cross-env nodemon\"",
"format": "cross-env prettier --config .prettierrc 'Source/**/*.{liquid,js,json,scss,ts}' --write",
"lint": "eslint --fix .",
"prebuild": "cross-env rimraf ./dist/",
"postbuild": "npm run build:scss && npm run build:static",
"postinstall": "cross-env copyfiles './node_modules/bulmaselect/dist/index.js' './Source/Webserver/public/js/bulmaselect/' -f",
"start": "npm run build && cross-env NODE_ENV=production node dist/Source/index.js",
"pm2": "npm run build && pm2 start pm2.config.json",
"test": "tsc && eslint ."
},
"repository": {
"type": "git",
@ -27,12 +36,16 @@
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.40.1",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
"express": "^4.18.2",
"express-rate-limit": "^6.6.0",
"express-session": "^1.17.3",
"liquidjs": "^9.42.0",
"path": "^0.12.7",
"prettier": "^2.7.1",
"purgecss": "^5.0.0",
"sass": "^1.55.0",
"terser": "^5.15.1"
}
}

8
purgecss.config.js Normal file
View File

@ -0,0 +1,8 @@
module.exports = {
content: ["./Source/Webserver/**/**/*.{liquid,js}"],
css: ["./Source/Webserver/**/**/*.css"],
fontFace: true,
variables: true,
keyframes: true,
};