mirror of
https://github.com/dilllxd/gitfolio.git
synced 2024-08-14 22:28:09 +00:00
Compare commits
183 commits
Author | SHA1 | Date | |
---|---|---|---|
2a3ccb5fcc | |||
a3368e34de | |||
07d210a2d5 | |||
6087e82ed1 | |||
6775659805 | |||
bc1b663d85 | |||
3fcdd8dfbd | |||
587d3d5f9c | |||
dc41ec356d | |||
086c0b19f4 | |||
5e85454348 | |||
1092195636 | |||
f29fdb9d71 | |||
7e478ecb0b | |||
b723da73ac | |||
f4eb0d09a3 | |||
4546cfc5be | |||
b6f9533a48 | |||
6fda3aada7 | |||
65ffcbf282 | |||
|
e0cd4e7e27 | ||
|
d499e36a74 | ||
|
f531548dec | ||
|
bd77188234 | ||
|
6617e831be | ||
|
485228f478 | ||
|
1fa84682ab | ||
|
d22615b0bc | ||
|
e8fb5b9e99 | ||
|
a1654306c6 | ||
|
a63bfe8b3f | ||
|
ea74a4ebaf | ||
|
3b77914839 | ||
|
2062489add | ||
|
aee258ff86 | ||
|
b33a6cdfb6 | ||
|
bd24174740 | ||
|
f4265e9848 | ||
|
ea517d5669 | ||
|
fc03761011 | ||
|
22541b9b3a | ||
|
758c3fddab | ||
|
d12bbe098f | ||
|
19644e86e0 | ||
|
febff4bb15 | ||
|
e22821a069 | ||
|
7e94343a75 | ||
|
4e6d12c97d | ||
|
52d976bc6b | ||
|
1226782b7f | ||
|
523521ea35 | ||
|
6a240bfed2 | ||
|
06a46c6beb | ||
|
24ae2e2356 | ||
|
ef1da752cd | ||
|
58a532d9a0 | ||
|
bf99035e7b | ||
|
97b61562c3 | ||
|
f6abb534a4 | ||
|
4b805dbe8a | ||
|
6cfe38774f | ||
|
f7354ba21f | ||
|
bac9a7e544 | ||
|
188b7699de | ||
|
17f390ed21 | ||
|
e513201a43 | ||
|
50a34fe8be | ||
|
d96308f1b3 | ||
|
a4f8717808 | ||
|
d774aee774 | ||
|
9302865ef3 | ||
|
80709a6a9e | ||
|
89179accc4 | ||
|
22aea37d3b | ||
|
5f7758b6f5 | ||
|
5a630ea3eb | ||
|
5218c959c8 | ||
|
f8ec76b7b6 | ||
|
d49d72483e | ||
|
85b58e2bf7 | ||
|
1c7fbe09b6 | ||
|
ee3ccb26ab | ||
|
566c7aea3a | ||
|
4687ff2e3e | ||
|
957ada3ea7 | ||
|
b7a21d8bd7 | ||
|
631fd62912 | ||
|
0e9a022c2a | ||
|
ef563330a4 | ||
|
8af465f46e | ||
|
a9198c274f | ||
|
4931a6a893 | ||
|
62b9ee4e5d | ||
|
9dd8f0ff82 | ||
|
85835e6167 | ||
|
c247ead4f4 | ||
|
5d963803be | ||
|
5e512a6ce5 | ||
|
45b3e5fe0b | ||
|
644b39dd12 | ||
|
44e28393cf | ||
|
ff2c5541c3 | ||
|
6ccbc0c681 | ||
|
0e1b7ba9af | ||
|
efe64030d5 | ||
|
517e20f9e5 | ||
|
8527e9bfdf | ||
|
723c6925ed | ||
|
ebb5785ea0 | ||
|
608f348cb5 | ||
|
ef3d9c94ee | ||
|
b2b2458fd6 | ||
|
0775b863f1 | ||
|
cecc8c82ad | ||
|
c06df995a6 | ||
|
fbe2858630 | ||
|
ec65c58c08 | ||
|
624b31969a | ||
|
327e0a93aa | ||
|
711de48493 | ||
|
fa52f9f981 | ||
|
0741978b3f | ||
|
030e52b340 | ||
|
1de7fd23ef | ||
|
0e90c885d1 | ||
|
5717f17eff | ||
|
870758aa69 | ||
|
39ffee2944 | ||
|
4ded27c56f | ||
|
5eb4e66567 | ||
|
163944c9b6 | ||
|
7f8f627565 | ||
|
03cba16e97 | ||
|
663e4fe104 | ||
|
44a7c4d8e9 | ||
|
c580732754 | ||
|
312ef4bc6d | ||
|
5d6fb31047 | ||
|
ee354ae852 | ||
|
4a2872171d | ||
|
d3136fb829 | ||
|
d47fc6c269 | ||
|
aac4592673 | ||
|
c772b6b47c | ||
|
6c0d2b1db6 | ||
|
2cc403b95c | ||
|
396817fad4 | ||
|
e48e55e593 | ||
|
4e7446c52a | ||
|
17cd85327b | ||
|
de728e75bd | ||
|
cb5bba6ba0 | ||
|
af801b40f9 | ||
|
5e3a931161 | ||
|
5848390bdb | ||
|
6a23ee1d80 | ||
|
9c5655eab8 | ||
|
8fcee176c4 | ||
|
8441691434 | ||
|
1341be7e39 | ||
|
88b29ab754 | ||
|
cbd7aeb88d | ||
|
df740ac8c4 | ||
|
fa3fac0dc0 | ||
|
fb00959194 | ||
|
b2b757442f | ||
|
6fb6408534 | ||
|
81e8302b22 | ||
|
438f80ee08 | ||
|
e62e4c05b3 | ||
|
2ec61a9132 | ||
|
7524dd4839 | ||
|
8feb05f808 | ||
|
b194b6758b | ||
|
911a23c2c2 | ||
|
1bdf9ef7d2 | ||
|
52014e1cd5 | ||
|
d84d6fd2b4 | ||
|
3a1731c776 | ||
|
5ff9146ff5 | ||
|
e7fed0a3d7 | ||
|
68039f0e4a | ||
|
9a10b06385 |
37 changed files with 9396 additions and 2763 deletions
17
.eslintrc.json
Normal file
17
.eslintrc.json
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"globals": {
|
||||||
|
"Atomics": "readonly",
|
||||||
|
"SharedArrayBuffer": "readonly"
|
||||||
|
},
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2018,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
}
|
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Set the default behavior, in case people don't have core.autocrlf set
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
# Require Unix line endings
|
||||||
|
* text eol=lf
|
4
.github/ISSUE_TEMPLATE/feature-request.md
vendored
4
.github/ISSUE_TEMPLATE/feature-request.md
vendored
|
@ -5,8 +5,8 @@ about: Request a new feature.
|
||||||
|
|
||||||
# What feature should be added?
|
# What feature should be added?
|
||||||
|
|
||||||
<!-- Explain what the feature is here -->
|
This feature adds Twitter, Linkedin and Medium links to your profile.
|
||||||
|
|
||||||
# Why should this feature be added?
|
# Why should this feature be added?
|
||||||
|
|
||||||
<!-- Provide information on what improvements this feature brings -->
|
Since a portfolio is being made, adding these links help improve the profile better.
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -64,4 +64,5 @@ typings/
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
# Editor files and folders
|
# Editor files and folders
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
|
17
.prettierrc.json
Normal file
17
.prettierrc.json
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.html", "*.ejs"],
|
||||||
|
"options": {
|
||||||
|
"parser": "html",
|
||||||
|
"htmlWhitespaceSensitivity": "ignore"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": "*.md",
|
||||||
|
"options": {
|
||||||
|
"tabWidth": 4
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
4
.snyk
Normal file
4
.snyk
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||||
|
version: v1.13.5
|
||||||
|
ignore: {}
|
||||||
|
patch: {}
|
3
.stylelintrc.json
Normal file
3
.stylelintrc.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"extends": ["stylelint-config-standard", "stylelint-prettier/recommended"]
|
||||||
|
}
|
26
.travis.yml
Normal file
26
.travis.yml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
dist: bionic
|
||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- 11
|
||||||
|
addons:
|
||||||
|
chrome: stable
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- node_modules
|
||||||
|
before_install:
|
||||||
|
- npm install -g @lhci/cli@0.3.x
|
||||||
|
before_script:
|
||||||
|
- npm install -g
|
||||||
|
script:
|
||||||
|
- npm run build
|
||||||
|
- npm run prettier
|
||||||
|
after_success:
|
||||||
|
- lhci autorun --upload.target=temporary-public-storage
|
||||||
|
deploy:
|
||||||
|
provider: pages
|
||||||
|
token: $GITHUB_TOKEN
|
||||||
|
cleanup: false
|
||||||
|
edge: true # opt in to dpl v2
|
||||||
|
local_dir: dist
|
||||||
|
verbose: true
|
||||||
|
fqdn: dylanh.dev # forcing run
|
|
@ -1,76 +1,76 @@
|
||||||
# Contributor Covenant Code of Conduct
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
## Our Pledge
|
## Our Pledge
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
contributors and maintainers pledge to making participation in our project and
|
contributors and maintainers pledge to making participation in our project and
|
||||||
our community a harassment-free experience for everyone, regardless of age, body
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||||
level of experience, education, socio-economic status, nationality, personal
|
level of experience, education, socio-economic status, nationality, personal
|
||||||
appearance, race, religion, or sexual identity and orientation.
|
appearance, race, religion, or sexual identity and orientation.
|
||||||
|
|
||||||
## Our Standards
|
## Our Standards
|
||||||
|
|
||||||
Examples of behavior that contributes to creating a positive environment
|
Examples of behavior that contributes to creating a positive environment
|
||||||
include:
|
include:
|
||||||
|
|
||||||
* Using welcoming and inclusive language
|
- Using welcoming and inclusive language
|
||||||
* Being respectful of differing viewpoints and experiences
|
- Being respectful of differing viewpoints and experiences
|
||||||
* Gracefully accepting constructive criticism
|
- Gracefully accepting constructive criticism
|
||||||
* Focusing on what is best for the community
|
- Focusing on what is best for the community
|
||||||
* Showing empathy towards other community members
|
- Showing empathy towards other community members
|
||||||
|
|
||||||
Examples of unacceptable behavior by participants include:
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
advances
|
advances
|
||||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
* Public or private harassment
|
- Public or private harassment
|
||||||
* Publishing others' private information, such as a physical or electronic
|
- Publishing others' private information, such as a physical or electronic
|
||||||
address, without explicit permission
|
address, without explicit permission
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
- Other conduct which could reasonably be considered inappropriate in a
|
||||||
professional setting
|
professional setting
|
||||||
|
|
||||||
## Our Responsibilities
|
## Our Responsibilities
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of acceptable
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
behavior and are expected to take appropriate and fair corrective action in
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
response to any instances of unacceptable behavior.
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
Project maintainers have the right and responsibility to remove, edit, or
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
permanently any contributor for other behaviors that they deem inappropriate,
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
threatening, offensive, or harmful.
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
## Scope
|
## Scope
|
||||||
|
|
||||||
This Code of Conduct applies both within project spaces and in public spaces
|
This Code of Conduct applies both within project spaces and in public spaces
|
||||||
when an individual is representing the project or its community. Examples of
|
when an individual is representing the project or its community. Examples of
|
||||||
representing a project or community include using an official project e-mail
|
representing a project or community include using an official project e-mail
|
||||||
address, posting via an official social media account, or acting as an appointed
|
address, posting via an official social media account, or acting as an appointed
|
||||||
representative at an online or offline event. Representation of a project may be
|
representative at an online or offline event. Representation of a project may be
|
||||||
further defined and clarified by project maintainers.
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
reported by contacting the project team at imfunny@wybemf.com. All
|
reported by contacting the project team at imfunny@wybemf.com. All
|
||||||
complaints will be reviewed and investigated and will result in a response that
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
is deemed necessary and appropriate to the circumstances. The project team is
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
Further details of specific enforcement policies may be posted separately.
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
faith may face temporary or permanent repercussions as determined by other
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
members of the project's leadership.
|
members of the project's leadership.
|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
|
||||||
|
|
||||||
[homepage]: https://www.contributor-covenant.org
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see
|
For answers to common questions about this code of conduct, see
|
||||||
https://www.contributor-covenant.org/faq
|
<https://www.contributor-covenant.org/faq>
|
||||||
|
|
321
README.md
321
README.md
|
@ -1,146 +1,175 @@
|
||||||
<img src="https://i.imgur.com/eA6clZr.png">
|
[](https://travis-ci.com/dilllxd/gitfolio)
|
||||||
|
[](https://github.com/prettier/prettier)
|
||||||
# Gitfolio [](https://twitter.com/intent/tweet?text=personal%20website%20and%20a%20blog%20for%20every%20github%20user%20&url=https://github.com/imfunniee/gitfolio)    
|
[](https://github.com/imfunniee/gitfolio/releases/latest)
|
||||||
|
|
||||||
### personal website + blog for every github user
|
# Gitfolio
|
||||||
|
|
||||||
Gitfolio will help you get started with a portfolio website where you could showcase your work + a blog that will help you spread your ideas into real world.
|
### personal website + blog for every github user
|
||||||
|
|
||||||
Check out this [live demo](https://imfunniee.github.io/gitfolio/) to see gitfolio in action.
|
Gitfolio will help you get started with a portfolio website where you could showcase your work + a blog that will help you spread your ideas into real world.
|
||||||
|
|
||||||
|
<img src="https://i.imgur.com/eA6clZr.png">
|
||||||
# Getting Started
|
|
||||||
|
---
|
||||||
### Let's Build
|
|
||||||
|
Check out this [live demo](https://k4ustu3h.cf) to see gitfolio in action.
|
||||||
a. Clone this repo or simply download it.
|
|
||||||
```sh
|
---
|
||||||
git clone https://github.com/imfunniee/gitfolio.git
|
|
||||||
```
|
# Getting Started
|
||||||
|
|
||||||
b. `cd` into the repo you just cloned or downloaded.
|
### Let's Install
|
||||||
```sh
|
|
||||||
cd gitfolio # Navigate into the project folder
|
Install gitfolio
|
||||||
npm i # Install the required dependencies
|
|
||||||
```
|
```sh
|
||||||
|
➜ ~ git clone https://github.com/k4ustu3h/gitfolio.git
|
||||||
c. Gitfolio is now ready to be used. The command
|
➜ ~ cd gitfolio
|
||||||
|
➜ ~ npm install -g
|
||||||
```sh
|
```
|
||||||
node build --name [username]
|
|
||||||
```
|
### Let's Build
|
||||||
Will build your website using your GitHub username and put it in the `dist/` folder.
|
|
||||||
|
Using the UI
|
||||||
d. To run your website navigate to `./dist/index.html` in your browser. [you won't see blogs until you are on localhost]
|
|
||||||
|
```sh
|
||||||
🎉 Congrats, you just made yourself a personal website!
|
➜ ~ gitfolio ui
|
||||||
|
```
|
||||||
> if you get stuck somewhere or get an error, please create an issue
|
|
||||||
|
> Tip: You can use ui to create new blogs and for updating your folio too.
|
||||||
### Let's Customize
|
|
||||||
|
or
|
||||||
#### Forks
|
|
||||||
|
```sh
|
||||||
To include forks on your personal website just provide `-f` or `--fork` argument while building
|
➜ ~ gitfolio build <username>
|
||||||
|
```
|
||||||
```
|
|
||||||
$ node build --name username -f
|
`<username>` is your username on github. This will build your website using your GitHub username and put it in the `/dist` folder.
|
||||||
```
|
|
||||||
|
To run your website use `run` command, Default port is 3000
|
||||||
#### Sorting Repos
|
|
||||||
|
```sh
|
||||||
To sort repos provide `--sort [sortBy]` argument while building. Where `[sort]` can be `created`, `updated`, `pushed`,`full_name`. Default: `created`
|
➜ ~ gitfolio run -p [port]
|
||||||
|
```
|
||||||
```
|
|
||||||
$ node build --name username --sort created
|
🎉 Congrats, you just made yourself a personal website!
|
||||||
```
|
|
||||||
|
---
|
||||||
#### Ordering Repos
|
|
||||||
|
### Let's Customize
|
||||||
To order the sorted repos provide `--order [orderBy]` argument while building. Where `[orderBy]` can be `asc` or `desc`. Default: `asc`
|
|
||||||
|
#### Forks
|
||||||
```
|
|
||||||
$ node build --name username --sort created --order desc
|
To include forks on your personal website just provide `-f` or `--fork` argument while building
|
||||||
```
|
|
||||||
|
```sh
|
||||||
#### Customize Themes
|
➜ ~ gitfolio build <username> -f
|
||||||
|
```
|
||||||
Themes are specified using the `--theme [theme-name]` flag when running the `build` command. The available themes are
|
|
||||||
|
#### Sorting Repos
|
||||||
* `light`
|
|
||||||
* `dark`
|
To sort repos provide `--sort [sortBy]` argument while building. Where `[sortBy]` can be `star`, `created`, `updated`, `pushed`,`full_name`. Default: `created`
|
||||||
> TODO: Add more themes
|
|
||||||
|
```sh
|
||||||
For example, the following command will build the website with the dark theme
|
➜ ~ gitfolio build <username> --sort star
|
||||||
```
|
```
|
||||||
$ node build --name username --theme dark
|
|
||||||
```
|
#### Ordering Repos
|
||||||
|
|
||||||
#### Customize background image
|
To order the sorted repos provide `--order [orderBy]` argument while building. Where `[orderBy]` can be `asc` or `desc`. Default: `asc`
|
||||||
|
|
||||||
To customize the background image just provide `--background [url]` argument while building
|
```sh
|
||||||
|
➜ ~ gitfolio build <username> --sort star --order desc
|
||||||
```
|
```
|
||||||
$ node build --name username --background https://images.unsplash.com/photo-1557277770-baf0ca74f908?w=1634
|
|
||||||
```
|
#### Customize Themes
|
||||||
|
|
||||||
You could also add in your custom CSS inside `index.css` to give it a more personal feel.
|
Themes are specified using the `--theme [theme-name]` flag when running the `build` command. The available themes are
|
||||||
|
|
||||||
|
- `light`
|
||||||
### Let's Publish
|
- `dark`
|
||||||
|
|
||||||
Head over to GitHub and create a new repository named `username.github.io`, where username is your username. Push the files inside`/dist` folder to repo you just created.
|
> TODO: Add more themes
|
||||||
|
|
||||||
Go To `username.github.io` your site should be up!!
|
For example, the following command will build the website with the dark theme
|
||||||
|
|
||||||
|
```sh
|
||||||
### Updating
|
➜ ~ gitfolio build <username> --theme dark
|
||||||
|
```
|
||||||
To update your info, simply run
|
|
||||||
|
#### Customize background image
|
||||||
```
|
|
||||||
$ node update
|
To customize the background image just provide `--background [url]` argument while building
|
||||||
```
|
|
||||||
This will update your info and your repository info.
|
```sh
|
||||||
|
➜ ~ gitfolio build <username> --background https://images.unsplash.com/photo-1557277770-baf0ca74f908?w=1634
|
||||||
To Update background or theme you need to run `build` command again.
|
```
|
||||||
|
|
||||||
|
You could also add in your custom CSS inside `index.css` to give it a more personal feel.
|
||||||
### Add a Blog
|
|
||||||
|
#### Add Social Media links on your profile
|
||||||
To add your first blog run this command, make sure the title don't have spaces instead use "-".
|
|
||||||
|
gitfolio supports adding the follwing Social links
|
||||||
```
|
|
||||||
$ node blog --title my-first-blog
|
- Codepen `-c, --codepen <username>`
|
||||||
```
|
- Dev.to `-d, --dev <username>`
|
||||||
|
- Dribbble `-D, --dribbble <username>`
|
||||||
This will create a `my-first-blog` folder inside `blog`. Inside `my-first-blog` you will find an `index.html` file which contains all the necessary elements for writing a blog. Customize the content of the file to write your first blog.
|
- Email `-e, --email <email>`
|
||||||
|
- Facebook `-F, --facebook <username>`
|
||||||
This also adds content to `blog.json` file. This file helps in showcasing your blogs on your personal website as [cards](https://imfunniee.github.io/gitfolio/#blog_section). You could customize the JSON object that corresponds your current blog.
|
- Instagram `-i, --instagram <username>`
|
||||||
|
- Keybase `-k, --keybase <username>`
|
||||||
Blog Demo? [here](https://imfunniee.github.io/gitfolio/blog/my-first-blog/)
|
- Medium `-m, --medium <username>`
|
||||||
|
- Reddit `-r, --reddit <username>`
|
||||||
Default JSON Format
|
- Stack Exchange `-E, --stackexchange <user id>`
|
||||||
```
|
- Steam `-S, --steam <username>`
|
||||||
{
|
- Telegram `-T, --telegram <username>`
|
||||||
"url_title": "my-first-blog", // the title you provide while creating a new blog, this appears in url
|
- Twitter `-w, --twitter <username>`
|
||||||
"title": "Lorem ipsum dolor sit amet", // main title of blog
|
- XDA Developers `-x, --xda <user id>`
|
||||||
"sub_title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", // sub-title of blog
|
|
||||||
"top_image": "https://images.unsplash.com/photo-1553748024-d1b27fb3f960?w=1450", // main image of blog
|
```sh
|
||||||
"visible": true // don't worry about this
|
➜ ~ gitfolio build <username> --twitter <twitter_username> --dribbble <dribbble_username>
|
||||||
}
|
```
|
||||||
```
|
|
||||||
|
---
|
||||||
More Arguments for Blog
|
|
||||||
|
### Let's Publish
|
||||||
```
|
|
||||||
--subtitle [subtitle] : gives blog a subtitle (Deafult : 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.')
|
Head over to GitHub and create a new repository named `username.github.io`, where username is your username. Push the files inside`/dist` folder to repo you just created.
|
||||||
--pagetitle [pagetitle] : gives blog page a title
|
|
||||||
--folder [folder] : give folder a title
|
Go To `username.github.io` your site should be up!!
|
||||||
```
|
|
||||||
|
---
|
||||||
> (use "-" instead of spaces)
|
|
||||||
|
### Updating
|
||||||
|
|
||||||
## License
|
To update your info, simply run
|
||||||

|
|
||||||
|
```sh
|
||||||
|
➜ ~ gitfolio update
|
||||||
|
```
|
||||||
|
|
||||||
|
or use the `Update` options in gitfolio's UI
|
||||||
|
|
||||||
|
This will update your info and your repository info.
|
||||||
|
|
||||||
|
To Update background or theme you need to run `build` command again.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### License
|
||||||
|
|
||||||
|
[](https://github.com/k4ustu3h/gitfolio/blob/master/LICENSE)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Acknowledgments
|
||||||
|
|
||||||
|
- Hat tip to anyone who's code was used
|
||||||
|
- The original [gitfolio](https://github.com/imfunniee/gitfolio) made by [@imfunniee](https://github.com/imfunniee/)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
[](https://github.com/topics/css)
|
||||||
|
[](https://html9responsiveboilerstrapjs.com/)
|
||||||
|
[](https://github.com/topics/html)
|
||||||
|
[](https://github.com/topics/javascript)
|
||||||
|
|
67
api.js
Normal file
67
api.js
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
const got = require("got");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The defaults here are the same as the API
|
||||||
|
* @see https://developer.github.com/v3/repos/#list-user-repositories
|
||||||
|
* @param {string} username
|
||||||
|
* @param {Object} opts
|
||||||
|
* @param {('all' | 'owner' | 'member')[]} [opts.types]
|
||||||
|
* @param {'created' | 'updated' | 'pushed' | 'full_name' | 'star'} [opts.sort]
|
||||||
|
* @param {'desc' | 'asc'} [opts.order]
|
||||||
|
*/
|
||||||
|
async function getRepos(username, opts = {}) {
|
||||||
|
let tempRepos;
|
||||||
|
let page = 1;
|
||||||
|
let repos = [];
|
||||||
|
|
||||||
|
const { sort } = opts;
|
||||||
|
const order = opts.order || (sort === "full_name" ? "asc" : "desc");
|
||||||
|
const types = opts.types || [];
|
||||||
|
let type = "all";
|
||||||
|
|
||||||
|
if (
|
||||||
|
types.includes("all") ||
|
||||||
|
(types.includes("owner") && types.includes("member"))
|
||||||
|
) {
|
||||||
|
type = "all";
|
||||||
|
} else if (types.includes("member")) {
|
||||||
|
type = "member";
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
let requestUrl = `https://api.github.com/users/${username}/repos?per_page=100&page=${page++}&type=${type}`;
|
||||||
|
if (sort && sort !== "star") {
|
||||||
|
requestUrl += `&sort=${sort}&direction=${order}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
tempRepos = await got(requestUrl);
|
||||||
|
tempRepos = JSON.parse(tempRepos.body);
|
||||||
|
repos = repos.concat(tempRepos);
|
||||||
|
} while (tempRepos.length === 100);
|
||||||
|
|
||||||
|
if (sort === "star") {
|
||||||
|
repos = repos.sort((a, b) => {
|
||||||
|
if (order === "desc") {
|
||||||
|
return b.stargazers_count - a.stargazers_count;
|
||||||
|
}
|
||||||
|
|
||||||
|
return a.stargazers_count - b.stargazers_count;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return repos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see https://developer.github.com/v3/users/#get-a-single-user
|
||||||
|
* @param {string} username
|
||||||
|
*/
|
||||||
|
async function getUser(username) {
|
||||||
|
const res = await got(`https://api.github.com/users/${username}`);
|
||||||
|
return JSON.parse(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
getRepos,
|
||||||
|
getUser
|
||||||
|
};
|
|
@ -1,9 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"url_title": "FooBar",
|
|
||||||
"title": "FooBar",
|
|
||||||
"sub_title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
||||||
"top_image": "https://images.unsplash.com/photo-1553748024-d1b27fb3f960?w=1450",
|
|
||||||
"visible": true
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -1,64 +0,0 @@
|
||||||
<!DOCTYPE html><html lang="en"><head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<title>Lorem ipsum dolor</title>
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
|
|
||||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
|
|
||||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="loading">
|
|
||||||
<div id="spinner"></div>
|
|
||||||
</div>
|
|
||||||
<a href="/" class="go_back"><i class="fas fa-arrow-left"></i></a>
|
|
||||||
<div id="background"></div>
|
|
||||||
<table id="profile_blog">
|
|
||||||
<tbody><tr>
|
|
||||||
<td style="width:8vw;"><div id="profile_img_blog"></div></td>
|
|
||||||
<td style="width:52vw;">
|
|
||||||
<div id="username_blog"></div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody></table>
|
|
||||||
<div id="blog-display">
|
|
||||||
<h1 id="blog_title">Lorem ipsum dolor</h1>
|
|
||||||
<h2 id="blog_sub_title">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h2>
|
|
||||||
<div id="blog">
|
|
||||||
<img src="https://images.unsplash.com/photo-1553748024-d1b27fb3f960?w=1450">
|
|
||||||
<p>
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut placerat pretium sem, ac maximus dui sodales a. Nunc aliquet hendrerit turpis ac egestas. Phasellus volutpat tristique maximus. <b>Pellentesque feugiat eget nisi et dignissim.</b> Nam nibh erat, sollicitudin non facilisis nec, scelerisque nec ipsum. Sed accumsan velit condimentum, pharetra felis vitae, commodo tellus. <u><i>Mauris consequat luctus orci.</i></u></p>
|
|
||||||
<p>
|
|
||||||
Vivamus pharetra lobortis dui non tincidunt. Mauris vitae nisi vestibulum, mollis magna a, maximus mi. Suspendisse dictum eget augue quis sodales. Quisque rutrum ligula nec dapibus tincidunt. <span>Proin hendrerit massa a tellus vestibulum, a hendrerit ipsum iaculis. Suspendisse potenti.</span> Praesent eget erat blandit, finibus sapien vitae, ullamcorper erat. Integer blandit, felis at ullamcorper maximus, odio lectus pretium mauris, vel consequat lectus quam eu risus. Pellentesque gravida nec diam eget vehicula.
|
|
||||||
</p>
|
|
||||||
<img src="https://images.unsplash.com/photo-1556814278-8906c7d3a05f?w=1050">
|
|
||||||
<p>
|
|
||||||
Donec hendrerit turpis non libero eleifend dignissim. Mauris non tempor metus, et tristique massa. Integer consequat justo quam, vitae aliquam arcu vestibulum at. Donec porttitor quam in tempus convallis. Praesent feugiat eget eros vitae accumsan. Duis ultricies odio quis nisl volutpat, consectetur imperdiet sem laoreet. Quisque maximus semper ligula at tincidunt. Pellentesque accumsan varius vehicula.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="footer_blog">
|
|
||||||
<a href="https://github.com/imfunniee" target="_blank">made on earth by a human</a>
|
|
||||||
</div>
|
|
||||||
<script type="text/javascript">
|
|
||||||
setTimeout(function(){
|
|
||||||
document.getElementById("loading").classList.add("animated");
|
|
||||||
document.getElementById("loading").classList.add("fadeOut");
|
|
||||||
setTimeout(function(){
|
|
||||||
document.getElementById("loading").classList.remove("animated");
|
|
||||||
document.getElementById("loading").classList.remove("fadeOut");
|
|
||||||
document.getElementById("loading").style.display = "none";
|
|
||||||
},800);
|
|
||||||
},1500);
|
|
||||||
$.getJSON("../../config.json", function(user){
|
|
||||||
var icon = document.createElement("link");
|
|
||||||
icon.setAttribute("rel", "icon");
|
|
||||||
icon.setAttribute("href", user[0].userimg);
|
|
||||||
icon.setAttribute("type", "image/png");
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(icon);
|
|
||||||
document.getElementById("profile_img_blog").style.background = `url('${user[0].userimg}') center center`;
|
|
||||||
document.getElementById("username_blog").innerHTML = `<spanstyle="display:${user[0].name == null || !user[0].name ? 'none' : 'block'};">${user[0].name}</span><br>@${user[0].username}<b id="blog_time"></b>`;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body></html>
|
|
BIN
assets/fonts/otf/manrope-bold.otf
Normal file
BIN
assets/fonts/otf/manrope-bold.otf
Normal file
Binary file not shown.
BIN
assets/fonts/variable/Manrope[wght].ttf
Normal file
BIN
assets/fonts/variable/Manrope[wght].ttf
Normal file
Binary file not shown.
BIN
assets/fonts/web/manrope-bold.woff2
Normal file
BIN
assets/fonts/web/manrope-bold.woff2
Normal file
Binary file not shown.
782
assets/index.css
782
assets/index.css
|
@ -1,433 +1,349 @@
|
||||||
@import url('https://fonts.googleapis.com/css?family=Poppins');
|
@charset "UTF-8";
|
||||||
@import url('https://fonts.googleapis.com/css?family=Questrial');
|
@font-face {
|
||||||
|
font-family: "Manrope VF";
|
||||||
body{
|
src: url("/assets/fonts/variable/Manrope%5Bwght%5D.ttf")
|
||||||
margin:0%;
|
format("truetype-variations");
|
||||||
padding:0%;
|
font-style: normal;
|
||||||
width:100vw;
|
font-weight: 200 800;
|
||||||
background:var(--bg-color);
|
}
|
||||||
color:var(--text-color);
|
|
||||||
max-width:100vw;
|
@font-face {
|
||||||
overflow-x:hidden;
|
font-family: "Manrope";
|
||||||
align-items:center;
|
src: url("/assets/fonts/web/manrope-bold.woff2") format("woff2"),
|
||||||
font-family: 'Poppins', sans-serif;
|
url("/assets/fonts/otf/manrope-bold.otf") format("opentype");
|
||||||
}
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
#loading {
|
}
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
body {
|
||||||
position: fixed;
|
align-items: center;
|
||||||
background: var(--bg-color);
|
background: var(--bg-color);
|
||||||
z-index: 999;
|
color: var(--text-color);
|
||||||
display: flex;
|
font-family: "Manrope VF", Manrope, sans-serif;
|
||||||
justify-content: center;
|
font-feature-settings: "calt", "liga";
|
||||||
flex-direction: column;
|
font-size: 64px;
|
||||||
align-items: center;
|
font-variation-ligatures: normal;
|
||||||
top:0;
|
font-variation-settings: "wght" 500;
|
||||||
bottom:0;
|
font-weight: 700;
|
||||||
left:0;
|
margin: 0%;
|
||||||
right:0;
|
max-width: 100vw;
|
||||||
}
|
overflow-x: hidden;
|
||||||
|
padding: 0%;
|
||||||
#spinner {
|
width: 100vw;
|
||||||
animation: rotate 0.5s infinite linear;
|
}
|
||||||
width:50px;
|
|
||||||
height:50px;
|
.profile {
|
||||||
border:2px solid var(--bg-color);
|
background: var(--background-image) center center;
|
||||||
border-bottom:2px solid var(--text-color);
|
background-repeat: no-repeat;
|
||||||
border-radius:50%;
|
background-size: cover !important;
|
||||||
margin:0;
|
color: #fff !important;
|
||||||
}
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
@keyframes rotate {
|
height: 92vh;
|
||||||
0% {transform: rotate(0deg);}
|
justify-content: center;
|
||||||
100% {transform: rotate(360deg);}
|
padding: 4vh 3vw;
|
||||||
}
|
position: fixed;
|
||||||
|
text-align: left;
|
||||||
#profile {
|
width: 24vw;
|
||||||
width:24vw;
|
}
|
||||||
padding:4vh 3vw;
|
|
||||||
height:92vh;
|
.display {
|
||||||
display:flex;
|
display: inline-block;
|
||||||
flex-direction:column;
|
height: 92vh;
|
||||||
justify-content:center;
|
padding: 4vh 3vw;
|
||||||
text-align:left;
|
padding-left: 33vw;
|
||||||
background:var(--background-image) center center;
|
width: 64vw;
|
||||||
background-size: cover !important;
|
}
|
||||||
background-repeat:no-repeat;
|
|
||||||
position:fixed;
|
.display h1 {
|
||||||
color:#fff !important;
|
color: var(--text-color);
|
||||||
}
|
font-family: "Asap", sans-serif;
|
||||||
|
font-size: 50px;
|
||||||
#display {
|
font-weight: bold;
|
||||||
width:64vw;
|
}
|
||||||
padding:4vh 3vw;
|
|
||||||
height:92vh;
|
.emoji {
|
||||||
display:inline-block;
|
height: 18px;
|
||||||
padding-left:33vw;
|
width: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#display h1 {
|
.footer {
|
||||||
font-size:50px;
|
padding: 8vh 0;
|
||||||
color:var(--text-color);
|
text-align: center;
|
||||||
font-weight:bold;
|
width: 100%;
|
||||||
font-family: 'Questrial', sans-serif;
|
}
|
||||||
}
|
|
||||||
|
.footer a {
|
||||||
.emoji {
|
color: var(--text-color) !important;
|
||||||
width:18px;
|
font-family: "Manrope VF", Manrope, sans-serif;
|
||||||
height:18px;
|
font-feature-settings: "calt", "liga";
|
||||||
}
|
font-variation-ligatures: normal;
|
||||||
|
font-variation-settings: "wght" 500;
|
||||||
#profile_img_blog {
|
font-weight: 700;
|
||||||
border-radius:50%;
|
text-decoration: none;
|
||||||
width:90px;
|
}
|
||||||
height:90px;
|
|
||||||
background-size:cover !important;
|
#profile_img {
|
||||||
background-repeat: no-repeat;
|
width: 180px;
|
||||||
}
|
height: 180px;
|
||||||
|
min-width: 180px;
|
||||||
#username_blog {
|
min-height: 180px;
|
||||||
font-size:18px;
|
max-width: 180px;
|
||||||
color:var(--text-color);
|
max-height: 180px;
|
||||||
font-family: 'Poppins', sans-serif;
|
border-radius: 5px;
|
||||||
font-weight:bold;
|
background-size: cover !important;
|
||||||
}
|
background-repeat: no-repeat !important;
|
||||||
|
}
|
||||||
#username_blog span {
|
|
||||||
font-size:24px;
|
@keyframes grad {
|
||||||
font-family: 'Questrial', sans-serif !important;
|
0% {
|
||||||
}
|
background-position: 0% 50%;
|
||||||
|
}
|
||||||
#username_blog b {
|
|
||||||
font-size:12px;
|
50% {
|
||||||
font-family:'Poppins', sans-serif;
|
background-position: 100% 50%;
|
||||||
font-weight:bold;
|
}
|
||||||
}
|
|
||||||
|
100% {
|
||||||
#blog-display {
|
background-position: 0% 50%;
|
||||||
width:60vw;
|
}
|
||||||
margin:0px 20vw;
|
}
|
||||||
text-align:left;
|
|
||||||
margin-top:3vh;
|
.profile div {
|
||||||
z-index:1;
|
font-weight: bold;
|
||||||
}
|
margin: 1.5vh 0;
|
||||||
|
}
|
||||||
#profile_blog {
|
|
||||||
width:60vw;
|
.hidden {
|
||||||
margin:0px 20vw;
|
opacity: 0;
|
||||||
margin-top:10vh;
|
}
|
||||||
text-align:left;
|
|
||||||
z-index:1;
|
#username {
|
||||||
}
|
color: white;
|
||||||
|
font-family: "Asap Condensed", sans-serif;
|
||||||
#background {
|
font-size: 18px;
|
||||||
width:100vw;
|
}
|
||||||
height:55vh;
|
|
||||||
background:var(--background-background);
|
.bottom_section span {
|
||||||
background-size:cover !important;
|
font-weight: bold;
|
||||||
background-repeat:no-repeat;
|
margin-right: 20px;
|
||||||
position: absolute;
|
}
|
||||||
z-index:-1;
|
|
||||||
margin-top:-10vh;
|
.socials span {
|
||||||
}
|
display: inline-block !important;
|
||||||
|
font-weight: normal !important;
|
||||||
#blog-display h1 {
|
margin-right: 2vw !important;
|
||||||
font-size:50px;
|
}
|
||||||
color:var(--text-color);
|
|
||||||
font-weight:bold;
|
#username span {
|
||||||
font-family: 'Questrial', sans-serif;
|
font-family: "Asap Condensed", sans-serif;
|
||||||
}
|
font-size: 24px;
|
||||||
|
}
|
||||||
#blog-display h2 {
|
|
||||||
color:var(--blog-gray-color);
|
.console-underscore {
|
||||||
}
|
display: inline-block;
|
||||||
|
left: 10px;
|
||||||
#blog-display {
|
position: relative;
|
||||||
padding:1vh 0px;
|
top: -0.14em;
|
||||||
font-family: 'Questrial', sans-serif;
|
}
|
||||||
}
|
|
||||||
|
#userbio {
|
||||||
#blog p {
|
font-family: "Asap", sans-serif;
|
||||||
font-size:17px;
|
font-size: 26px;
|
||||||
line-height:25px;
|
width: 100%;
|
||||||
word-spacing:1.2px;
|
}
|
||||||
margin:5vh 0px;
|
|
||||||
}
|
#about {
|
||||||
|
font-family: "Asap", sans-serif;
|
||||||
#blog p span {
|
font-size: 18px;
|
||||||
padding:2px 4px;
|
}
|
||||||
background:var(--text-color);
|
|
||||||
color:var(--bg-color) !important;
|
.projects a {
|
||||||
}
|
display: flex;
|
||||||
|
text-decoration: none;
|
||||||
#blog img {
|
|
||||||
width:100%;
|
/* 30px is the gutter size in magic grid */
|
||||||
margin:2vh 0px;
|
width: calc(49% - 30px);
|
||||||
border-radius:5px;
|
|
||||||
border:1px solid rgb(0, 0, 0, 0.08);
|
/* 49% avoids a weird single column on some wide screens */
|
||||||
}
|
}
|
||||||
|
|
||||||
#header {
|
.socials span a {
|
||||||
width:63vw;
|
font-weight: normal !important;
|
||||||
text-align:right;
|
}
|
||||||
padding:3vh 0px;
|
|
||||||
position:absolute;
|
#about a,
|
||||||
}
|
#username a {
|
||||||
|
color: #fff !important;
|
||||||
#header a {
|
font-weight: bold;
|
||||||
color:var(--text-color);
|
text-decoration: none;
|
||||||
text-decoration:none;
|
}
|
||||||
margin-left:4vw;
|
|
||||||
font-weight:bold;
|
#about a:hover,
|
||||||
}
|
#username a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
#footer_blog {
|
}
|
||||||
width:90vw;
|
|
||||||
padding:8vh 5vw;
|
#about span {
|
||||||
text-align:center;
|
display: block;
|
||||||
}
|
margin: 1vh 0;
|
||||||
|
}
|
||||||
#footer_blog a {
|
|
||||||
color:var(--text-color) !important;
|
.bottom_section span i {
|
||||||
text-decoration:none;
|
font-size: 15px;
|
||||||
font-family: 'Questrial', sans-serif;
|
}
|
||||||
font-weight:bold;
|
|
||||||
}
|
#about span i {
|
||||||
|
font-size: 16px;
|
||||||
#footer {
|
}
|
||||||
width:100%;
|
|
||||||
padding:8vh 0px;
|
#work {
|
||||||
text-align:center;
|
margin: 2vh 0;
|
||||||
}
|
padding: 4vh 0 !important;
|
||||||
|
}
|
||||||
#footer a {
|
|
||||||
color:var(--text-color) !important;
|
#forks {
|
||||||
text-decoration:none;
|
margin: 2vh 0;
|
||||||
font-family: 'Questrial', sans-serif;
|
padding: 4vh 0 !important;
|
||||||
font-weight:bold;
|
}
|
||||||
}
|
|
||||||
|
.projects {
|
||||||
#profile_img {
|
margin-left: -15px;
|
||||||
width:180px;
|
|
||||||
height:180px;
|
/* align section w/ heading above */
|
||||||
border-radius:5px;
|
}
|
||||||
background-size:cover !important;
|
|
||||||
}
|
.projects section {
|
||||||
|
border: 1px solid rgb(0, 0, 0, 0.08);
|
||||||
#profile div {
|
border-radius: 5px;
|
||||||
font-weight:bold;
|
box-shadow: 0 0 0 rgb(0, 0, 0, 0);
|
||||||
margin:1.5vh 0px;
|
color: var(--text-color);
|
||||||
}
|
display: inline-block;
|
||||||
|
margin: 1vh 0;
|
||||||
#username {
|
padding: 2.5vh 5%;
|
||||||
font-size:18px;
|
transform: scale(1);
|
||||||
font-weight:bold;
|
transition: 0.4s ease-in-out;
|
||||||
}
|
width: 100%;
|
||||||
|
}
|
||||||
#username span {
|
|
||||||
font-size:24px;
|
.projects section:hover {
|
||||||
}
|
border: 1px solid rgb(0, 0, 0, 0);
|
||||||
|
box-shadow: 0 15px 35px rgb(0, 0, 0, 0.06);
|
||||||
#userbio {
|
cursor: pointer;
|
||||||
font-size:26px;
|
transform: scale(1.03);
|
||||||
font-family: 'Questrial', sans-serif;
|
}
|
||||||
width:100%;
|
|
||||||
}
|
.section_title {
|
||||||
|
font-size: 24px;
|
||||||
#about {
|
font-weight: bold;
|
||||||
font-size:18px;
|
margin: 1vh 0;
|
||||||
font-family: 'Questrial', sans-serif;
|
padding: 0 1px;
|
||||||
}
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
#about span {
|
|
||||||
margin:1vh 0px;
|
.about_section {
|
||||||
display:block;
|
font-family: "Asap", sans-serif;
|
||||||
}
|
font-size: 18px;
|
||||||
|
font-weight: bold;
|
||||||
#about span i {
|
margin: 2vh 0;
|
||||||
font-size:16px;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
#work {
|
.bottom_section {
|
||||||
margin:2vh 0px;
|
font-size: 14px;
|
||||||
padding:4vh 0px !important;
|
margin: 1vh 0;
|
||||||
}
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
#forks {
|
|
||||||
margin:2vh 0px;
|
.socials {
|
||||||
padding:4vh 0px !important;
|
color: #fff;
|
||||||
}
|
margin: 3vh 0 !important;
|
||||||
|
text-decoration: none;
|
||||||
.projects {
|
}
|
||||||
columns:2;
|
|
||||||
}
|
::selection {
|
||||||
|
background: var(--text-color);
|
||||||
.projects section {
|
color: var(--bg-color);
|
||||||
width:85%;
|
}
|
||||||
padding:2.5vh 5%;
|
|
||||||
display:inline-block;
|
@media (max-width: 800px) {
|
||||||
border-radius:5px;
|
.profile {
|
||||||
color:var(--text-color);
|
height: 60vh;
|
||||||
border:1px solid rgb(0, 0, 0, 0.08);
|
padding: 4vh 5vw;
|
||||||
box-shadow:0px 0px 0px rgb(0, 0, 0, 0);
|
position: relative;
|
||||||
transition:0.4s ease-in-out;
|
text-align: center;
|
||||||
margin:2vh 0px;
|
width: 90vw;
|
||||||
transform:scale(1);
|
}
|
||||||
}
|
|
||||||
|
.display {
|
||||||
.projects section:hover {
|
display: inline-block;
|
||||||
cursor: pointer;
|
height: auto;
|
||||||
border:1px solid rgb(0, 0, 0, 0);
|
padding: 4vh 5vw;
|
||||||
box-shadow:0px 15px 35px rgb(0, 0, 0, 0.06);
|
padding-left: 5vw;
|
||||||
transform:scale(1.03);
|
width: 90vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section_title {
|
.profile_img {
|
||||||
font-size:24px;
|
animation: grad 8s ease infinite;
|
||||||
font-weight:bold;
|
background: var(--gradient);
|
||||||
margin:1vh 0px;
|
background-size: 300% 300%;
|
||||||
}
|
font-family: "Asap Condensed", sans-serif;
|
||||||
|
font-size: 128px;
|
||||||
.about_section {
|
margin: 0 auto !important;
|
||||||
font-size:18px;
|
transition: background 0.5s ease;
|
||||||
font-family: 'Questrial', sans-serif;
|
-webkit-background-clip: text;
|
||||||
margin:2vh 0px;
|
-webkit-text-fill-color: transparent;
|
||||||
font-weight:bold;
|
}
|
||||||
}
|
|
||||||
|
@keyframes grad {
|
||||||
.bottom_section {
|
0% {
|
||||||
margin:1vh 0px;
|
background-position: 0% 50%;
|
||||||
font-size:14px;
|
}
|
||||||
}
|
|
||||||
|
50% {
|
||||||
.bottom_section span {
|
background-position: 100% 50%;
|
||||||
margin-right:20px;
|
}
|
||||||
font-weight:bold;
|
|
||||||
}
|
100% {
|
||||||
|
background-position: 0% 50%;
|
||||||
.bottom_section span i {
|
}
|
||||||
font-size:15px;
|
}
|
||||||
}
|
|
||||||
|
#work {
|
||||||
#blog_section {
|
margin: 0;
|
||||||
margin:2vh 0px;
|
}
|
||||||
padding:2vh 0px !important;
|
|
||||||
}
|
.projects {
|
||||||
|
margin-left: 0;
|
||||||
#blogs {
|
|
||||||
columns:2;
|
/* remove neg margin to align w/ header */
|
||||||
}
|
}
|
||||||
|
|
||||||
#blogs section {
|
.projects a {
|
||||||
width:85%;
|
width: 100%;
|
||||||
display:inline-block;
|
}
|
||||||
border-radius:5px;
|
|
||||||
color:var(--text-color);
|
.projects section {
|
||||||
border:1px solid rgb(0, 0, 0, 0.04);
|
width: 88%;
|
||||||
box-shadow:0px 0px 0px rgb(0, 0, 0, 0);
|
}
|
||||||
transition:0.4s ease-in-out;
|
}
|
||||||
transform:scale(1);
|
|
||||||
padding:0px;
|
::-webkit-scrollbar {
|
||||||
margin:2vh 0px;
|
height: 5px;
|
||||||
}
|
width: 5px;
|
||||||
|
}
|
||||||
#blogs section img {
|
|
||||||
width:100%;
|
::-webkit-scrollbar-track {
|
||||||
border-radius:5px 5px 0px 0px;
|
background: var(--bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog_container {
|
::-webkit-scrollbar-thumb {
|
||||||
padding:2.5vh 5%;
|
background: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
#blogs section:hover {
|
/* Iconify */
|
||||||
cursor: pointer;
|
|
||||||
border:1px solid rgb(0, 0, 0, 0);
|
.iconify {
|
||||||
box-shadow:0px 15px 35px rgb(0, 0, 0, 0.06);
|
font-size: 24px;
|
||||||
transform:scale(1.03);
|
line-height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.go_back {
|
|
||||||
position: absolute;
|
|
||||||
color:var(--text-color);
|
|
||||||
font-size:26px;
|
|
||||||
margin-left:5vw;
|
|
||||||
margin-top:4vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
::selection {
|
|
||||||
color:var(--bg-color);
|
|
||||||
background:var(--text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 800px){
|
|
||||||
#profile {
|
|
||||||
width:90vw;
|
|
||||||
padding:4vh 5vw;
|
|
||||||
height:60vh;
|
|
||||||
text-align:center;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
#display {
|
|
||||||
width:90vw;
|
|
||||||
padding:4vh 5vw;
|
|
||||||
height:auto;
|
|
||||||
display:inline-block;
|
|
||||||
padding-left:5vw;
|
|
||||||
}
|
|
||||||
#profile_img {
|
|
||||||
width:120px;
|
|
||||||
height:120px;
|
|
||||||
margin:0px auto !important;
|
|
||||||
}
|
|
||||||
#work {
|
|
||||||
margin:0px;
|
|
||||||
}
|
|
||||||
#projects {
|
|
||||||
columns:1;
|
|
||||||
}
|
|
||||||
#projects section {
|
|
||||||
width:88%;
|
|
||||||
}
|
|
||||||
#blogs {
|
|
||||||
columns:1;
|
|
||||||
}
|
|
||||||
#blogs section {
|
|
||||||
width:98%;
|
|
||||||
}
|
|
||||||
#blog_section {
|
|
||||||
margin:0px;
|
|
||||||
}
|
|
||||||
#blog-display {
|
|
||||||
width:90vw;
|
|
||||||
margin:0px 5vw;
|
|
||||||
text-align:left;
|
|
||||||
margin-top:0vh;
|
|
||||||
z-index:1;
|
|
||||||
}
|
|
||||||
#profile_blog {
|
|
||||||
width:90vw;
|
|
||||||
margin:0px 5vw;
|
|
||||||
margin-top:10vh;
|
|
||||||
text-align:left;
|
|
||||||
z-index:1;
|
|
||||||
}
|
|
||||||
.go_back {
|
|
||||||
position: relative;
|
|
||||||
color:var(--text-color);
|
|
||||||
font-size:26px;
|
|
||||||
margin-left:5vw;
|
|
||||||
top:5vh;
|
|
||||||
}
|
|
||||||
#blog img {
|
|
||||||
margin:1vh 0px !important;
|
|
||||||
}
|
|
||||||
#blog p {
|
|
||||||
margin:2vh 0px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar {width:5px;height:5px;}
|
|
||||||
::-webkit-scrollbar-track {background:var(--bg-color);}
|
|
||||||
::-webkit-scrollbar-thumb {background:var(--text-color);}
|
|
||||||
|
|
|
@ -1,74 +1,50 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||||
<title></title>
|
<title></title>
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
|
<link
|
||||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
|
href="https://fonts.googleapis.com/css?family=Asap|Asap+Condensed&display=swap"
|
||||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
rel="stylesheet"
|
||||||
<link rel="stylesheet" href="index.css">
|
/>
|
||||||
</head>
|
<script src="https://unpkg.com/magic-grid/dist/magic-grid.min.js"></script>
|
||||||
<body>
|
<script src="https://code.iconify.design/1/1.0.6/iconify.min.js"></script>
|
||||||
<div id="loading">
|
<script
|
||||||
<div id="spinner"></div>
|
src="https://code.jquery.com/jquery-3.5.0.min.js"
|
||||||
</div>
|
integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ="
|
||||||
<div id="profile">
|
crossorigin="anonymous"
|
||||||
<div id="profile_img"></div>
|
></script>
|
||||||
<div id="username">
|
<link rel="stylesheet" href="index.css" />
|
||||||
<div id="fullname"></div>
|
</head>
|
||||||
</div>
|
|
||||||
<div id="userbio"></div>
|
<body>
|
||||||
<div id="about"></div>
|
<div class="profile">
|
||||||
</div>
|
<div id="profile_img"></div>
|
||||||
<div id="display">
|
<div id="username">
|
||||||
<div id="work">
|
<div id="fullname"></div>
|
||||||
<h1>Work.</h1>
|
</div>
|
||||||
<div class="projects" id="work_section"></div>
|
<div id="about"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="forks" style="display:none;">
|
<div class="display">
|
||||||
<h1>Forks.</h1>
|
<div id="work">
|
||||||
<div class="projects" id="forks_section"></div>
|
<h1>Work.</h1>
|
||||||
</div>
|
<div class="projects" id="work_section"></div>
|
||||||
<div id="blog_section">
|
</div>
|
||||||
<h1>Blog.</h1>
|
<div id="forks" style="display: none;">
|
||||||
<div id="blogs"></div>
|
<h1>Forks.</h1>
|
||||||
</div>
|
<div class="projects" id="forks_section"></div>
|
||||||
<div id="footer">
|
</div>
|
||||||
<a href="https://github.com/imfunniee" target="_blank">made on earth by a human</a>
|
<div class="footer">
|
||||||
</div>
|
<a
|
||||||
</div>
|
href="https://github.com/dilllxd/gitfolio#acknowledgments"
|
||||||
<script type="text/javascript">
|
target="_blank"
|
||||||
setTimeout(function(){
|
>
|
||||||
document.getElementById("loading").classList.add("animated");
|
made on earth by humans
|
||||||
document.getElementById("loading").classList.add("fadeOut");
|
</a>
|
||||||
setTimeout(function(){
|
</div>
|
||||||
document.getElementById("loading").classList.remove("animated");
|
</div>
|
||||||
document.getElementById("loading").classList.remove("fadeOut");
|
<div id="script"></div>
|
||||||
document.getElementById("loading").style.display = "none";
|
</body>
|
||||||
},800);
|
</html>
|
||||||
},1500);
|
|
||||||
$.getJSON("blog.json", function(blog){
|
|
||||||
if(blog.length == 0){
|
|
||||||
return document.getElementById("blog_section").style.display = "none";
|
|
||||||
}
|
|
||||||
for(var i = 0; i < blog.length; i++){
|
|
||||||
$("#blogs").append(`
|
|
||||||
<a href="./blog/${blog[i].url_title}/" target="_blank">
|
|
||||||
<section>
|
|
||||||
<img src="${blog[i].top_image}">
|
|
||||||
<div class="blog_container">
|
|
||||||
<div class="section_title">${blog[i].title}</div>
|
|
||||||
<div class="about_section">
|
|
||||||
${blog[i].sub_title}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</a>
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,31 +1,39 @@
|
||||||
:root {
|
:root {
|
||||||
--bg-color: rgb(10, 10, 10);
|
--bg-color: rgb(10, 10, 10);
|
||||||
--text-color: #fff;
|
--text-color: #fff;
|
||||||
--blog-gray-color: rgb(180, 180, 180);
|
--background-image: linear-gradient(
|
||||||
--background-image: linear-gradient(90deg, rgba(10, 10, 10, 0.6), rgb(10, 10, 10, 1)), url("{{background}}");
|
90deg,
|
||||||
--background-background: linear-gradient(0deg, rgba(10, 10, 10, 1), rgba(10, 10, 10, 0.6)),
|
rgba(10, 10, 10, 0.3),
|
||||||
url("{{background-image}}") center center fixed;
|
rgb(10, 10, 10, 1)
|
||||||
--height: 50vh;
|
),
|
||||||
}
|
url("{{{background}}}");
|
||||||
#display h1 {
|
--background-background: linear-gradient(
|
||||||
-webkit-background-clip: text;
|
0deg,
|
||||||
background-clip: text;
|
rgba(10, 10, 10, 1),
|
||||||
-webkit-text-fill-color: #fff;
|
rgba(10, 10, 10, 0.6)
|
||||||
}
|
),
|
||||||
#blog-display h1 {
|
url("{{{background}}}") center center fixed;
|
||||||
-webkit-background-clip: text;
|
--height: 50vh;
|
||||||
background-clip: text;
|
--gradient: linear-gradient(90deg, #009bef, #f00);
|
||||||
-webkit-text-fill-color: #fff;
|
}
|
||||||
}
|
|
||||||
.projects section {
|
#display h1 {
|
||||||
background: rgb(20, 20, 20);
|
-webkit-background-clip: text;
|
||||||
}
|
background-clip: text;
|
||||||
#blog_section section {
|
-webkit-text-fill-color: #fff;
|
||||||
background: rgb(20, 20, 20);
|
}
|
||||||
}
|
|
||||||
@media (max-width: 800px) {
|
.projects section {
|
||||||
:root {
|
background: rgb(20, 20, 20);
|
||||||
--background-image: linear-gradient(0deg, rgba(10, 10, 10, 1), rgb(10, 10, 10, 0)),
|
}
|
||||||
url("{{background-image}}") !important;
|
|
||||||
}
|
@media (max-width: 800px) {
|
||||||
}
|
:root {
|
||||||
|
--background-image: linear-gradient(
|
||||||
|
0deg,
|
||||||
|
rgba(10, 10, 10, 1),
|
||||||
|
rgba(10, 10, 10, 0)
|
||||||
|
),
|
||||||
|
url("{{{background}}}") !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,12 @@
|
||||||
:root {
|
:root {
|
||||||
--bg-color: #fff;
|
--bg-color: #fff;
|
||||||
--text-color: rgb(10, 10, 10);
|
--text-color: rgb(10, 10, 10);
|
||||||
--blog-gray-color: rgb(80, 80, 80);
|
--background-image: linear-gradient(
|
||||||
--background-image: linear-gradient(90deg, rgba(10, 10, 10, 0.4), rgb(10, 10, 10, 0.4)), url("{{background}}");
|
90deg,
|
||||||
--background-background: #fff;
|
rgba(10, 10, 10, 0.4),
|
||||||
}
|
rgb(10, 10, 10, 0.4)
|
||||||
|
),
|
||||||
|
url("{{{background}}}");
|
||||||
|
--background-background: #fff;
|
||||||
|
--gradient: linear-gradient(90deg, #009bef, #f00);
|
||||||
|
}
|
||||||
|
|
75
bin/gitfolio.js
Executable file
75
bin/gitfolio.js
Executable file
|
@ -0,0 +1,75 @@
|
||||||
|
#! /usr/bin/env node
|
||||||
|
|
||||||
|
/* Argument parser */
|
||||||
|
const program = require("commander");
|
||||||
|
|
||||||
|
process.env.OUT_DIR = process.env.OUT_DIR || process.cwd();
|
||||||
|
|
||||||
|
const { buildCommand } = require("../build");
|
||||||
|
const { updateCommand } = require("../update");
|
||||||
|
const { uiCommand } = require("../ui");
|
||||||
|
const { runCommand } = require("../run");
|
||||||
|
const { version } = require("../package.json");
|
||||||
|
|
||||||
|
function collect(val, memo) {
|
||||||
|
memo.push(val);
|
||||||
|
return memo;
|
||||||
|
}
|
||||||
|
|
||||||
|
program
|
||||||
|
.command("build <username>")
|
||||||
|
.description(
|
||||||
|
"Build site with your GitHub username. This will be used to customize your site"
|
||||||
|
)
|
||||||
|
.option("-t, --theme [theme]", "specify a theme to use", "light")
|
||||||
|
.option("-b, --background [background]", "set the background image")
|
||||||
|
.option("-f, --fork", "includes forks with repos")
|
||||||
|
.option("-s, --sort [sort]", "set default sort for repository", "created")
|
||||||
|
.option("-o, --order [order]", "set default order on sort", "asc")
|
||||||
|
|
||||||
|
.option("-c, --codepen [username]", "specify codepen username")
|
||||||
|
.option("-d, --dev [username]", "specify dev username")
|
||||||
|
.option("-D, --dribbble [username]", "specify dribbble username")
|
||||||
|
.option("-e, --email [email]", "specify email")
|
||||||
|
.option("-F, --facebook [username]", "specify facebook username")
|
||||||
|
.option("-i, --instagram [username]", "specify instagram username")
|
||||||
|
.option("-k, --keybase [username]", "specify keybase username")
|
||||||
|
.option("-m, --medium [username]", "specify medium username")
|
||||||
|
.option("-r, --reddit [username]", "specify reddit username")
|
||||||
|
.option("-E, --stackexchange [user id]", "specify stackexchange user id")
|
||||||
|
.option("-S, --steam [username]", "specify steam username")
|
||||||
|
.option("-T, --telegram [username]", "specify telegram username")
|
||||||
|
.option("-w, --twitter [username]", "specify twitter username")
|
||||||
|
.option("-x, --xda [user id]", "specify xda user id")
|
||||||
|
.option("-y, --youtube [user id]", "specify youtube user id")
|
||||||
|
.action(buildCommand);
|
||||||
|
|
||||||
|
program
|
||||||
|
.command("update")
|
||||||
|
.description("Update user and repository data")
|
||||||
|
.action(updateCommand);
|
||||||
|
|
||||||
|
program
|
||||||
|
.command("ui")
|
||||||
|
.description("Create and Manage gitfolio with ease")
|
||||||
|
.action(uiCommand);
|
||||||
|
|
||||||
|
program
|
||||||
|
.command("run")
|
||||||
|
.description("Run build files")
|
||||||
|
.option("-p, --port [port]", "provide a port for localhost, default is 3000")
|
||||||
|
.action(runCommand);
|
||||||
|
|
||||||
|
program.on("command:*", () => {
|
||||||
|
console.log("Unknown Command: " + program.args.join(" "));
|
||||||
|
program.help();
|
||||||
|
});
|
||||||
|
|
||||||
|
program
|
||||||
|
.version(version, "-v --version")
|
||||||
|
.usage("<command> [options]")
|
||||||
|
.parse(process.argv);
|
||||||
|
|
||||||
|
if (program.args.length === 0) {
|
||||||
|
program.help();
|
||||||
|
}
|
71
blog.js
71
blog.js
|
@ -1,71 +0,0 @@
|
||||||
const program = require('commander');
|
|
||||||
const fs = require('fs');
|
|
||||||
const jsdom = require('jsdom').JSDOM,
|
|
||||||
options = {
|
|
||||||
resources: "usable"
|
|
||||||
};
|
|
||||||
|
|
||||||
program
|
|
||||||
.version('0.1.2')
|
|
||||||
.option('-t, --title [title]', 'give blog a title')
|
|
||||||
.option('-s, --subtitle [subtitle]', 'give blog a subtitle', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.')
|
|
||||||
.option('-p, --pagetitle [pagetitle]', 'give blog page a title')
|
|
||||||
.option('-f, --folder [folder]', 'give folder a title (use "-" instead of spaces)')
|
|
||||||
.parse(process.argv);
|
|
||||||
|
|
||||||
function createBlog(title, subtitle, pagetitle, folder) {
|
|
||||||
if (!fs.existsSync(`./dist/blog/${folder}`)){
|
|
||||||
fs.mkdirSync(`./dist/blog/${folder}`, { recursive: true });
|
|
||||||
}
|
|
||||||
fs.copyFile('./assets/blog/blogTemplate.html', `./dist/blog/${folder}/index.html`, (err) => {
|
|
||||||
if (err) throw err;
|
|
||||||
jsdom.fromFile(`./dist/blog/${folder}/index.html`, options).then(function (dom) {
|
|
||||||
let window = dom.window, document = window.document;
|
|
||||||
var style = document.createElement("link");
|
|
||||||
style.setAttribute("rel","stylesheet")
|
|
||||||
style.setAttribute("href","../../index.css");
|
|
||||||
document.getElementsByTagName("head")[0].appendChild(style);
|
|
||||||
|
|
||||||
document.getElementsByTagName("title")[0].textContent = pagetitle;
|
|
||||||
document.getElementById("blog_title").textContent = title;
|
|
||||||
document.getElementById("blog_sub_title").textContent = subtitle;
|
|
||||||
|
|
||||||
fs.writeFile(`./dist/blog/${folder}/index.html`, '<!DOCTYPE html>'+window.document.documentElement.outerHTML, function (error){
|
|
||||||
if (error) throw error;
|
|
||||||
var blog_data = {
|
|
||||||
"url_title": pagetitle,
|
|
||||||
"title": title,
|
|
||||||
"sub_title": subtitle,
|
|
||||||
"top_image": "https://images.unsplash.com/photo-1553748024-d1b27fb3f960?w=1450",
|
|
||||||
"visible": true }
|
|
||||||
fs.readFile("./dist/blog.json", function (err , data) {
|
|
||||||
if (err) throw err;
|
|
||||||
var old_blogs = JSON.parse(data);
|
|
||||||
old_blogs.push(blog_data);
|
|
||||||
fs.writeFile('./dist/blog.json', JSON.stringify(old_blogs, null, ' '), function(err){
|
|
||||||
if (err) throw err;
|
|
||||||
console.log('Blog Created Successfully in "blog" folder.');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}).catch(function(error){
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (program.title) {
|
|
||||||
/* Check if build has been executed before blog this will prevent it from giving "link : index.css" error */
|
|
||||||
if (!fs.existsSync(`./dist/index.html`) || !fs.existsSync(`./dist/index.css`)){
|
|
||||||
return console.log("You need to run build command before using blog one");
|
|
||||||
}
|
|
||||||
if (!program.pagetitle) {
|
|
||||||
program.pagetitle = program.title;
|
|
||||||
}
|
|
||||||
if (!program.folder) {
|
|
||||||
program.folder = program.title;
|
|
||||||
}
|
|
||||||
createBlog(program.title, program.subtitle, program.pagetitle, program.folder);
|
|
||||||
} else {
|
|
||||||
console.log("Provide a title to create a new blog");
|
|
||||||
}
|
|
205
build.js
205
build.js
|
@ -1,92 +1,113 @@
|
||||||
/* Argument parser */
|
// Filepath utilities
|
||||||
const program = require('commander');
|
const path = require("path");
|
||||||
/* Filepath utilities */
|
// Promise library
|
||||||
const path = require('path');
|
const bluebird = require("bluebird");
|
||||||
/* Promise library */
|
const hbs = require("handlebars");
|
||||||
const bluebird = require('bluebird');
|
// Creates promise-returning async functions from callback-passed async functions
|
||||||
const hbs = require('handlebars');
|
const fs = bluebird.promisifyAll(require("fs"));
|
||||||
/* Creates promise-returning async functions
|
const fse = require("fs-extra");
|
||||||
from callback-passed async functions */
|
const { updateHTML } = require("./populate");
|
||||||
const fs = bluebird.promisifyAll(require('fs'));
|
const { getConfig, outDir } = require("./utils");
|
||||||
const { updateHTML } = require('./populate');
|
|
||||||
|
const assetDir = path.resolve(`${__dirname}/assets/`);
|
||||||
|
const config = path.join(outDir, "config.json");
|
||||||
/* Specify the options the program uses */
|
const tempfont = path.resolve(assetDir, "fonts");
|
||||||
program
|
const fonts = path.join(outDir, "assets/fonts");
|
||||||
.version('0.1.2')
|
|
||||||
.option('-n, --name [username]', 'your GitHub username. This will be used to customize your site')
|
/**
|
||||||
.option('-t, --theme [theme]', 'specify a theme to use')
|
* Creates the stylesheet used by the site from a template stylesheet.
|
||||||
.option('-b, --background [background]', 'set the background image')
|
*
|
||||||
.option('-f, --fork', 'includes forks with repos')
|
* Theme styles are added to the new stylesheet depending on command line
|
||||||
.option('-s, --sort [sort]', 'set default sort for repository')
|
* arguments.
|
||||||
.option('-o, --order [order]', 'set default order on sort')
|
*/
|
||||||
.parse(process.argv);
|
async function populateCSS({
|
||||||
|
theme = "light",
|
||||||
const config = './dist/config.json';
|
background = "https://source.unsplash.com/1280x720/?wallpaper",
|
||||||
const assetDir = path.resolve('./assets/');
|
} = {}) {
|
||||||
const outDir = path.resolve('./dist/');
|
// Get the theme the user requests. Defaults to 'light'
|
||||||
|
theme = `${theme}.css`;
|
||||||
/**
|
const template = path.resolve(assetDir, "index.css");
|
||||||
* Creates the stylesheet used by the site from a template stylesheet.
|
const stylesheet = path.join(outDir, "index.css");
|
||||||
*
|
|
||||||
* Theme styles are added to the new stylesheet depending on command line
|
try {
|
||||||
* arguments.
|
await fs.accessAsync(outDir, fs.constants.F_OK);
|
||||||
*/
|
} catch (error) {
|
||||||
async function populateCSS() {
|
await fs.mkdirAsync(outDir);
|
||||||
/* Get the theme the user requests. Defaults to 'light' */
|
}
|
||||||
let theme = `${program.theme || 'light'}.css`; /* Site theme, defaults to 'light' */
|
|
||||||
let template = path.resolve(assetDir, 'index.css');
|
// Copy over the template CSS stylesheet
|
||||||
let stylesheet = path.join(outDir, 'index.css');
|
await fs.copyFileAsync(template, stylesheet);
|
||||||
|
|
||||||
try {
|
// Copy Fonts
|
||||||
await fs.accessAsync(outDir, fs.constants.F_OK);
|
fse.copySync(tempfont, fonts);
|
||||||
} catch (err) {
|
|
||||||
await fs.mkdirAsync(outDir);
|
// Get an array of every available theme
|
||||||
}
|
const themes = await fs.readdirAsync(path.join(assetDir, "themes"));
|
||||||
/* Copy over the template CSS stylesheet */
|
|
||||||
await fs.copyFileAsync(template, stylesheet);
|
if (!themes.includes(theme)) {
|
||||||
|
console.error('Error: Requested theme not found. Defaulting to "light".');
|
||||||
/* Get an array of every available theme */
|
theme = "light";
|
||||||
let themes = await fs.readdirAsync(path.join(assetDir, 'themes'));
|
}
|
||||||
|
|
||||||
if (!themes.includes(theme)) {
|
// Read in the theme stylesheet
|
||||||
console.error('Error: Requested theme not found. Defaulting to "light".');
|
let themeSource = await fs.readFileSync(path.join(assetDir, "themes", theme));
|
||||||
theme = 'light';
|
themeSource = themeSource.toString("utf-8");
|
||||||
}
|
const themeTemplate = hbs.compile(themeSource);
|
||||||
/* Read in the theme stylesheet */
|
const styles = themeTemplate({
|
||||||
let themeSource = await fs.readFileSync(path.join(assetDir, 'themes', theme));
|
background: `${background}`,
|
||||||
themeSource = themeSource.toString('utf-8');
|
});
|
||||||
let themeTemplate = hbs.compile(themeSource);
|
// Add the user-specified styles to the new stylesheet
|
||||||
let styles = themeTemplate({
|
await fs.appendFileAsync(stylesheet, styles);
|
||||||
'background': `${process.background || 'https://images.unsplash.com/photo-1553748024-d1b27fb3f960?w=1450'}`
|
|
||||||
})
|
// Update the config file with the user's theme choice
|
||||||
/* Add the user-specified styles to the new stylesheet */
|
const data = await getConfig();
|
||||||
await fs.appendFileAsync(stylesheet, styles);
|
data[0].theme = theme;
|
||||||
|
await fs.writeFileAsync(config, JSON.stringify(data, null, " "));
|
||||||
/* Update the config file with the user's theme choice */
|
}
|
||||||
let data = await fs.readFileAsync(config);
|
|
||||||
data = JSON.parse(data);
|
async function populateConfig(opts) {
|
||||||
data[0].theme = theme;
|
const data = await getConfig();
|
||||||
await fs.writeFileAsync(config, JSON.stringify(data, null, ' '));
|
Object.assign(data[0], opts);
|
||||||
}
|
await fs.writeFileAsync(config, JSON.stringify(data, null, " "));
|
||||||
|
}
|
||||||
populateCSS();
|
|
||||||
|
async function buildCommand(username, program) {
|
||||||
if (program.name) {
|
await populateCSS(program);
|
||||||
let sort = program.sort ? program.sort : 'created';
|
let types;
|
||||||
let order = -1;
|
if (!program.include || !program.include.length) {
|
||||||
let includeFork = false;
|
types = ["all"];
|
||||||
|
} else {
|
||||||
if(program.order){
|
types = program.include;
|
||||||
if(program.order === 'asc')
|
}
|
||||||
order = 1;
|
|
||||||
else if(program.order === 'desc')
|
const opts = {
|
||||||
order = -1;
|
sort: program.sort,
|
||||||
}
|
order: program.order,
|
||||||
if(program.fork){
|
includeFork: Boolean(program.fork),
|
||||||
includeFork = true;
|
types,
|
||||||
}
|
codepen: program.codepen,
|
||||||
updateHTML(('%s', program.name), sort, order, includeFork);
|
dev: program.dev,
|
||||||
} else {
|
dribbble: program.dribbble,
|
||||||
console.error("Error: Please provide a GitHub username.");
|
email: program.email,
|
||||||
}
|
facebook: program.facebook,
|
||||||
|
instagram: program.instagram,
|
||||||
|
keybase: program.keybase,
|
||||||
|
medium: program.medium,
|
||||||
|
reddit: program.reddit,
|
||||||
|
stackexchange: program.stackexchange,
|
||||||
|
steam: program.steam,
|
||||||
|
telegram: program.telegram,
|
||||||
|
twitter: program.twitter,
|
||||||
|
xda: program.xda,
|
||||||
|
youtube: program.youtube,
|
||||||
|
};
|
||||||
|
|
||||||
|
await populateConfig(opts);
|
||||||
|
updateHTML(("%s", username), opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
buildCommand,
|
||||||
|
populateCSS,
|
||||||
|
populateConfig,
|
||||||
|
};
|
||||||
|
|
11
default/config.json
Normal file
11
default/config.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"username": null,
|
||||||
|
"name": null,
|
||||||
|
"userimg": null,
|
||||||
|
"sort": null,
|
||||||
|
"order": null,
|
||||||
|
"includeFork": null,
|
||||||
|
"theme": "light.css"
|
||||||
|
}
|
||||||
|
]
|
1
dist/blog.json
vendored
1
dist/blog.json
vendored
|
@ -1 +0,0 @@
|
||||||
[]
|
|
8
dist/config.json
vendored
8
dist/config.json
vendored
|
@ -1,8 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"username": null,
|
|
||||||
"name": null,
|
|
||||||
"userimg": null,
|
|
||||||
"theme": "light"
|
|
||||||
}
|
|
||||||
]
|
|
7487
package-lock.json
generated
7487
package-lock.json
generated
File diff suppressed because it is too large
Load diff
79
package.json
79
package.json
|
@ -1,20 +1,59 @@
|
||||||
{
|
{
|
||||||
"name": "gitfolio",
|
"name": "gitfolio",
|
||||||
"version": "0.1.2",
|
"version": "0.1.5",
|
||||||
"description": "portfolio website for showcasing your work",
|
"description": "a portfolio website for everyone to showcase their work",
|
||||||
"main": "build.js",
|
"main": "build.js",
|
||||||
"scripts": {
|
"bin": "bin/gitfolio.js",
|
||||||
"clean": "rm -f dist/index.*",
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"build": "OUT_DIR='./dist' node bin/gitfolio.js build dilllxd -f -t dark -s updated -e dylan@dylanh.dev -i dilllx -k dilll -r dilllx -S dilll -w dilllxd -y UCuQ2CKTDMlxugSQsDJKVeQA",
|
||||||
},
|
"cli": "OUT_DIR='./dist' node bin/gitfolio.js",
|
||||||
"author": "imfunny",
|
"clean": "rm -rf ./dist/*",
|
||||||
"license": "ISC",
|
"prettier": "prettier --write \"./**/*.{js,jsx,json,html,css,md}\"",
|
||||||
"dependencies": {
|
"snyk-protect": "snyk protect",
|
||||||
"bluebird": "^3.5.4",
|
"prepare": "npm run snyk-protect",
|
||||||
"commander": "^2.20.0",
|
"test": "snyk test"
|
||||||
"github-emoji": "^1.1.0",
|
},
|
||||||
"got": "^9.6.0",
|
"author": {
|
||||||
"handlebars": "^4.1.2",
|
"name": "@imfunniee and community",
|
||||||
"jsdom": "^15.0.0"
|
"email": "imfunny@wybemf.com",
|
||||||
}
|
"url": "https://imfunniee.github.io"
|
||||||
}
|
},
|
||||||
|
"bugs": "https://github.com/imfunniee/gitfolio/issues",
|
||||||
|
"homepage": "https://github.com/imfunniee/gitfolio",
|
||||||
|
"keywords": [
|
||||||
|
"personal-website",
|
||||||
|
"github",
|
||||||
|
"portfolio",
|
||||||
|
"portfolio website",
|
||||||
|
"gitfolio",
|
||||||
|
"git"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/imfunniee/gitfolio"
|
||||||
|
},
|
||||||
|
"license": "GPL-3.0",
|
||||||
|
"dependencies": {
|
||||||
|
"bluebird": "^3.5.4",
|
||||||
|
"body-parser": "^1.19.0",
|
||||||
|
"commander": "^2.20.0",
|
||||||
|
"ejs": "3.0.2",
|
||||||
|
"express": "^4.17.0",
|
||||||
|
"fs-extra": "9.0.0",
|
||||||
|
"github-emoji": "^1.1.1",
|
||||||
|
"got": "11.0.2",
|
||||||
|
"handlebars": "4.7.6",
|
||||||
|
"jsdom": "16.2.2",
|
||||||
|
"ncp": "^2.0.0",
|
||||||
|
"snyk": "1.307.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^6.8.0",
|
||||||
|
"prettier": "2.0.5",
|
||||||
|
"stylelint": "13.3.3",
|
||||||
|
"stylelint-config-prettier": "^8.0.1",
|
||||||
|
"stylelint-config-standard": "^20.0.0",
|
||||||
|
"stylelint-prettier": "^1.1.2"
|
||||||
|
},
|
||||||
|
"snyk": true
|
||||||
|
}
|
||||||
|
|
545
populate.js
545
populate.js
|
@ -1,117 +1,428 @@
|
||||||
const fs = require('fs');
|
const fs = require("fs");
|
||||||
const got = require('got');
|
const emoji = require("github-emoji");
|
||||||
const emoji = require('github-emoji');
|
const jsdom = require("jsdom").JSDOM,
|
||||||
const jsdom = require('jsdom').JSDOM,
|
options = {
|
||||||
options = {
|
resources: "usable"
|
||||||
resources: "usable"
|
};
|
||||||
};
|
const { getConfig, outDir } = require("./utils");
|
||||||
|
const { getRepos, getUser } = require("./api");
|
||||||
function convertToEmoji(text) {
|
|
||||||
if (text == null) return;
|
function convertToEmoji(text) {
|
||||||
text = text.toString();
|
if (text == null) return;
|
||||||
if (text.match(/(?<=:\s*).*?(?=\s*:)/gs) != null) {
|
text = text.toString();
|
||||||
var str = text.match(/(?<=:\s*).*?(?=\s*:)/gs);
|
var pattern = /(?<=:\s*).*?(?=\s*:)/gs;
|
||||||
str = str.filter(function (arr) {
|
if (text.match(pattern) != null) {
|
||||||
return /\S/.test(arr);
|
var str = text.match(pattern);
|
||||||
});
|
str = str.filter(function(arr) {
|
||||||
for (i = 0; i < str.length; i++) {
|
return /\S/.test(arr);
|
||||||
if (emoji.URLS[str[i]] != undefined) {
|
});
|
||||||
var output = emoji.of(str[i]);
|
for (i = 0; i < str.length; i++) {
|
||||||
var emojiImage = output.url.replace("assets-cdn.github", "github.githubassets");
|
if (emoji.URLS[str[i]] != undefined) {
|
||||||
text = text.replace(`:${str[i]}:`, `<img src="${emojiImage}" class="emoji">`);
|
text = text.replace(
|
||||||
}
|
`:${str[i]}:`,
|
||||||
}
|
`<img src="${emoji.URLS[str[i]]}" class="emoji">`
|
||||||
return text;
|
);
|
||||||
} else {
|
}
|
||||||
return text;
|
}
|
||||||
}
|
return text;
|
||||||
}
|
} else {
|
||||||
|
return text;
|
||||||
module.exports.updateHTML = (username, sort, order, includeFork) => {
|
}
|
||||||
//add data to assets/index.html
|
}
|
||||||
jsdom.fromFile("./assets/index.html", options).then(function (dom) {
|
|
||||||
let window = dom.window, document = window.document;
|
module.exports.updateHTML = (username, opts) => {
|
||||||
(async () => {
|
const {
|
||||||
try {
|
includeFork,
|
||||||
console.log("Building HTML/CSS...");
|
codepen,
|
||||||
var repos = await got(`https://api.github.com/users/${username}/repos?sort=${sort}&order=${order}&per_page=1200`);
|
dev,
|
||||||
repos = JSON.parse(repos.body);
|
dribbble,
|
||||||
for (var i = 0; i < repos.length; i++) {
|
email,
|
||||||
if(repos[i].fork == false){
|
facebook,
|
||||||
document.getElementById("work_section").innerHTML += `
|
instagram,
|
||||||
<a href="${repos[i].html_url}" target="_blank">
|
keybase,
|
||||||
<section>
|
medium,
|
||||||
<div class="section_title">${repos[i].name}</div>
|
reddit,
|
||||||
<div class="about_section">
|
stackexchange,
|
||||||
<span style="display:${repos[i].description == undefined ? 'none' : 'block'};">${convertToEmoji(repos[i].description)}</span>
|
steam,
|
||||||
</div>
|
telegram,
|
||||||
<div class="bottom_section">
|
twitter,
|
||||||
<span style="display:${repos[i].language == null ? 'none' : 'inline-block'};"><i class="fas fa-code"></i> ${repos[i].language}</span>
|
xda,
|
||||||
<span><i class="fas fa-star"></i> ${repos[i].stargazers_count}</span>
|
youtube
|
||||||
<span><i class="fas fa-code-branch"></i> ${repos[i].forks_count}</span>
|
} = opts;
|
||||||
</div>
|
//add data to assets/index.html
|
||||||
</section>
|
jsdom
|
||||||
</a>`;
|
.fromFile(`${__dirname}/assets/index.html`, options)
|
||||||
}else{
|
.then(function(dom) {
|
||||||
if(includeFork == true){
|
let window = dom.window,
|
||||||
document.getElementById("forks").style.display = "block";
|
document = window.document;
|
||||||
document.getElementById("forks_section").innerHTML += `
|
(async () => {
|
||||||
<a href="${repos[i].html_url}" target="_blank">
|
try {
|
||||||
<section>
|
console.log("Building HTML/CSS...");
|
||||||
<div class="section_title">${repos[i].name}</div>
|
const repos = await getRepos(username, opts);
|
||||||
<div class="about_section">
|
|
||||||
<span style="display:${repos[i].description == undefined ? 'none' : 'block'};">${convertToEmoji(repos[i].description)}</span>
|
for (var i = 0; i < repos.length; i++) {
|
||||||
</div>
|
let element;
|
||||||
<div class="bottom_section">
|
if (repos[i].fork == false) {
|
||||||
<span style="display:${repos[i].language == null ? 'none' : 'inline-block'};"><i class="fas fa-code"></i> ${repos[i].language}</span>
|
element = document.getElementById("work_section");
|
||||||
<span><i class="fas fa-star"></i> ${repos[i].stargazers_count}</span>
|
} else if (includeFork == true) {
|
||||||
<span><i class="fas fa-code-branch"></i> ${repos[i].forks_count}</span>
|
document.getElementById("forks").style.display = "block";
|
||||||
</div>
|
element = document.getElementById("forks_section");
|
||||||
</section>
|
} else {
|
||||||
</a>`;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
element.innerHTML += `
|
||||||
}
|
<a href="${repos[i].html_url}" target="_blank">
|
||||||
var user = await got(`https://api.github.com/users/${username}`);
|
<section>
|
||||||
user = JSON.parse(user.body);
|
<div class="section_title">${repos[i].name}</div>
|
||||||
document.title = user.login;
|
<div class="about_section">
|
||||||
var icon = document.createElement("link");
|
<span style="display:${
|
||||||
icon.setAttribute("rel", "icon");
|
repos[i].description == undefined
|
||||||
icon.setAttribute("href", user.avatar_url);
|
? "none"
|
||||||
icon.setAttribute("type", "image/png");
|
: "block"
|
||||||
document.getElementsByTagName("head")[0].appendChild(icon);
|
};">${convertToEmoji(repos[i].description)}</span>
|
||||||
document.getElementById("profile_img").style.background = `url('${user.avatar_url}') center center`
|
</div>
|
||||||
document.getElementById("username").innerHTML = `<span style="display:${user.name == null || !user.name ? 'none' : 'block'};">${user.name}</span>@${user.login}`;
|
<div class="bottom_section">
|
||||||
//document.getElementById("github_link").href = `https://github.com/${user.login}`;
|
<span style="display:${
|
||||||
document.getElementById("userbio").innerHTML = convertToEmoji(user.bio);
|
repos[i].language == null
|
||||||
document.getElementById("userbio").style.display = user.bio == null || !user.bio ? 'none' : 'block';
|
? "none"
|
||||||
document.getElementById("about").innerHTML = `
|
: "inline-block"
|
||||||
<span style="display:${user.company == null || !user.company ? 'none' : 'block'};"><i class="fas fa-users"></i> ${user.company}</span>
|
};"><span class="iconify" data-icon="mdi-code-tags"></span> ${
|
||||||
<span style="display:${user.email == null || !user.email ? 'none' : 'block'};"><i class="fas fa-envelope"></i> ${user.email}</span>
|
repos[i].language
|
||||||
<span style="display:${user.blog == null || !user.blog ? 'none' : 'block'};"><i class="fas fa-link"></i> ${user.blog}</span>
|
}</span>
|
||||||
<span style="display:${user.location == null || !user.location ? 'none' : 'block'};"><i class="fas fa-map-marker-alt"></i> ${user.location}</span>
|
<span><span class="iconify" data-icon="mdi-star"></span> ${
|
||||||
<span style="display:${user.hireable == false || !user.hireable ? 'none' : 'block'};"><i class="fas fa-user-tie"></i> Available for hire</span>`;
|
repos[i].stargazers_count
|
||||||
//add data to config.json
|
}</span>
|
||||||
fs.readFile("./dist/config.json", function (err, data) {
|
<span><span class="iconify" data-icon="mdi-source-fork"></span> ${
|
||||||
if (err) throw err;
|
repos[i].forks_count
|
||||||
data = JSON.parse(data);
|
}</span>
|
||||||
data[0].username = user.login;
|
</div>
|
||||||
data[0].name = user.name;
|
</section>
|
||||||
data[0].userimg = user.avatar_url;
|
</a>`;
|
||||||
fs.writeFile('./dist/config.json', JSON.stringify(data, null, ' '), function (err) {
|
}
|
||||||
if (err) throw err;
|
const user = await getUser(username);
|
||||||
});
|
document.title = user.login;
|
||||||
});
|
var icon = document.createElement("link");
|
||||||
fs.writeFile('dist/index.html', '<!DOCTYPE html>' + window.document.documentElement.outerHTML, function (error) {
|
icon.setAttribute("rel", "icon");
|
||||||
if (error) throw error;
|
icon.setAttribute("href", user.avatar_url);
|
||||||
console.log("Build Complete");
|
icon.setAttribute("type", "image/png");
|
||||||
process.exit(0)
|
|
||||||
});
|
document.getElementsByTagName("head")[0].appendChild(icon);
|
||||||
} catch (error) {
|
document.getElementById(
|
||||||
console.log(error);
|
"profile_img"
|
||||||
}
|
).style.background = `url('${user.avatar_url}') center center`;
|
||||||
})();
|
document.getElementsByTagName("head")[0].innerHTML += `
|
||||||
}).catch(function (error) {
|
<meta name="description" content="${user.bio}" />
|
||||||
console.log(error);
|
<meta property="og:image" content="${user.avatar_url}" />
|
||||||
});
|
<meta property="og:type" content="profile" />
|
||||||
}
|
<meta property="og:title" content="${user.login}" />
|
||||||
|
<meta property="og:url" content="${user.html_url}" />
|
||||||
|
<meta property="og:description" content="${user.bio}" />
|
||||||
|
<meta property="profile:username" content="${user.login}" />
|
||||||
|
<meta name="twitter:image:src" content="${user.avatar_url}" />
|
||||||
|
<meta name="twitter:card" content="summary" />
|
||||||
|
<meta name="twitter:title" content="${user.login}" />
|
||||||
|
<meta name="twitter:description" content="${user.bio}" />`;
|
||||||
|
//Socials
|
||||||
|
document.getElementById(
|
||||||
|
"username"
|
||||||
|
).innerHTML = `<span id="text" style="display:${
|
||||||
|
user.name == null || !user.name ? "none" : "block"
|
||||||
|
};"></span><div class='console-underscore' id='console'>_</div>`;
|
||||||
|
document.getElementById("about").innerHTML = `
|
||||||
|
<span style="display:${
|
||||||
|
user.company == null || !user.company ? "none" : "block"
|
||||||
|
};"><span class="iconify" data-icon="mdi-face"></span> ${
|
||||||
|
user.company
|
||||||
|
}</span>
|
||||||
|
<span style="display:block;"><a href="${
|
||||||
|
user.html_url
|
||||||
|
}"><span class="iconify" data-icon="mdi-github-circle"></span> @${
|
||||||
|
user.login
|
||||||
|
}</a></span>
|
||||||
|
<span style="display:${
|
||||||
|
email == null ? "none !important" : "block"
|
||||||
|
};"><a href="mailto:${email}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-email"></span> ${email}</a></span>
|
||||||
|
<span style="display:${
|
||||||
|
user.location == null || !user.location ? "none" : "block"
|
||||||
|
};"><a href="https://www.google.com/maps/search/?api=1&query=${
|
||||||
|
user.location
|
||||||
|
}"><span class="iconify" data-icon="mdi-map-marker"></span> ${
|
||||||
|
user.location
|
||||||
|
}</a></span>
|
||||||
|
<span style="display:${
|
||||||
|
user.hireable == false || !user.hireable ? "none" : "block"
|
||||||
|
};"><span class="iconify" data-icon="mdi-account-tie"></span> Available for hire</span>
|
||||||
|
<div class="socials">
|
||||||
|
<span style="display:${
|
||||||
|
codepen == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://codepen.io/${codepen}" target="_blank" class="socials"><span class="iconify" data-icon="simple-icons:codepen"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
dev == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://dev.to/${dev}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-dev-to"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
dribbble == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://www.dribbble.com/${dribbble}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-dribbble"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
facebook == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://facebook.com/${facebook}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-facebook-box"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
instagram == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://www.instagram.com/${instagram}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-instagram"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
keybase == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://keybase.io/${keybase}" target="_blank" class="socials"><span class="iconify" data-icon="simple-icons:keybase"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
medium == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://medium.com/@${medium}" target="_blank" class="socials"><span class="iconify" data-icon="fa-brands:medium-m"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
reddit == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://www.reddit.com/u/${reddit}" target="_blank" class="socials"><span class="iconify" data-icon="fa:reddit-alien"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
stackexchange == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://stackexchange.com/users/${stackexchange}" target="_blank" class="socials"><span class="iconify" data-icon="mdi:stack-exchange"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
steam == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://steamcommunity.com/id/${steam}" target="_blank" class="socials"><span class="iconify" data-icon="mdi:steam"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
telegram == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://t.me/${telegram}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-telegram"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
twitter == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://www.twitter.com/${twitter}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-twitter"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
xda == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://forum.xda-developers.com/member.php?u=${xda}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-xda"></span></a></span>
|
||||||
|
<span style="display:${
|
||||||
|
youtube == null ? "none !important" : "block"
|
||||||
|
};"><a href="https://www.youtube.com/channel/${youtube}" target="_blank" class="socials"><span class="iconify" data-icon="mdi-youtube"></span></a></span>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
//Script
|
||||||
|
document.getElementById("script").innerHTML = `<script>
|
||||||
|
const magicProjectsGrid = new MagicGrid({
|
||||||
|
container: "#work_section",
|
||||||
|
animate: false,
|
||||||
|
gutter: 30, // default gutter size
|
||||||
|
static: true,
|
||||||
|
useMin: false,
|
||||||
|
maxColumns: 2,
|
||||||
|
useTransform: true
|
||||||
|
});
|
||||||
|
|
||||||
|
const magicForksGrid = new MagicGrid({
|
||||||
|
container: "#forks_section",
|
||||||
|
animate: false,
|
||||||
|
gutter: 30, // default gutter size
|
||||||
|
static: true,
|
||||||
|
useMin: false,
|
||||||
|
maxColumns: 2,
|
||||||
|
useTransform: true
|
||||||
|
});
|
||||||
|
|
||||||
|
$("document").ready(() => {
|
||||||
|
magicProjectsGrid.listen();
|
||||||
|
magicForksGrid.listen();
|
||||||
|
});
|
||||||
|
|
||||||
|
// function([string1, string2],target id,[color1,color2])
|
||||||
|
consoleText(["${user.name}", "${user.bio}"], "text", [
|
||||||
|
"white",
|
||||||
|
"white"
|
||||||
|
]);
|
||||||
|
|
||||||
|
function consoleText(words, id, colors) {
|
||||||
|
if (colors === undefined) colors = ["#fff"];
|
||||||
|
var visible = true;
|
||||||
|
var con = document.getElementById("console");
|
||||||
|
var letterCount = 1;
|
||||||
|
var x = 1;
|
||||||
|
var waiting = false;
|
||||||
|
var target = document.getElementById(id);
|
||||||
|
target.setAttribute("style", "color:" + colors[0]);
|
||||||
|
window.setInterval(function() {
|
||||||
|
if (letterCount === 0 && waiting === false) {
|
||||||
|
waiting = true;
|
||||||
|
target.innerHTML = words[0].substring(0, letterCount);
|
||||||
|
window.setTimeout(function() {
|
||||||
|
var usedColor = colors.shift();
|
||||||
|
colors.push(usedColor);
|
||||||
|
var usedWord = words.shift();
|
||||||
|
words.push(usedWord);
|
||||||
|
x = 1;
|
||||||
|
target.setAttribute("style", "color:" + colors[0]);
|
||||||
|
letterCount += x;
|
||||||
|
waiting = false;
|
||||||
|
}, 1000);
|
||||||
|
} else if (letterCount === words[0].length + 1 && waiting === false) {
|
||||||
|
waiting = true;
|
||||||
|
window.setTimeout(function() {
|
||||||
|
x = -1;
|
||||||
|
letterCount += x;
|
||||||
|
waiting = false;
|
||||||
|
}, 1000);
|
||||||
|
} else if (waiting === false) {
|
||||||
|
target.innerHTML = words[0].substring(0, letterCount);
|
||||||
|
letterCount += x;
|
||||||
|
}
|
||||||
|
}, 120);
|
||||||
|
window.setInterval(function() {
|
||||||
|
if (visible === true) {
|
||||||
|
con.className = "console-underscore hidden";
|
||||||
|
visible = false;
|
||||||
|
} else {
|
||||||
|
con.className = "console-underscore";
|
||||||
|
|
||||||
|
visible = true;
|
||||||
|
}
|
||||||
|
}, 400);
|
||||||
|
}
|
||||||
|
</script>`;
|
||||||
|
//add data to config.json
|
||||||
|
const data = await getConfig();
|
||||||
|
data[0].username = user.login;
|
||||||
|
data[0].name = user.name;
|
||||||
|
data[0].userimg = user.avatar_url;
|
||||||
|
|
||||||
|
await fs.writeFile(
|
||||||
|
`${outDir}/config.json`,
|
||||||
|
JSON.stringify(data, null, " "),
|
||||||
|
function(err) {
|
||||||
|
if (err) throw err;
|
||||||
|
console.log("Config file updated.");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
await fs.writeFile(
|
||||||
|
`${outDir}/gamer.html`,
|
||||||
|
`<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="7; url='https://www.youtube.com/playlist?list=UUp0gATorETNZ6ttOTMeV7jA'" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Please follow <a href="https://www.youtube.com/playlist?list=UUp0gATorETNZ6ttOTMeV7jA">this link</a>.</p>
|
||||||
|
</body>
|
||||||
|
</html>`,
|
||||||
|
function(error) {
|
||||||
|
if (error) throw error;
|
||||||
|
console.log("Wrote gamer.html");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
await fs.writeFile(
|
||||||
|
`${outDir}/vps.html`,
|
||||||
|
`<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="refresh" content="7; url='http://207.244.250.120/'" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Please follow <a href="http://207.244.250.120/">this link</a>.</p>
|
||||||
|
</body>
|
||||||
|
</html>`,
|
||||||
|
function(error) {
|
||||||
|
if (error) throw error;
|
||||||
|
console.log("Wrote vps.html");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
await fs.writeFile(
|
||||||
|
`${outDir}/keybase.txt`,
|
||||||
|
`==================================================================
|
||||||
|
https://keybase.io/dilll
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
I hereby claim:
|
||||||
|
|
||||||
|
* I am an admin of https://dylanh.dev
|
||||||
|
* I am dilll (https://keybase.io/dilll) on keybase.
|
||||||
|
* I have a public key with fingerprint 9D2F 65D5 8FE7 5DED 1B8E 3B12 E58D 4317 E154 D022
|
||||||
|
|
||||||
|
To do so, I am signing this object:
|
||||||
|
|
||||||
|
{
|
||||||
|
"body": {
|
||||||
|
"key": {
|
||||||
|
"eldest_kid": "0120390f95b82550aa978d217eeac984e667e5b39cf01f64dadcd4899090a19919780a",
|
||||||
|
"fingerprint": "9d2f65d58fe75ded1b8e3b12e58d4317e154d022",
|
||||||
|
"host": "keybase.io",
|
||||||
|
"key_id": "e58d4317e154d022",
|
||||||
|
"kid": "0101b1f37fc0a6e762d2f16c51c2cc86129d89630638017cb71f17f23a082b1820130a",
|
||||||
|
"uid": "9432f8a7178f663cc1f70c77cbe51319",
|
||||||
|
"username": "dilll"
|
||||||
|
},
|
||||||
|
"service": {
|
||||||
|
"hostname": "dylanh.dev",
|
||||||
|
"protocol": "https:"
|
||||||
|
},
|
||||||
|
"type": "web_service_binding",
|
||||||
|
"version": 1
|
||||||
|
},
|
||||||
|
"ctime": 1556653778,
|
||||||
|
"expire_in": 157680000,
|
||||||
|
"prev": "6311ea796c2fdce63368d0422d2cd6fd5382355c793a82d8c50cac59ed6f147f",
|
||||||
|
"seqno": 26,
|
||||||
|
"tag": "signature"
|
||||||
|
}
|
||||||
|
|
||||||
|
which yields the signature:
|
||||||
|
|
||||||
|
-----BEGIN PGP MESSAGE-----
|
||||||
|
Version: Keybase OpenPGP v2.1.0
|
||||||
|
Comment: https://keybase.io/crypto
|
||||||
|
|
||||||
|
yMNxAnicbVJtUFRlFAZpS0AUauJjotQLihEf970f7713Z2oCtGITRpNVK2q5H++F
|
||||||
|
22676+6ygMCUjSPCxFqSDaPgqINAipKjw4BWG+Q0KCqfDkIwBoOiwAoj1DBE0V0m
|
||||||
|
/vX+OfOe8zzPec6Zcz3IzyfA90F5SthIRhfm29FakeuT2V7bU4gJFqkA0xZiRrQc
|
||||||
|
kElCdofBqEiYFsMBgZMcLnO0wBI0jfM8x7ASARiEeJFjKQQhg2iB5EQZBzKkJF4S
|
||||||
|
JYrlOJzDecBxQIXjPBaHyYo5G9msNsXsUGU5iZAhLdGsjBhaQhIQWEQKgEA0K1Gk
|
||||||
|
qg5oSsIJQiXmWOxehmpO4O0oQbGoOfVjWLb3P/gV3zgQgEwysojzEDGQUDsCKNJA
|
||||||
|
JESRhYDgJJaDJA5JFgeMKDBABoxMkDzOEgJgCRyQy75zl+U4iiRklmcAw8oQkqII
|
||||||
|
ZAYXGZWHaEACzgu0I5uZ/xSpaEkxmUxYcRymppyKiLxb9Y6xUi4w8eacBAk5VZrV
|
||||||
|
ZnFYRItJzec4HFa71stzFFi9wDwkGP6TMAiKWVJXqDKcyGZXLGZMC1Sk6FC8moCm
|
||||||
|
IaRJhmHjMJRvVWzIoHgRNANZXH3ePmo7LQZJABDPcFAkZElEkCQhK+EUoa5HlKAs
|
||||||
|
0SRLkDQtMhzJs4TEijQu8iLNIbUIKEbGvEPtM1swLQFVn3y2qmlXss28I9eGsOK2
|
||||||
|
1sxnfHwDfJ7VrPLelk+Af/DKxcHxdUtZ60cTy8I+GvAbWVNwMI9yRHy8uOmRoc2K
|
||||||
|
QpdSTsWk1/1eenx39EL96raLMzvwYHdaTs/8wzPRERvHX+0ypZ7YNFdOkUMD5rPj
|
||||||
|
o9/de9zx2/PG/ceOFR8Kjvk65OUrT+c2t/j3x1T1pg00zZPV+ANNyJDw1qz+WkYg
|
||||||
|
MPZf5ks0h3cc8CTWvH+k4AvLlSRqMcov0zV8acyjzD4patr+bnXClsNJoS80Hj0d
|
||||||
|
OxOyt7b8Ubv4yerPS92N+oCUssLMoSeBMc4+c0lo5OWUquRQrqHZHXFPhy8wkXtE
|
||||||
|
EGQbvqjv1FygqwbWoG/qg+/3Di7+IGnC83RX689sPbnubtbA3mt/uuZhVHL06+Q/
|
||||||
|
Ve6asZjm6Bc9+w52x16PG+zVVfU6dRp+MPL4H+vZ3dUHnvvQuHPL3/517+gGO9eW
|
||||||
|
xt9udr3nE7BQCdomw99ugNuoyl+J/TcnUk/0k41Jr3kmPuvKmtXnRuQU6q6eh3u2
|
||||||
|
vZQ/fGM67efNp2am6jzdjoyghkuj20/fPxm466nLuatlJL+nqOjQnYo7qypu596t
|
||||||
|
qfsxrc9Y/W3ThkrPdGJHi7vol4mptUnp02UftCaFT2rcM+c6Y/v0qXrrzvYvsRGb
|
||||||
|
K8/zV2vD0e/HiKGH3c1zG155I95zpCK+5M3Kc1FNG13O2NopA7t4czI5+6v0YPns
|
||||||
|
LeW8cuPxraW6n9wwLO/Cv16Pxg0=
|
||||||
|
=wUqU
|
||||||
|
-----END PGP MESSAGE-----
|
||||||
|
|
||||||
|
And finally, I am proving ownership of this host by posting or
|
||||||
|
appending to this document.
|
||||||
|
|
||||||
|
View my publicly-auditable identity here: https://keybase.io/dilll
|
||||||
|
|
||||||
|
==================================================================`,
|
||||||
|
function(error) {
|
||||||
|
if (error) throw error;
|
||||||
|
console.log(`wrote keybase.txt`);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
await fs.writeFile(
|
||||||
|
`${outDir}/index.html`,
|
||||||
|
"<!DOCTYPE html>" + window.document.documentElement.outerHTML,
|
||||||
|
function(error) {
|
||||||
|
if (error) throw error;
|
||||||
|
console.log(`Build Complete, Files can be Found @ ${outDir}\n`);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
})
|
||||||
|
.catch(function(error) {
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
22
run.js
Normal file
22
run.js
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
const path = require("path");
|
||||||
|
const express = require("express");
|
||||||
|
const outDir = path.resolve("./dist/" || process.env.OUT_DIR);
|
||||||
|
const app = express();
|
||||||
|
app.use(express.static(`${outDir}`));
|
||||||
|
|
||||||
|
function runCommand(program) {
|
||||||
|
const port = program.port ? program.port : 3000;
|
||||||
|
|
||||||
|
app.get("/", (req, res) => {
|
||||||
|
res.sendFile("/index.html");
|
||||||
|
});
|
||||||
|
|
||||||
|
app.listen(port);
|
||||||
|
console.log(
|
||||||
|
`\nGitfolio running on port ${port}, Navigate to http://localhost:${port} in your browser\n`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
runCommand
|
||||||
|
};
|
114
ui.js
Normal file
114
ui.js
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
const fs = require("fs");
|
||||||
|
const express = require("express");
|
||||||
|
const jsdom = require("jsdom").JSDOM;
|
||||||
|
const { updateHTML } = require("./populate");
|
||||||
|
const { populateCSS, populateConfig } = require("./build");
|
||||||
|
const { updateCommand } = require("./update");
|
||||||
|
const app = express();
|
||||||
|
app.set("view engine", "ejs");
|
||||||
|
app.use(express.static(__dirname + "/views"));
|
||||||
|
app.set("views", __dirname + "/views");
|
||||||
|
app.use(
|
||||||
|
express.json({
|
||||||
|
limit: "50mb"
|
||||||
|
})
|
||||||
|
);
|
||||||
|
app.use(
|
||||||
|
express.urlencoded({
|
||||||
|
limit: "50mb",
|
||||||
|
extended: true
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const port = 3000;
|
||||||
|
|
||||||
|
global.DOMParser = new jsdom().window.DOMParser;
|
||||||
|
const { outDir } = require("./utils");
|
||||||
|
|
||||||
|
function uiCommand() {
|
||||||
|
app.get("/", (req, res) => {
|
||||||
|
res.render("index.ejs");
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/update", (req, res) => {
|
||||||
|
if (!fs.existsSync(`${outDir}/config.json`)) {
|
||||||
|
return res.send(
|
||||||
|
'You need to run build command before using update<br><a href="/">Go Back</a>'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateCommand();
|
||||||
|
res.redirect("/");
|
||||||
|
});
|
||||||
|
|
||||||
|
app.post("/build", (req, res) => {
|
||||||
|
const { username } = req.body;
|
||||||
|
if (!username) {
|
||||||
|
return res.send("username can't be empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
const sort = req.body.sort ? req.body.sort : "created";
|
||||||
|
const order = req.body.order ? req.body.order : "asc";
|
||||||
|
const includeFork = req.body.fork === "true";
|
||||||
|
const types = ["owner"];
|
||||||
|
const codepen = req.body.codepen ? req.body.codepen : null;
|
||||||
|
const dev = req.body.dev ? req.body.dev : null;
|
||||||
|
const dribbble = req.body.dribbble ? req.body.dribbble : null;
|
||||||
|
const email = req.body.email ? req.body.email : null;
|
||||||
|
const facebook = req.body.facebook ? req.body.facebook : null;
|
||||||
|
const instagram = req.body.instagram ? req.body.instagram : null;
|
||||||
|
const keybase = req.body.keybase ? req.body.keybase : null;
|
||||||
|
const medium = req.body.medium ? req.body.medium : null;
|
||||||
|
const reddit = req.body.reddit ? req.body.reddit : null;
|
||||||
|
const stackexchange = req.body.stackexchange
|
||||||
|
? req.body.stackexchange
|
||||||
|
: null;
|
||||||
|
const steam = req.body.steam ? req.body.steam : null;
|
||||||
|
const telegram = req.body.telegram ? req.body.telegram : null;
|
||||||
|
const twitter = req.body.twitter ? req.body.twitter : null;
|
||||||
|
const xda = req.body.xda ? req.body.xda : null;
|
||||||
|
const youtube = req.body.youtube ? req.body.youtube : null;
|
||||||
|
const background = req.body.background
|
||||||
|
? req.body.background
|
||||||
|
: "https://source.unsplash.com/1280x720/?wallpaper";
|
||||||
|
const theme = req.body.theme === "on" ? "dark" : "light";
|
||||||
|
const opts = {
|
||||||
|
sort,
|
||||||
|
order,
|
||||||
|
includeFork,
|
||||||
|
types,
|
||||||
|
codepen,
|
||||||
|
dev,
|
||||||
|
dribbble,
|
||||||
|
email,
|
||||||
|
facebook,
|
||||||
|
instagram,
|
||||||
|
keybase,
|
||||||
|
medium,
|
||||||
|
reddit,
|
||||||
|
stackexchange,
|
||||||
|
steam,
|
||||||
|
telegram,
|
||||||
|
twitter,
|
||||||
|
xda
|
||||||
|
};
|
||||||
|
|
||||||
|
updateHTML(username, opts);
|
||||||
|
populateCSS({
|
||||||
|
background,
|
||||||
|
theme
|
||||||
|
});
|
||||||
|
populateConfig(opts);
|
||||||
|
res.redirect("/");
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("\nStarting...");
|
||||||
|
app.listen(port);
|
||||||
|
console.log(
|
||||||
|
`The GUI is running on port ${port}, Navigate to http://localhost:${port} in your browser\n`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
uiCommand
|
||||||
|
};
|
53
update.js
53
update.js
|
@ -1,13 +1,40 @@
|
||||||
const fs = require('fs');
|
const { getConfig } = require("./utils");
|
||||||
const {updateHTML} = require('./populate');
|
const { updateHTML } = require("./populate");
|
||||||
|
|
||||||
fs.readFile("./dist/config.json", function (err , data) {
|
async function updateCommand() {
|
||||||
if (err) throw err;
|
const data = await getConfig();
|
||||||
data = JSON.parse(data);
|
const { username } = data[0];
|
||||||
var username = data[0].username;
|
if (username === null) {
|
||||||
if(!username || username == null){
|
console.log(
|
||||||
console.log("username not found in config.json, please run build command before using update");
|
"username not found in config.json, please run build command before using update"
|
||||||
return;
|
);
|
||||||
}
|
return;
|
||||||
updateHTML(username);
|
}
|
||||||
});
|
|
||||||
|
const opts = {
|
||||||
|
sort: data[0].sort,
|
||||||
|
order: data[0].order,
|
||||||
|
includeFork: data[0].includeFork,
|
||||||
|
types: data[0].types,
|
||||||
|
codepen: data[0].codepen,
|
||||||
|
dev: data[0].dev,
|
||||||
|
dribbble: data[0].dribbble,
|
||||||
|
email: data[0].email,
|
||||||
|
facebook: data[0].facebook,
|
||||||
|
instagram: data[0].instagram,
|
||||||
|
keybase: data[0].keybase,
|
||||||
|
medium: data[0].medium,
|
||||||
|
reddit: data[0].reddit,
|
||||||
|
stackexchange: data[0].stackexchange,
|
||||||
|
steam: data[0].steam,
|
||||||
|
telegram: data[0].telegram,
|
||||||
|
twitter: data[0].twitter,
|
||||||
|
xda: data[0].xda,
|
||||||
|
youtube: data[0].youtube
|
||||||
|
};
|
||||||
|
updateHTML(username, opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
updateCommand
|
||||||
|
};
|
||||||
|
|
33
utils.js
Normal file
33
utils.js
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
const path = require("path");
|
||||||
|
const bluebird = require("bluebird");
|
||||||
|
const fs = bluebird.promisifyAll(require("fs"));
|
||||||
|
|
||||||
|
const outDir = path.resolve("./dist/" || process.env.OUT_DIR);
|
||||||
|
const configPath = path.join(outDir, "config.json");
|
||||||
|
|
||||||
|
const defaultConfigPath = path.resolve(`${__dirname}/default/config.json`);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tries to read file from out dir,
|
||||||
|
* if not present returns default file contents
|
||||||
|
*/
|
||||||
|
async function getFileWithDefaults(file, defaultFile) {
|
||||||
|
try {
|
||||||
|
await fs.accessAsync(file, fs.constants.F_OK);
|
||||||
|
} catch (error) {
|
||||||
|
const defaultData = await fs.readFileAsync(defaultFile);
|
||||||
|
return JSON.parse(defaultData);
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = await fs.readFileAsync(file);
|
||||||
|
return JSON.parse(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getConfig() {
|
||||||
|
return getFileWithDefaults(configPath, defaultConfigPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
outDir,
|
||||||
|
getConfig
|
||||||
|
};
|
BIN
views/css/font/Circular.otf
Normal file
BIN
views/css/font/Circular.otf
Normal file
Binary file not shown.
173
views/css/index.css
Normal file
173
views/css/index.css
Normal file
|
@ -0,0 +1,173 @@
|
||||||
|
@import url("https://fonts.googleapis.com/css?family=Poppins");
|
||||||
|
@import url("https://fonts.googleapis.com/css?family=Questrial");
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Circular";
|
||||||
|
src: url("./font/Circular.otf");
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0%;
|
||||||
|
padding: 0%;
|
||||||
|
width: 100vw;
|
||||||
|
max-width: 100vw;
|
||||||
|
overflow-x: hidden;
|
||||||
|
align-items: center;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
background: rgb(250, 250, 250) !important;
|
||||||
|
will-change: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
width: 90vw;
|
||||||
|
padding: 4vh 5vw;
|
||||||
|
font-weight: bold;
|
||||||
|
background: rgb(255, 255, 255);
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
header b {
|
||||||
|
font-family: "Circular", sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
header a {
|
||||||
|
font-size: 16px;
|
||||||
|
margin: 1.8vh 0;
|
||||||
|
margin-left: 4vw;
|
||||||
|
color: #000;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: 0.4s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
header a:hover {
|
||||||
|
color: #bebebe;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
width: 90vw;
|
||||||
|
padding: 2vh 5vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
form .button {
|
||||||
|
margin: 2vh 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
margin: 1.5vh 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
display: inline-block !important;
|
||||||
|
margin-right: 25px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
transition: 0.4s ease-in-out !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
color: #fff;
|
||||||
|
background: #000 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.-size-small {
|
||||||
|
margin-right: 1vw !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#top_image {
|
||||||
|
width: 100vw;
|
||||||
|
height: 50vh;
|
||||||
|
position: absolute;
|
||||||
|
top: 14vh;
|
||||||
|
left: 0;
|
||||||
|
background: linear-gradient(0deg, rgb(250, 250, 250), rgb(200, 200, 200));
|
||||||
|
background-size: cover !important;
|
||||||
|
background-repeat: no-repeat !important;
|
||||||
|
z-index: 1;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove i {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-right: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#top_image i {
|
||||||
|
font-size: 20px;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 5;
|
||||||
|
top: 4vh;
|
||||||
|
right: 5vw;
|
||||||
|
padding: 15px 15px;
|
||||||
|
background: #fff;
|
||||||
|
color: rgb(0, 0, 0);
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#top_image i:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div_for_buttons {
|
||||||
|
margin-top: 5vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.para {
|
||||||
|
font-size: 17px;
|
||||||
|
line-height: 25px;
|
||||||
|
word-spacing: 1.2px;
|
||||||
|
margin: 5vh 0;
|
||||||
|
background: transparent;
|
||||||
|
border: 0;
|
||||||
|
width: 100%;
|
||||||
|
font-family: "Questrial", sans-serif;
|
||||||
|
resize: none;
|
||||||
|
height: auto;
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.para span {
|
||||||
|
padding: 2px 4px;
|
||||||
|
background: #000;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove {
|
||||||
|
margin-bottom: 2vh 0;
|
||||||
|
font-weight: bold;
|
||||||
|
transition: 0.4s ease-in-out;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
color: rgb(255, 70, 70);
|
||||||
|
}
|
||||||
|
|
||||||
|
::selection {
|
||||||
|
color: #fff;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
input,
|
||||||
|
textarea:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
::placeholder {
|
||||||
|
color: #000;
|
||||||
|
}
|
247
views/index.ejs
Normal file
247
views/index.ejs
Normal file
|
@ -0,0 +1,247 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
||||||
|
<title>Gitfolio UI</title>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"
|
||||||
|
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
|
||||||
|
crossorigin="anonymous"
|
||||||
|
/>
|
||||||
|
<link rel="stylesheet" type="text/css" href="./css/index.css" />
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdn.jsdelivr.net/gh/zeva-ui/zeva/dist/css/zeva.min.css"
|
||||||
|
/>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="body-light">
|
||||||
|
<header>
|
||||||
|
<b>gitfolio</b>
|
||||||
|
<a href="/update" style="float: right">Update</a>
|
||||||
|
<a href="/" style="float: right">Home</a>
|
||||||
|
</header>
|
||||||
|
<form method="post" action="build">
|
||||||
|
<h3>Build or Edit Portfolio</h3>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="username"
|
||||||
|
id="username"
|
||||||
|
name="username"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="background"
|
||||||
|
name="background"
|
||||||
|
id="background"
|
||||||
|
/>
|
||||||
|
<h3>Sort By :</h3>
|
||||||
|
<label class="label">
|
||||||
|
Star
|
||||||
|
<input type="radio" name="sort" value="star" />
|
||||||
|
<span class="radio"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="label">
|
||||||
|
Created
|
||||||
|
<input type="radio" name="sort" value="created" checked />
|
||||||
|
<span class="radio"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="label">
|
||||||
|
Updated
|
||||||
|
<input type="radio" name="sort" value="updated" />
|
||||||
|
<span class="radio"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="label">
|
||||||
|
Pushed
|
||||||
|
<input type="radio" name="sort" value="pushed" />
|
||||||
|
<span class="radio"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="label">
|
||||||
|
Full Name
|
||||||
|
<input type="radio" name="sort" value="full_name" />
|
||||||
|
<span class="radio"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<h3>Order By :</h3>
|
||||||
|
<label class="label">
|
||||||
|
Asc
|
||||||
|
<input type="radio" name="order" value="asc" checked />
|
||||||
|
<span class="radio"></span>
|
||||||
|
</label>
|
||||||
|
<label class="label">
|
||||||
|
Desc
|
||||||
|
<input type="radio" name="order" value="desc" />
|
||||||
|
<span class="radio"></span>
|
||||||
|
</label>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<label class="label">
|
||||||
|
Use Dark Theme
|
||||||
|
<input type="checkbox" id="theme" name="theme" />
|
||||||
|
<span class="checkbox"></span>
|
||||||
|
</label>
|
||||||
|
<label class="label">
|
||||||
|
Include Forks
|
||||||
|
<input type="checkbox" id="fork" name="fork" value="true" />
|
||||||
|
<span class="checkbox"></span>
|
||||||
|
</label>
|
||||||
|
<label class="label">
|
||||||
|
Include Socials
|
||||||
|
<input type="checkbox" id="socials" name="socials" />
|
||||||
|
<span class="checkbox"></span>
|
||||||
|
</label>
|
||||||
|
<div style="display: none" id="input_for_socials">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="codepen username"
|
||||||
|
id="codepen"
|
||||||
|
name="codepen"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="dev username"
|
||||||
|
id="dev"
|
||||||
|
name="dev"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="dribbble username"
|
||||||
|
id="dribbble"
|
||||||
|
name="dribbble"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="email address"
|
||||||
|
id="email"
|
||||||
|
name="email"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="facebook username"
|
||||||
|
id="facebook"
|
||||||
|
name="facebook"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="instagram username"
|
||||||
|
id="instagram"
|
||||||
|
name="instagram"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="keybase username"
|
||||||
|
id="keybase"
|
||||||
|
name="keybase"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="medium username"
|
||||||
|
id="medium"
|
||||||
|
name="medium"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="reddit username"
|
||||||
|
id="reddit"
|
||||||
|
name="reddit"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="stackexchange username"
|
||||||
|
id="stackexchange"
|
||||||
|
name="stackexchange"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="steam username"
|
||||||
|
id="steam"
|
||||||
|
name="steam"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="telegram username"
|
||||||
|
id="telegram"
|
||||||
|
name="telegram"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="twitter username"
|
||||||
|
id="twitter"
|
||||||
|
name="twitter"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="xda user id"
|
||||||
|
id="xda"
|
||||||
|
name="xda"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="input h-weight-bold"
|
||||||
|
placeholder="youtube user id"
|
||||||
|
id="youtube"
|
||||||
|
name="youtube"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<button type="submit" class="button" id="build">Build</button>
|
||||||
|
</form>
|
||||||
|
<script
|
||||||
|
type="text/javascript"
|
||||||
|
src="https://cdn.jsdelivr.net/gh/zeva-ui/zeva/dist/js/index.min.js"
|
||||||
|
></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
document.querySelector("#socials").addEventListener("change", event => {
|
||||||
|
if (event.target.checked) {
|
||||||
|
document.querySelector("#input_for_socials").style.display = "block";
|
||||||
|
} else {
|
||||||
|
document.querySelector("#input_for_socials").style.display = "none";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Add table
Add a link
Reference in a new issue