Skip to content

Instantly share code, notes, and snippets.

View jeremyboggs's full-sized avatar

Jeremy Boggs jeremyboggs

View GitHub Profile
@jeremyboggs
jeremyboggs / singular-post-type-label.php
Created May 15, 2016 12:08
Display the singular label for a post type in WordPress. (Sigh....)
<?php
$post_type = get_query_var( 'post_type' );
if ( is_array( $post_type ) ) {
$post_type = reset( $post_type );
}
$post_type_obj = get_post_type_object( $post_type );
?>
<h1><?php echo $post_type_obj->labels->singular_name; ?></h1>
/* Default styles */
body {}
/* 600px Breakpoint */
@media screen and (min-width: 600px) {
}
/* 900px Breakpoint */
@media screen and (min-width: 900px) {
<!DOCTYPE HTML>
<meta charset="utf-8">
<title>My Project</title>
<link rel="stylesheet" href="styles.css">
<a href="#">Skip to main content</a>
<header role="banner">
<h1>My project</h1>
</header>
<main id="main" role="main">
<h2>Lorem Ipsum</h2>
@jeremyboggs
jeremyboggs / library.html
Last active December 20, 2015 22:13
Jekyll datafile and template for library listing.
{% assign library = site.data.library | sort: 'title' %}
<ul>
{% for work in library %}
<li>
<a href="{{ work.resource }}">
<em>{{ work.title }}</em>
</a>,
{% assign authors = work.author %}
{% if authors %}
@jeremyboggs
jeremyboggs / index.html
Last active December 16, 2015 23:44
Basic
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Your Name · Home</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Add your content -->
@jeremyboggs
jeremyboggs / authors.html
Last active November 28, 2015 21:49
Parse a list of authors with Liquid templating. Handles single and multiple authors.
{% assign authors = page.author %}
{% if authors %}
<p>By
{% for author in authors %}
{% if forloop.last and forloop.length > 1 %} and {% endif %}<span resource="{{ author.resource }}" typeof="Person" property="creator"><em property="rdfs:label">{{ author.name }}</em></span>{% if forloop.last == false and forloop.length > 2 %}, {% endif %}{% endfor %}.</p>
{% endif %}
</p>
desc "Deploy it"
task :deploy, [:msg] => :build do |t, args|
msg = args[:msg] || 'Updates site.'
sh 'git clone -b gh-pages [email protected]:clioweb/clioweb.org.git ~/tmp/clioweb-gh-pages'
sh 'cp -r ~/tmp/clioweb-gh-pages/.git _site/.git'
sh "cd _site/ && git add . && git commit -am '#{msg}' && git push origin gh-pages"
cleanup
end
@jeremyboggs
jeremyboggs / where-to-start.md
Last active August 29, 2015 14:25
How to start

Where should I start? Practical suggestions for someone interested in doing Digital Humanites work.

Got to thinking after someone asked this question at Leadership Alliance conference: What is your practical advice for getting started in DH?

  • Learn to use every feature in your web browser.
    • View source
    • Developer tools
    • Console, resource requests.
    • Tab management
  • History management.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Lorem Ipsum</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="styles.css">
</head>
<body>
#sidebar #filterNav {
margin-left:0;
margin-bottom: 20px !important; /*This changes the space between the project nav and the project tiles.*/
padding-left:0;
background-color: #DDCAAA; /*this is the color of the project navigation bar*/
text-align: center;
list-style: none;
line-height: 3;
max-width: 970px;
}