Add privacy and ToS links

To be GDPR compliant we need to provide privacy statement. These should
be linked on the index page. So as soon as a document exist under
`public/docs/privacy.md` the link will show up.

Since we already add legal links, we also add Terms of Use, which will
show up as soon as `public/docs/terms-of-use.md` exists.

This should allow everyone to provide the legal documents they need for
GDPR and other privacy and business laws.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
Sheogorath 2018-05-23 01:14:52 +02:00
parent 7a91d01830
commit 41a36e2e18
No known key found for this signature in database
GPG key ID: 1F05CC3635CDDFFD
3 changed files with 9 additions and 4 deletions

View file

@ -2,6 +2,7 @@
// response
// external modules
var fs = require('fs')
var path = require('path')
var markdownpdf = require('markdown-pdf')
var shortId = require('shortid')
var querystring = require('querystring')
@ -75,7 +76,9 @@ function showIndex (req, res, next) {
allowPDFExport: config.allowPDFExport,
signin: req.isAuthenticated(),
infoMessage: req.flash('info'),
errorMessage: req.flash('error')
errorMessage: req.flash('error'),
privacyStatement: fs.existsSync(path.join(config.docsPath, 'privacy.md')),
termsOfUse: fs.existsSync(path.join(config.docsPath, 'terms-of-use.md'))
})
}

View file

@ -105,5 +105,7 @@
"Export to Snippet": "Export to Snippet",
"Select Visibility Level": "Select Visibility Level",
"Night Theme": "Night Theme",
"Follow us on %s and %s.": "Follow us on %s, and %s."
"Follow us on %s and %s.": "Follow us on %s, and %s.",
"Privacy": "Privacy",
"Terms of Use": "Terms of Use"
}

View file

@ -147,7 +147,7 @@
<option value="da">dansk</option>
</select>
<p>
&copy; 2018 <a href="https://hackmd.io">HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a>
&copy; 2018 <a href="https://hackmd.io">HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a><% if(privacyStatement) { %> | <a href="<%- url %>/s/privacy" target="_blank"><%= __('Privacy') %></a><% } %><% if(termsOfUse) { %> | <a href="<%- url %>/s/terms-of-use" target="_blank"><%= __('Terms of Use') %></a><% } %>
</p>
<h6 class="social-foot">
<%- __('Follow us on %s and %s.', '<a href="https://github.com/hackmdio/HackMD" target="_blank"><i class="fa fa-github"></i> GitHub</a>, <a href="https://twitter.com/hackmdio" target="_blank"><i class="fa fa-twitter"></i> Twitter</a>', '<a href="https://www.facebook.com/hackmdio" target="_blank"><i class="fa fa-facebook-square"></i> Facebook</a>') %>