Skip to content
Merged
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
51 changes: 24 additions & 27 deletions scripts/content.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -582,20 +582,17 @@ const pairHome = { en: "/", tr: "/tr/" };

const person = { "@type": "Person", name: "Halit Sever", url: "https://www.halit.org/", sameAs: ["https://github.com/halitsever"] };

function webApp(lang, page, t = tool) {
/** WebPage, not WebApplication: Google's app rich result needs ratings or reviews we don't have. */
function toolPage(lang, page, t = tool) {
return {
"@context": "https://schema.org",
"@type": "WebApplication",
"@type": "WebPage",
name: page.h1,
alternateName: t[lang].name,
url: `https://tools.halit.org${page.path}`,
description: page.description,
inLanguage: lang,
applicationCategory: "UtilitiesApplication",
operatingSystem: "Any",
browserRequirements: "Requires JavaScript",
isAccessibleForFree: true,
offers: { "@type": "Offer", price: "0", priceCurrency: "USD" },
author: person,
};
}
Expand Down Expand Up @@ -850,7 +847,7 @@ const enTool = {
},
],
};
enTool.jsonLd = [webApp("en", enTool), faqLd(enTool.faq)];
enTool.jsonLd = [toolPage("en", enTool), faqLd(enTool.faq)];

const trTool = {
kind: "tool",
Expand Down Expand Up @@ -1048,7 +1045,7 @@ const trTool = {
},
],
};
trTool.jsonLd = [webApp("tr", trTool), faqLd(trTool.faq)];
trTool.jsonLd = [toolPage("tr", trTool), faqLd(trTool.faq)];

const compare = TOOLS[1];
const c = (code) => `<code>${code}</code>`;
Expand Down Expand Up @@ -1176,7 +1173,7 @@ const enCompare = {
},
],
};
enCompare.jsonLd = [webApp("en", enCompare, compare), faqLd(enCompare.faq)];
enCompare.jsonLd = [toolPage("en", enCompare, compare), faqLd(enCompare.faq)];

const trCompare = {
kind: "tool",
Expand Down Expand Up @@ -1294,7 +1291,7 @@ const trCompare = {
},
],
};
trCompare.jsonLd = [webApp("tr", trCompare, compare), faqLd(trCompare.faq)];
trCompare.jsonLd = [toolPage("tr", trCompare, compare), faqLd(trCompare.faq)];

const kdv = TOOLS[2];
const KDV_SRC = {
Expand Down Expand Up @@ -1459,7 +1456,7 @@ const trKdv = {
},
],
};
trKdv.jsonLd = [webApp("tr", trKdv, kdv), faqLd(trKdv.faq)];
trKdv.jsonLd = [toolPage("tr", trKdv, kdv), faqLd(trKdv.faq)];

const yas = TOOLS[3];
const LAW = {
Expand Down Expand Up @@ -1584,7 +1581,7 @@ const trYas = {
},
],
};
trYas.jsonLd = [webApp("tr", trYas, yas), faqLd(trYas.faq)];
trYas.jsonLd = [toolPage("tr", trYas, yas), faqLd(trYas.faq)];

const days = TOOLS[4];

Expand Down Expand Up @@ -1696,7 +1693,7 @@ const enDays = {
},
],
};
enDays.jsonLd = [webApp("en", enDays, days), faqLd(enDays.faq)];
enDays.jsonLd = [toolPage("en", enDays, days), faqLd(enDays.faq)];

const lines = TOOLS[5];
const LB_SRC = {
Expand Down Expand Up @@ -1845,7 +1842,7 @@ const enLines = {
},
],
};
enLines.jsonLd = [webApp("en", enLines, lines), faqLd(enLines.faq)];
enLines.jsonLd = [toolPage("en", enLines, lines), faqLd(enLines.faq)];

const cases = TOOLS[6];
const CASE_SRC = {
Expand Down Expand Up @@ -1999,7 +1996,7 @@ const enCase = {
},
],
};
enCase.jsonLd = [webApp("en", enCase, cases), faqLd(enCase.faq)];
enCase.jsonLd = [toolPage("en", enCase, cases), faqLd(enCase.faq)];

const trCase = {
kind: "tool",
Expand Down Expand Up @@ -2116,7 +2113,7 @@ const trCase = {
},
],
};
trCase.jsonLd = [webApp("tr", trCase, cases), faqLd(trCase.faq)];
trCase.jsonLd = [toolPage("tr", trCase, cases), faqLd(trCase.faq)];

const colors = TOOLS[7];
const COLOR_SRC = {
Expand Down Expand Up @@ -2211,7 +2208,7 @@ const enHex = {
},
],
};
enHex.jsonLd = [webApp("en", enHex, colors), faqLd(enHex.faq)];
enHex.jsonLd = [toolPage("en", enHex, colors), faqLd(enHex.faq)];

const blanks = TOOLS[8];
const UCD = "https://www.unicode.org/Public/UCD/latest/ucd/";
Expand Down Expand Up @@ -2389,7 +2386,7 @@ const enInvisible = {
},
],
};
enInvisible.jsonLd = [webApp("en", enInvisible, blanks), faqLd(enInvisible.faq)];
enInvisible.jsonLd = [toolPage("en", enInvisible, blanks), faqLd(enInvisible.faq)];

const trInvisible = {
kind: "tool",
Expand Down Expand Up @@ -2542,7 +2539,7 @@ const trInvisible = {
},
],
};
trInvisible.jsonLd = [webApp("tr", trInvisible, blanks), faqLd(trInvisible.faq)];
trInvisible.jsonLd = [toolPage("tr", trInvisible, blanks), faqLd(trInvisible.faq)];

const repeater = TOOLS[9];
const REP_SRC = {
Expand Down Expand Up @@ -2682,7 +2679,7 @@ const enRepeat = {
},
],
};
enRepeat.jsonLd = [webApp("en", enRepeat, repeater), faqLd(enRepeat.faq)];
enRepeat.jsonLd = [toolPage("en", enRepeat, repeater), faqLd(enRepeat.faq)];

const reversal = TOOLS[10];
const REV_SRC = {
Expand Down Expand Up @@ -2804,7 +2801,7 @@ const enReverse = {
},
],
};
enReverse.jsonLd = [webApp("en", enReverse, reversal), faqLd(enReverse.faq)];
enReverse.jsonLd = [toolPage("en", enReverse, reversal), faqLd(enReverse.faq)];

const flips = TOOLS[11];
const FLIP_SRC = {
Expand Down Expand Up @@ -2932,7 +2929,7 @@ const enFlip = {
},
],
};
enFlip.jsonLd = [webApp("en", enFlip, flips), faqLd(enFlip.faq)];
enFlip.jsonLd = [toolPage("en", enFlip, flips), faqLd(enFlip.faq)];

const trFlip = {
kind: "tool",
Expand Down Expand Up @@ -3015,7 +3012,7 @@ const trFlip = {
},
],
};
trFlip.jsonLd = [webApp("tr", trFlip, flips), faqLd(trFlip.faq)];
trFlip.jsonLd = [toolPage("tr", trFlip, flips), faqLd(trFlip.faq)];

const chmods = TOOLS[12];
const GNU = "https://www.gnu.org/software/coreutils/manual/html_node/";
Expand Down Expand Up @@ -3179,7 +3176,7 @@ const enChmod = {
},
],
};
enChmod.jsonLd = [webApp("en", enChmod, chmods), faqLd(enChmod.faq)];
enChmod.jsonLd = [toolPage("en", enChmod, chmods), faqLd(enChmod.faq)];

const slugs = TOOLS[13];
const SLUG_SRC = {
Expand Down Expand Up @@ -3304,7 +3301,7 @@ const enSlug = {
},
],
};
enSlug.jsonLd = [webApp("en", enSlug, slugs), faqLd(enSlug.faq)];
enSlug.jsonLd = [toolPage("en", enSlug, slugs), faqLd(enSlug.faq)];

const specials = TOOLS[14];
const SPECIAL_SRC = {
Expand Down Expand Up @@ -3493,7 +3490,7 @@ const enSpecial = {
},
],
};
enSpecial.jsonLd = [webApp("en", enSpecial, specials), faqLd(enSpecial.faq)];
enSpecial.jsonLd = [toolPage("en", enSpecial, specials), faqLd(enSpecial.faq)];

const trSpecial = {
kind: "tool",
Expand Down Expand Up @@ -3602,7 +3599,7 @@ const trSpecial = {
},
],
};
trSpecial.jsonLd = [webApp("tr", trSpecial, specials), faqLd(trSpecial.faq)];
trSpecial.jsonLd = [toolPage("tr", trSpecial, specials), faqLd(trSpecial.faq)];

export const pages = {
list: [enHome, trHome, enTool, trTool, enCompare, trCompare, trKdv, trYas, enDays, enLines, enCase, trCase, enHex, enInvisible, trInvisible, enRepeat, enReverse, enFlip, trFlip, enChmod, enSlug, enSpecial, trSpecial],
Expand Down