From 9ae202820b698796f93b929b3e30cd499de796a1 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 16 Aug 2021 14:40:34 +0200 Subject: init site --- .gitignore | 16 + README.md | 84 + index.js | 84 + package.json | 26 + public/assets/fonts/ionicons.eot | Bin 0 -> 120724 bytes public/assets/fonts/ionicons.svg | 2230 ++++++++++++++++++ public/assets/fonts/ionicons.ttf | Bin 0 -> 188508 bytes public/assets/fonts/ionicons.woff | Bin 0 -> 67904 bytes public/assets/img/close-black.png | Bin 0 -> 1511 bytes public/assets/img/close.png | Bin 0 -> 3738 bytes public/assets/img/soc-face.png | Bin 0 -> 4531 bytes public/assets/img/soc-inst.png | Bin 0 -> 12397 bytes public/assets/js/vendor/flickity.pkgd.min.js | 56 + public/assets/js/vendor/froogaloop.js | 287 +++ public/assets/js/vendor/loader.js | 99 + public/assets/js/vendor/oktween.js | 159 ++ public/db.json | 1 + sync.sh | 7 + templates/_footer.liquid | 8 + templates/_header.liquid | 38 + templates/home.liquid | 17 + yarn.lock | 3151 ++++++++++++++++++++++++++ 22 files changed, 6263 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 index.js create mode 100644 package.json create mode 100755 public/assets/fonts/ionicons.eot create mode 100755 public/assets/fonts/ionicons.svg create mode 100755 public/assets/fonts/ionicons.ttf create mode 100755 public/assets/fonts/ionicons.woff create mode 100644 public/assets/img/close-black.png create mode 100644 public/assets/img/close.png create mode 100644 public/assets/img/soc-face.png create mode 100644 public/assets/img/soc-inst.png create mode 100644 public/assets/js/vendor/flickity.pkgd.min.js create mode 100644 public/assets/js/vendor/froogaloop.js create mode 100755 public/assets/js/vendor/loader.js create mode 100644 public/assets/js/vendor/oktween.js create mode 120000 public/db.json create mode 100755 sync.sh create mode 100644 templates/_footer.liquid create mode 100644 templates/_header.liquid create mode 100644 templates/home.liquid create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9240c5c --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# Ignore top level and nested deps +/node_modules/ +/app/node_modules/**/node_modules/ +.bin/ +*.swp +.DS_Store +.env +.tmp +npm-debug.log +site/public/decks/ + +yarn-error.log + +public/assets/uploads/ +public/swimmer/ + diff --git a/README.md b/README.md new file mode 100644 index 0000000..b8eae67 --- /dev/null +++ b/README.md @@ -0,0 +1,84 @@ +# No6092 + +Charles Stankievech + +## Installation + +```bash +npm install -g yarn +yarn install +``` + +## Development + +To run the server: + +```bash +yarn server +``` + +The server will be running on http://localhost:3000/ and the admin pages are on http://localhost:3000/admin/ + +When you start editing, be sure to pull the most recent changes before you do anything: + +```bash +git pull +``` + +If you add any new files, add them so git will keep track of them: + +```bash +git add -A +``` + +Commit changes with git, and then push them: + +```bash +git commit -am "adding some changes" +git push +``` + +Always please commit and push when you stop working! Otherwise we might have merge conflicts and it will be annoying :) + +## Production + +To log into the server, simply `ssh km@km` + +The site runs in production using `pm2`. + +### Starting the first time + +If the server ever restarts, you can restart the KM site this way: + +```bash +pm2 start index.js --name km +``` + +### Synchronizing + +You should not update your database locally if you can help it. If this cannot be avoided, log into the server first, commit changes there and then push them. Then pull locally, which will update your database with the latest changes. + +To synchronize images with the server, run this command at any time: + +```bash +yarn sync +``` + +### Updating the site + +First, push your local changes: + +```bash +yarn sync +git commit -am 'updating the database' +git push +``` + +Then on the server, pull changes and restart it: + +```bash +ssh km@km +cd km-galerie +git pull +pm2 restart km +``` diff --git a/index.js b/index.js new file mode 100644 index 0000000..3a42816 --- /dev/null +++ b/index.js @@ -0,0 +1,84 @@ +var okcms = require("okcms"); +var path = require("path"); + +var isProduction = process.env.OK_PRODUCTION === "true"; + +var app = okcms + .createApp({ + project: "No. 6092", + + debug: !isProduction, + production: isProduction, + + admin: { + dashboard: { + resources: {}, + }, + }, + + schemas: { + work: { + id: { type: "string", hidden: true }, + title: { type: "string" }, + author: { type: "string" }, + description: { type: "text" }, + thumbnail: { type: "image" }, + image: { type: "image" }, + hidden: { type: "flag" }, + }, + page: { + id: { type: "string", hidden: true }, + title: { type: "string" }, + body: { type: "text" }, + hidden: { type: "flag" }, + }, + }, + + resources: [{ type: "work" }, { type: "page" }], + + views: { + "/": { + template: "home", + data: [ + { type: "work", query: "*" }, + { type: "page", query: "*" }, + ], + }, + }, + + services: { + s3: { + // key: process.env.S3_KEY, + // secret: process.env.S3_SECRET, + // bucket: process.env.S3_BUCKET, + // dirname: "km", + local: { + localPath: path.join(__dirname, "./public/assets/uploads/"), + remotePath: "/assets/uploads/", + }, + image: { + allowed: true, + preserveFilename: false, + maxbytes: 2 * 1024 * 1024, + }, + file: { + allowed: true, + preserveFilename: true, + maxbytes: 100 * 1024 * 1024, + }, + video: { + allowed: true, + preserveFilename: true, + maxbytes: 200 * 1024 * 1024, + }, + audio: { + allowed: true, + preserveFilename: true, + maxbytes: 100 * 1024 * 1024, + }, + }, + }, + }) + .listen(process.env.PORT || 3000); + +console.log("Server listening at port " + (process.env.PORT || 3000) + "..."); diff --git a/package.json b/package.json new file mode 100644 index 0000000..fcb6355 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "km-galerie", + "version": "1.0.0", + "description": "KM Galerie Website", + "main": "index.js", + "scripts": { + "dev": "nodemon ./index.js --ignore db.json --ignore public --watch 'templates/*' --watch index.js --ext liquid", + "server": "node ./index.js", + "build": "node ./build.sh", + "sync": "bash ./sync.sh" + }, + "author": "Jules and Markus", + "dependencies": { + "okcms": "git+ssh://git@ghghgh.us/~/okcms.git" + }, + "license": "UNLICENSED", + "devDependencies": { + "grunt": "^1.3.0", + "grunt-cli": "^1.3.2", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-concat": "^0.5.1", + "grunt-contrib-copy": "^0.8.0", + "grunt-contrib-uglify": "^0.9.1", + "nodemon": "^2.0.7" + } +} diff --git a/public/assets/fonts/ionicons.eot b/public/assets/fonts/ionicons.eot new file mode 100755 index 0000000..92a3f20 Binary files /dev/null and b/public/assets/fonts/ionicons.eot differ diff --git a/public/assets/fonts/ionicons.svg b/public/assets/fonts/ionicons.svg new file mode 100755 index 0000000..49fc8f3 --- /dev/null +++ b/public/assets/fonts/ionicons.svg @@ -0,0 +1,2230 @@ + + + + + +Created by FontForge 20120731 at Thu Dec 4 09:51:48 2014 + By Adam Bradley +Created by Adam Bradley with FontForge 2.0 (http://fontforge.sf.net) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/assets/fonts/ionicons.ttf b/public/assets/fonts/ionicons.ttf new file mode 100755 index 0000000..c4e4632 Binary files /dev/null and b/public/assets/fonts/ionicons.ttf differ diff --git a/public/assets/fonts/ionicons.woff b/public/assets/fonts/ionicons.woff new file mode 100755 index 0000000..5f3a14e Binary files /dev/null and b/public/assets/fonts/ionicons.woff differ diff --git a/public/assets/img/close-black.png b/public/assets/img/close-black.png new file mode 100644 index 0000000..191442a Binary files /dev/null and b/public/assets/img/close-black.png differ diff --git a/public/assets/img/close.png b/public/assets/img/close.png new file mode 100644 index 0000000..529d730 Binary files /dev/null and b/public/assets/img/close.png differ diff --git a/public/assets/img/soc-face.png b/public/assets/img/soc-face.png new file mode 100644 index 0000000..98bc74f Binary files /dev/null and b/public/assets/img/soc-face.png differ diff --git a/public/assets/img/soc-inst.png b/public/assets/img/soc-inst.png new file mode 100644 index 0000000..9d73bfc Binary files /dev/null and b/public/assets/img/soc-inst.png differ diff --git a/public/assets/js/vendor/flickity.pkgd.min.js b/public/assets/js/vendor/flickity.pkgd.min.js new file mode 100644 index 0000000..db7e391 --- /dev/null +++ b/public/assets/js/vendor/flickity.pkgd.min.js @@ -0,0 +1,56 @@ +/*! + * Flickity PACKAGED v2.2.2 + * Touch, responsive, flickable carousels + * + * Licensed GPLv3 for open source use + * or Flickity Commercial License for commercial use + * + * https://flickity.metafizzy.co + * Copyright 2015-2021 Metafizzy + */ +(function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s