« get me outta code hell

New old art dump post, crazy <art> stuff - blog - My blog website - https://florrie.ed1.club
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-08-09 00:07:10 -0300
committerFlorrie <towerofnix@gmail.com>2018-08-09 00:07:10 -0300
commit6cc53c6ee86a6426da662e0bb76501d641388248 (patch)
treea6c6f39cf2cf32f419bf98347646a4b425c82b28
parentc1ac1cc1913508ad2a235cc69e2cb654e2dbe9ec (diff)
New old art dump post, crazy <art> stuff
-rw-r--r--build.js28
-rwxr-xr-xpublish.sh2
-rw-r--r--site/index.md40
-rw-r--r--site/posts/38-old-art-dump.md42
-rw-r--r--site/static/site.css10
5 files changed, 101 insertions, 21 deletions
diff --git a/build.js b/build.js
index b0da29c..dbd57b9 100644
--- a/build.js
+++ b/build.js
@@ -584,11 +584,29 @@ const parsePostText = async (text) => {
   )
 
   processedMarkdown = await processMarkdown(processedMarkdown,
-    /<art>([^<]*)<\/art>/g,
-    match => fixWS`
-      [![${match[1].match(/^[0-9]+-(.*)$/)[1]}](static/media/${encodeURIComponent(match[1])}.png)](static/media/${encodeURIComponent(match[1])}.png)
-      ([${match[1].match(/^[0-9]+-(.*)$/)[1]}.kra](static/media/${encodeURIComponent(match[1])}.kra))
-    `
+    /<art([^>]*)>([^<]*)<\/art>/g,
+    ([ _, attrText = '', filename ]) => {
+      const attrs = attrText.split(' ')
+        .filter(Boolean)
+        .map(entry => entry.includes('=') ? entry.split('=') : [entry, entry])
+        .map(([ k, v ]) => [k, v.startsWith('"') && v.endsWith('"') ? v.slice(1, -1) : v])
+        .map(([ k, v ]) => [k, v === 'true' ? true : v === 'false' ? false : v === k ? true : v])
+        .reduce((acc, [ k, v ]) => Object.assign({}, acc, {[k]: v}), {})
+
+      const options = Object.assign({
+        ext: 'kra',
+        noext: false
+      }, attrs)
+
+      return fixWS`
+        <div class="art-container"><div>
+          <a href="static/media/${encodeURIComponent(filename)}.png"><img alt="![${filename.match(/^[0-9]+-(.*)$/)[1]}" src="static/media/${encodeURIComponent(filename)}.png"></a>
+          ${options.noext ? '' : fixWS`
+            <br>(<a href="static/media/${encodeURIComponent(filename)}.${options.ext}">${filename.match(/^[0-9]+-(.*)$/)[1]}.${options.ext}</a>)
+          `}
+        </div></div>
+      `
+    }
   )
 
   return {
diff --git a/publish.sh b/publish.sh
index 7b25b8e..d1e51a9 100755
--- a/publish.sh
+++ b/publish.sh
@@ -2,4 +2,4 @@ export BLOG_ORIGIN='https://florrie.ed1.club/'
 node build.js
 
 echo '-- Publish:'
-echo '-- rsync -a site/ florrie@ed1.club:/home/florrie/public_html'
+echo '-- rsync -a --info=progress2 site/ florrie@ed1.club:/home/florrie/public_html'
diff --git a/site/index.md b/site/index.md
index d378e3b..f4cd65a 100644
--- a/site/index.md
+++ b/site/index.md
@@ -1,32 +1,42 @@
 
-    title: "Art dump July!!!!!!!"
-    permalink: '37-art-dump-july'
-    date: {m: 8, d: 1, y: 2018}
+    title: "Old art dump"
+    permalink: '38-old-art-dump'
+    date: {m: 8, d: 9, y: 2018}
     categories:
     - 'art'
 
 ---
 
-# Art dump July!!!!!!!
+# Old art dump
 
-July! I can't say I've started drawing *more*, but I did have a mini-revelation around half-way through the month: I'd rather focus on making *better* art instead of *more* art. So more trying new things and learning stuff from that, instead of stressing over just not making and sharing enough.
+Ooh secret old art dump! Most of these are grabbed from an old mini-blog I had on the Wings of Fire wiki; a few are recovered from a backup of my old laptop. These are all really, *really* old - from 2015 and 2016 - so they don't really say anything about my current art, but I find them interesting to look at anyways. So for posterity and curiosity, here's a dump of old things I drew.
 
-Okay, so, first, the big one. As is obvious to anyone who's played the game, this is a drawing of the hero from Dragon Quest IV - in particular, it's a trace/color of the PSX box art.
+<art noext>38-first-dragon-drawing</art>
 
-<art>37-dq4psx</art>
+<art noext>38-second-dragon-drawing</art>
 
-Here's the original DQ4 PSX box art, drawn by Akira Toriyama (I assume):
+<art noext>38-sleet-and-floe-in-a-snow-cave</art>
 
-![DQ4 PSX box art](static/media/37-dq4psxcover.jpg)
+<art noext>38-not-good-at-all</art>
 
-Aaaand here's the other random art I made!
+<art noext>38-moon's-mountain-home</art>
 
-<art>37-bwddl</art>
+<art noext>38-hole-in-the-ceiling</art>
 
-<art>37-lazydod</art>
+<art noext>38-drew-this-null</art>
 
-<art>37-flt</art>
+<art noext>38-nightwings-tunnel</art>
 
-<art>37-lines</art>
+A couple collaborations with [LittleLynx][littlelynx]:
 
-<art>37-dragbirdfire</art>
+<art noext>38-littlelynx-collab-clay</art>
+
+She drew the dragon, Clay; I added some things to the background and the sparkly effects.
+
+<art noext>38-littlelynx-collab-tsunami</art>
+
+Like with Clay, she drew Tsunami, and most of the background; I added sparklies.
+
+Also some outtakes: [a drawing of a scene](static/media/38-the-wingery.png) that I didn't do too much with, [some crazy ruler testing](static/media/38-sky-picture.png), and [a picture of Sunny with a turtle she caught from the lake](static/media/38-sunny's-turtle.png) that I had trouble turning into an actual picture.
+
+  [littlelynx]: https://scratch.mit.edu/users/LittleLynx
diff --git a/site/posts/38-old-art-dump.md b/site/posts/38-old-art-dump.md
new file mode 100644
index 0000000..f4cd65a
--- /dev/null
+++ b/site/posts/38-old-art-dump.md
@@ -0,0 +1,42 @@
+
+    title: "Old art dump"
+    permalink: '38-old-art-dump'
+    date: {m: 8, d: 9, y: 2018}
+    categories:
+    - 'art'
+
+---
+
+# Old art dump
+
+Ooh secret old art dump! Most of these are grabbed from an old mini-blog I had on the Wings of Fire wiki; a few are recovered from a backup of my old laptop. These are all really, *really* old - from 2015 and 2016 - so they don't really say anything about my current art, but I find them interesting to look at anyways. So for posterity and curiosity, here's a dump of old things I drew.
+
+<art noext>38-first-dragon-drawing</art>
+
+<art noext>38-second-dragon-drawing</art>
+
+<art noext>38-sleet-and-floe-in-a-snow-cave</art>
+
+<art noext>38-not-good-at-all</art>
+
+<art noext>38-moon's-mountain-home</art>
+
+<art noext>38-hole-in-the-ceiling</art>
+
+<art noext>38-drew-this-null</art>
+
+<art noext>38-nightwings-tunnel</art>
+
+A couple collaborations with [LittleLynx][littlelynx]:
+
+<art noext>38-littlelynx-collab-clay</art>
+
+She drew the dragon, Clay; I added some things to the background and the sparkly effects.
+
+<art noext>38-littlelynx-collab-tsunami</art>
+
+Like with Clay, she drew Tsunami, and most of the background; I added sparklies.
+
+Also some outtakes: [a drawing of a scene](static/media/38-the-wingery.png) that I didn't do too much with, [some crazy ruler testing](static/media/38-sky-picture.png), and [a picture of Sunny with a turtle she caught from the lake](static/media/38-sunny's-turtle.png) that I had trouble turning into an actual picture.
+
+  [littlelynx]: https://scratch.mit.edu/users/LittleLynx
diff --git a/site/static/site.css b/site/static/site.css
index 9483ed9..e2693d8 100644
--- a/site/static/site.css
+++ b/site/static/site.css
@@ -98,6 +98,16 @@ th, td {
   padding: 2px;
 }
 
+/* Art */
+
+div.art-container {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  margin-bottom: 4px;
+  margin-top: 4px;
+}
+
 /* Page specific stuff ----------------------------------------------------- */
 
 /* Post pages */