Skip to content

Instantly share code, notes, and snippets.

curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/index" &&
curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/placeholders.json" &&
curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/.helix/headers.json" &&
curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/docs/library/library.json" &&
curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/metadata.json" &&
curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/fragments/gnav" &&
curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/fragments/footer" &&
curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/fragments/demo" &&
curl -X POST "https://admin.hlx.page/preview/adobecom/milo-college/main/fragments/404" &&
curl -X POST "https://admin.hlx.page/live/adobecom/milo-college/main/index" &&
/*
* A Cloudflare Worker to accept `.html` requests
* and forward to Franklin.
*
* This is helpful for any site that wishes to continue
* using `.html` for legacy reasons.
*
*/
const removeHtml = (path) => {
const pathSplit = path.split('/');
@auniverseaway
auniverseaway / helix-cheat-sheet.bash
Created November 17, 2021 18:29
Helix developer cache clearing cheat sheet
## Re-sync all github code to Helix Code Bus
curl -X POST "https://admin.hlx3.page/code/{{github-user}}/{{repo}}/{{branch}}/*"
## Re-sync github file to Helix Code Bus
curl -X POST "https://admin.hlx3.page/code/{{github-user}}/{{repo}}/{{branch}}/scripts.js"
## "Preview" a page
curl -X POST "https://admin.hlx3.page/preview/{{github-user}}/{{repo}}/{{branch}}/path/to/page"
## "Publish" a page
.accordion {
background: #EFEFEF;
border: 1px solid #dddddd;
border-radius: 6px;
}
.accordion .item-title {
cursor: pointer;
padding: 12px;
border-bottom: 1px solid #dddddd;
function decorateAccordion(el) {
const titles = el.querySelectorAll(':scope > div:nth-child(odd)');
titles.forEach((title) => {
// Add a class to the title container
title.classList.add('item-title');
// Remove the empty div
title.querySelector(':scope > div:last-of-type').remove();
// Add a class to the content
title.nextElementSibling.classList.add('item-content');
// Add a click handler to open the content
<div class="accordion">
<div>
<div>Guatemala Huehuetenango Finca Rosma</div>
<div></div>
</div>
<div>
<div>
<picture>
<source media="(max-width: 400px)" srcset="./media_1.jpeg?width=750">
<img src="./media_1.jpeg?width=2000" loading="lazy">
<div class="accordion"></div>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<script src="/scripts.js" type="module"></script>
<link rel="stylesheet" href="/styles.css"/>
const hero = document.querySelector('.hero');
console.log(hero);