Policygen helps you setup and publish Privacy Policies and Terms of Service policies to your site with ease. Simply set your config in the initializer and we'll do the hard work for you.
Add this line to your application's Gemfile:
gem 'policygen'
And then execute:
$ bundle
Or install it yourself as:
$ gem install policygen
To setup the policygen config file in your rails project run
rails generate policygen:install
Add the following to app/config/tailwind.config.js
module.exports = {
content: [
'./public/*.html',
...,
getPolicygenViewPath()
]
}
function getPolicygenViewPath() {
const { execSync } = require("child_process");
const path = execSync("bundle show policygen").toString().trim();
return `${path}/**/*.{erb,html,rb}`;
}
Policygen mounts two view helpers to render your policies into any view you want to setup. The contents are driven by the config defined in policygen.rb
Once you've answered all the config questions you're ready to render your privacy and terms page.
<div class="whatever-your-container-is">
<%= privacy_policy %>
</div>
<div class="whatever-your-container-is">
<%= terms_of_service %>
</div>
/* The outmost container class */
.policygen-container {
}
/* The h1 header class */
.policygen-h1 {
}
/* The h2 header class */
.policygen-h2 {
}
/* The h3 header class */
.policygen-h3 {
}
/* The section class, break/margin between each section of the policy */
.policygen-section {
}
/* Body text, the paragraph text within each section */
.policygen-body-text {
}
/* Unordered lists */
.policygen-ul {
}
/* Ordered list */
.policygen-ol {
}
/* Bold paragraph class */
.policygen-bold {
}
/* Link class, remember to have a hover on this class */
.policygen-link {
}
You can change the colors used
config.tailwind_config = {
heading_color: "text-gray-900",
body_color: "text-gray-800",
link_color: "text-blue-500 hover:text-blue-700"
}
Bug reports and pull requests are welcome on GitHub at https://github.com/imothee/policygen. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Policygen project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.