From 068badb857215f0e10500ddd29a8b335efe3b2bd Mon Sep 17 00:00:00 2001 From: Bradley Taunt Date: Fri, 17 Jan 2025 15:12:31 -0500 Subject: Complete styling changes - again --- wruby.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'wruby.rb') diff --git a/wruby.rb b/wruby.rb index d4f49e6..c646630 100644 --- a/wruby.rb +++ b/wruby.rb @@ -58,6 +58,8 @@ 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" @@ -66,7 +68,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, link: relative_path + '/', content: html_content } + items << { title: title, date: date, formatted_date: formatted_date, link: relative_path + '/', content: html_content } end items @@ -81,7 +83,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 + "\n

View all posts →

\n" + footer_content File.write("#{output_dir}/index.html", index_content) @@ -96,7 +98,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 + "\n" + footer_content File.write("#{output_dir}/posts/index.html", list_content) -- cgit v1.2.3-70-g09d2