Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Honing my JSON+LD Structured Data Skills

Denver Prophit Jr. inetbiz

💭
Honing my JSON+LD Structured Data Skills
View GitHub Profile
@inetbiz
inetbiz / .eleventy.js
Last active Apr 4, 2022 — forked from tobystokes/.eleventy.js
eleventy-img caching
View .eleventy.js
const imageShortcode = require("./image");
module.exports = function(eleventyConfig) {
eleventyConfig.addNunjucksShortcode("image", imageShortcode);
// ... + other eleventyConfig
};
View webmention-fragment.html
<! -- Webbmtions https://www.w3.org/TR/webmention/ -->
<article class="box post">
<header>
<h3>Notify WebMention</h3>
</header>
<div class="responses" id="responses">
<form class="webmention-form ui form" action="https://webmention.herokuapp.com/api/webmention" method="post">
<div class="fields">
<div class="twelve wide field">
<label for="wurl">Have you written a <a href="https://indieweb.org/responses">Webmention response</a> to this? URL:</label>
@inetbiz
inetbiz / publisher.md
Last active Oct 7, 2021
The Publisher Entity in Jekyll Article Schema
View publisher.md
"publisher": {
    "@type": "ProfessionalService",
    "@id": "{{site.url}}/about.html",
    "name": "{{ site.title}}",
    "logo": {
      "@type": "ImageObject",
      "representativeOfPage": "False",
      "width": {
 "@type": "QuantitativeValue",
@inetbiz
inetbiz / mainentity.md
Last active Oct 11, 2021
Webpage Type mainentityofPage code common to all types
View mainentity.md
"mainEntityofPage": {
    "@type": "{{page.mainentity}}",
{% if page.wikidatas %}
    "mentions": [
{% for item in page.wikidatas %}
      {
        "@type": "Thing",
        "name": "{{ item.name }}",
        "@id": "{{ item.url }}"
@inetbiz
inetbiz / wpshortcode.php
Created Oct 4, 2021
WordPress Shortcode to JSON-LD relatedLink from current category
View wpshortcode.php
// Add Shortcode
function jsonlink( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'numberposts' => '',
),
$atts,
'relatedLink'
@inetbiz
inetbiz / 2021-01-01-draft-template.md
Last active Oct 11, 2021
Article Draft YAML Template For Jekyll Schema Article
View 2021-01-01-draft-template.md
---
layout: xxxxxxx
title: ""
crumbtitle: ""
categories: xxxx-xxxx
tags: xxx xxx
wikidata: ###
genre: "https://en.wikipedia.org/wiki/xxxxxxxx"
isbasedon: ["URL, "URL"]
@inetbiz
inetbiz / members.yml
Created Oct 2, 2021
YAML For Site Authors in Jekyll CMS
View members.yml
member1:
birth_country: "United States of America"
birth_city: "Somewhere"
birth_region: CA
birth_zip: 11111
birth_date: "YYYY-MM-DD"
education: "New Horizons Technology School"
image: "assets/images/main/denver-prophit-jr.png"
nationality: "United States of America"
name: "John Doe"
@inetbiz
inetbiz / _capitalize_all.rb
Created Oct 1, 2021
Jekyll Custom Plugin to Capitalize All Words in a String
View _capitalize_all.rb
require 'liquid'
require 'uri'
# Capitalize all words of the input
module Jekyll
module CapitalizeAll
def capitalize_all(words)
return words.split(' ').map(&:capitalize).join(' ')
end
end
@inetbiz
inetbiz / articleJSON.html
Last active Oct 11, 2021
Article JSON-LD aggregated in Jekyll Front Matter, data files, YAML, etc.
View articleJSON.html
{
"@context": "https://schema.org",
"@type": "Article",
"@id": "#article",
"url": "{{ site.url }}{{ page.url }}",
"name": "{{ page.title }}",
"headline": "{{ page.title }}",
"genre": "{{ page.genre }}",
"keywords": {{ page.tags |replace: "-", " " | join: ", | capitalize_all | jsonify }},
"description": "{{ page.excerpt | strip_newlines | strip | strip_html }}",
@inetbiz
inetbiz / head.html
Last active Oct 1, 2021
Jekyll Head File
View head.html
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="index,follow">
<meta name="msapplication-tap-highlight" content="no">
<title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{{page.excerpt}}"/>
{% include favicon.html %}
{% capture critical %}
{% include critical.scss %}