Browse Source

Enabled Gzip compression through node dependency and updated script to compress and resize images down to 690px.

pull/4/head
jrtechs 6 years ago
parent
commit
3ec3a65bc5
50 changed files with 24 additions and 8 deletions
  1. +1
    -0
      README.md
  2. BIN
      downloads/content/1.jpg
  3. BIN
      entries/hardware/media/2ac00ccdcae9b672a2f844b7f8f318c5.png
  4. BIN
      entries/hardware/media/31210e78cc2cae122a6c3fdb93ab87c0.png
  5. BIN
      entries/hardware/media/3812f5e41805eb999b057c15bae19081.png
  6. BIN
      entries/hardware/media/d460663e2f964c76a15d2c07a7052d60.png
  7. BIN
      entries/hardware/media/f19479753c6d86855a3a77f1cf840942.png
  8. BIN
      entries/java/media/2a20326e77c3f67aa3753401ba4bc612.png
  9. BIN
      entries/java/media/2a96900bae1e8946a1df243d8318e69f.png
  10. BIN
      entries/java/media/c1e712bdead908ebd72921ec2d1cbd5e.png
  11. BIN
      entries/java/media/f5cb2682e219549cb07acd1d01c2ccb1.png
  12. BIN
      entries/programming/media/90703af9527d8d4aecc7eefbda5f049a.png
  13. BIN
      entries/programs/media/90e4464eb85c998c8db42c965468aa54.png
  14. BIN
      entries/projects/media/088cc48e754c1b99e0fcd5a5eddb9d64.png
  15. BIN
      entries/projects/media/09bce0ed13f28db38a141bd10bb096c8.jpg
  16. BIN
      entries/projects/media/09d34d523359111041accf89c82fd6c2.png
  17. BIN
      entries/projects/media/0b9d25d56269d39f60177b6b29a882da.png
  18. BIN
      entries/projects/media/13f1d6d93532bfb23a03a9a4fec5f41b.png
  19. BIN
      entries/projects/media/161edc628257e8a2f92086c5987dcf0f.png
  20. BIN
      entries/projects/media/23c6ad380e3224fbcd0c8d28cbecac23.png
  21. BIN
      entries/projects/media/463f2aa188466da8f47309235039250c.jpg
  22. BIN
      entries/projects/media/50dc96254f26b730e842134db98c9966.jpg
  23. BIN
      entries/projects/media/5b7a15fd7b5da2939f4e27eae4ceada3.jpg
  24. BIN
      entries/projects/media/5ebac37ad45784c31219451d6e4c4504.jpg
  25. BIN
      entries/projects/media/81ffef0249da3c1fc077d114fb6beecb.jpg
  26. BIN
      entries/projects/media/ad84021445feb7021f2320f6be599ef5.png
  27. BIN
      entries/projects/media/d0888a3222fa328c291629fac491e268.jpg
  28. BIN
      entries/projects/media/d3f05acc1973ea938920407511c28bff.png
  29. BIN
      entries/projects/media/f8802f1f71cb433274d265fc81e36fc6.jpg
  30. BIN
      entries/projects/media/fc0a0ddf2a914b171bb3a5013e9e7b6c.png
  31. BIN
      entries/projects/media/steam/ben2.png
  32. BIN
      entries/projects/media/steam/diagram.png
  33. BIN
      entries/projects/media/steam/jrtechs1.png
  34. BIN
      entries/projects/media/steam/jrtechs2.png
  35. BIN
      entries/web-development/media/0a829ea2071126a5642534f54bc0fe19.png
  36. BIN
      entries/web-development/media/422d949d18969b9b2b8cf754ddc1e779.jpg
  37. BIN
      entries/web-development/media/4fcc3a9fe52f7b2e8bc1bfb164846073.png
  38. BIN
      entries/web-development/media/55ad5b49fe28c6374968b0f8a5b3e48b.png
  39. BIN
      entries/web-development/media/fa157040d5849cc48de1cbec2c67ef69.jpg
  40. BIN
      entries/web-development/media/fbd5a1128549b4feb5bafe3595ac1989.png
  41. BIN
      img/posts/computer.jpg
  42. BIN
      img/posts/floppy2.jpg
  43. BIN
      img/posts/rit1.jpg
  44. BIN
      img/posts/rit2.jpg
  45. BIN
      img/posts/spaghetti.jpg
  46. BIN
      img/posts/steamGraphWebBanner.png
  47. BIN
      img/posts/wordpress_banner.jpg
  48. BIN
      img/website/404.jpg
  49. +16
    -5
      optimizeImages.sh
  50. +7
    -3
      server.js

+ 1
- 0
README.md View File

@ -75,6 +75,7 @@ npm install crypto
npm install remarkable npm install remarkable
npm install markdown npm install markdown
npm install highlight.js npm install highlight.js
npm install compression
npm install memory-cache --save npm install memory-cache --save
``` ```

BIN
downloads/content/1.jpg View File

Before After
Width: 750  |  Height: 914  |  Size: 72 KiB Width: 900  |  Height: 1097  |  Size: 85 KiB

BIN
entries/hardware/media/2ac00ccdcae9b672a2f844b7f8f318c5.png View File

Before After
Width: 854  |  Height: 573  |  Size: 38 KiB Width: 690  |  Height: 463  |  Size: 103 KiB

BIN
entries/hardware/media/31210e78cc2cae122a6c3fdb93ab87c0.png View File

Before After
Width: 849  |  Height: 573  |  Size: 36 KiB Width: 690  |  Height: 466  |  Size: 94 KiB

BIN
entries/hardware/media/3812f5e41805eb999b057c15bae19081.png View File

Before After
Width: 853  |  Height: 569  |  Size: 50 KiB Width: 690  |  Height: 460  |  Size: 124 KiB

BIN
entries/hardware/media/d460663e2f964c76a15d2c07a7052d60.png View File

Before After
Width: 1365  |  Height: 725  |  Size: 35 KiB Width: 690  |  Height: 366  |  Size: 58 KiB

BIN
entries/hardware/media/f19479753c6d86855a3a77f1cf840942.png View File

Before After
Width: 850  |  Height: 569  |  Size: 49 KiB Width: 690  |  Height: 462  |  Size: 122 KiB

BIN
entries/java/media/2a20326e77c3f67aa3753401ba4bc612.png View File

Before After
Width: 1401  |  Height: 1010  |  Size: 104 KiB Width: 690  |  Height: 497  |  Size: 157 KiB

BIN
entries/java/media/2a96900bae1e8946a1df243d8318e69f.png View File

Before After
Width: 1430  |  Height: 768  |  Size: 166 KiB Width: 690  |  Height: 371  |  Size: 112 KiB

BIN
entries/java/media/c1e712bdead908ebd72921ec2d1cbd5e.png View File

Before After
Width: 1404  |  Height: 1010  |  Size: 49 KiB Width: 690  |  Height: 496  |  Size: 147 KiB

BIN
entries/java/media/f5cb2682e219549cb07acd1d01c2ccb1.png View File

Before After
Width: 1400  |  Height: 1007  |  Size: 60 KiB Width: 690  |  Height: 496  |  Size: 89 KiB

BIN
entries/programming/media/90703af9527d8d4aecc7eefbda5f049a.png View File

Before After
Width: 600  |  Height: 878  |  Size: 413 KiB Width: 600  |  Height: 878  |  Size: 413 KiB

BIN
entries/programs/media/90e4464eb85c998c8db42c965468aa54.png View File

Before After
Width: 1429  |  Height: 678  |  Size: 176 KiB Width: 690  |  Height: 327  |  Size: 86 KiB

BIN
entries/projects/media/088cc48e754c1b99e0fcd5a5eddb9d64.png View File

Before After
Width: 367  |  Height: 726  |  Size: 5.8 KiB Width: 367  |  Height: 726  |  Size: 6.7 KiB

BIN
entries/projects/media/09bce0ed13f28db38a141bd10bb096c8.jpg View File

Before After
Width: 756  |  Height: 1008  |  Size: 244 KiB Width: 690  |  Height: 920  |  Size: 126 KiB

BIN
entries/projects/media/09d34d523359111041accf89c82fd6c2.png View File

Before After
Width: 768  |  Height: 416  |  Size: 84 KiB Width: 690  |  Height: 374  |  Size: 104 KiB

BIN
entries/projects/media/0b9d25d56269d39f60177b6b29a882da.png View File

Before After
Width: 1430  |  Height: 1139  |  Size: 320 KiB Width: 690  |  Height: 550  |  Size: 122 KiB

BIN
entries/projects/media/13f1d6d93532bfb23a03a9a4fec5f41b.png View File

Before After
Width: 1200  |  Height: 650  |  Size: 139 KiB Width: 690  |  Height: 374  |  Size: 99 KiB

BIN
entries/projects/media/161edc628257e8a2f92086c5987dcf0f.png View File

Before After
Width: 2217  |  Height: 1105  |  Size: 77 KiB Width: 690  |  Height: 344  |  Size: 109 KiB

BIN
entries/projects/media/23c6ad380e3224fbcd0c8d28cbecac23.png View File

Before After
Width: 952  |  Height: 695  |  Size: 28 KiB Width: 690  |  Height: 504  |  Size: 92 KiB

BIN
entries/projects/media/463f2aa188466da8f47309235039250c.jpg View File

Before After
Width: 986  |  Height: 1314  |  Size: 467 KiB Width: 690  |  Height: 920  |  Size: 165 KiB

BIN
entries/projects/media/50dc96254f26b730e842134db98c9966.jpg View File

Before After
Width: 826  |  Height: 1102  |  Size: 360 KiB Width: 690  |  Height: 921  |  Size: 164 KiB

BIN
entries/projects/media/5b7a15fd7b5da2939f4e27eae4ceada3.jpg View File

Before After
Width: 503  |  Height: 116  |  Size: 10 KiB Width: 503  |  Height: 116  |  Size: 7.8 KiB

BIN
entries/projects/media/5ebac37ad45784c31219451d6e4c4504.jpg View File

Before After
Width: 817  |  Height: 1090  |  Size: 322 KiB Width: 690  |  Height: 921  |  Size: 150 KiB

BIN
entries/projects/media/81ffef0249da3c1fc077d114fb6beecb.jpg View File

Before After
Width: 503  |  Height: 116  |  Size: 11 KiB Width: 503  |  Height: 116  |  Size: 8.1 KiB

BIN
entries/projects/media/ad84021445feb7021f2320f6be599ef5.png View File

Before After
Width: 1024  |  Height: 557  |  Size: 105 KiB Width: 690  |  Height: 375  |  Size: 84 KiB

BIN
entries/projects/media/d0888a3222fa328c291629fac491e268.jpg View File

Before After
Width: 503  |  Height: 116  |  Size: 10 KiB Width: 503  |  Height: 116  |  Size: 7.9 KiB

BIN
entries/projects/media/d3f05acc1973ea938920407511c28bff.png View File

Before After
Width: 697  |  Height: 598  |  Size: 219 KiB Width: 690  |  Height: 592  |  Size: 199 KiB

BIN
entries/projects/media/f8802f1f71cb433274d265fc81e36fc6.jpg View File

Before After
Width: 982  |  Height: 737  |  Size: 259 KiB Width: 690  |  Height: 518  |  Size: 61 KiB

BIN
entries/projects/media/fc0a0ddf2a914b171bb3a5013e9e7b6c.png View File

Before After
Width: 1024  |  Height: 595  |  Size: 20 KiB Width: 690  |  Height: 401  |  Size: 14 KiB

BIN
entries/projects/media/steam/ben2.png View File

Before After
Width: 1909  |  Height: 941  |  Size: 330 KiB Width: 690  |  Height: 340  |  Size: 94 KiB

BIN
entries/projects/media/steam/diagram.png View File

Before After
Width: 3238  |  Height: 1856  |  Size: 59 KiB Width: 690  |  Height: 396  |  Size: 12 KiB

BIN
entries/projects/media/steam/jrtechs1.png View File

Before After
Width: 1251  |  Height: 944  |  Size: 413 KiB Width: 690  |  Height: 521  |  Size: 206 KiB

BIN
entries/projects/media/steam/jrtechs2.png View File

Before After
Width: 1894  |  Height: 940  |  Size: 294 KiB Width: 690  |  Height: 342  |  Size: 98 KiB

BIN
entries/web-development/media/0a829ea2071126a5642534f54bc0fe19.png View File

Before After
Width: 1431  |  Height: 738  |  Size: 231 KiB Width: 690  |  Height: 356  |  Size: 90 KiB

BIN
entries/web-development/media/422d949d18969b9b2b8cf754ddc1e779.jpg View File

Before After
Width: 750  |  Height: 914  |  Size: 72 KiB Width: 690  |  Height: 841  |  Size: 62 KiB

BIN
entries/web-development/media/4fcc3a9fe52f7b2e8bc1bfb164846073.png View File

Before After
Width: 1429  |  Height: 715  |  Size: 464 KiB Width: 690  |  Height: 345  |  Size: 136 KiB

BIN
entries/web-development/media/55ad5b49fe28c6374968b0f8a5b3e48b.png View File

Before After
Width: 1431  |  Height: 763  |  Size: 509 KiB Width: 690  |  Height: 368  |  Size: 153 KiB

BIN
entries/web-development/media/fa157040d5849cc48de1cbec2c67ef69.jpg View File

Before After
Width: 626  |  Height: 960  |  Size: 70 KiB Width: 626  |  Height: 960  |  Size: 69 KiB

BIN
entries/web-development/media/fbd5a1128549b4feb5bafe3595ac1989.png View File

Before After
Width: 1430  |  Height: 1140  |  Size: 750 KiB Width: 690  |  Height: 550  |  Size: 201 KiB

BIN
img/posts/computer.jpg View File

Before After
Width: 1436  |  Height: 536  |  Size: 237 KiB Width: 690  |  Height: 258  |  Size: 34 KiB

BIN
img/posts/floppy2.jpg View File

Before After
Width: 3013  |  Height: 943  |  Size: 253 KiB Width: 690  |  Height: 216  |  Size: 32 KiB

BIN
img/posts/rit1.jpg View File

Before After
Width: 4032  |  Height: 1048  |  Size: 499 KiB Width: 690  |  Height: 179  |  Size: 26 KiB

BIN
img/posts/rit2.jpg View File

Before After
Width: 3007  |  Height: 1221  |  Size: 253 KiB Width: 690  |  Height: 280  |  Size: 28 KiB

BIN
img/posts/spaghetti.jpg View File

Before After
Width: 1123  |  Height: 368  |  Size: 29 KiB Width: 690  |  Height: 226  |  Size: 15 KiB

BIN
img/posts/steamGraphWebBanner.png View File

Before After
Width: 1080  |  Height: 344  |  Size: 174 KiB Width: 690  |  Height: 220  |  Size: 140 KiB

BIN
img/posts/wordpress_banner.jpg View File

Before After
Width: 1173  |  Height: 240  |  Size: 6.3 KiB Width: 690  |  Height: 141  |  Size: 2.8 KiB

BIN
img/website/404.jpg View File

Before After
Width: 600  |  Height: 564  |  Size: 35 KiB Width: 690  |  Height: 649  |  Size: 37 KiB

+ 16
- 5
optimizeImages.sh View File

@ -1,10 +1,21 @@
#!/bin/bash #!/bin/bash
for f in $(find ./ -name '*.jpg' -or -name '*.JPG');
do jpegoptim --size=500k $f;
done
WIDTH="690>"
for f in $(find ./ -name '*.png' -or -name '*.PNG');
do optipng $f;
files=("./entries" "./img")
for folder in "${files[@]}"; do
for f in $(find $folder -name '*.jpg' -or -name '*.JPG'); do
convert "$f" -resize $WIDTH "$f"
jpegoptim --max=80 --strip-all --preserve --totals --all-progressive "$f"
done
for f in $(find $folder -name '*.png' -or -name '*.PNG'); do
convert "$f" -resize $WIDTH "$f"
optipng -o7 -preserve "$f"
done
done done

+ 7
- 3
server.js View File

@ -11,18 +11,22 @@ const url = require('url');
const express = require("express"); const express = require("express");
const session = require('express-session');
//const session = require('express-session');
const includes = require('./includes/includes.js'); const includes = require('./includes/includes.js');
const utils = require('./utils/utils.js');
const map = require('./utils/generateSiteMap.js'); const map = require('./utils/generateSiteMap.js');
map.main(); map.main();
const app = express(); const app = express();
app.use(session({ secret: utils.getFileLine('../session_secret'), cookie: { maxAge: 6000000 }}));
//app.use(session({ secret: utils.getFileLine('../session_secret'), cookie: { maxAge: 6000000 }}));
//compresses the site
var compression = require('compression')
app.use(compression());
const port = 8000; const port = 8000;

Loading…
Cancel
Save