aboutsummaryrefslogtreecommitdiffhomepage
path: root/wruby.rb
diff options
context:
space:
mode:
authorBradley Taunt <bt@btxx.org>2025-01-17 15:47:56 -0500
committerBradley Taunt <bt@btxx.org>2025-01-17 15:47:56 -0500
commit1e88c7f1ca7ba8d47ba83a94732b03ef30130006 (patch)
treedd196f13a793ea3fcf27bbb2d819cca3e6f7294f /wruby.rb
parent73e2850430e3709eec5ac1a3b2380ad085f13e9c (diff)
Revert "Complete styling changes - again"
This reverts commit 068badb857215f0e10500ddd29a8b335efe3b2bd.
Diffstat (limited to 'wruby.rb')
-rw-r--r--wruby.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/wruby.rb b/wruby.rb
index c646630..d4f49e6 100644
--- a/wruby.rb
+++ b/wruby.rb
@@ -58,8 +58,6 @@ def process_markdown_files(input_directory, output_directory, header_content, fo
date = Date.parse(lines[2]&.strip || '') rescue Date.today
html_content = Kramdown::Document.new(md_content).to_html
- formatted_date = date.strftime("%b %d, %Y")
-
relative_path = path.sub(input_directory + '/', '').sub('.md', '')
item_dir = File.join(output_directory, relative_path)
output_file = "#{item_dir}/index.html"
@@ -68,7 +66,7 @@ def process_markdown_files(input_directory, output_directory, header_content, fo
header = replace_title_placeholder(header_content, title)
File.write(output_file, header + html_content + footer_content)
- items << { title: title, date: date, formatted_date: formatted_date, link: relative_path + '/', content: html_content }
+ items << { title: title, date: date, link: relative_path + '/', content: html_content }
end
items
@@ -83,7 +81,7 @@ def generate_index(posts, header_content, footer_content, root_index_file, post_
header = replace_title_placeholder(header_content, root_title)
index_content = header + root_html + "<ul class=\"posts\">\n"
- posts.first(post_count).each { |post| index_content << "<li><a href='/#{posts_dir}/#{post[:link]}'>#{post[:title]}</a><span>#{post[:formatted_date]}</span></li>\n" }
+ posts.first(post_count).each { |post| index_content << "<li><span>#{post[:date]}</span><a href='/#{posts_dir}/#{post[:link]}'>#{post[:title]}</a></li>\n" }
index_content << "</ul>\n<p><a href='/#{posts_dir}'>View all posts &rarr;</a></p>\n" + footer_content
File.write("#{output_dir}/index.html", index_content)
@@ -98,7 +96,7 @@ def generate_full_posts_list(posts, header_content, footer_content, posts_index_
header = replace_title_placeholder(header_content, posts_title)
list_content = header + posts_html + "<ul class=\"posts\">\n"
- posts.each { |post| list_content << "<li><a href='/#{posts_dir}/#{post[:link]}'>#{post[:title]}</a><span>#{post[:formatted_date]}</span></li>\n" }
+ posts.each { |post| list_content << "<li><span>#{post[:date]}</span><a href='/#{posts_dir}/#{post[:link]}'>#{post[:title]}</a></li>\n" }
list_content << "</ul>\n" + footer_content
File.write("#{output_dir}/posts/index.html", list_content)