Skip to content

Instantly share code, notes, and snippets.

View inetbiz's full-sized avatar
💭
Honing my JSON+LD Structured Data Skills

Denver Prophit Jr. inetbiz

💭
Honing my JSON+LD Structured Data Skills
View GitHub Profile
@inetbiz
inetbiz / BreadCrumbs.html
Last active September 24, 2021 16:05
Jekyll Schema BreadCrumbs in JSON Format
"breadcrumb": {
"@type": "BreadcrumbList",
"itemListElement": [
{% assign crumbs = page.url | remove:'/index.html' | split: '/' %} {% assign crumbs_total = crumbs | size | minus: 1 %}{% for crumb in crumbs offset: 1 %}{% if forloop.index == crumbs_total %}
{
"@type": "ListItem",
"position": "{{ forloop.index }}",
"item": {
"@id": "{{ site.url }}{{ page.url }}",
"name": "{{ page.crumbtitle}}"
@inetbiz
inetbiz / gtag.html
Last active August 19, 2021 14:44
Google Tag - User Timings
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx-xx"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('set',{'content_group1':'{{page.title}}'});
if (window.performance) {
var timeSincePageLoad = Math.round(performance.now());
gtag('event', 'timing_complete', {
@tobystokes
tobystokes / .eleventy.js
Last active April 3, 2022 23:47
eleventy-img caching
const imageShortcode = require("./image");
module.exports = function(eleventyConfig) {
eleventyConfig.addNunjucksShortcode("image", imageShortcode);
// ... + other eleventyConfig
};
@inetbiz
inetbiz / rv-camphost.json
Last active September 19, 2020 14:34
RV / Caravan Park Lodging Business JSON+LD
{
"@context": "https://schema.org/",
"@type": [
"LodgingBusiness",
"CampGround"
],
"@id": "#brand",
"sameAs": [
"http://www.facebook.com/your-profile",
"http://www.twitter.com/yourProfile",
@jakubmikita
jakubmikita / Storable.php
Last active February 19, 2019 18:11
WordPress global storage using filter
<?php
/**
* Storable interface
*/
interface Storable extends \ArrayAccess, \Iterator {}
@inetbiz
inetbiz / .htaccess
Last active August 24, 2021 18:37
WordPress Security & Optimization in htaccess and Robots.txt
# BEGIN WordPress https://wordpress.org/support/article/htaccess/
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
Allow [ Trusted Domains/IPs ]
</Files>
# FINISH XML RPC BLOCKING
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
@inetbiz
inetbiz / schema-person.html
Last active December 2, 2021 23:55
Schema.org Person markup in JSON+LD format. Includes birthdate, place of birth, photo and worksFor with remote @id
<!-- Run the code inbetween <script></script> through https://www.webtoolkitonline.com/json-minifier.html -->
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Person",
"@id": "#person",
"mainEntityOfPage": {
"@type": "ProfilePage",
"mainEntity": { "@id": "/schema-person.html#person" },
"lastReviewed": "2019-03-03T12:17:12.5249075-08:00"
@inetbiz
inetbiz / organization.json
Last active June 20, 2017 23:44
JSON+LD Organization Schema with extensive data
{
"@context": "http://schema.org",
"@type": "Organization",
"@id": "#publisher",
"@reverse":
{
"publisher":
{
"@type":"Website",
"potentialAction":
@nternetinspired
nternetinspired / output-articles-by-collection.liquid
Last active April 25, 2021 02:17
Loop through Jekyll collections and output their content as sections and articles
{% comment %}
Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting title and full text with good basic html semantics.
Use page.excerpt instead of page.content to grab the first paragraph, blog list style. Markdownify is optional, depends how you authored content in your collections; I typically use Markdown.
{% endcomment % }
{% for collection in site.collections %}
{% assign name = collection.label %}
<section>
@inetbiz
inetbiz / product.tpl
Last active August 29, 2015 14:20
Prestashop Product Detail Tabs *Alpha Code*
{*
* 2015 StrikeHawk eCommerce, Inc.
*
* NOTICE OF LICENSE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*