Major update - simpler file structure, better layouts, moar content

This commit is contained in:
2022-09-23 02:40:26 -04:00
commit 8c024d74cd
346 changed files with 19555 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<%- include('../../functions') -%>
<% if (page.title && (page.render_opts || '').indexOf('no_title') == -1) { -%>
<h2>
<a
class="titleLink"
href="/<%= page.path %>"
id="<%= snakeCase(page.title) %>"
name="<%= snakeCase(page.title) %>"
><%= page.title %></a>
</h2>
<% } -%>
<%- content %>

View File

@@ -0,0 +1,108 @@
<%- include('../../functions') -%>
<%
var
journals = site.pages.filter(thePage => thePage.content_type === 'journal'),
curr = journals.filter(journal => journal.filePath === page.filePath),
currIndex = journals.map(journal => journal.filePath).indexOf(page.filePath),
prev = currIndex < (journals.length - 1) ? journals[currIndex + 1] : null,
next = currIndex > 0 ? journals[currIndex - 1] : null;
%>
<% if (page.title) { -%>
<h2>
<a class="p-name u-url" href="/<%= page.path %>"><%= page.title %></a>
</h2>
<% } -%>
<% if (page.readTime) { -%>
<p class="journal readTime">
<span class="icon glasses-icon">&#x1f453;</span> <%= page.readTime %>
</p>
<% } -%>
<% if (page.tldr || page.description) { -%>
<p><i>TL;DR &mdash; <%- page.tldr || page.description %></i></p>
<% } -%>
<div class="e-content">
<%- content %>
</div>
<footer class="update-footer clearfix">
<% if (Array.isArray(page?.tags) && page.tags.length) { -%>
<div class="update-tags">
<span class="icon folder-icon">&#x1f4c1;</span>
<% page.tags.forEach((tag, index) => { -%>
<%= index > 0 ? ' / ' : '' %>
<a href="/journal/tags/<%= tag %>/index.html">
#<span class="p-category category"><%= tag %></span>
</a>
<% }) -%>
</div>
<% } -%>
<!--
<span class="update-citation">[iew.us q/1g0k2]
<a class="u-shortlink" type="text/html" rel="shortlink" href="https://iew.us/q/1g0k2">&#128279;</a>
</span>
-->
<a rel="bookmark" href="/<%= page.path %>" class="u-url update-footer-link update-footer-time">
<time datetime="<%= page.date_pub %>"
class="dt-published published js-pubDate pubDate"
><%= prettyDate(page.date_pub) %></time>
</a>
<div class="update-nav clearfix">
<% if (prev) { -%>
<div class="update-nav-linkWrapper">
&lt; Previous Entry
<a class="update-nav-link update-nav-prev" href='/<%= prev.path %>'>
<%=prev.title%>
<br />
<span class="update-nav-pubDate">
(<time
datetime="<%= prev.date_pub %>"
class="dt-published published js-pubDate pubDate js-noRelativeTime"
><%= shortDate(prev.date_pub) %></time>)
</span>
</a>
</div>
<% } -%>
<% if (next) { -%>
<div class="update-nav-linkWrapper update-nav-nextWrapper">
Next Entry &gt;
<a class="update-nav-link update-nav-next" href='/<%= next.path %>'>
<%=next.title%>
<br />
<span class="update-nav-pubDate">
(<time
datetime="<%= next.date_pub %>"
class="dt-published published js-pubDate pubDate js-noRelativeTime"
><%= shortDate(next.date_pub) %></time>)
</span>
</a>
</div>
<% } -%>
</div>
</footer>

View File

@@ -0,0 +1,99 @@
<%- include('../../functions') -%>
<%
var
card_url = "http://gatherer.wizards.com/Pages/Search/Default.aspx?name=+[%22CARD-NAME%22]",
detail_url = "http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=",
image_url = "/images/magic/commanders/",
deck = page.deck || {},
info = deck.info || {},
cards = deck.cards || [],
lands = deck.lands || [],
changes = deck.changes || [],
starting_lands = info.starting_lands || [],
commander = info.commander && info.commander_id ?
"<li><a href='" + detail_url + info.commander_id + "' target='_blank'>" + info.commander +
"</a> <em>(Commander)</em></li>" :
"",
commander_img = info.commander && info.commander_img ?
"<img src='" + image_url + info.commander_img + "' class='magic-commander-img' alt='" + info.commander + " card' />":
""
;
-%>
<h2>
<a href="/<%= page.path %>" name="<%= snakeCase(page.title) %>" id="<%= snakeCase(page.title) %>">
<%= page.title %>
</a>
</h2>
<p>
Below is my <strong><%= info.name %></strong> deck for <a href="https://magic.wizards.com/">Magic: the Gathering</a>
(<%= info.format %> format).
It was last updated on <%= info.date_upd %>.
</p>
<p>
Each card listed below is linked to its entry on <a href="http://gatherer.wizards.com/">The Gatherer</a>
(the official <abbr title="Magic: the Gatheirng">MtG</abbr> card database) and should open in a new window or tab in
your browser.
</p>
<h3> Decklist </h3>
<%- commander_img %>
<ul>
<%- commander %>
<% cards.forEach(function(card) { %>
<li><a href="<%- card_url.replace('CARD-NAME', card) %>" target="_blank"><%= card %></a></li>
<% }) %>
<% lands.forEach(function(land) { %>
<li><a href="<%- card_url.replace('CARD-NAME', land.type) %>" target="_blank"><%= land.type %></a> (x<%=land.count%>)</li>
<% }) %>
</ul>
<% if (starting_lands && starting_lands.length > 0) { %>
<h4>Starting Lands</h4>
<p>
In order to speed our games along, my gaming group allows everyone to start with 3 basic lands.
The lands listed below are included in the counts above.</p>
<ul>
<% starting_lands.forEach(function(land) { %>
<% if (typeof land === 'string') { %>
<li><a href="<%- card_url.replace('CARD-NAME', land) %>" target="_blank"><%= land %></a></li>
<% } else {%>
<li>
<a href="<%- card_url.replace('CARD-NAME', land.type) %>" target="_blank"><%= land.type %></a> (x<%=land.count%>)
</li>
<% } %>
<% }) %>
</ul>
<% } %>
<% if (changes && changes.length > 0) { %>
<h4>Changes from Previous Versions</h4>
<ul>
<% changes.forEach(function(change) { %>
<li>
Implemented <%= change.date_upd %>:
<ul>
<% if (change.adds) { %>
<% change.adds.forEach(function(add) { %>
<li><a href="<%- card_url.replace('CARD-NAME', add) %>" target="_blank"><%= add %></a> (added)</li>
<% }) %>
<% } %>
<% if (change.dels) { %>
<% change.dels.forEach(function(del) { %>
<li><a href="<%- card_url.replace('CARD-NAME', del) %>" target="_blank"><%= del %></a> (removed)</li>
<% }) %>
<% } %>
</ul>
</li>
<% }) %>
</ul>
<% } %>
<%- content %>