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
(async function downloadCompleteHTML() { | |
// Helper function to fetch content of external files (CSS, JS, images) | |
async function fetchResource(url, isBinary = false) { | |
try { | |
const response = await fetch(url); | |
if (isBinary) { | |
const blob = await response.blob(); | |
return new Promise((resolve, reject) => { | |
const reader = new FileReader(); | |
reader.onloadend = () => resolve(reader.result); |
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
--- | |
import ButtonGroup from "./ButtonGroup.astro"; | |
interface Props { | |
projectTitle: string; | |
body: string; | |
href: string; | |
type?: string; | |
repo?: string; | |
external?: boolean; | |
image?: string; |
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
/* Fixed background image, replace with css gradient if you are cool */ | |
.cssbackground { | |
position: fixed; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
background-image: url("bg.png"); | |
background-size: cover; | |
z-index: -1; |
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
--- | |
layout: none | |
--- | |
{% assign allCollections = site.collections %} | |
{% for collection in allCollections %} | |
{% assign allPosts = allPosts | concat: collection.docs %} | |
{% endfor %} |
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 loops through the paginated posts in Jekyll --> | |
{% for post in paginator.posts %} | |
<!-- Modulo counter in liquid, will enclose div.columns every 3 posts starting at 0 --> | |
{% assign mod = forloop.index0 | modulo:3 %} | |
<!-- If the modulo counter is 0, then open a div with class columns --> | |
{% if mod == 0 %} | |
<div class="columns"> | |
{% endif %} | |
<!-- This is the post div, it will be repeated 3 times --> | |
<div class="column"> |
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
<!--Capture page title to use for collection filter on for loop, collection must be listed in the _config.yml to be used as a key pair--> | |
{% assign thisCollection = page.title | downcase %} | |
<!--determine the sorted sections to iterate over using front matter--> | |
{% assign items_grouped = site.[thisCollection] | group_by: 'frontmatterProp' %} | |
<table class="table table-sm table-responsive"> | |
<thead> | |
<tr> | |
<th style="width: 50%; text-align: left;">item name</th> |
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
{% for collection in site.collections %} | |
{% if collection.label == "posts" %} | |
{% continue %} | |
{% endif %} | |
{% for item in site[collection.label] %} | |
<div> | |
<h5 class="card-title">{{item.name}}</h5> | |
<p>{{ item.description }}</p> | |
</div> | |
{% endfor %} |
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
// Add the number property of array1 and array2 where the id matches and declare as array3 | |
let array1 = [{ id: 1, number: 3}, { id: 3, number: 4}, { id: 2, number: 4}] | |
let array2 = [{ id: 1, number: 3}, { id: 2, number: 5}, {id: 3,number: 3}] | |
let array3 = []; | |
for (let i = 0; i < array2.length; i++) { | |
for (let j = 0; j < array1.length; j++) { | |
if (array2[i].id === array1[j].id) { | |
array3.push({ | |
id: array2[i].id, |