Skip to content

Commit 41a36e2

Browse files
committed
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>
1 parent 7a91d01 commit 41a36e2

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

lib/response.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// response
33
// external modules
44
var fs = require('fs')
5+
var path = require('path')
56
var markdownpdf = require('markdown-pdf')
67
var shortId = require('shortid')
78
var querystring = require('querystring')
@@ -75,7 +76,9 @@ function showIndex (req, res, next) {
7576
allowPDFExport: config.allowPDFExport,
7677
signin: req.isAuthenticated(),
7778
infoMessage: req.flash('info'),
78-
errorMessage: req.flash('error')
79+
errorMessage: req.flash('error'),
80+
privacyStatement: fs.existsSync(path.join(config.docsPath, 'privacy.md')),
81+
termsOfUse: fs.existsSync(path.join(config.docsPath, 'terms-of-use.md'))
7982
})
8083
}
8184

locales/en.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,7 @@
105105
"Export to Snippet": "Export to Snippet",
106106
"Select Visibility Level": "Select Visibility Level",
107107
"Night Theme": "Night Theme",
108-
"Follow us on %s and %s.": "Follow us on %s, and %s."
109-
}
108+
"Follow us on %s and %s.": "Follow us on %s, and %s.",
109+
"Privacy": "Privacy",
110+
"Terms of Use": "Terms of Use"
111+
}

public/views/index/body.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
<option value="da">dansk</option>
148148
</select>
149149
<p>
150-
&copy; 2018 <a href="https://hackmd.io">HackMD</a> | <a href="<%- url %>/s/release-notes" target="_blank"><%= __('Releases') %></a>
150+
&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><% } %>
151151
</p>
152152
<h6 class="social-foot">
153153
<%- __('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>') %>

0 commit comments

Comments
 (0)