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 / .eleventy.js
Last active April 4, 2022 23:03 — forked from tobystokes/.eleventy.js
eleventy-img caching
const imageShortcode = require("./image");
module.exports = function(eleventyConfig) {
eleventyConfig.addNunjucksShortcode("image", imageShortcode);
// ... + other eleventyConfig
};
@inetbiz
inetbiz / webmention-fragment.html
Created October 18, 2021 15:06
Send Webmention Form
<! -- 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 October 7, 2021 00:42
The Publisher Entity in Jekyll Article Schema
"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 October 11, 2021 09:58
Webpage Type mainentityofPage code common to all types
"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 October 4, 2021 16:50
WordPress Shortcode to JSON-LD relatedLink from current category
// Add Shortcode
function jsonlink( $atts ) {
// Attributes
$atts = shortcode_atts(
array(
'numberposts' => '',
),
$atts,
'relatedLink'
@inetbiz
inetbiz / 2021-01-01-draft-template.md
Last active October 11, 2021 10:06
Article Draft YAML Template For Jekyll Schema Article
---
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 October 2, 2021 01:02
YAML For Site Authors in Jekyll CMS
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 October 1, 2021 23:54
Jekyll Custom Plugin to Capitalize All Words in a String
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 October 11, 2021 09:53
Article JSON-LD aggregated in Jekyll Front Matter, data files, YAML, etc.
{
"@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 October 1, 2021 14:07
Jekyll Head File
<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 %}