Skip to content

Commit

Permalink
Switch to the new metadata format
Browse files Browse the repository at this point in the history
  • Loading branch information
waferbaby committed Feb 4, 2024
1 parent c9f6f30 commit c058297
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
22 changes: 11 additions & 11 deletions layouts/default.erb
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<!DOCTYPE html>
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Uses This<% if @page %> / <%= @page.title %><% elsif @post %> / <%= @post.title %><% end %><% if @pagination && @pagination[:current_page] > 1 %> (Page <%= @pagination[:current_page] %>)<% end %></title>
<title>Uses This<% if @page %> / <%= @page.title %><% end %><% if @pagination && @pagination.current_page > 1 %> (Page <%= @pagination.current_page %>)<% end %></title>
<link href="/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css">
<link href="/feed.atom" rel="alternate" title="Uses This" type="application/atom+xml">
<link href="https://wafer.baby/@d" rel="me">
<% if @pagination %>
<% if @pagination[:urls][:previous_page] %><link rel="prev" href="<%= @pagination[:urls][:previous_page] %>"><% end %>
<% if @pagination[:urls][:next_page] %><link rel="next" href="<%= @pagination[:urls][:next_page] %>"><% end %>
<% if @pagination.urls[:previous_page] %><link rel="prev" href="<%= @pagination.urls[:previous_page] %>"><% end %>
<% if @pagination.urls[:next_page] %><link rel="next" href="<%= @pagination.urls[:next_page] %>"><% end %>
<% end %>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta name="description" content="A nerdy interview site asking a random selection of people all about the tools and techniques they're using to get things done">
<meta name="author" content="Daniel Bogan">
<meta name="keywords" content="interview, setup<% if @post && @post.categories %>, <%= @post.categories.join(', ') %><% end %>">
<% if @post %>
<meta property="og:title" content="Uses This: <%= @post.title %>">
<meta property="og:description" content="<%= @post.summary %>">
<meta name="keywords" content="interview, setup<% if @page.categories %>, <%= @page.categories.join(', ') %><% end %>">
<% if @page.slug %>
<meta property="og:title" content="Uses This: <%= @page.title %>">
<meta property="og:description" content="<%= @page.summary %>">
<meta property="og:type" content="article">
<meta property="article:published_time" content="<%= @post.date.iso8601 %>">
<% @post.categories.each do |category| %>
<meta property="article:published_time" content="<%= @page.date.iso8601 %>">
<% @page.categories.each do |category| %>
<meta property="article:tag" content="<%= category %>">
<% end %>
<meta property="og:image:url" content="https://usesthis.com/images/interviews/<%= @post.slug %>/portrait.jpg">
<meta property="og:image:url" content="https://usesthis.com/images/interviews/<%= @page.slug %>/portrait.jpg">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="500">
<meta property="og:image:height" content="335">
Expand All @@ -31,7 +31,7 @@
<body>
<header id="masthead">
<h1><a href="/" title="The latest interviews.">Uses <span>This</span></a></h1>
<p id="description"><%= @site.posts.count %> interviews since 2009</p>
<p id="description">X interviews since 2009</p>
</header>
<nav id="control">
<ul>
Expand Down
18 changes: 9 additions & 9 deletions layouts/post.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ layout: default
<article class="h-entry">
<header>
<figure>
<img src="/images/interviews/<%= @post.slug %>/portrait.jpg" width="500" height="335" class="portrait u-photo" alt="A picture of <%= @post.title %>">
<% if @post.credits %>
<figcaption>Image by <% if @post.credits[:url] %><a href="<%= @post.credits[:url] %>" title="More details about <%= @post.credits[:name] %>."><%= @post.credits[:name] %></a><% else %><%= @post.credits[:name] %><% end %><% if @post.credits[:details] %> (<%= @post.credits[:details] %>)<% end %><% if @post.credits[:licence] %> (<a href="http://creativecommons.org/licenses/<%= @post.credits[:licence] %>/4.0/" title="The <%= @post.credits[:licence].upcase %> Creative Commons licence."><%= @post.credits[:licence].upcase %></a>)<% end %>.</figcaption>
<img src="/images/interviews/<%= @page.slug %>/portrait.jpg" width="500" height="335" class="portrait u-photo" alt="A picture of <%= @page.title %>">
<% if @page.credits %>
<figcaption>Image by <% if @page.credits[:url] %><a href="<%= @page.credits[:url] %>" title="More details about <%= @page.credits[:name] %>."><%= @page.credits[:name] %></a><% else %><%= @page.credits[:name] %><% end %><% if @page.credits[:details] %> (<%= @page.credits[:details] %>)<% end %><% if @page.credits[:licence] %> (<a href="http://creativecommons.org/licenses/<%= @page.credits[:licence] %>/4.0/" title="The <%= @page.credits[:licence].upcase %> Creative Commons licence."><%= @page.credits[:licence].upcase %></a>)<% end %>.</figcaption>
<% end %>
</figure>
</figure>
<h2 class="p-name"><%= @post.title %></h2>
<p class="summary p-job-title"><%= @post.summary %></p>
<h2 class="p-name"><%= @page.title %></h2>
<p class="summary p-job-title"><%= @page.summary %></p>
<p class="details">
<time datetime="<%= @post.date.strftime('%Y-%m-%d') %>" class="dt-published"><%= @post.date.strftime('%B %d, %Y') %></time> in
<% @post.categories.each do |slug| %>
<a href="/categories/<%= slug %>/" title="All the <%= slug %> interviews." class="p-category"><%= slug %></a><%= ', ' unless @post.categories.last == slug %>
<time datetime="<%= @page.date.strftime('%Y-%m-%d') %>" class="dt-published"><%= @page.date.strftime('%B %d, %Y') %></time> in
<% @page.categories.each do |slug| %>
<a href="/categories/<%= slug %>/" title="All the <%= slug %> interviews." class="p-category"><%= slug %></a><%= ', ' unless @page.categories.last == slug %>
<% end %>
</header>
<div class="e-content">
<%= yield %>
<% if @post.licence %><p id="licence"><strong>Note:</strong> This interview is available under the <a href="http://creativecommons.org/licenses/<%= @post.licence %>/4.0/" title="The <%= @post.licence.upcase %> Creative Commons licence."><%= @post.licence.upcase %> Creative Commons licence</a>.</p><% end %>
<% if @page.licence %><p id="licence"><strong>Note:</strong> This interview is available under the <a href="http://creativecommons.org/licenses/<%= @page.licence %>/4.0/" title="The <%= @page.licence.upcase %> Creative Commons licence."><%= @page.licence.upcase %> Creative Commons licence</a>.</p><% end %>
</div>
</article>
16 changes: 8 additions & 8 deletions layouts/posts.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ layout: default
title: Interviews
---

<% if @pagination[:current_page] == 1 && !@category %>
<% if @pagination.current_page == 1 && !@category %>
<h2>Welcome!</h2>
<p>Uses This is a collection of nerdy interviews asking people from all walks of life what they use to get the job done.</p>
<% else %>
<h2><% if @category %><%= @category.capitalize %><% else %>Interviews<% end %><% if @pagination[:current_page] > 1 %> (Page <%= @pagination[:current_page] %>)<% end %></h2>
<p>There are <%= @pagination[:post_count] %> interviews<% if @category %> in this category<% end %>. Happy reading!</p>
<h2><% if @category %><%= @category.capitalize %><% else %>Interviews<% end %><% if @pagination.current_page > 1 %> (Page <%= @pagination.current_page %>)<% end %></h2>
<p>There's <%= @pagination.post_count %> interview<% if @pagination.post_count != 1 %>s<% end %><% if @category %> in this category<% end %>. Happy reading!</p>
<% end %>
<% @pagination[:posts].each do |post| %>
<% @pagination.posts.each do |post| %>
<article class="interviewee h-card">
<a href="/interviews/<%= post.slug %>" title="An interview with <%= post.title %>." class="u-url">
<figure>
Expand All @@ -29,10 +29,10 @@ title: Interviews
</article>
<% end %>
<% if @pagination[:page_count] > 1 %>
<% if @pagination.page_count > 1 %>
<nav id="paginator">
<p>Page <strong><%= @pagination[:current_page] %></strong> of <strong><%= @pagination[:page_count] %></strong></p>
<span id="previous"><% if @pagination[:previous_page] %><a href="<%= @pagination[:urls][:previous_page] %>" title="Page <%= @pagination[:previous_page] %> of the interviews."><% end %>Previous<% if @pagination[:previous_page] %></a><% end %></span>
<span id="next"><% if @pagination[:next_page] %><a href="<%= @pagination[:urls][:next_page] %>" title="Page <%= @pagination[:next_page] %> of the interviews."><% end %>Next<% if @pagination[:next_page] %></a><% end %></span>
<p>Page <strong><%= @pagination.current_page %></strong> of <strong><%= @pagination.page_count %></strong></p>
<span id="previous"><% if @pagination.previous_page %><a href="<%= @pagination.urls[:previous_page] %>" title="Page <%= @pagination.previous_page %> of the interviews."><% end %>Previous<% if @pagination.previous_page %></a><% end %></span>
<span id="next"><% if @pagination.next_page %><a href="<%= @pagination.urls[:next_page] %>" title="Page <%= @pagination.next_page %> of the interviews."><% end %>Next<% if @pagination.next_page %></a><% end %></span>
</nav>
<% end %>
4 changes: 2 additions & 2 deletions pages/categories/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Categories
---

<h2>Categories</h2>
<p>There are currently <%= @site.categories.count %> categories on the site.</p>
<p>There are currently <%= @site.categories.keys.count %> categories on the site.</p>

<% ('a'..'z').each do |letter| %>
<% unless (slugs = @site.categories.keys.select { |key| key[0] == letter }.sort).empty? %>
Expand All @@ -13,7 +13,7 @@ title: Categories
<% slugs.each do |slug| %>
<li>
<a href="/categories/<%= slug %>/" title="All the <%= slug %> interviews."><%= slug %></a><br>
<span class="summary"><%= @site.categories[slug].count %> interview<%= 's' unless @site.categories[slug].count == 1 %></span>
<span class="summary"><%= @site.categories.send(slug).count %> interview<%= 's' unless @site.categories.send(slug).count == 1 %></span>
</li>
<% end %>
</ul>
Expand Down

0 comments on commit c058297

Please sign in to comment.