mirror of
https://github.com/dilllxd/gitfolio.git
synced 2024-08-14 22:28:09 +00:00
v0.1.3
-added cli support (thanks @rohit-smpx) -arguments for fork -you can now sort and order repos -fixed bugs
This commit is contained in:
parent
81e8302b22
commit
6fb6408534
13 changed files with 1853 additions and 1056 deletions
45
README.md
45
README.md
|
@ -11,31 +11,29 @@ Check out this [live demo](https://imfunniee.github.io/gitfolio/) to see gitfoli
|
|||
|
||||
# Getting Started
|
||||
|
||||
### Let's Install
|
||||
|
||||
Install gitfolio
|
||||
|
||||
```sh
|
||||
npm i -g gitfolio
|
||||
```
|
||||
|
||||
### Let's Build
|
||||
|
||||
a. Clone this repo or simply download it.
|
||||
```sh
|
||||
git clone https://github.com/imfunniee/gitfolio.git
|
||||
gitfolio build <username>
|
||||
```
|
||||
This will build your website using your GitHub username and put it in the `/dist` folder.
|
||||
|
||||
b. `cd` into the repo you just cloned or downloaded.
|
||||
```sh
|
||||
cd gitfolio # Navigate into the project folder
|
||||
npm i # Install the required dependencies
|
||||
```
|
||||
|
||||
c. Gitfolio is now ready to be used. The command
|
||||
To run your website use `run` command
|
||||
|
||||
```sh
|
||||
node build --name [username]
|
||||
gitfolio build <username>
|
||||
```
|
||||
Will build your website using your GitHub username and put it in the `dist/` folder.
|
||||
|
||||
d. To run your website navigate to `./dist/index.html` in your browser. [you won't see blogs until you are on localhost]
|
||||
|
||||
🎉 Congrats, you just made yourself a personal website!
|
||||
|
||||
> if you get stuck somewhere or get an error, please create an issue
|
||||
|
||||
### Let's Customize
|
||||
|
||||
|
@ -44,7 +42,7 @@ d. To run your website navigate to `./dist/index.html` in your browser. [you won
|
|||
To include forks on your personal website just provide `-f` or `--fork` argument while building
|
||||
|
||||
```
|
||||
$ node build --name username -f
|
||||
$ gitfolio build username -f
|
||||
```
|
||||
|
||||
#### Sorting Repos
|
||||
|
@ -52,7 +50,7 @@ $ node build --name username -f
|
|||
To sort repos provide `--sort [sortBy]` argument while building. Where `[sortBy]` can be `star`, `created`, `updated`, `pushed`,`full_name`. Default: `created`
|
||||
|
||||
```
|
||||
$ node build --name username --sort star
|
||||
$ gitfolio build username --sort star
|
||||
```
|
||||
|
||||
#### Ordering Repos
|
||||
|
@ -60,7 +58,7 @@ $ node build --name username --sort star
|
|||
To order the sorted repos provide `--order [orderBy]` argument while building. Where `[orderBy]` can be `asc` or `desc`. Default: `asc`
|
||||
|
||||
```
|
||||
$ node build --name username --sort star --order desc
|
||||
$ gitfolio build username --sort star --order desc
|
||||
```
|
||||
|
||||
#### Customize Themes
|
||||
|
@ -73,7 +71,7 @@ Themes are specified using the `--theme [theme-name]` flag when running the `bui
|
|||
|
||||
For example, the following command will build the website with the dark theme
|
||||
```
|
||||
$ node build --name username --theme dark
|
||||
$ gitfolio build username --theme dark
|
||||
```
|
||||
|
||||
#### Customize background image
|
||||
|
@ -81,7 +79,7 @@ $ node build --name username --theme dark
|
|||
To customize the background image just provide `--background [url]` argument while building
|
||||
|
||||
```
|
||||
$ node build --name username --background https://images.unsplash.com/photo-1557277770-baf0ca74f908?w=1634
|
||||
$ gitfolio build username --background https://images.unsplash.com/photo-1557277770-baf0ca74f908?w=1634
|
||||
```
|
||||
|
||||
You could also add in your custom CSS inside `index.css` to give it a more personal feel.
|
||||
|
@ -99,7 +97,7 @@ Go To `username.github.io` your site should be up!!
|
|||
To update your info, simply run
|
||||
|
||||
```
|
||||
$ node update
|
||||
$ gitfolio update
|
||||
```
|
||||
This will update your info and your repository info.
|
||||
|
||||
|
@ -111,7 +109,7 @@ To Update background or theme you need to run `build` command again.
|
|||
To add your first blog run this command.
|
||||
|
||||
```
|
||||
$ node blog --title my-first-blog
|
||||
$ gitfolio blog my-first-blog
|
||||
```
|
||||
> (use "-" instead of spaces)
|
||||
|
||||
|
@ -142,11 +140,12 @@ More Arguments for Blog
|
|||
|
||||
> (use "-" instead of spaces)
|
||||
|
||||
|
||||
## Support
|
||||
|
||||
Support me by buying me a coffee ☕
|
||||
Support me to make more projects like this by Buying me a Coffee ☕
|
||||
|
||||
<a href="https://www.buymeacoffee.com/imfunniee" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
|
||||
<a href="https://www.buymeacoffee.com/imfunniee" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;"></a>
|
||||
|
||||
## License
|
||||
![GitHub](https://img.shields.io/github/license/imfunniee/gitfolio.svg)
|
||||
|
|
|
@ -287,6 +287,7 @@ body{
|
|||
font-size:24px;
|
||||
font-weight:bold;
|
||||
margin:1vh 0px;
|
||||
padding:0px 1px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ process.env.OUT_DIR = process.env.OUT_DIR || process.cwd();
|
|||
const {buildCommand} = require('../build');
|
||||
const {updateCommand} = require('../update');
|
||||
const {blogCommand} = require('../blog');
|
||||
const {runCommand} = require('../run');
|
||||
const {version} = require('../package.json');
|
||||
|
||||
program
|
||||
|
@ -21,6 +22,7 @@ program
|
|||
|
||||
program
|
||||
.command('update')
|
||||
.description('Update user and repository data')
|
||||
.action(updateCommand);
|
||||
|
||||
program
|
||||
|
@ -31,6 +33,11 @@ program
|
|||
.option('-f, --folder [folder]', 'give folder a title (use "-" instead of spaces)')
|
||||
.action(blogCommand);
|
||||
|
||||
program
|
||||
.command('run')
|
||||
.description('Run build files')
|
||||
.action(runCommand);
|
||||
|
||||
program.on('command:*', () => {
|
||||
console.log('Unknown Command: ' + program.args.join(' '))
|
||||
program.help()
|
||||
|
|
2
blog.js
2
blog.js
|
@ -64,5 +64,5 @@ function blogCommand(title, program) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
blogCommand,
|
||||
blogCommand
|
||||
};
|
||||
|
|
2
build.js
2
build.js
|
@ -83,5 +83,5 @@ async function buildCommand(username, program) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
buildCommand,
|
||||
buildCommand
|
||||
};
|
||||
|
|
764
package-lock.json
generated
764
package-lock.json
generated
File diff suppressed because it is too large
Load diff
10
package.json
10
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "gitfolio",
|
||||
"version": "0.1.2",
|
||||
"description": "portfolio website for showcasing your work",
|
||||
"version": "0.1.3",
|
||||
"description": "a portfolio website for everyone to showcase your work",
|
||||
"main": "build.js",
|
||||
"bin": "bin/gitfolio.js",
|
||||
"scripts": {
|
||||
|
@ -34,9 +34,13 @@
|
|||
"dependencies": {
|
||||
"bluebird": "^3.5.4",
|
||||
"commander": "^2.20.0",
|
||||
"express": "^4.17.0",
|
||||
"github-emoji": "^1.1.0",
|
||||
"got": "^9.6.0",
|
||||
"handlebars": "^4.1.2",
|
||||
"jsdom": "^15.1.0"
|
||||
"jsdom": "^15.1.0",
|
||||
"ncp": "^2.0.0",
|
||||
"open": "^6.3.0",
|
||||
"x-default-browser": "^0.4.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ module.exports.updateHTML = (username, sort, order, includeFork) => {
|
|||
});
|
||||
fs.writeFile(`${outDir}/index.html`, '<!DOCTYPE html>' + window.document.documentElement.outerHTML, function (error) {
|
||||
if (error) throw error;
|
||||
console.log("Build Complete");
|
||||
console.log(`Build Complete, Files can be Found @ ${outDir}`);
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
|
25
run.js
Normal file
25
run.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const express = require('express');
|
||||
const open = require('open');
|
||||
const defaultBrowser = require('x-default-browser');
|
||||
const app = express();
|
||||
app.use(express.static(__dirname + '/dist'));
|
||||
|
||||
function runCommand(){
|
||||
app.get('/',function(req,res){
|
||||
res.sendFile('/index.html');
|
||||
});
|
||||
|
||||
app.listen(3000);
|
||||
|
||||
defaultBrowser(function (err, res) {
|
||||
if(err) throw err;
|
||||
(async () => {
|
||||
await open('http://localhost:3000', {app: res.commonName});
|
||||
console.log("ctrl + c to exit");
|
||||
})();
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
runCommand
|
||||
};
|
|
@ -1,5 +1,4 @@
|
|||
const fs = require('fs');
|
||||
const {getConfig, outDir} = require('./utils');
|
||||
const {getConfig} = require('./utils');
|
||||
const {updateHTML} = require('./populate');
|
||||
|
||||
async function updateCommand() {
|
||||
|
@ -16,5 +15,5 @@ async function updateCommand() {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
updateCommand,
|
||||
updateCommand
|
||||
};
|
||||
|
|
2
utils.js
2
utils.js
|
@ -35,5 +35,5 @@ async function getBlog() {
|
|||
module.exports = {
|
||||
outDir,
|
||||
getConfig,
|
||||
getBlog,
|
||||
getBlog
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue