Skip to content

Commit

Permalink
linux foundation offerings
Browse files Browse the repository at this point in the history
  • Loading branch information
nvsajeeva committed Sep 6, 2024
1 parent d503055 commit ecadc19
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/certifications.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"name": "Linux Foundation Offerings",
"logo": "../../../../images/linuxfoundation.png",
"description": "Use the coupon KUBEFLEX30 to get 30% off on ANY Linux Foundation training or certification",
"category": "Education",
"url": "https://shareasale.com/r.cfm?b=734319&u=4386404&m=59485&urllink=&afftrack=",
"promotion": "30% off",
"affiliate": true
}
]
Binary file added docs/images/linuxfoundation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions docs/javascripts/certifications.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
document$.subscribe(function () {
const container = document.getElementById("certifications-container");
const filter = document.getElementById("filter");
const baseURL = window.location.origin + "/";

fetch(baseURL + "certifications.json")
.then(response => response.json())
.then(grantors => {
function displaygrantors(filteredgrantors) {
container.innerHTML = "";
filteredgrantors.forEach(grantor => {
const tile = document.createElement("div");
tile.className = "grantor-tile";

const logo = document.createElement("img");
logo.src = baseURL + grantor.logo;
logo.alt = `${grantor.name} logo`;

const name = document.createElement("h3");
name.textContent = grantor.name;

const description = document.createElement("p");
description.textContent = grantor.description;

const promotion = document.createElement("div");
promotion.className = "offer";
promotion.textContent = grantor.promotion;

const seeMore = document.createElement("div");
seeMore.className = "see-more";

// Create heart icon if the grantor is an affiliate
if (grantor.affiliate) {
const heartIcon = document.createElement("span");
heartIcon.className = "heart";
heartIcon.innerHTML = `❤️`; // Use an emoji or a heart icon
seeMore.appendChild(heartIcon);
}

const seeMoreLink = document.createElement("a");
seeMoreLink.href = grantor.url;
seeMoreLink.textContent = "See more";
seeMore.appendChild(seeMoreLink);

tile.appendChild(logo);
tile.appendChild(name);
tile.appendChild(description);
tile.appendChild(promotion);
tile.appendChild(seeMore);

container.appendChild(tile);
});
}

filter.addEventListener("change", function () {
const selectedCategory = filter.value;
const filteredgrantors = selectedCategory === "All" ? grantors : grantors.filter(grantor => grantor.category === selectedCategory);
displaygrantors(filteredgrantors);
});

// Initial display
displaygrantors(grantors);
})
.catch(error => console.error("Error fetching grantors:", error));
});
65 changes: 65 additions & 0 deletions docs/javascripts/trainings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
document$.subscribe(function () {
const container = document.getElementById("trainings-container");
const filter = document.getElementById("filter");
const baseURL = window.location.origin + "/";

fetch(baseURL + "trainings.json")
.then(response => response.json())
.then(grantors => {
function displaygrantors(filteredgrantors) {
container.innerHTML = "";
filteredgrantors.forEach(grantor => {
const tile = document.createElement("div");
tile.className = "grantor-tile";

const logo = document.createElement("img");
logo.src = baseURL + grantor.logo;
logo.alt = `${grantor.name} logo`;

const name = document.createElement("h3");
name.textContent = grantor.name;

const description = document.createElement("p");
description.textContent = grantor.description;

const promotion = document.createElement("div");
promotion.className = "offer";
promotion.textContent = grantor.promotion;

const seeMore = document.createElement("div");
seeMore.className = "see-more";

// Create heart icon if the grantor is an affiliate
if (grantor.affiliate) {
const heartIcon = document.createElement("span");
heartIcon.className = "heart";
heartIcon.innerHTML = `❤️`; // Use an emoji or a heart icon
seeMore.appendChild(heartIcon);
}

const seeMoreLink = document.createElement("a");
seeMoreLink.href = grantor.url;
seeMoreLink.textContent = "See more";
seeMore.appendChild(seeMoreLink);

tile.appendChild(logo);
tile.appendChild(name);
tile.appendChild(description);
tile.appendChild(promotion);
tile.appendChild(seeMore);

container.appendChild(tile);
});
}

filter.addEventListener("change", function () {
const selectedCategory = filter.value;
const filteredgrantors = selectedCategory === "All" ? grantors : grantors.filter(grantor => grantor.category === selectedCategory);
displaygrantors(filteredgrantors);
});

// Initial display
displaygrantors(grantors);
})
.catch(error => console.error("Error fetching grantors:", error));
});
11 changes: 11 additions & 0 deletions docs/trainings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"name": "Linux Foundation Offerings",
"logo": "../../../../images/linuxfoundation.png",
"description": "Use the coupon KUBEFLEX30 to get 30% off on ANY Linux Foundation training or certification",
"category": "Education",
"url": "https://shareasale.com/r.cfm?b=734319&u=4386404&m=59485&urllink=&afftrack=",
"promotion": "30% off",
"affiliate": true
}
]
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@ markdown_extensions:
extra_css:
- 'assets/extra.css'
extra_javascript:
- javascripts/programs.js
- javascripts/programs.js
- javascripts/certifications.js
- javascripts/trainings.js

0 comments on commit ecadc19

Please sign in to comment.