summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Whalan <ewhal@pantsu.cat>2016-06-18 07:18:47 +0200
committerGitHub <noreply@github.com>2016-06-18 07:18:47 +0200
commite199b9f914d57724c9a08ca3749a08a7aad46256 (patch)
tree36c3ac2147220d64f28c37dfc45542823cc6e3bf
parent74064dbfe4dd1a05a145d33b51d02e0bc7f1f23e (diff)
parentd8f3db5cb0c665a66ddc5ae7f0af2ec37c2dd0b5 (diff)
Merge pull request #14 from akpu1/patch-10
Generalised donation banner significantly more general; other misc changes
-rw-r--r--Gruntfile.js20
-rw-r--r--README.md6
-rw-r--r--dist.json25
-rw-r--r--templates/banners.json4
-rw-r--r--templates/banners/donate.swig17
-rw-r--r--templates/banners/donations.swig23
6 files changed, 51 insertions, 44 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 4438b94..18318b0 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -2,25 +2,7 @@ module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
swig: {
- dist: {
- init: {
- allowErrors: false
- },
- banners: grunt.file.readJSON('templates/banners.json'),
- dest: 'dist',
- generateRobotstxt: false,
- generateSitemap: false,
- max_upload_size: 128,
- pkgVersion: '<%= pkg.version %>',
- production: false,
- siteName: 'Pantsu',
- siteUrl: 'https://pantsu.cat/',
- src: [
- 'templates/index.swig',
- 'templates/faq.swig',
- 'templates/tools.swig'
- ],
- }
+ dist: grunt.file.readJSON('dist.json'),
},
htmlmin: {
dist: {
diff --git a/README.md b/README.md
index 5ebf9f3..c8bbea3 100644
--- a/README.md
+++ b/README.md
@@ -47,11 +47,9 @@ After this, the pomf site is now compressed and set up inside `dist/`.
## Configuring
-The majority of the settings are in `static/includes/settings.inc.php`.
+Front-end related settings, such as the name of the site, and maximum allowable file size, are found in `templates/site_variables.json`. Changes made here will only take effect after rebuilding the site pages. This may be done by running `grunt` from the root of the site directory.
-For file size configuration, open `Gruntfile.js` in an editor and modify the
-`max_upload_size` value. The value is expressed in mebibytes (MiB). Run `grunt`
-again to rebuild the pages for the changes to take effect.
+Back-end related settings, such as database configuration, and path for uploaded files, are found in `static/php/includes/settings.inc.php`. Changes made here take effect immediately.
If you intend to allow uploading files larger than 2 MB, you may also need to
increase POST size limits in `php.ini` and webserver configuration. For PHP,
diff --git a/dist.json b/dist.json
new file mode 100644
index 0000000..8016939
--- /dev/null
+++ b/dist.json
@@ -0,0 +1,25 @@
+{
+ "init": {
+ "allowErrors": false
+ },
+ "dest": "dist",
+ "pkgVersion": "<%= pkg.version %>",
+ "banners": [
+ "banners/malware_scans.swig",
+ "banners/donations.swig"
+ ],
+ "src": [
+ "templates/index.swig",
+ "templates/faq.swig",
+ "templates/tools.swig"
+ ],
+ "generateRobotstxt": false,
+ "generateSitemap": false,
+ "max_upload_size": 128,
+ "production": false,
+ "siteName": "Pantsu",
+ "siteUrl": "https://pantsu.cat/",
+ "paypalUrl": "",
+ "bitcoinAddress": "",
+ "flattrUrl": ""
+}
diff --git a/templates/banners.json b/templates/banners.json
deleted file mode 100644
index 6cefb70..0000000
--- a/templates/banners.json
+++ /dev/null
@@ -1,4 +0,0 @@
-[
- "banners/malware_scans.swig",
- "banners/donate.swig"
-]
diff --git a/templates/banners/donate.swig b/templates/banners/donate.swig
deleted file mode 100644
index dcd7f7c..0000000
--- a/templates/banners/donate.swig
+++ /dev/null
@@ -1,17 +0,0 @@
-<p class="alert alert-info">
- <strong>pomf.se is a free service, but our hosting bill isn't</strong> &mdash; we need almost $100 a month for that. Donations help keep pomf.se free, online, and fast. Everything (after fees) goes to the hosting bill.
- <span class="donate-btns">
- <a class="donate-btn donate-paypal" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=BHUVEZY96YZ6N" target="_BLANK">
- <span class="icon icon-paypal"></span>
- PayPal
- </a>
- <a class="donate-btn donate-bitcoin" href="bitcoin:1CrbCGSTFM5ccmjFoU4jRSQod44Ttu8nHY?label=pomf.se&amp;message=Hosting%20Bills" target="_BLANK">
- <span class="icon icon-bitcoin"></span>
- Bitcoin
- </a>
- <a class="donate-btn donate-flattr" href="https://flattr.com/submit/auto?user_id=neku&amp;url=http://pomf.se" target="_BLANK">
- <span class="icon icon-flattr"></span>
- Flattr
- </a>
- </span>
-</p>
diff --git a/templates/banners/donations.swig b/templates/banners/donations.swig
new file mode 100644
index 0000000..884f4ba
--- /dev/null
+++ b/templates/banners/donations.swig
@@ -0,0 +1,23 @@
+<p class="alert alert-info">
+ <strong>{{siteName}} is free to use, but our hosting costs are far from it</strong> &mdash; donations are what keep {{siteName}} alive, free, and fast.
+ <span class="donate-btns">
+ {% if paypalUrl != '' %}
+ <a class="donate-btn donate-paypal" href="{{paypalUrl}}" target="_BLANK">
+ <span class="icon icon-paypal"></span>
+ PayPal
+ </a>
+ {% endif %}
+ {% if bitcoinAddress != '' %}
+ <a class="donate-btn donate-bitcoin" href="bitcoin:{{bitcoinAddress}}?label={{siteName}}&amp;message=Hosting%20Costs" target="_BLANK">
+ <span class="icon icon-bitcoin"></span>
+ Bitcoin
+ </a>
+ {% endif %}
+ {% if flattrUrl != '' %}
+ <a class="donate-btn donate-flattr" href="{{flattrUrl}}" target="_BLANK">
+ <span class="icon icon-flattr"></span>
+ Flattr
+ </a>
+ {% endif %}
+ </span>
+</p>