Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (33)
Showing with 3459 additions and 361 deletions
image: node:6.6.0
image: node:21.2.0
pages:
stage: deploy
script:
- npm install
- npm run install
- npm run build
artifacts:
paths:
- public
......
......@@ -7,76 +7,15 @@
## Presteps
1. Install Node ( Welcome to the world of Node <3 )
2. run `npm install -g gulp-cli`
## Installation
1. `npm install` from root folder
## Running the application
* `gulp 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. Doesn't that sound awesome to you?
Let us know ;)
## Building
1. `npm run build`
## License
......
echo "Processing assets"
mkdir -p public/fonts public/img
cp node_modules/bootstrap/fonts/*.{ttf,woff,eot,svg,woff2} node_modules/font-awesome/fonts/*.{ttf,woff,eot,svg,woff2,otf} fonts/*.{ttf,woff,woff2} node_modules/bootcards/dist/fonts/*.{ttf,woff,eot,svg,woff2,otf} public/fonts
cp node_modules/leaflet/dist/images/** img/** public/img
npx pug pug/pages --out public
echo "Processing events"
mkdir -p public/events
echo "events:" > public/events/index.yaml
for f in $(ls -r events/details); do
event=$(basename $f .yaml)
echo "Processing $event"
echo " $event:" >> public/events/index.yaml
cat "events/details/$f" | sed 's/^/ /' >> public/events/index.yaml
if ! [ -f public/events/$event.html ]; then
npx js-yaml "events/details/$f" > "public/events/$event.json"
npx pug -O public/events/$event.json pug/templates/individual_event_page.pug
mv pug/templates/individual_event_page.html public/events/$event.html
fi
done
npx js-yaml public/events/index.yaml > public/events/index.json
npx pug -O public/events/index.json pug/templates/events.pug
mv pug/templates/events.html public/events/index.html
echo "Processing CSS"
mkdir -p public/css
cat 'node_modules/bootstrap/dist/css/bootstrap.min.css' 'node_modules/font-awesome/css/font-awesome.min.css' 'node_modules/leaflet/dist/leaflet.css' 'node_modules/bootcards/dist/css/bootcards-desktop.min.css' css/*.css | npx postcss > public/css/index.css
echo "Processing JS"
mkdir -p public/js
npx uglify-js 'node_modules/jquery/dist/jquery.min.js' 'node_modules/bootstrap/dist/js/bootstrap.min.js' 'node_modules/leaflet/dist/leaflet.js' 'node_modules/bootcards/dist/js/bootcards.min.js' 'js/*.js' -o public/js/index.js
\ No newline at end of file
.events-list {
min-height: 65px;
}
.event-details {
min-height: 80vh;
}
.bootcards-richtext>.panel-body {
font-size: 16px;
max-width: 968px;
padding: 25px 35px;
}
.bootcards-richtext>.panel-body img {
margin: 15px 0;
}
.col-sm-8 .panel-heading .panel-title {
padding-left: 20px;
}
.panel-heading .panel-title {
font-weight: 700;
margin-top: 15px;
}
.event-card .panel-body img {
box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.3);
max-width: 80%;
}
.separator {
margin: -1px 15px;
padding: 15px 0 10px;
}
.separator-top {
margin-right: 15px;
padding: 15px 0 10px;
}
a.list-group-item::before {
display: none;
}
.list-group-item.events-list.separator:hover {
margin-right: 0;
}
.panel .panel-heading .pull-right {
margin-top: -36px;
margin-right: 10px;
padding: 6px 25px;
}
......@@ -35,45 +35,3 @@ h1 {
margin: auto;
max-width: 968px;
}
.separator {
margin: -1px 15px;
padding: 15px 0 10px;
}
.separator-top {
margin-right: 15px;
padding: 15px 0 10px;
}
.events-list {
min-height: 65px;
}
.event-details {
min-height: 80vh;
}
.bootcards-richtext>.panel-body {
font-size: 16px;
max-width: 968px;
padding: 25px 35px;
}
.bootcards-richtext>.panel-body img {
margin: 15px 0;
}
.col-sm-8 .panel-heading .panel-title {
padding-left: 20px;
}
.panel-heading .panel-title {
font-weight: 700;
margin-top: 15px;
}
.event-card .panel-body img {
box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.3);
max-width: 80%;
}
id: "0"
name: "GNU/Linux Install Fest - Wayanad"
id: "2017-06-17-00"
name: "GNU/Linux Install Fest and Debian Stretch Release Party - Wayanad"
state: "Kerala"
district: "Wayanad"
venue: "Pazhassi Library, Mananthavady"
lat: ""
lng: ""
locationame: "Pazhassi Library, Mananthavady"
organizedby: "FSUG Wayanadu"
when: "2017-06-17 10:00 AM to 02:00 PM"
lon: ""
organizedby: "FSUG Wayanad"
when: "17-06-2017 10:00 AM to 02:00 PM"
description: "GNU/Linux install fest"
contactinfo: "TBA"
contactinfo: ""
imgurl: "https://wiki.debian.org/ReleasePartyStretch/India/Kerala/Mananthavady?action=AttachFile&do=get&target=wayanadfest.jpeg"
id: "1"
name: "GNU/Linux Install Fest - Calicut"
id: "2017-06-18-00"
name: "GNU/Linux Install Fest and Debian Stretch Release Party - Calicut"
state: "Kerala"
district: "Calicut"
venue: "Parishad Bhavan"
lat: ""
lng: ""
locationame: "Calicut"
lon: ""
organizedby: "FSUG Calicut"
when: "2017-06-18 10:00 AM"
when: "18-06-2017 10:00 AM"
description: "GNU/Linux Install Fest"
contactinfo: ""
imgurl: "https://wiki.debian.org/ReleasePartyStretch/India/Kerala/Kozhikode?action=AttachFile&do=get&target=cltfest.png"
id: "2"
id: "2017-06-24-00"
name: "Debian Stretch Release Party - Kochi"
state: "Kerala"
district: "Ernakulam"
venue: "CUSAT"
lat: ""
lng: ""
locationame: "CUSAT"
lon: ""
organizedby: "FOSSClub, ILUG Cochin and DAKF"
when: "2017-06-24 03:00 PM to 06:00 PM"
when: "24-06-2017 03:00 PM to 06:00 PM"
description: "Debian Stretch Release Party - Kochi"
contactinfo: "TBA"
imgurl: "https://wiki.debian.org/ReleasePartyStretch/India/Kerala/Cochin/CUSAT?action=AttachFile&do=get&target=cochin_cufest.jpeg"
id: "3"
name: "Debian Stretch Release Party - Thrissur"
id: "2017-07-05-00"
name: "GNU/Linux Install Fest and Debian Stretch Release Party - Thrissur"
state: "Kerala"
district: "Thrissur"
venue: "St.Mary's College"
lat: ""
lng: ""
locationame: "St.Mary's College"
lon: ""
organizedby: "FSUG Thrissur, ICFOSS and KSSP"
when: "2017-07-05 09:30 AM to 12:30 PM"
when: "05-07-2017 09:30 AM to 12:30 PM"
description: "Debian Stretch Release Party along with GNU/Linux Install Fest - Thrissur"
contactinfo: "Riot room #fsugtcr:matrix.org"
imgurl: "https://wiki.debian.org/ReleasePartyStretch/India/Kerala/Thrissur?action=AttachFile&do=get&target=fsug_thrissur_debian_stretch_release_party_poster.png"
id: "2018-02-17-00"
name: "FOSSMeet'18 - NIT Calicut"
state: "Kerala"
district: "Calicut"
venue: "National Institute of Technology, Calicut"
lat: "11.3200"
lon: "75.9327"
organizedby: "FOSSCell, NITC"
when: "17-02-2018 09:00 AM to 18-02-2018 07:00 PM"
description: "FOSSMeet is an annual event on Free and Open Source Software, conducted at National Institute of Technology, Calicut."
contactinfo: "Riot room #fosscell:matrix.org"
imgurl: "https://pbs.twimg.com/profile_images/834881470275604480/HI0hdYp1.jpg"
version: "1.0"
events: !!inc/dir [ 'details' , { ignoreTopLevelDir: true, ignoreIndicator: '-', excludeTopLevelDirSeparator: true } ]
var gulp = require('gulp');
var htmlhint = require('gulp-htmlhint');
var jshint = require('gulp-jshint');
var csslint = require('gulp-csslint');
var pug = require('gulp-pug');
var concat = require('gulp-concat');
var cssmin = require('gulp-cssmin');
var uglify = require('gulp-uglify');
var connect = require('gulp-connect');
var connectProxy = require('gulp-connect-proxy');
var yamlinc = require("gulp-yaml-include");
var runSequence = require('run-sequence');
var readYaml = require('read-yaml');
var glob = require("glob");
gulp.task('assetscopy', function() {
gulp.src([
'node_modules/bootstrap/fonts/*.{ttf,woff,eot,svg, woff2}',
'node_modules/font-awesome/fonts/*.{ttf,woff,eot,svg,woff2,otf}',
'fonts/*.{ttf,woff,woff2}',
'node_modules/bootcards/dist/fonts/*.{ttf,woff,eot,svg,woff2,otf}'
]).pipe(gulp.dest('public/fonts'));
gulp.src([
'node_modules/leaflet/dist/images/**',
'img/**'
]).pipe(gulp.dest('public/img'));
});
gulp.task('htmllint', function() {
gulp.src("public/*.html")
.pipe(htmlhint());
});
gulp.task('csslint', function() {
gulp.src('css/*.css')
.pipe(csslint({
'shorthand': false
}))
.pipe(csslint.formatter());
});
gulp.task('jslint', function() {
gulp.src(["gulpfile.js", "js/*.js"])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('GenerateIndexPage', function(){
gulp.src('pug/pages/*.pug')
.pipe(pug({
pretty: true,
data: {
debug: true
}
}))
.pipe(gulp.dest('public'));
});
gulp.task('GenerateEventsYAML', function(){
return gulp.src("events/index.yaml")
.pipe(yamlinc())
.pipe(gulp.dest('public/events'));
});
gulp.task('GenerateEventsPage', function(){
readYaml('public/events/index.yaml', function(err, ydata) {
if (err) throw err;
gulp.src('pug/templates/events.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
events: ydata
}
}))
.pipe(concat('index' + '.html'))
.pipe(gulp.dest('public/events'));
});
glob("events/details/*.yaml", {}, function (er, files) {
var nooffiles = files.length;
for(var i = 0; i < nooffiles; i++){
readYaml(files[i], function(err, ydata) {
if (err) throw err;
var id = ydata.id;
gulp.src('pug/templates/individual_event_page.pug')
.pipe(pug({
pretty: true,
data: {
debug: true,
evt: ydata
}
}))
.pipe(concat(id + '.html'))
.pipe(gulp.dest('public/events'));
});
}
});
});
gulp.task('pughtml', function(){
runSequence('GenerateEventsYAML',[
'GenerateIndexPage',
'GenerateEventsPage'
]);
});
gulp.task('cssmin', function() {
gulp.src([
'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',
'node_modules/bootcards/dist/css/bootcards-desktop.min.css',
// 'node_modules/bootcards/dist/css/bootcards-android.min.css',
// 'node_modules/bootcards/dist/css/bootcards-ios.min.css',
'css/*.css'
])
.pipe(concat('index.css'))
.pipe(cssmin())
.pipe(gulp.dest('public/css'));
});
gulp.task('jsuglify', function() {
gulp.src([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/leaflet/dist/leaflet.js',
'node_modules/bootcards/dist/js/bootcards.min.js',
'js/*.js'
])
.pipe(concat('index.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js'));
gulp.src([
'node_modules/html5shiv/dist/html5shiv.js',
'node_modules/Respond.js/src/respond.js'
])
.pipe(uglify())
.pipe(gulp.dest('public/js'));
});
gulp.task('verify', [
'public',
'htmllint',
'csslint',
'jslint'
]);
gulp.task('public', [
'assetscopy',
'pughtml',
'cssmin',
'jsuglify'
]);
gulp.task('connect', function() {
connect.server({
root: 'public',
port: 8080,
livereload: true
});
});
gulp.task('watch', function() {
gulp.watch([
'./pug/**/*.pug'
], [
'pughtml',
'htmllint',
]);
gulp.watch([
'css/*.css',
'package.json'
], [
'csslint',
'cssmin'
]);
gulp.watch([
'js/*.js',
'package.json'
], [
'jslint',
'jsuglify',
]);
});
gulp.task('serve', [
'public',
'connect',
'watch'
]);
gulp.task('default', [
'serve'
]);
......@@ -47,7 +47,7 @@ var locations = [{
"TITLE": "dgplug (Linux Users' Group of Durgapur)",
"URL": "https://www.dgplug.org/",
"MLIST": "http://lists.dgplug.org/listinfo.cgi/users-dgplug.org",
"MATURL": "https://matrix.to/#/#freenode_#dgplug:matrix.org",
"MATURL": "https://matrix.to/#/#dgplug:libera.chat",
"TGURL": ""
}, {
"LAT": "18.975",
......@@ -210,8 +210,8 @@ var locations = [{
"MATURL": "",
"TGURL": ""
}, {
"LAT": "28.6138",
"LNG": "77.2089",
"LAT": "28.7140",
"LNG": "77.3000",
"TITLE": "NDBUG (New Delhi BSD User Group)",
"URL": "http://ndbug.in",
"MLIST": "",
......@@ -225,4 +225,70 @@ var locations = [{
"MLIST": "https://groups.google.com/forum/#!forum/nitcosc",
"MATURL": "https://matrix.to/#/#fosscell:diasp.in",
"TGURL": "https://t.me/fosscell"
}];
}, {
"LAT": "28.6139",
"LNG": "77.2090",
"TITLE": "Indian Linux User's Group Delhi",
"URL": "http://www.linuxdelhi.org/",
"MLIST": "",
"MATURL": "https://matrix.to/#/#ilugd:matrix.org",
"TGURL": "https://t.me/joinchat/AAAAAEAc48wCHkUXViXBcg"
}, {
"LAT":" 23.6",
"LNG": "72.95",
"TITLE": "UnitedBSD (BSD users Group) ",
"URL": "https://unitedbsd.com",
"MLIST": "",
"MATURL": "https://riot.im/app/#/room/#bsd:matrix.org",
"TGURL": "https://t.me/unitedbsd"
}, {
"LAT":" 10.62655",
"LNG": "76.14496",
"TITLE": "FOSSers VAST",
"URL": "http://fossers.vidyaacademy.ac.in",
"MLIST": "https://lists.fsci.org.in/postorius/lists/fossersvast.lists.fsci.org.in",
"MATURL": "https://matrix.to/#/#FOSSersVAST:matrix.org",
"TGURL": "https://t.me/fossersvast"
}, {
"LAT":"11.93855",
"LNG": "79.4984801",
"TITLE": "Viluppuram GLUG",
"URL": "https://vglug.org",
"MLIST": "https://groups.google.com/forum/#!forum/viluppuramglug",
"MATURL": "https://matrix.to/#/+vglug:matrix.org",
"TGURL": ""
}, {
"LAT": "28.6129",
"LNG": "77.2277",
"TITLE": "PyDelhi",
"URL": "https://pydelhi.org/",
"MLIST": "https://mail.python.org/mailman/listinfo/ncr-python.in",
}, {
"LAT": "28.6328",
"LNG": "77.2195",
"TITLE": "Mozilla Delhi",
"URL": "https://wiki.mozilla.org/India/Delhi",
"TGURL": "https://t.me/mozilladelhi",
}, {
"LAT": "28.4653",
"LNG": "77.5106",
"TITLE": "Greater Noida Developer Group",
"URL": "http://www.gndg.in/",
"TGURL": "https://t.me/joinchat/AoNm4T5dyUMR40KBgwuF8w",
}, {
"LAT":"9.727128",
"LNG": "76.726013",
"TITLE": "The Nexus, SJCET Palai (Free Software and Hardware Users Group/Club) ",
"URL": "https://github.com/thenexusproject",
"MLIST": "",
"MATURL": "",
"TGURL": ""
}, {
"LAT":"12.991829015583626",
"LNG": "80.22862809291958",
"TITLE": "ILUGC (Indian Linux User Group - Chennai)",
"URL": "https://ilugc.in",
"MLIST": "https://www.freelists.org/list/ilugc",
"MATURL": "https://matrix.to/#/#ilugc:libera.chat",
"TGURL": ""
}];
\ No newline at end of file
This diff is collapsed.
......@@ -10,29 +10,19 @@
},
"homepage": "https://fsug.in",
"devDependencies": {
"connect-livereload": "^0.5.4",
"glob": "^7.1.2",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.1",
"gulp-connect": "^5.0.0",
"gulp-connect-proxy": "^0.3.1",
"gulp-csslint": "^1.0.0",
"gulp-cssmin": "^0.2.0",
"gulp-htmlhint": "^0.3.1",
"gulp-jshint": "^2.0.4",
"gulp-pug": "^3.3.0",
"gulp-uglify": "^3.0.0",
"gulp-yaml-data": "^0.2.0",
"gulp-yaml-include": "^0.2.0",
"read-yaml": "^1.1.0",
"run-sequence": "^1.2.2"
"csslint": "^1.0.5",
"cssnano": "^6.0.1",
"htmlhint": "^1.1.4",
"js-yaml": "^4.1.0",
"jshint": "^2.13.6",
"postcss-cli": "^10.1.0",
"pug-cli": "^1.0.0-alpha6",
"uglify-js": "^3.17.4"
},
"dependencies": {
"Respond.js": "git+https://github.com/scottjehl/Respond.git#1.4.0",
"bootcards": "^1.1.2",
"bootcards": "git+https://github.com/bootcards/bootcards.git",
"bootstrap": "^3.3.7",
"font-awesome": "^4.7.0",
"html5shiv": "^3.7.0",
"jquery": "2.2.4",
"leaflet": "^1.0.3",
"normalize.css": "^7.0.0"
......@@ -40,6 +30,6 @@
"author": "FSCI - Free Software Community of India <fosscommunity.in@disroot.org>",
"license": "GPL-3.0",
"scripts": {
"install": "gulp public"
"build": "sh build.sh"
}
}
module.exports = {
plugins: [
require('cssnano')({
preset: 'default',
}),
],
};
\ No newline at end of file
......@@ -14,20 +14,27 @@ block content
.panel-body
.search-form
.row
.col-xs-10
.col-xs-2.col-sm-8
| &nbsp;
//-.form-group
input.form-control(type='text', placeholder='Search Contacts...')
i.fa.fa-search
.col-xs-2
a.btn.btn-primary.btn-block(href='#')
.col-xs-5.col-sm-2
a.btn.btn-primary.btn-block(href='https://git.fosscommunity.in/community/fsci.org.in/tree/master/events/details' target='_blank')
i.fa.fa-plus
span Add
.col-xs-5.col-sm-2
a.btn.btn-primary.btn-block(href='http://fsci.org.in')
i.fa.fa-plus
span Back
// panel body
.list-group
// list of sample data
for event in events.events
for event in events
a.list-group-item.events-list.separator(href='/events/' + event.id + '.html')
img.img-rounded.pull-left(src=event.imgurl)
h4.list-group-item-heading= event.name
p.list-group-item-text!= event.locationame
p.list-group-item-text!= event.when
//- for event in sortedEvents
h4.list-group-item-heading=event.id
......@@ -27,7 +27,7 @@ block content
a.list-group-item(href='/events/' + event.lat + '.' + event.lng + '.html')
img.img-rounded.pull-left(src=event.imgurl)
h4.list-group-item-heading= event.name
p.list-group-item-text!= event.locationame
p.list-group-item-text!= event.venue + ', ' + event.district
.col-sm-12.bootcards-cards
// contact details
#contact-card.event-card.col-sm-4
......@@ -41,28 +41,31 @@ block content
.list-group
.list-group-item.separator-top
label= "NAME"
h4.list-group-item-heading= evt.name
h4.list-group-item-heading= name
.list-group-item.separator
label= "LOCATION"
if (evt.lat != "" && evt.lng != "")
a(href="http://www.openstreetmap.org/?mlat=" + evt.lat + "&mlon=" + evt.lng + "&ref=FSCI")
h4.list-group-item-heading= evt.locationame
if (lat != "" && lng != "")
a(href="http://www.openstreetmap.org/?mlat=" + lat + "&mlon=" + lng + "&ref=FSCI")
h4.list-group-item-heading= venue + ', ' + district
else
h4.list-group-item-heading= evt.locationame
h4.list-group-item-heading= venue + ', ' + district
.list-group-item.separator
label= "ORGANIZED BY"
h4.list-group-item-heading= evt.organizedby
h4.list-group-item-heading= organizedby
.list-group-item.separator
label= "DATETIME"
h4.list-group-item-heading= evt.when
.list-group-item.separator
label= "CONTACT INFO"
h4.list-group-item-heading= evt.contactinfo
h4.list-group-item-heading= when
if (contactinfo != "")
.list-group-item.separator
label= "CONTACT INFO"
h4.list-group-item-heading= contactinfo
#description-card.event-card.col-sm-8
.panel.panel-default.bootcards-richtext.event-details
.panel-heading
h3.panel-title Description
.panel-body!= evt.description
a.btn.btn-primary.pull-right(href='http://fsci.org.in/events')
span Back
.panel-body!= description
p.lead
img(src=evt.imgurl, alt=evt.name)
img(src=imgurl, alt=name)
npx htmlhint public/*.html
npx csslint css/*.css
npx jshint js/*.js
\ No newline at end of file