Skip to content

Instantly share code, notes, and snippets.

Jon Earley jonearley

Block or report user

Report or block jonearley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jonearley
jonearley / gist:caf879bddcd46878db2b
Last active Aug 29, 2015
Self correcting Semantic URL slugs, Stack Overflow style.
View gist:caf879bddcd46878db2b
'''
Self correcting Semantic URL slugs, Stack Overflow style.
Format:
website.com/obj/<pk>/<slug>
For example, we have obj with pk: 1, title: "Hello World", and slug: "hello-world"
website.com/obj/1/ -> website.com/obj/1/hello-world
website.com/obj/1/hello-moon/ -> website.com/obj/1/hello-world
View designer.html
<link rel="import" href="../notification-elements/notification-alert.html">
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<polymer-element name="my-element">
<template>
<style>
:host {
View _date_coverage.html.erb
<% @wmon = (1..12).to_a.unshift('--') %>
<% @wday = (1..31).to_a.unshift('--') %>
<div class="form-group <% if f.object.class.multiple? key %>multi_value<% end %>">
<p class="text-bold">Date Coverage</p>
<p class="help-block">The date range the work's data was created, as determined by the creator.</p>
<% if f.object.class.multiple? key %>
<ul class="listing">
@jonearley
jonearley / drupal-jsonapi-views.md
Last active Dec 13, 2018
Requirements for extending the Drupal json api for node pages with views to include breadcrumbs and weight.
View drupal-jsonapi-views.md

Task: Add weight and breadcrumbs attributes to node pages.

Using the json api for "Jobs at the Library" Drupal node page as the example. For full: https://dev.lib.umich.edu/web/jsonapi/node/page/68bd39d6-5546-4789-9b3c-0724782b2508

Breadcrumb specs:

  • Start at the homepage.
  • Attach property of breadcrumbs with an array of objects as the value.
  • Each object in the array contains text and to. text is the page title. to is the alias to that page.
View drupal-api.md

[DRAFT] Drupal API

Documentation for the API between Drupal and Gatsby.

Content types

Definition

{
View universal-header.json
{
"label":"Discover",
"heading":"Discover what the library has to offer",
"primary":[
{
"name":"Library Website",
"description":"Go to the library's home on the web.",
"href":"https://www.lib.umich.edu/"
},
{
@jonearley
jonearley / metadata-api.md
Last active Dec 11, 2019
Metadata component API
View metadata-api.md

Metadata component API

Re: U-M Library Design System Metadata component

Definitions

  • Term: The display text for a single field.
  • Description: A single description for its term, but a term can have many.
  • Field: The combination of a single term and its associated description(s).
You can’t perform that action at this time.