diff options
| -rw-r--r-- | Gruntfile.js | 20 | ||||
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | dist.json | 25 | ||||
| -rw-r--r-- | templates/banners.json | 4 | ||||
| -rw-r--r-- | templates/banners/donate.swig | 17 | ||||
| -rw-r--r-- | templates/banners/donations.swig | 23 |
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: { @@ -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> — 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&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&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&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> — 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}}&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> |
