├── .gitignore ├── Procfile ├── views ├── error.pug ├── layout.pug └── index.pug ├── portfolios ├── joshuadavidson.js ├── scrabill.js ├── jsoranno.js ├── aspen.js ├── beemtz.js ├── carmenw.js ├── natalieb.js ├── shanisebarona.js ├── valeriaoshiro.js ├── ryanwaite.js └── cmgorton.js ├── public └── stylesheets │ └── style.css ├── package.json ├── app.js ├── routes └── index.js ├── bin └── www └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: ./bin/www -------------------------------------------------------------------------------- /views/error.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | h1= message 5 | h2= error.status 6 | pre #{error.stack} 7 | -------------------------------------------------------------------------------- /portfolios/joshuadavidson.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Joshua Davidson", 3 | "oldURL": "https://jwaynedavidson.com/", 4 | "newURL": "" 5 | } 6 | -------------------------------------------------------------------------------- /portfolios/scrabill.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Shannon", 3 | "oldURL": "https://scrabill.github.io", 4 | "newURL": "http://shannoncrabill.com/" 5 | } 6 | -------------------------------------------------------------------------------- /portfolios/jsoranno.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Juanita Soranno", 3 | "oldURL": "http://www.jsoranno.com", 4 | "newURL": "http://www.jsoranno.com" 5 | } 6 | -------------------------------------------------------------------------------- /portfolios/aspen.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Aspen Hollyer", 3 | "oldURL": "https://ahollyer.github.io/portfolio/", 4 | "newURL": "http://www.aspenhollyer.com" 5 | } 6 | -------------------------------------------------------------------------------- /portfolios/beemtz.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Bee", 3 | "oldURL": "https://beemtz.github.io", 4 | "newURL": " /*URL for your professional portfolio here!*/ " 5 | } 6 | -------------------------------------------------------------------------------- /portfolios/carmenw.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Carmen W.", 3 | "oldURL": "https://carmenwright.github.io/carmenwright/", 4 | "newURL": "http://carmenwright.xyz" 5 | } 6 | -------------------------------------------------------------------------------- /portfolios/natalieb.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Natalie B.", 3 | "oldURL": "https://baker-natalie.github.io/NatalieBaker", 4 | "newURL": "http://ohcodinglady.com" 5 | } -------------------------------------------------------------------------------- /portfolios/shanisebarona.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Shanise Barona", 3 | "oldURL": "http://www.shanisebarona.com", 4 | "newURL": "http://www.shanisebarona.com" 5 | } 6 | -------------------------------------------------------------------------------- /portfolios/valeriaoshiro.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Valeria Oshiro", 3 | "oldURL": "http://valeriaoshiro.com/oldPortfolio/", 4 | "newURL": "http://valeriaoshiro.com" 5 | } 6 | -------------------------------------------------------------------------------- /views/layout.pug: -------------------------------------------------------------------------------- 1 | doctype html 2 | html 3 | head 4 | title= title 5 | link(rel='stylesheet', href='/stylesheets/style.css') 6 | body 7 | block content 8 | -------------------------------------------------------------------------------- /portfolios/ryanwaite.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ryan Waite", 3 | "oldURL": "https://ryanwaite28.github.io/resume-site/index.html", 4 | "newURL": "https://ryanwaite28.github.io/resume/" 5 | } -------------------------------------------------------------------------------- /portfolios/cmgorton.js: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Christina Gorton", 3 | "oldURL": "https://cmgorton.github.io/First_Portfolio/", 4 | "newURL": "https://cmgorton.github.io/First_Portfolio/" 5 | } 6 | -------------------------------------------------------------------------------- /public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | header { 2 | height: 100px; 3 | text-align: center; 4 | border-bottom: 1px solid black; 5 | } 6 | 7 | iframe { 8 | width: 100%; 9 | height: 80vh; 10 | border: none; 11 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "portfoliogallery", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "debug": "~2.2.0", 10 | "express": "~4.14.0", 11 | "fs": "0.0.1-security", 12 | "morgan": "~1.7.0", 13 | "pug": "^2.0.0-beta11" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /views/index.pug: -------------------------------------------------------------------------------- 1 | extends layout 2 | 3 | block content 4 | header 5 | h1 Choose a Portfolio 6 | select(id="list" onchange="displayPortfolio()") 7 | option(value="" disabled selected hidden) Choose a page 8 | for portfolio, i in portfolios 9 | option(value=portfolios[i].oldURL) #{portfolios[i].name} 10 | 11 | div(id="display") 12 | script. 13 | function displayPortfolio() { 14 | document.getElementById('display').innerHTML=''; 15 | var iframe = document.createElement('iframe'); 16 | iframe.src = document.getElementById('list').value; 17 | document.getElementById('display').appendChild(iframe); 18 | }; -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var path = require('path'); 3 | var logger = require('morgan'); 4 | var index = require('./routes/index'); 5 | var app = express(); 6 | 7 | // view engine setup 8 | app.set('views', path.join(__dirname, 'views')); 9 | app.set('view engine', 'pug'); 10 | 11 | // uncomment after placing your favicon in /public 12 | //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico'))); 13 | app.use(logger('dev')); 14 | app.use(express.static(path.join(__dirname, 'public'))); 15 | 16 | app.use('/', index); 17 | 18 | // catch 404 and forward to error handler 19 | app.use(function(req, res, next) { 20 | var err = new Error('Not Found'); 21 | err.status = 404; 22 | next(err); 23 | }); 24 | 25 | // error handler 26 | app.use(function(err, req, res, next) { 27 | // set locals, only providing error in development 28 | res.locals.message = err.message; 29 | res.locals.error = req.app.get('env') === 'development' ? err : {}; 30 | 31 | // render the error page 32 | res.status(err.status || 500); 33 | res.render('error'); 34 | }); 35 | 36 | module.exports = app; 37 | -------------------------------------------------------------------------------- /routes/index.js: -------------------------------------------------------------------------------- 1 | //all our dependencies 2 | var express = require('express'); 3 | var router = express.Router(); 4 | var fs = require('fs'); 5 | var path = require('path'); 6 | 7 | //our display function grabs the files merged from each contributor, reads them, and pushes the data to an array that we use to build the page 8 | function display() { 9 | var directory = './portfolios/'; 10 | var fileList = []; 11 | var portfolios = []; 12 | //get the list of files we will be using 13 | fs.readdir(directory, function(err, files) { 14 | if (err) return; 15 | files.forEach(function(f) { 16 | fileList.push(f); 17 | }); 18 | //read each file and convert it to json 19 | fileList.forEach(function(p) { 20 | var file = directory + p; 21 | var portfolio = JSON.parse(fs.readFileSync(file, 'utf8')); 22 | portfolios.push(portfolio); 23 | }) 24 | //generate the page, iterate the information from the files in the page 25 | router.get('/', function(req, res, next) { 26 | res.render('index', { title: 'Portfolio Gallery', portfolios: portfolios }); 27 | }); 28 | }); 29 | } 30 | //set it all in motion! 31 | display(); 32 | module.exports = router; -------------------------------------------------------------------------------- /bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('portfoliogallery:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '3000'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # first-portfolios 2 | 3 | # How to submit your portfolio: 4 | 1. Make sure your portfolio is hosted. We recommend you host with Github pages or Firebase. [Github pages is easy and free](https://pages.github.com/), [Firebase](https://firebase.google.com/docs/hosting/quickstart) is also good for quickly deploying a website. Host your first portfolio with one of these methods separately from your professional portfolio so it can stay the same indefinitely and remain a point of comparison to all the new things you will accomplish! You will also be able to add a link to your current portfolio to easily compare. 5 | 2. Grab the link to your first portfolio. 6 | 3. Fork the [repository for the project](https://github.com/codetteclub/first-portfolios). 7 | Now that you have the link to your portfolio, you will need to fork the repository for the project. 8 | You will start at https://github.com/codetteclub/first-portfolios. At the upper-right of the screen, click the button that says “fork”. Follow this template to create a file with your portfolio information: 9 | ``` 10 | { 11 | "name": "YOUR NAME HERE", 12 | "oldURL": "http://www.YOURFIRSTPORTFOLIOURLHERE.com", 13 | "newURL": "http://www.YOURNEWPORTFOLIOURLHERE.com" 14 | } 15 | ``` 16 | save this file as `YOURNAME.js` within the portfolios folder in your fork of the repository. Once you have committed the new file, you will be ready to start your pull request! 17 | Commit your file to the portfolios folder within your fork of the project. 18 | 4. Submit your pull request! Go to the master repository and select the button that says “New pull request.” 19 | The Compare Changes page will load, and you will need to select “compare across forks.” The base fork should be the master repository, the head fork will the version that you are submitting. Click the green “Create pull request” button. 20 | On the next page you will need to fill in at least the title, and optionally add more information about your pull request. A title describing your filename will be plenty of info for this contribution. Once you have filled in that information, you can click the next green “Create pull request” button. 21 | 5. That’s it! Now just relax and wait for your submission to be merged! 22 | 23 | 24 | 25 | Woohoo! You did it! Go you! 26 | --------------------------------------------------------------------------------