mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-09-11 18:37:33 -05:00
feat: add terms
These terms are almost entirely a mashup of generated/pre-made documents from both https://termly.io/ and https://www.termsfeed.com/, which were then merged together and modified to the best of our ability to fit our specific needs. However we are not legal experts, and there is quite a lot of legalese here, and possibly broad policies with regards to collection/retention/sharing which we do NOT necessarily want/need. Our goal is to collect as LITTLE information about users as possible, and to never sell or directly share that data with any 3rd parties besides those required for operation, such as Cloudflare and Stripe. I have done my best to remove all the broad policies that would allow us to sell user data, as we do NOT want to do that, but I am no legal expert and may have missed things. In those cases, we are more than happy to revise/remove the problematic areas to clarify our goals/intentions
This commit is contained in:
35
src/routes/terms.js
Normal file
35
src/routes/terms.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
const { Router } = require('express');
|
||||
const { marked } = require('marked');
|
||||
const matter = require('gray-matter');
|
||||
const logger = require('../logger');
|
||||
|
||||
const router = new Router();
|
||||
|
||||
router.get('/:slug', async (request, response, next) => {
|
||||
const renderData = {
|
||||
layout: 'blog-opengraph'
|
||||
};
|
||||
|
||||
const termName = request.params.slug;
|
||||
|
||||
let rawTerm;
|
||||
try {
|
||||
rawTerm = await fs.readFile(path.join('terms', `${termName}.md`), 'utf-8');
|
||||
} catch (err) {
|
||||
logger.error(err);
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
const { data: termInfo, content } = matter(rawTerm);
|
||||
renderData.termInfo = termInfo;
|
||||
|
||||
const htmlPost = marked.parse(content);
|
||||
renderData.htmlPost = htmlPost;
|
||||
|
||||
response.render('terms/term', renderData);
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
@@ -98,6 +98,7 @@ app.use(express.static('public'));
|
||||
logger.info('Importing routes');
|
||||
const routes = {
|
||||
home: require('./routes/home'),
|
||||
terms: require('./routes/terms'),
|
||||
faq: require('./routes/faq'),
|
||||
docs: require('./routes/docs'),
|
||||
progress: require('./routes/progress'),
|
||||
@@ -108,6 +109,7 @@ const routes = {
|
||||
};
|
||||
|
||||
app.use('/', routes.home);
|
||||
app.use('/terms', routes.terms);
|
||||
app.use('/faq', routes.faq);
|
||||
app.use('/docs', routes.docs);
|
||||
app.use('/progress', routes.progress);
|
||||
|
||||
Reference in New Issue
Block a user