From b688d83ff3a8d91134e14973fc6969201339f545 Mon Sep 17 00:00:00 2001 From: Shrimadhav U K <shrimadhavuk@gmail.com> Date: Wed, 7 Jun 2017 10:48:17 +0530 Subject: [PATCH] restructuring --- .gitlab-ci.yml | 4 +-- Gruntfile.js | 20 +++++------ README.md | 9 ++--- bower.json | 27 -------------- css/improve.css | 8 +++++ css/main.css | 34 ++++++++++++++++++ css/map.css | 9 +++++ css/preamble.css | 8 +++++ css/style.css | 61 -------------------------------- js/locations.js | 2 -- js/script.js | 3 +- package.json | 11 +++++- pug/layout.pug | 22 +++++++----- pug/pages/404.pug | 9 +++-- pug/pages/index.pug | 51 +++++++++++++------------- pug/settings/mixins.pug | 11 ++++++ pug/settings/variables.pug | 22 ++++++++++++ pug/templates/css.pug | 11 +++--- pug/templates/head_inwrapper.pug | 8 ++--- pug/templates/js.pug | 2 +- pug/templates/meta_favicons.pug | 20 +++++------ pug/templates/meta_seo.pug | 3 ++ 22 files changed, 187 insertions(+), 168 deletions(-) delete mode 100644 bower.json create mode 100644 css/improve.css create mode 100644 css/main.css create mode 100644 css/map.css create mode 100644 css/preamble.css delete mode 100644 css/style.css create mode 100644 pug/settings/mixins.pug create mode 100644 pug/settings/variables.pug diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78d4be7..c75eb64 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,10 +2,8 @@ image: node:6.6.0 pages: stage: deploy script: - - npm install -g grunt-cli bower - npm install - - bower install --allow-root - - grunt public:dev + - ./node_modules/grunt-cli/bin/grunt public:dev artifacts: paths: - public diff --git a/Gruntfile.js b/Gruntfile.js index 5e44329..606d4ba 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -60,13 +60,13 @@ module.exports = function(grunt) { expand: true, files: [{ expand: true, - cwd: 'bower_components/html5shiv/dist', + cwd: 'node_modules/html5shiv/dist', src: "**", dest: 'public/js' }, { expand: true, - cwd: 'bower_components/respond/src', + cwd: 'node_modules/Respond.js/src', src: "**", dest: 'public/js' } @@ -76,7 +76,7 @@ module.exports = function(grunt) { expand: true, files: [{ expand: true, - cwd: 'bower_components/leaflet/dist/images', + cwd: 'node_modules/leaflet/dist/images', src: "**", dest: 'public/img' }] @@ -105,9 +105,9 @@ module.exports = function(grunt) { compress: { files: { 'public/js/index.js': [ - //'bower_components/jquery/dist/jquery.min.js', - //'bower_components/bootstrap/dist/js/bootstrap.min.js', - 'bower_components/leaflet/dist/leaflet.js', + //'node_modules/jquery/dist/jquery.min.js', + //'node_modules/bootstrap/dist/js/bootstrap.min.js', + 'node_modules/leaflet/dist/leaflet.js', 'js/*.js' ] }, @@ -125,10 +125,10 @@ module.exports = function(grunt) { compress: { files: { 'public/css/index.css': [ - 'bower_components/bootstrap/dist/css/bootstrap.min.css', - //'public/bower_components/font-awesome/css/font-awesome.min.css', - //'public/bower_components/normalize-css/normalize.css', - 'bower_components/leaflet/dist/leaflet.css', + 'node_modules/bootstrap/dist/css/bootstrap.min.css', + //'node_modules/font-awesome/css/font-awesome.min.css', + //'node_modules/normalize.css/normalize.css', + 'node_modules/leaflet/dist/leaflet.css', 'css/*.css' ] } diff --git a/README.md b/README.md index c0ce91d..1bc773e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ ## Official Website of Free Software User Groups in India - ## Dependencies 1. Node @@ -9,12 +8,10 @@ 1. Install Node ( Welcome to the world of Node <3 ) 2. run `npm install -g grunt-cli` -3. run `npm install -g bower` ## Installation 1. `npm install` from root folder -2. `bower install` from root folder ## Running the application @@ -85,16 +82,16 @@ Let us know ;) Official Website of Free Software User Groups in India Copyleft (É”) 2017 FSCI (Free Software Community of India) - All rights reserved, all wrongs reversed - + This project comes under free software license: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. diff --git a/bower.json b/bower.json deleted file mode 100644 index d4cbee2..0000000 --- a/bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "fsug", - "authors": [ - "FSCI - Free Software Community of India <fosscommunity.in@disroot.org>" - ], - "description": "Free Software User Groups in India", - "license": "GPL-3.0", - "homepage": "http://fsug.in/", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "bootstrap": "^3.3.7", - "normalize-css": "normalize.css#4.1.1", - "jquery": "2.2.4", - "html5shiv": "3.7.0", - "respond": "https://github.com/scottjehl/Respond.git#1.4.0", - "leaflet": "^1.0.3" - }, - "resolutions": { - "jquery": "~2.2.4" - } -} diff --git a/css/improve.css b/css/improve.css new file mode 100644 index 0000000..038652b --- /dev/null +++ b/css/improve.css @@ -0,0 +1,8 @@ +#improve { + font-size: 12px; + vertical-align: middle; + background-color: #EEEEEE; + padding: 10px; + border-radius: 2px; + margin-top: 30px; +} diff --git a/css/main.css b/css/main.css new file mode 100644 index 0000000..3d0ea8f --- /dev/null +++ b/css/main.css @@ -0,0 +1,34 @@ +@font-face { + font-family: Amaranth-Regular; + src: url(../fonts/Amaranth-Regular.ttf); +} + +@font-face { + font-family: Roboto-Thin; + src: url(../fonts/Roboto-Thin.ttf); +} + +#wrapper { + max-width: 968px; + margin: auto; + color: #454545; +} + +#main { + text-align: center; + margin: 8px; +} + +#main h1 { + font-family: "Amaranth-Regular"; + color: #949494; +} + +#main h2 { + font-family: "Roboto-Thin"; + color: #898989; +} + +#main p { + text-align: justify; +} diff --git a/css/map.css b/css/map.css new file mode 100644 index 0000000..2b4d57b --- /dev/null +++ b/css/map.css @@ -0,0 +1,9 @@ +#mapid { + height: 60vh; + margin: 20px auto; +} + +/* Override values in leaflet.css */ +#mapid.leaflet-container .leaflet-pane .leaflet-popup .leaflet-popup-content-wrapper .leaflet-popup-content { + margin: 5px 20px 15px; +} diff --git a/css/preamble.css b/css/preamble.css new file mode 100644 index 0000000..0e529b0 --- /dev/null +++ b/css/preamble.css @@ -0,0 +1,8 @@ +#preamble-list { + text-align: left; + padding-left: 15px; +} + +#preamble-list li { + padding: 10px; +} diff --git a/css/style.css b/css/style.css deleted file mode 100644 index 5cadcdf..0000000 --- a/css/style.css +++ /dev/null @@ -1,61 +0,0 @@ -@font-face { - font-family: Amaranth-Regular; - src: url(../fonts/Amaranth-Regular.ttf); -} - -@font-face { - font-family: Roboto-Thin; - src: url(../fonts/Roboto-Thin.ttf); -} - -#wrapper { - max-width: 968px; - margin: auto; - color: #454545; -} - -#main { - text-align: center; - margin: 8px; -} - -#main h1 { - font-family: "Amaranth-Regular"; - color: #949494; -} - -#main h2 { - font-family: "Roboto-Thin"; - color: #898989; -} - -#main p { - text-align: justify; -} - -#mapid { - height: 60vh; - margin: 20px auto; -} - -/* Override values in leaflet.css */ -#mapid.leaflet-container .leaflet-pane .leaflet-popup .leaflet-popup-content-wrapper .leaflet-popup-content { - margin: 5px 20px 15px; -} - -#preamble-list { - text-align: left; - padding-left: 15px; -} -#preamble-list li { - padding: 10px; -} - -#improve { - font-size: 12px; - vertical-align: middle; - background-color: #EEEEEE; - padding: 10px; - border-radius: 2px; - margin-top: 30px; -} diff --git a/js/locations.js b/js/locations.js index 0f6992b..13a1260 100644 --- a/js/locations.js +++ b/js/locations.js @@ -186,5 +186,3 @@ var locations = [{ "MATURL": "", "TGURL": "" }]; - -var locations_length = locations.length; diff --git a/js/script.js b/js/script.js index b0c3c3e..fcd72e9 100644 --- a/js/script.js +++ b/js/script.js @@ -13,9 +13,9 @@ var mapMarker = L.icon({ }); // see locations.js file to add new locations +var locations_length = locations.length; for (var i = 0; i < locations_length; i++) { - var texttodisplay = ""; texttodisplay += "<b>"; texttodisplay += ""; @@ -60,6 +60,7 @@ for (var i = 0; i < locations_length; i++) { } texttodisplay += ""; texttodisplay += "</b>"; + if ((locations[i].LAT !== "") || (locations[i].LNG !== "")) { L.marker([locations[i].LAT, locations[i].LNG], { icon: mapMarker diff --git a/package.json b/package.json index c990177..c3164d6 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "devDependencies": { "connect-livereload": "^0.5.4", "grunt": "^1.0.1", + "grunt-cli": "^1.2.0", "grunt-connect-proxy": "^0.2.0", "grunt-contrib-concat": "^1.0.1", "grunt-contrib-connect": "^1.0.2", @@ -29,7 +30,15 @@ "load-grunt-tasks": "^3.5.0", "time-grunt": "^1.3.0" }, - "dependencies": {}, + "dependencies": { + "html5shiv": "^3.7.0", + "Respond.js": "git+https://github.com/scottjehl/Respond.git#1.4.0", + "jquery": "2.2.4", + "bootstrap": "^3.3.7", + "normalize.css": "^7.0.0", + "font-awesome": "^4.7.0", + "leaflet": "^1.0.3" + }, "author": "FSCI - Free Software Community of India <fosscommunity.in@disroot.org>", "license": "GPL-3.0" } diff --git a/pug/layout.pug b/pug/layout.pug index 9a8e07a..62e4fd2 100644 --- a/pug/layout.pug +++ b/pug/layout.pug @@ -1,11 +1,15 @@ +//- Mixins and Varibles +include ./settings/mixins +include ./settings/variables + doctype html(lang='en') - head - include ./templates/head_inwrapper - include ./templates/meta_seo - title FSCI (Free Software Community of India) - include ./templates/css - include ./templates/meta_favicons - body - block content - include ./templates/js + head + include ./templates/head_inwrapper + include ./templates/meta_seo + include ./templates/meta_favicons + block head + include ./templates/css + body + block content + include ./templates/js diff --git a/pug/pages/404.pug b/pug/pages/404.pug index 7450f7d..5914990 100644 --- a/pug/pages/404.pug +++ b/pug/pages/404.pug @@ -1,6 +1,9 @@ extends ../layout.pug -block content +block head + base(href='/')/ + title 404. Not Found! - p.FourZeroFour - h1.text-center 404. Not Found +block content + p.FourZeroFour + h1.text-center 404. Not Found diff --git a/pug/pages/index.pug b/pug/pages/index.pug index ee408f8..98b5afd 100644 --- a/pug/pages/index.pug +++ b/pug/pages/index.pug @@ -1,28 +1,29 @@ extends ../layout.pug +block head + title= $vars.title + block content - #wrapper.container - #main.row - h1 Free Software User Groups in India - #mapid - ol#preamble-list - li Free Software Community of India is a collective of Free Software (sometimes also called as Open Source Software) users, advocates and developers. - li We maintain communication and collaboration infrastructure for everyone that respects their freedom and privacy. We maintain a list of Free Software communities and offer sub domains of fsug.in or fosscommunity.in. We depend on donations and community manpower to run the infrastructure. - li We mentor Free Software enthusiasts to become Free Software contributors. - li We provide GNU/Linux installation and configuration support mainly via online messaging groups. - p - |Join the conversation at our - a(href='https://matrix.to/#/#fsci:matrix.org', target='__blank') matrix chat room - | or collaborate with us on our - a(href='https://www.loomio.org/g/esPoQ4S0/free-software-community-of-india-fsci-', target='__blank') loomio group - |. - p - |If you need a subdomain or want to list your community in the map please - a(href='mailto:fosscommunity.in@disroot.org') mail to FSCI - | with sufficient details of your community or - a(href='https://gitlab.com/fsci/fsci.org.in/blob/master/js/locations.js', target='__blank') edit this list - |. - #improve - a(href='https://gitlab.com/fsci/fsci.org.in', target='_blank') - img(src='img/code.png') - span Improve this page + #wrapper.container + #main.row + h1= $vars.heading + #mapid + ol#preamble-list + each item in $vars.preamblelist + li!= item + p + |Join the conversation at our + a(href=$vars.MatrixLink, target='_blank') matrix chat room + | or collaborate with us on our + a(href=$vars.LoomioLink, target='_blank') loomio group + |. + p + |If you need a subdomain or want to list your community in the map please + a(href='mailto:fosscommunity.in@disroot.org') mail to FSCI + | with sufficient details of your community or + a(href='https://gitlab.com/fsci/fsci.org.in/blob/master/js/locations.js', target='_blank') edit this list + |. + #improve + a(href='https://gitlab.com/fsci/fsci.org.in', target='_blank') + img(src='img/code.png', alt="Contribute!") + span Improve this page diff --git a/pug/settings/mixins.pug b/pug/settings/mixins.pug new file mode 100644 index 0000000..f6b43eb --- /dev/null +++ b/pug/settings/mixins.pug @@ -0,0 +1,11 @@ +mixin meta(name,content) + meta(name=name, content=content)/ + +mixin metap(property,content) + meta(property=property, content=content)/ + +mixin link(rel, href) + link(rel=rel, href=href, type!=attributes.type, sizes!=attributes.sizes, color!=attributes.color)/ + +mixin script(src) + script(type="text/javascript", src=src) diff --git a/pug/settings/variables.pug b/pug/settings/variables.pug new file mode 100644 index 0000000..28faa0d --- /dev/null +++ b/pug/settings/variables.pug @@ -0,0 +1,22 @@ +- + var $vars = {}; //funky name to hold all global variables in templates. + + $vars.title = "FSCI (Free Software Community of India)"; + + $vars.preamblelist = [ + "Free Software Community of India is a collective of Free Software (sometimes also called as Open Source Software) users, advocates and developers.", + "We maintain communication and collaboration infrastructure for everyone that respects their freedom and privacy. We maintain a list of Free Software communities and offer sub domains of fsug.in or fosscommunity.in. We depend on donations and community manpower to run the infrastructure.", + "We mentor Free Software enthusiasts to become Free Software contributors.", + "We provide GNU/Linux installation and configuration support mainly via online messaging groups." + ]; + + $vars.heading = "Free Software User Groups in India"; + + $vars.LoomioLink = "https://www.loomio.org/g/esPoQ4S0/free-software-community-of-india-fsci-"; + + $vars.MatrixLink = "https://matrix.to/#/%23fsci:matrix.org"; + $vars.TGLink = "https://t.me/fscin"; + + $vars.author = ""; + $vars.keywords = ""; + $vars.description = ""; diff --git a/pug/templates/css.pug b/pug/templates/css.pug index ec57963..ae8be61 100644 --- a/pug/templates/css.pug +++ b/pug/templates/css.pug @@ -1,10 +1,11 @@ -<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> -<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> +// HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries +// WARNING: Respond.js doesn't work if you view the page via file:// <!--[if lt IE 9]> - <script type="text/javascript" src="js/html5shiv.js"></script> - <script type="text/javascript" src="js/respond.js"></script> + +script('js/html5shiv.js') + +script('js/respond.js') <![endif]--> //- Compiled CSS -link(rel='stylesheet', href='css/index.css')/ +//- the files in the css directory are added here on grunt serve ++link('stylesheet', 'css/index.css')(type='text/css') diff --git a/pug/templates/head_inwrapper.pug b/pug/templates/head_inwrapper.pug index fa7d9ed..6865182 100644 --- a/pug/templates/head_inwrapper.pug +++ b/pug/templates/head_inwrapper.pug @@ -1,6 +1,6 @@ meta(charset='utf-8')/ -meta(http-equiv='X-UA-Compatible', content='IE=edge;chrome=1')/ -meta(name='viewport', content='width=device-width, initial-scale=1.0')/ +meta(http-equiv='X-UA-Compatible', content='IE=edge')/ ++meta('viewport','width=device-width, initial-scale=1.0') // The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -meta(http-equiv='content-type', content='text/html')/ -meta(name='apple-mobile-web-app-capable', content='yes')/ +//- meta(http-equiv='content-type', content='text/html')/ ++meta('apple-mobile-web-app-capable','yes') diff --git a/pug/templates/js.pug b/pug/templates/js.pug index 94f4f21..ebe203b 100644 --- a/pug/templates/js.pug +++ b/pug/templates/js.pug @@ -1,2 +1,2 @@ //- Compile JavaScript -script(type="text/javascript", src='js/index.js') ++script('js/index.js') diff --git a/pug/templates/meta_favicons.pug b/pug/templates/meta_favicons.pug index f7e8298..f37d13b 100644 --- a/pug/templates/meta_favicons.pug +++ b/pug/templates/meta_favicons.pug @@ -1,12 +1,12 @@ // http://realfavicongenerator.net/ -link(rel='apple-touch-icon', sizes='180x180', href='/img/favicons/apple-touch-icon.png')/ -link(rel='icon', type='image/png', href='/img/favicons/favicon-32x32.png', sizes='32x32')/ -link(rel='icon', type='image/png', href='/img/favicons/favicon-16x16.png', sizes='16x16')/ -link(rel='manifest', href='/img/favicons/manifest.json')/ -link(rel='mask-icon', href='/img/favicons/safari-pinned-tab.svg', color='#5bbad5')/ -link(rel='shortcut icon', href='/img/favicons/favicon.ico')/ -meta(name='apple-mobile-web-app-title', content='FSUG')/ -meta(name='application-name', content='FSUG')/ -meta(name='msapplication-config', content='/img/favicons/browserconfig.xml')/ -meta(name='theme-color', content='#ffffff')/ ++link('apple-touch-icon','/img/favicons/apple-touch-icon.png')(type='image/png',sizes='180x180') ++link('icon','/img/favicons/favicon-32x32.png')(type='image/png',sizes='32x32') ++link('icon','/img/favicons/favicon-16x16.png')(type='image/png', sizes='16x16') ++link('manifest','/img/favicons/manifest.json') ++link('mask-icon','/img/favicons/safari-pinned-tab.svg')(color='#5bbad5') ++link('shortcut icon','/img/favicons/favicon.ico') ++meta('apple-mobile-web-app-title','FSUG.IN') ++meta('application-name','FSUG.IN') ++meta('msapplication-config','/img/favicons/browserconfig.xml') ++meta('theme-color','#ffffff') // http://realfavicongenerator.net/ diff --git a/pug/templates/meta_seo.pug b/pug/templates/meta_seo.pug index 2eb957f..3e25b7c 100644 --- a/pug/templates/meta_seo.pug +++ b/pug/templates/meta_seo.pug @@ -1,4 +1,7 @@ // the Original SEO ++meta('author',$vars.author) ++meta('keywords',$vars.keywords) ++meta('description',$vars.description) // if each site makes their own METAs, then ...? -- GitLab