diff options
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | bin/index.atom.erb | 8 | ||||
-rw-r--r-- | bin/index.md.erb | 4 | ||||
-rw-r--r-- | bin/page.html.erb | 2 | ||||
-rw-r--r-- | bin/util.rb | 19 | ||||
-rw-r--r-- | src/index.md | 30 | ||||
-rw-r--r-- | src/main.js | 118 | ||||
-rw-r--r-- | src/main.scss | 7 | ||||
-rw-r--r-- | src/missing.txt | 12 |
9 files changed, 44 insertions, 168 deletions
@@ -15,7 +15,7 @@ html.suffixes = md org html.src = $(shell find src -type f \( -false $(foreach s,$(html.suffixes), -o -name '*.$s' ) \)) # Translate the source filenames into output filenames html.out = $(call patsubst-all,$(addprefix src/%.,$(html.suffixes)),out/%.html,$(html.src)) -html.out += $(addsuffix index.html,$(sort $(dir $(patsubst src/%,out/%,$(html.src))))) +html.out += $(foreach d,$(sort $(dir $(patsubst src/%,out/%,$(html.src)))),$dindex.html $dindex.atom) mydir = $(patsubst %/,%,$(patsubst out/%,%,$(dir $@))) @@ -43,12 +43,16 @@ out/%.css: src/%.scss out/%.css: out/%.scss scss --stdin < $< > $@ +out/index.md : $(bin/index) bin/index.md.erb .var.html.src $(html.src) bin/write-atomic + bin/index md '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@ out/%/index.md : $(bin/index) bin/index.md.erb .var.html.src $(html.src) bin/write-atomic - bin/index md $(mydir) $(filter $(patsubst out/%,src/%,$(@D))/%,$^) | bin/write-atomic $@ + bin/index md '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@ +out/index.atom : $(bin/index) bin/index.atom.erb .var.html.src $(html.src) bin/write-atomic + bin/index atom '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@ out/%/index.atom: $(bin/index) bin/index.atom.erb .var.html.src $(html.src) bin/write-atomic - bin/index atom $(mydir) $(filter $(patsubst out/%,src/%,$(@D))/%,$^) | bin/write-atomic $@ + bin/index atom '$(mydir)' $(filter $(patsubst out%,src%,$(@D))/%,$^) | bin/write-atomic $@ -www: +www: FORCE mkdir -p $@ unionfs -o ro out:src www diff --git a/bin/index.atom.erb b/bin/index.atom.erb index 7864e75..0667088 100644 --- a/bin/index.atom.erb +++ b/bin/index.atom.erb @@ -5,17 +5,17 @@ <link rel="self" type="application/atom+xml" href="./index.atom"/> <link rel="alternate" type="text/html" href="./"/> <link rel="alternate" type="text/markdown" href="./index.md"/> - <updated><%= @pages.map{|p|p.date}.sort.last.rfc3339 %></updated> + <updated><%= @pages.map{|p|p.updated}.sort.last.rfc3339 %></updated> <author><%= Person.new("Andrew Murrell").atom %></author> <id>https://lukeshu.com/blog/</id> - <% @pages.sort_by{|p| p.date}.reverse.each do |page| %> + <% @pages.sort_by{|p| p.updated}.reverse.each do |page| %> <entry xmlns="http://www.w3.org/2005/Atom"> <link rel="alternate" type="text/html" href="./<%= page.slug %>.html"/> <link rel="alternate" type="text/markdown" href="./<%= page.slug %>.md"/> <id>https://lukeshu.com/blog/<%= page.slug %>.html</id> - <updated><%= page.date.rfc3339 %></updated> - <published><%= page.date.rfc3339 %></published> + <updated><%= page.updated.rfc3339 %></updated> + <published><%= page.published.rfc3339 %></published> <title><%= page.title %></title> <content type="html"><%= html_escape(page.content) %></content> <author><%= page.author.atom %></author> diff --git a/bin/index.md.erb b/bin/index.md.erb index 392447e..a9419ba 100644 --- a/bin/index.md.erb +++ b/bin/index.md.erb @@ -2,5 +2,5 @@ title: "<%= @path %>" --- -<% @pages.sort_by{|a|a.published}.each do |a| %> - * <time><%= a.published.strftime('%Y-%m-%d') %></time> - [<%= a.title %>](./<%= a.slug %>.html) (last updated <time><%= a.updated.strftime('%Y-%m-%d') %></time>)<% end %> +<% @pages.sort_by{|a|a.published}.reverse.each do |a| %> + * <time><%= a.published.strftime('%Y-%m-%d') %></time> - [<%= a.title %>](<%= a.url %>) (last updated <time><%= a.updated.strftime('%Y-%m-%d') %></time>)<% end %> diff --git a/bin/page.html.erb b/bin/page.html.erb index 694d11a..8317282 100644 --- a/bin/page.html.erb +++ b/bin/page.html.erb @@ -9,7 +9,7 @@ </head> <body> <header> - <p><%= @page.breadcrumbs %></p> + <p class=breadcrumbs><%= @page.breadcrumbs %></p> <h1>Andrew D. Murrell</h1> <nav> <ul> diff --git a/bin/util.rb b/bin/util.rb index ec604a3..3ded48e 100644 --- a/bin/util.rb +++ b/bin/util.rb @@ -137,16 +137,23 @@ class Page @src ||= infile.sub(/^(src|out)\//, '/') end + def url + if @url.nil? + u = src.sub(/\.[^\/.]*$/, '.html').sub(/\/index[.]html$/, '') + @url = u == '' ? '/' : u + end + @url + end + def breadcrumbs if @breadcrumbs.nil? bc = [] - url = src.sub(/\.[^\/.]*$/, '.html').sub(/\/index[.]html$/, '') - url = '/' if url == '' - while url != "/" - bc.unshift("<a href=\"#{url}\">#{File.basename(url, File.extname(url))}</a>") - url = File.dirname(url) + u = url + while u != "/" + bc.unshift("<a href=\"#{u}\">#{File.basename(u, File.extname(u))}</a>") + u = File.dirname(u) end - bc.unshift("<a href=\"#{url}\">Andrew D. Murrell</a>") + bc.unshift("<a href=\"/\">Andrew D. Murrell</a>") @breadcrumbs = bc.join(' ยป ') end @breadcrumbs diff --git a/src/index.md b/src/index.md deleted file mode 100644 index a4cc5a7..0000000 --- a/src/index.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: AndrewDM -html_head_extra: | - <script src=main.js></script> - <meta name="description" content="AndrewDM.me: Personal Blogs, Projects, and Portfolios of Andrew Murrell."/> ---- - -<section id="sidebar"> - <h3>Coming Soon!</h3> - <ul> - <li>Better CSS!</li> - <li>Better <span style="color:red;">Colors</span> [help!]</li> - <li>Magic is Magic [1.5/5 complete!] - <a href="?s=SS" class="tag SS">Short Story </a> - </li> - <li>Search functionality that actually searches the text!</li> - </ul> -</section> -<section id="topbar"> - <!--<div id="constructionBanner"> - <h1 id="constructionMessage">Website Under Construction: - I'm not a web dev, please don't mind the colors and blocky edges.</h1> - </div>--> - <div id="links"> - </div> -</section> -<hr> -<section> - <!--<a href="staticindex.html">CS Major Mode</a>--> -</section> diff --git a/src/main.js b/src/main.js deleted file mode 100644 index 6f34e2a..0000000 --- a/src/main.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright (C) 2016 Andrew Murrell - - The JavaScript code in this page is free software: you can - redistribute it and/or modify it under the terms of the GNU - General Public License (GNU GPL) as published by the Free Software - Foundation, either version 3 of the License, or (at your option) - any later version. The code is distributed WITHOUT ANY WARRANTY; - without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - - As additional permission under GNU GPL version 3 section 7, you - may distribute non-source (e.g., minimized or compacted) forms of - that code without the copy of the GNU GPL normally required by - section 4, provided you include this license notice and a URL - through which recipients can access the Corresponding Source. - -*/ - -function init() { - /* Search Bar Handling */ - /* - var searchbar = document.getElementById("search"); - searchbar.onfocus = function() { this.value = ""; } - searchbar.onblur = function() { - if (this.value == "") { - this.value = "Search"; - } - clear(); initSections(); - } - searchbar.onkeyup = clear;//function() { if (event.keycode == 13) clear }; - */ - initSections(); - -} - -function initSections() { - addSection("Writing"); - addItem("Writing", - mkItem("http://365tomorrows.com/12/03/a-simple-lament/", - "365 Tomorrows: A Simple Lament", - [["FF", "Flash Fiction"]])); - addItem("Writing", - mkItem("./DND/Tastavi.html", - "Tastavi's Backstory", - [["SS", "Short Story"]])); - addItem("Writing", - mkItem("./DND/SpellGauntlet.txt", - "Spell Gauntlet: Practical Spellcasting", - [["FF", "Flash Fiction"], - ["SS", "Short Story"], - ["WP", "WIP"]])); - addItem("Writing", - mkItem("./DND/SoP.txt", - "Psionic Schools for D&D", - [["ES", "Essay"], - ["HB", "Homebrew"]])); - - /*addItem("Writing", - mkItem("./DND/Psionist.html", - "D&D 5e Psionist Class", - [//["ES", "Essay"], - ["HB", "Homebrew"]]));*/ - - addSection("Programming"); - addItem("Programming", - mkItem("./DND/WaterdeepBazaar/WaterdeepBazaar.html", - "Waterdeep Bazaar: Marketplace Generator", - [["DM", "DMing Resource"], - ["WP", "WIP"]])); - - /*addSection("Music"); - addItem("Music", - mkItem("./Playlists.html", - "Playlists", - [["WP", "WIP"]]));*/ - - //addSection("Art"); - - /*addSection("Misc"); - addItem("Misc", - mkItem("./Reading_List.html", - "Reading List", - [["WP", "WIP"]]));*/ - -} - -function mkItem(href, title, tags) { - return { - href: href, - title: title, - tags: tags - }; -} - -function addSection(name) { - // add h2 with id 'name' there. - var append = "<h2>" + name + "</h2>"; - // add empty table there 'name-tbl' - append += "<table id=\"" + name + "-tbl\"></table>"; - // find 'links' - document.getElementById("links").innerHTML += append; -} - -function addItem(section, item) { - var append = "<tr><td><a href=\"" + item.href + "\">" + item.title + "</a></td><td>"; - for (i = 0; i < item.tags.length; i++) { - append += "<a href=\"?s=" + item.tags[i][0] + "\" class=\"tag " + item.tags[i][0] + "\">" + item.tags[i][1] + "</a>"; - } - append += "</td></tr>"; - document.getElementById(section + "-tbl").innerHTML += append; -} - -function clear() { - document.getElementById("links").innerHTML = ""; -} - -onload = init; diff --git a/src/main.scss b/src/main.scss index 53c5154..9a89e6d 100644 --- a/src/main.scss +++ b/src/main.scss @@ -7,11 +7,12 @@ header { width: 100%; background-color: black; color: white; + p.breadcrumbs { + background-color: blue; + } h1 { font-size: 50px; - height: 50px; - margin: 0px 0px 0px 0px; - padding: 0px 0px 0px 10px; + margin: 0; } } diff --git a/src/missing.txt b/src/missing.txt new file mode 100644 index 0000000..67de762 --- /dev/null +++ b/src/missing.txt @@ -0,0 +1,12 @@ +Writing/Programming "section"s + + addItem("Writing", + mkItem("http://365tomorrows.com/12/03/a-simple-lament/", + "365 Tomorrows: A Simple Lament", + [["FF", "Flash Fiction"]])); + + addItem("Programming", + mkItem("./DND/WaterdeepBazaar/WaterdeepBazaar.html", + "Waterdeep Bazaar: Marketplace Generator", + [["DM", "DMing Resource"], + ["WP", "WIP"]])); |