Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main into staging #579

Merged
merged 6 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build_pages_native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
npm install
npm run gen-people
npm run gen-teams
npm run update-stats
hugo --minify
npm run postbuild
# - name: Test HTML code
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_pages_no_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
npm install
npm run gen-people
npm run gen-teams
npm run update-stats
hugo --minify
npm run postbuild
# - name: Test HTML code
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The project will require both people and teams data to be present. If not, these

```sh
npm run gen-people
npm run gen-team
npm run gen-teams
```

## Local admin
Expand Down
Binary file added assets/images/1724437526298-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/1724437526298.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/DIVD x Cyberaquad 2024-04 (1)-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 59 additions & 22 deletions assets/scss/ui/card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
width: 100%;
flex: 0 0 200px;
overflow: hidden;

position: relative;

img {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -40,8 +40,6 @@
display: flex;
flex-direction: column;



h2 {
flex: 1 1 auto;
font-weight: 700;
Expand All @@ -61,10 +59,49 @@
}
}


.card-article {
figure {
clip-path: polygon(360px 220px, 0px calc(100% - 0px), 0px 23.54px, 0px 23.54px, 0.30812px 19.72188px, 1.20016px 16.09984px, 2.62764px 12.72236px, 4.54208px 9.63792px, 6.895px 6.895px, 9.63792px 4.54208px, 12.72236px 2.62764px, 16.09984px 1.20016px, 19.72188px 0.30812px, 23.54px 0, calc(100% - 77.06px) 0px, calc(100% - 77.06px) 0px, calc(100% - 75.89428px) 0.04116px, calc(100% - 74.73984px) 0.16368px, calc(100% - 73.60076px) 0.36612px, calc(100% - 72.48112px) 0.64704px, calc(100% - 71.385px) 1.005px, calc(100% - 70.31648px) 1.43856px, calc(100% - 69.27964px) 1.94628px, calc(100% - 68.27856px) 2.52672px, calc(100% - 67.31732px) 3.17844px, calc(100% - 66.4px) 3.9px, calc(100% - 5.86px) 55.05px, calc(100% - 5.86px) 55.05px, calc(100% - 4.7943899999999px) 56.03488px, calc(100% - 3.8259199999999px) 57.10064px, calc(100% - 2.9581299999999px) 58.23996px, calc(100% - 2.1945599999999px) 59.44552px, calc(100% - 1.5387499999999px) 60.71px, calc(100% - 0.99423999999999px) 62.02608px, calc(100% - 0.56456999999989px) 63.38644px, calc(100% - 0.25327999999996px) 64.78376px, calc(100% - 0.063909999999964px) 66.21072px, calc(100% - 0px) 67.66px, 100% calc(100% - 0.0099999999999909px));
clip-path: polygon(
360px 220px,
0px calc(100% - 0px),
0px 23.54px,
0px 23.54px,
0.30812px 19.72188px,
1.20016px 16.09984px,
2.62764px 12.72236px,
4.54208px 9.63792px,
6.895px 6.895px,
9.63792px 4.54208px,
12.72236px 2.62764px,
16.09984px 1.20016px,
19.72188px 0.30812px,
23.54px 0,
calc(100% - 77.06px) 0px,
calc(100% - 77.06px) 0px,
calc(100% - 75.89428px) 0.04116px,
calc(100% - 74.73984px) 0.16368px,
calc(100% - 73.60076px) 0.36612px,
calc(100% - 72.48112px) 0.64704px,
calc(100% - 71.385px) 1.005px,
calc(100% - 70.31648px) 1.43856px,
calc(100% - 69.27964px) 1.94628px,
calc(100% - 68.27856px) 2.52672px,
calc(100% - 67.31732px) 3.17844px,
calc(100% - 66.4px) 3.9px,
calc(100% - 5.86px) 55.05px,
calc(100% - 5.86px) 55.05px,
calc(100% - 4.7943899999999px) 56.03488px,
calc(100% - 3.8259199999999px) 57.10064px,
calc(100% - 2.9581299999999px) 58.23996px,
calc(100% - 2.1945599999999px) 59.44552px,
calc(100% - 1.5387499999999px) 60.71px,
calc(100% - 0.99423999999999px) 62.02608px,
calc(100% - 0.56456999999989px) 63.38644px,
calc(100% - 0.25327999999996px) 64.78376px,
calc(100% - 0.063909999999964px) 66.21072px,
calc(100% - 0px) 67.66px,
100% calc(100% - 0.0099999999999909px)
);
}
}

Expand All @@ -82,25 +119,24 @@
}

.card-person {
border-radius: 20px;
border-radius: 20px;
padding: 16px;
background-color: #fff;
display: grid;
grid-template-columns: 64px 1fr;
grid-template-rows: auto;
grid-template-areas: "pic head"
"content content";
grid-template-areas:
"pic head"
"content content";


figure {
width: 64px;
height: 64px;
grid-area: pic;
position: relative;
border-radius: 50%;
overflow: hidden;
background-color: #e3e3e3;

background-color: #e3e3e3;
}

header {
Expand Down Expand Up @@ -163,10 +199,10 @@
}

header {

padding: 8px 16px 16px 16px;
h3, h3 a {
color: #FFD736;
h3,
h3 a {
color: #ffd736;
text-align: center;
font-family: Open Sans;
font-size: 1em;
Expand All @@ -179,7 +215,7 @@
}

h6 {
color: #FFF;
color: #fff;
text-align: center;
font-family: Open Sans;
font-size: 14px;
Expand All @@ -193,13 +229,12 @@
}
}

@media(max-width: 700px) {
@media (max-width: 700px) {
min-width: 160px;
}
}

.people-image {

max-width: 100%;
height: 600px;
border-top-right-radius: 240px;
Expand All @@ -222,7 +257,12 @@
display: flex;
flex-direction: column;
img {
height: 450px;
width: 100%;
object-fit: cover;
object-position: center;
border-top-left-radius: 50%;
border-top-right-radius: 50%;
}

article {
Expand All @@ -243,12 +283,9 @@
}
}



&.secondary {
article {
background-color: var(--brand);
}
}

}
}
2 changes: 1 addition & 1 deletion content/contribute/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ opener: "Empower our mission to help others: how you can get involved"
intro: We are a group of volunteers that scout the web for potential cyber security risks.
becomevolunteer:
title: Become a volunteer
image: /images/1724437526298.jfif
image: /images/1724437526298-1.jpg
Alt tag for image: An illustration of 2 people talking about code, shown by a speakingballoon filled with 010101.
description: Are you interested in joining our diverse team of ethical hackers, researchers, IT professionals, or legal experts, and learning from the best? Please sign up.
alt: Drawing of a group of voluteer hackers
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"postbuild": "node ./scripts/postbuild.js",
"gen-people": "node ./scripts/generate_people.js",
"gen-teams": "node ./scripts/generate_teams.js",
"update-stats": "node ./scripts/update_stats.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Les Kleuver",
Expand Down
49 changes: 49 additions & 0 deletions scripts/update_stats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const axios = require('axios');
const fs = require('fs');
const matter = require('gray-matter');

async function updateMarkdown() {
try {
// Fetch the data from the endpoint
const response = await axios.get('https://csirt.divd.nl/csv/stats.json');
const { data } = response;

// Initialize totals
let totalMembers = 0;
let totalCases = 0;
let totalIps = 0;

// Aggregate data from each year using Object.entries
Object.entries(data).forEach(([, stats]) => {
totalMembers += stats.cases;
totalCases += stats.cases;
totalIps += stats.ips;
});

// Read the existing markdown file
const filePath = 'content/block/_index.en.md';
const fileContent = fs.readFileSync(filePath, 'utf8');

// Parse the front matter
const parsed = matter(fileContent);
const frontMatter = parsed.data;

// Update the front matter with the aggregated data
frontMatter.mission.members = totalMembers.toString();
frontMatter.mission.totalcases = totalCases.toString();
frontMatter.mission.ips = totalIps;

// Convert back to markdown with updated front matter
const newContent = matter.stringify(parsed.content, frontMatter);

// Write the updated content back to the file
fs.writeFileSync(filePath, newContent, 'utf8');

console.log('Markdown file updated successfully!');
} catch (error) {
console.error('Error fetching data:', error);
}
}

// Run the function
updateMarkdown();
Loading