2022-05-08 22:41:11 -04:00
---
2023-11-03 14:56:22 -04:00
title: "🍲 Public Domain Recipes 🍳"
2022-06-23 09:41:34 -04:00
description: 'The fast-loading recipe site with cooking only and no ads.'
2022-09-20 17:11:29 -04:00
layout: single
2022-05-08 22:41:11 -04:00
---
2022-05-26 23:58:53 +00:00
## What do you want to cook?
2022-05-08 22:41:11 -04:00
2022-06-23 21:19:50 -04:00
< div class = "search js-only" >
2022-07-02 09:37:26 -04:00
< input type = "text" id = "search" placeholder = "Search ALL Recipes..." >
2022-07-01 16:15:50 -03:00
< button id = "clear-search" >
2022-05-26 23:58:53 +00:00
< svg xmlns = "http://www.w3.org/2000/svg" class = "ionicon" viewBox = "0 0 512 512" > < title > Backspace< / title > < path d = "M135.19 390.14a28.79 28.79 0 0021.68 9.86h246.26A29 29 0 00432 371.13V140.87A29 29 0 00403.13 112H156.87a28.84 28.84 0 00-21.67 9.84v0L46.33 256l88.86 134.11z" fill = "none" stroke = "currentColor" stroke-linejoin = "round" stroke-width = "32" > < / path > < path fill = "none" stroke = "currentColor" stroke-linecap = "round" stroke-linejoin = "round" stroke-width = "32" d = "M336.67 192.33L206.66 322.34M336.67 322.34L206.66 192.33M336.67 192.33L206.66 322.34M336.67 322.34L206.66 192.33" > < / path > < / svg >
< / button >
< / div >
< script >
2022-07-01 20:45:01 +05:30
// @license magnet:?xt=urn:btih:5ac446d35272cc2e4e85e4325b146d0b7ca8f50c& dn=unlicense.txt Unlicense
2022-07-01 16:15:50 -03:00
document.addEventListener("DOMContentLoaded", () => {
2022-06-23 21:19:50 -04:00
for (e of document.getElementsByClassName("js-only")) {
2022-07-01 16:15:50 -03:00
e.classList.remove("js-only");
2022-06-23 21:19:50 -04:00
}
2022-05-26 23:58:53 +00:00
2022-07-01 16:15:50 -03:00
const recipes = document.querySelectorAll("#artlist li");
const search = document.getElementById("search");
2022-07-02 09:37:26 -04:00
const oldheading = document.getElementById("newest-recipes");
2022-07-01 16:15:50 -03:00
const clearSearch = document.getElementById("clear-search");
const artlist = document.getElementById("artlist");
2022-05-26 23:58:53 +00:00
2022-07-01 16:15:50 -03:00
search.addEventListener("input", () => {
// grab search input value
2022-07-02 13:08:17 -07:00
const searchText = search.value.toLowerCase().trim().normalize('NFD').replace(/\p{Diacritic}/gu, "");
2022-07-01 20:49:35 -03:00
const searchTerms = searchText.split(" ");
2022-05-26 23:58:53 +00:00
const hasFilter = searchText.length > 0;
2022-07-01 16:15:50 -03:00
artlist.classList.toggle("list-searched", hasFilter);
2022-07-02 09:37:26 -04:00
oldheading.classList.toggle("hidden", hasFilter);
2022-07-01 16:15:50 -03:00
2022-05-26 23:58:53 +00:00
// for each recipe hide all but matched
2022-07-01 16:15:50 -03:00
recipes.forEach(recipe => {
2022-07-02 13:08:17 -07:00
const searchString = `${recipe.textContent} ${recipe.dataset.tags}` .toLowerCase().normalize('NFD').replace(/\p{Diacritic}/gu, "");
2022-07-01 19:15:30 -07:00
const isMatch = searchTerms.every(term => searchString.includes(term));
2022-07-01 20:49:35 -03:00
2022-07-01 16:15:50 -03:00
recipe.hidden = !isMatch;
recipe.classList.toggle("matched-recipe", hasFilter & & isMatch);
})
2022-05-26 23:58:53 +00:00
})
2022-07-01 16:15:50 -03:00
clearSearch.addEventListener("click", () => {
search.value = "";
recipes.forEach(recipe => {
recipe.hidden = false;
recipe.classList.remove("matched-recipe");
2022-05-26 23:58:53 +00:00
})
2022-07-01 16:15:50 -03:00
artlist.classList.remove("list-searched");
2022-07-02 09:37:26 -04:00
oldheading.classList.remove("hidden");
2022-05-26 23:58:53 +00:00
})
})
2022-07-01 20:45:01 +05:30
// @license -end
2022-05-26 23:58:53 +00:00
< / script >
2022-05-08 22:41:11 -04:00
2022-07-02 09:37:26 -04:00
## Newest Recipes
2022-05-08 22:41:11 -04:00
{{< artlist > }}
2022-05-26 23:58:53 +00:00
## Or Browse by Category...
{{< tagcloud > }}
2022-05-08 22:41:11 -04:00
## About this site
2023-11-03 14:56:22 -04:00
This recipe website is designed to be simple and with no ads or tracking. All recipes are public domain and free for anyone to share. Originally forked from Luke Smith's based.cooking project.
2022-05-08 22:41:11 -04:00
2023-11-03 14:56:22 -04:00
## How to add a recipe
2022-05-08 22:41:11 -04:00
2023-11-03 14:56:22 -04:00
New recipes can be submitted [on Github ](https://github.com/ronaldlong46/public-domain-recipes ).