Commit 790ce433 by Shrimadhav U K

Code Beautification

parent 9e7106a5
/vendor
/node_modules
.sass-cache
.project
.settings/
public/**/*.html
public/css
public/img
public/fonts
public/js
.yo-rc.json
/bower_components
/public
image: node:6.6.0
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
- npm install -g grunt-cli bower
- npm install
- bower install --allow-root
- grunt public:dev
artifacts:
paths:
- public
only:
- master
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
htmlhint: {
options: {
'attr-lower-case': true,
'attr-value-not-empty': false,
'tag-pair': true,
'tag-self-close': false,
'tagname-lowercase': true,
'id-class-value': true,
'id-unique': true,
'img-alt-require': true,
'img-alt-not-empty': true
},
main: {
src: ['public/**.html']
}
},
jshint: {
main: {
files: [{
src: ['Gruntfile.js', 'js/**/*.js']
}]
},
options: {
globals: {
'jQuery': true,
'console': true
}
}
},
pug: {
options: {
pretty: true,
data: {
debug: true
}
},
pages: {
files: [{
expand: true,
cwd: 'pug/pages',
src: '*.pug',
dest: 'public/',
ext: '.html'
}]
}
},
copy: {
iejs: {
expand: true,
files: [{
expand: true,
cwd: 'bower_components/html5shiv/dist',
src: "**",
dest: 'public/js'
},
{
expand: true,
cwd: 'bower_components/respond/src',
src: "**",
dest: 'public/js'
}
]
},
lfltcss: {
expand: true,
files: [{
expand: true,
cwd: 'bower_components/leaflet/dist/images',
src: "**",
dest: 'public/img'
}]
},
fonts: {
expand: true,
files: [{
expand: true,
cwd: 'fonts',
src: "**",
dest: 'public/fonts'
}]
},
imgrsrc: {
expand: true,
files: [{
expand: true,
cwd: 'img',
src: "**",
dest: 'public/img'
}]
}
},
uglify: {
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',
'js/*.js'
]
},
options: {
mangle: true,
unused: true
}
}
},
cssmin: {
options: {
sourceMap: true
},
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',
'css/*.css'
]
}
}
},
watch: {
grunt: {
files: ['Gruntfile.js'],
options: {
nospawn: true,
keepalive: true,
livereload: true
},
tasks: ['public:dev']
},
html: {
files: ['public/*.html'],
options: {
nospawn: true,
keepalive: true,
livereload: true
},
tasks: ['htmlhint']
},
js: {
files: 'js/**',
options: {
nospawn: true,
livereload: true
},
tasks: ['jshint', 'uglify']
},
pug: {
files: ['pug/**'],
options: {
nospawn: true,
livereload: true
},
tasks: ['pug']
},
css: {
files: 'css/**',
options: {
nospawn: true,
livereload: true
},
tasks: ['cssmin']
}
},
connect: {
server: {
options: {
port: 8080,
base: 'public',
hostname: 'localhost',
livereload: true
}
}
}
});
grunt.registerTask('public:dev', function(target) {
grunt.task.run([
'pug',
'htmlhint',
'jshint',
'copy',
'uglify',
'cssmin'
]);
});
grunt.registerTask('serve', function(target) {
grunt.task.run([
'public:dev',
'connect',
'watch'
]);
});
};
This diff is collapsed. Click to expand it.
## Free Software User Group
## Dependencies
1. Node
## Presteps
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
* `grunt serve` - starts a local server and keeps watching the file changes
### Under the Hood!
Okay, Let's look at it one by one.
We installed [Node](https://nodejs.org/en/) so that we can use [Grunt](https://gruntjs.com) ( The super awesome javascript task runnner).
But why do we even need a task runner? I'm sure you guys had fun at Selenium workshop, automating things. Grunt helps you automate a lot of things.
Now, take a look at package.json file. You'll see a lot of grunt-* dependencies each serving a special purpose in your project. eg. `grunt-contrib-concat` is for concatenating files.
Now, `Gruntfile.js`: This is where you configure/define your grunt tasks. Let's see what all things are defined there now.
Look at jshint
```
jshint: {
main: {
files : [{
src : ['Gruntfile.js', 'js/**/*.js']
}]
},
options: {
globals: {
'jQuery': true,
'angular': true,
'console': true,
'$': true,
'_': true,
'moment': true
}
}
},
```
Here `main` corresponds to a subtask. That means you run this task as `grunt jshint:main`. `grunt jshint`, as you would expect, will run all the subtasks associated with jshint(In this case we've only one, ie `main`)
Now, what does this `jshint:main` task do?
It checks all the files (ie,`Gruntfile.js` and all the javascript files within js folder) for syntax errors.
Similarly we've htmlhint, [pug](https://pugjs.org/) and concat.
Now the cool part! `watch` is the task which lets you watch different files for changes and runs associated task whenever some change happens.
for example,
```
js: {
files: 'js/**',
options: {
nospawn: true,
livereload: true
},
tasks: ['jshint', 'concat']
},
```
This portion inside `watch` configures `jshint` and `uglify` to be run whenever files inside js folder (`js/**`) changes.
Is that a lot to take in?
Just one more! `connect` task starts a local server at [http://localhost:8080](http://localhost:8080). It also inject a script to your page that keeps a live connection to the server, so that browser will automatically refresh whenever you change and save code. Does that sound awesome to you?
Let me know ;)
{
"name": "fsug",
"authors": [
"Bady <ambadyanands2207@gmail.com>"
],
"description": "Free Software User Group",
"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"
}
}
@font-face {
font-family: Amaranth-Regular;
src: url(../fonts/Amaranth-Regular.ttf);
font-family: Amaranth-Regular;
src: url(../fonts/Amaranth-Regular.ttf);
}
@font-face {
font-family: Roboto-Thin;
src: url(../fonts/Roboto-Thin.ttf);
font-family: Roboto-Thin;
src: url(../fonts/Roboto-Thin.ttf);
}
#wrapper {
max-width: 968px;
margin: auto;
color: #454545;
max-width: 968px;
margin: auto;
color: #454545;
}
#main {
text-align: center;
margin: 8px;
text-align: center;
margin: 8px;
}
#main h1 {
font-family: "Amaranth-Regular";
color: #949494;
font-family: "Amaranth-Regular";
color: #949494;
}
#main h2 {
font-family: "Roboto-Thin";
color: #898989;
font-family: "Roboto-Thin";
color: #898989;
}
#main p {
text-align: justify;
text-align: justify;
}
#mapid {
height: 60vh;
margin: 20px auto;
height: 60vh;
margin: 20px auto;
}
#improve {
font-size: 12px;
vertical-align: middle;
background-color: #EEEEEE;
padding: 10px;
border-radius: 2px;
margin-top: 30px;
font-size: 12px;
vertical-align: middle;
background-color: #EEEEEE;
padding: 10px;
border-radius: 2px;
margin-top: 30px;
}
var mymap = L.map('mapid').setView([21, 78], 4);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
L.tileLayer('//{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mymap);
var mapMarker = L.icon({
iconUrl: 'img/marker-icon.png',
shadowUrl: 'img/marker-shadow.png',
iconSize: [20, 30],
shadowSize: [30, 30],
shadowAnchor: [10, 14]
iconUrl: 'img/marker-icon.png',
shadowUrl: 'img/marker-shadow.png',
iconSize: [20, 30],
shadowSize: [30, 30],
shadowAnchor: [10, 14]
});
var goa = L.marker([15.49, 73.82], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://goa.fsug.in" target="__blank" style="text-decoration: none">FSUG Goa</a></b>');
var coep = L.marker([18.5293994,73.8560156], {
icon: mapMarker
var coep = L.marker([18.5293994, 73.8560156], {
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://co.fsug.in" target="__blank" style="text-decoration: none">FSUG at College of Engineering, Pune</a></b>');
var plug = L.marker([18.519368, 73.855321], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://plug.org.in" target="__blank" style="text-decoration: none">Pune GNU/Linux Users Group, Pune</a></b>');
var thrissur = L.marker([10.52, 76.21], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://thrissur.fsug.in" target="__blank" style="text-decoration: none">FSUG Thrissur</a></b>');
var calicut = L.marker([11.25, 75.78], {
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://calicut.fsug.in" target="__blank" style="text-decoration: none">FSUG Calicut</a></b>');
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://calicut.fsug.in" target="__blank" style="text-decoration: none">FSUG Calicut</a></b>');
var lbs = L.marker([12.50, 75.05], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://lbs.fsug.in" target="__blank" style="text-decoration: none">FSUG at LBS College of Engineering, Kasargode</a></b>');
var rset = L.marker([10.01, 76.34], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="https://riot.im/app/#/room/rsetfc:matrix.org" target="__blank" style="text-decoration: none">RSETFC (Rajagiri School of Engineering & Technology FOSS Club), Ernakulam</a></b>');
var fossclub = L.marker([10.00, 76.33], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://fossclub.in" target="__blank" style="text-decoration: none">FOSSClub, Ernakulam</a></b>');
var malappuram = L.marker([11.04, 76.08], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="https://www.freelists.org/list/ssug-malappuram" target="__blank" style="text-decoration: none">SSUG (Swathanthra Software Users Group) Malappuram</a></b>');
var mes = L.marker([10.84, 76.03], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="https://groups.google.com/forum/#!forum/mes-fsug" target="__blank" style="text-decoration: none">FSUG at MES College of Engineering, Malappuram</a></b>');
var thiruvananthapuram = L.marker([8.49, 76.95], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="https://www.freelists.org/list/ssug-malappuram" target="__blank" style="text-decoration: none">FSUG Thiruvananthapuram</a></b>');
var kollam = L.marker([8.88, 76.60], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="https://www.freelists.org/list/ssug-kollam" target="__blank" style="text-decoration: none">SSUG (Swathanthra Software Users Group) Kollam</a></b>');
var meerut = L.marker([28.99, 77.7], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="https://groups.google.com/forum/#!forum/glug-meerut" target="__blank" style="text-decoration: none">GLUG (Gnu/Linux Users Group) Meerut</a></b>');
var palakkad = L.marker([10.77, 76.65], {
icon: mapMarker
icon: mapMarker
}).addTo(mymap).bindPopup('<b><a href="http://plus.fosscommunity.in" target="__blank" style="text-decoration: none">PLUS (Palakkad Libre software Users Society)</a></b>');
{
"name": "fsug",
"description": "Free Software User Group",
"repository": {
"type": "git",
"url": "git+ssh://git@gitlab.com:fsug/fsug.gitlab.io.git"
},
"bugs": {
"url": "https://gitlab.com/fsug/fsug.gitlab.io/issues"
},
"homepage": "https://fsug.in",
"devDependencies": {
"connect-livereload": "^0.5.4",
"grunt": "^1.0.1",
"grunt-connect-proxy": "^0.2.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-nodeunit": "^0.4.1",
"grunt-contrib-pug": "^1.0.0",
"grunt-contrib-uglify": "^0.5.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-htmlhint": "^0.9.13",
"grunt-preprocess": "^5.1.0",
"jshint-stylish": "^2.2.1",
"jstransformer-markdown-it": "^2.0.0",
"load-grunt-tasks": "^3.5.0",
"time-grunt": "^1.3.0"
},
"dependencies": {},
"author": "Bady <ambadyanands2207@gmail.com>",
"license": "GPL-3.0"
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<head>
<title>FSUG</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/leaflet.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div id="wrapper" class="container">
<div id="main" class="row">
<h1>fsug.in</h1>
<h2>Free Software User Groups in India</h2>
<div id="mapid"></div>
<p>fsug.in is managed by <a href="https://riot.im/app/#/room/#fsci:matrix.org" target="__blank">FSCI (Free Software Community of India)</a> in order to help various Free Software Communities in India to help them maintain their online existence. fsug.in offers it subdomains to Free Software Communities in India for free. If you need a subdomain or want to list your community here please <a href="mailto:fosscommunity.in@disroot.org">mail to FSCI</a> with sufficient details of your community.</p>
<div id="improve">
<a href="https://gitlab.com/fsug/fsug.gitlab.io" target="_blank">
<img src="img/code.png">
<span>Improve this page</span>
</a>
</div>
</div>
</div>
<script src="js/leaflet.js"></script>
<script src="js/script.js"></script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
doctype
html(lang='en')
head
include ./templates/head_inwrapper
include ./templates/meta_seo
title FSUG
include ./templates/css
include ./templates/meta_favicons
body
block content
include ./templates/js
extends ../layout.pug
block content
p.FourZeroFour
h1.text-center 404. Not Found
extends ../layout.pug
block content
#wrapper.container
#main.row
h1 fsug.in
h2 Free Software User Groups in India
#mapid
p
| fsug.in is managed by
a(href='https://matrix.to/#/#fsci:matrix.org', target='__blank') FSCI (Free Software Community of India)
| in order to help various Free Software Communities in India to help them maintain their online existence.
| fsug.in offers it subdomains to Free Software Communities in India for free.
| If you need a subdomain or want to list your community here please
a(href='mailto:fosscommunity.in@disroot.org') mail to FSCI
| with sufficient details of your community.
#improve
a(href='https://gitlab.com/fsug/fsug.gitlab.io', target='_blank')
img(src='img/code.png')
span Improve this page
<!-- 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>
<![endif]-->
//- Compiled CSS
link(rel='stylesheet', href='css/index.css')/
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')/
// 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')/
//- Compile JavaScript
script(type="text/javascript", src='js/index.js')
// 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')/
// http://realfavicongenerator.net/
// the Original SEO
// if each site makes their own METAs, then ...?
// OpenGraph
// Twitter Cards
// Google Plus Author Info
// Google Structured data markup
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment