-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add year key to the projects and configuration
- Loading branch information
Showing
26 changed files
with
150 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "10 sec clicker!", | ||
"description": "Let's click", | ||
"author": "safesuk", | ||
"facebook": "https://www.facebook.com/nattapat.sukpootanan" | ||
} | ||
"name": "10 sec clicker!", | ||
"description": "Let's click", | ||
"author": "safesuk", | ||
"facebook": "https://www.facebook.com/nattapat.sukpootanan", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "Rock Paper Scissor Spock Lizard", | ||
"description": "Just a rock paper scissor (only with 5 ways)", | ||
"author": "Yuttakhan Baingen", | ||
"facebook": "https://www.facebook.com/yuttakhan.baingen" | ||
} | ||
"name": "Rock Paper Scissor Spock Lizard", | ||
"description": "Just a rock paper scissor (only with 5 ways)", | ||
"author": "Yuttakhan Baingen", | ||
"facebook": "https://www.facebook.com/yuttakhan.baingen", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "Aleph Zero", | ||
"description": "ℵ0 ℵ1 ℵ2...", | ||
"author": "aomKhunpanitchot", | ||
"facebook": "https://www.facebook.com/AomKhunpanitchot" | ||
} | ||
"name": "Aleph Zero", | ||
"description": "ℵ0 ℵ1 ℵ2...", | ||
"author": "aomKhunpanitchot", | ||
"facebook": "https://www.facebook.com/AomKhunpanitchot", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "BNK48 Guess the name", | ||
"description": "Guess the current members name", | ||
"author": "NOEI", | ||
"facebook": "https://www.facebook.com/sarayut.booytawee" | ||
} | ||
"name": "BNK48 Guess the name", | ||
"description": "Guess the current members name", | ||
"author": "NOEI", | ||
"facebook": "https://www.facebook.com/sarayut.booytawee", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "Breakout!", | ||
"description": "Just destroy all bricks and win!", | ||
"author": "Pimanus Kutragoon", | ||
"facebook": "https://www.facebook.com/earthgy.pimanus" | ||
} | ||
"name": "Breakout!", | ||
"description": "Just destroy all bricks and win!", | ||
"author": "Pimanus Kutragoon", | ||
"facebook": "https://www.facebook.com/earthgy.pimanus", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,61 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const excludes = [".git", ".idea", "node_modules"]; | ||
const directories = []; | ||
const excludes = ['.git', '.idea', 'node_modules'] | ||
const directories = [] | ||
|
||
const { years } = require('./config') | ||
|
||
fs.readdirSync(path.join(__dirname)).forEach(file => { | ||
if (fs.lstatSync(path.join(__dirname, file)).isDirectory()) { | ||
if (!excludes.includes(file)) { | ||
directories.push(file); | ||
} | ||
if (fs.lstatSync(path.join(__dirname, file)).isDirectory()) { | ||
if (!excludes.includes(file)) { | ||
directories.push(file) | ||
} | ||
}); | ||
|
||
let gameTemplate = ``; | ||
} | ||
}) | ||
|
||
let gameTemplateMap = {} | ||
|
||
for (const { year, header, description } of years) { | ||
gameTemplateMap[year] = ` | ||
<div> | ||
<h1 class="heading">${header}</h1> | ||
<p class="desc">${description}</p> | ||
<a | ||
class="hacking" | ||
href="https://github.com/chunza2542/noobtoberfest" | ||
target="_blank" | ||
>START HACKING</a> | ||
</div> | ||
<br /> | ||
<hr /> | ||
` | ||
} | ||
|
||
directories.forEach(directory => { | ||
let info = fs.readFileSync(path.join(__dirname, directory, "info.json")); | ||
info = JSON.parse(info.toString()); | ||
let info = fs.readFileSync(path.join(__dirname, directory, 'info.json')) | ||
info = JSON.parse(info.toString()) | ||
|
||
const template = ` | ||
const template = ` | ||
<div class="game"> | ||
<a class="head" href="/${directory}" target="_blank"><h3>${info.name}</h3></a> | ||
<p style="color: #ccc">${info.description}</p> | ||
<a href="${info.facebook}" target="_blank" class="author">${info.author}</a> | ||
</div>` | ||
|
||
gameTemplate += template; | ||
}); | ||
gameTemplateMap[info.year] += template | ||
}) | ||
|
||
const totalTemplate = years | ||
.map(({ year }) => gameTemplateMap[year]) | ||
|
||
let htmlTemplate = fs.readFileSync(path.join(__dirname, "template.html")).toString(); | ||
htmlTemplate = htmlTemplate.replace("#include-template", gameTemplate); | ||
.join() | ||
|
||
fs.writeFileSync("index.html", htmlTemplate); | ||
console.log("Done~"); | ||
let htmlTemplate = fs | ||
.readFileSync(path.join(__dirname, 'template.html')) | ||
.toString() | ||
|
||
htmlTemplate = htmlTemplate.replace('#include-template', totalTemplate) | ||
|
||
fs.writeFileSync('index.html', htmlTemplate) | ||
console.log('Done~') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
years: [ | ||
{ | ||
year: 2020, | ||
header: 'Noobtoberfest 2020', | ||
description: `Game-coding challenge for everyone who wants to contribute to an open-source project for Hacktoberfest 2020`, | ||
}, | ||
{ | ||
year: 2019, | ||
header: 'Noobtoberfest 2019', | ||
description: `Game-coding challenge for everyone who wants to contribute to an open-source project for Hacktoberfest 2019`, | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "Dream Time", | ||
"description": "Click button to plant the flower.", | ||
"author": "Kanokpit Yowaratch", | ||
"facebook": "https://www.facebook.com/kanokpit.y" | ||
} | ||
"name": "Dream Time", | ||
"description": "Click button to plant the flower.", | ||
"author": "Kanokpit Yowaratch", | ||
"facebook": "https://www.facebook.com/kanokpit.y", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "Fruit or Vegetable", | ||
"description": "Test your knowledge!", | ||
"author": "pugkung", | ||
"facebook": "https://www.facebook.com/axid.pugkung" | ||
} | ||
"name": "Fruit or Vegetable", | ||
"description": "Test your knowledge!", | ||
"author": "pugkung", | ||
"facebook": "https://www.facebook.com/axid.pugkung", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "Predict number", | ||
"description": "Prediction number start predict went counter more than 5", | ||
"author": "Phumai Chanphunga", | ||
"facebook": "https://www.facebook.com/phumisito" | ||
} | ||
"name": "Predict number", | ||
"description": "Prediction number start predict went counter more than 5", | ||
"author": "Phumai Chanphunga", | ||
"facebook": "https://www.facebook.com/phumisito", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "Press F for no reason", | ||
"description": "just press F (or r for reset on keyboard)", | ||
"author": "Chayapatr Archiwaranguprok", | ||
"facebook": "https://www.facebook.com/chayapatr" | ||
} | ||
"name": "Press F for no reason", | ||
"description": "just press F (or r for reset on keyboard)", | ||
"author": "Chayapatr Archiwaranguprok", | ||
"facebook": "https://www.facebook.com/chayapatr", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
{ | ||
"name": "Roulette", | ||
"description": "Spin to green box, and you will get reward. if not score will decrease.", | ||
"author": "Supawit Ruen", | ||
"facebook": "https://www.facebook.com/supawit.ruen" | ||
"facebook": "https://www.facebook.com/supawit.ruen", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "tic tac toe", | ||
"description": "Attempted to start tic tac toe in HTML. ", | ||
"author": "T. Rob.", | ||
"facebook": "N/A" | ||
"name": "tic tac toe", | ||
"description": "Attempted to start tic tac toe in HTML. ", | ||
"author": "T. Rob.", | ||
"facebook": "N/A", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "tic tac toe", | ||
"description": "Attempted to start tic tac toe in HTML. ", | ||
"author": "T. Rob.", | ||
"facebook": "N/A" | ||
"name": "tic tac toe", | ||
"description": "Attempted to start tic tac toe in HTML. ", | ||
"author": "T. Rob.", | ||
"facebook": "N/A", | ||
"year": 2019 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "type in 1 sec", | ||
"description": "let's type", | ||
"author": "safesuk", | ||
"facebook": "https://www.facebook.com/nattapat.sukpootanan" | ||
} | ||
"name": "type in 1 sec", | ||
"description": "let's type", | ||
"author": "safesuk", | ||
"facebook": "https://www.facebook.com/nattapat.sukpootanan", | ||
"year": 2019 | ||
} |