color: var(--dark-text);
}
+.full-content p {
+ text-indent: 0em;
+ color: var(--light-text);
+}
+
code {
font-family: monospace;
background-color: var(--post-bg);
font-variant-emoji: text;
}
+ul .thought-item::before {
+ content: "☭\FE0E";
+ font-variant-emoji: text;
+}
+
ul .pinned::before {
content: "✯\FE0E";
font-variant-emoji: text;
def bookmark?
post_type == 'bookmark'
end
+
+ def short_dispatch?
+ dispatch? &&
+ content.present? &&
+ content.split.size <= 150 &&
+ !content.strip.start_with?("Dear friends,")
+ end
def rendered_content
MarkdownRenderer.render(content)
<div class="field bookmark-field" style="display: none;">
<%= form.label :url %>
- <%= form.url_field :url, onblur: 'fetchTitle()' %>
+ <%= form.url_field :url %>
</div>
<div class="actions">
}
}
-function fetchTitle() {
- var url = document.getElementById('post_url').value;
- if (url && document.getElementById('post_title').value === '') {
- document.getElementById('post_title').value = 'Title for ' + url;
- }
-}
-
document.addEventListener('DOMContentLoaded', function() {
console.log("DOM loaded");
toggleFields();
<div class="post">
<ul class="container">
<% @items.each do |item| %>
- <li class="<%= item.post_type %>-item">
+ <li class="<%= item.post_type %>-item<%= if item.short_dispatch? then " thought-item" end %>">
<% if item.dispatch? %>
<span class="post-link">
<%= link_to item.title, public_post_path(year: item.published_at.year, slug: item.slug) %>
</span>
<span class="dash">—</span>
<span class="meta">posted <%= item.published_at.strftime('%d/%m/%y') %>, tagged as <%= raw item.format_tags %></span>
- <blockquote class="excerpt"><%= item.generate_excerpt %>...</blockquote>
+ <% if item.short_dispatch? %>
+ <blockquote class="full-content">
+ <%= raw item.rendered_content.html_safe %>
+ </blockquote>
+ <% else %>
+ <blockquote class="excerpt"><%= item.generate_excerpt %>...</blockquote>
+ <% end %>
<% else %>
<span class="post-link">
<%= link_to item.title, item.url, target: "_blank" %>
<h1><%= @post.title %></h1>
<%= link_to "↼ Back to some other dispatches...", "#{root_path}?filter=posts" %>
<div class="postmeta">
- <p>Posted <%= @post.published_at.strftime('%B %d, %Y') %> and tagged <%= raw @post.format_tags %> Reading Time: about <%= @reading_time %> minute(s).</p>
+ <p>Posted <%= @post.published_at.strftime('%B %d, %Y') %> and tagged <%= raw @post.format_tags %>
<% if [email protected]_dispatch?%>Reading Time: about <%= @reading_time %> minute(s).<% end %></p>
</div>
</div>
</div>
<div class="container" id="bottom">
<h3>Follow via email</h3>
<iframe scrolling="no" style="width:100%!important;height:220px;border:1px #ccc solid !important" src="https://buttondown.email/acb?as_embed=true"></iframe><br>
<h3>More stuff from Aidan</h3>
<p><span class="callout">→ Circular economy</span>: if this work has been of interest to you, please consider subsidising my existence, <em>no subscriptions</em>: <%= link_to "click here to donate with PayPal <abbr title=\"external link\">↗︎</abbr>".html_safe, "https://paypal.me/aidancornelius/10.00/" %> or <%= link_to "here for more options and information <abbr title=\"external link\">↙︎</abbr>".html_safe, "/sponsor/" %>.</p>
<p><span class="callout">→ Stay updated</span>: email masochists amongst us may receive my dispatches directly in their inbox with the form below. Alternatively, you are able to subscribe in an RSS reader via the <%= link_to "feed <abbr title=\"internal link\">↙︎</abbr>".html_safe, "https://mndrdr.org/feed/dispatches/" %> to keep your inbox sanity.</p>
+ <% end %>
<p><%= link_to "↑ Back to top", "#top" %> or <%= link_to "↼ Back to some other dispatches...", "#{root_path}?filter=posts" %></p>
</div>
\ No newline at end of file