From 02fd0dab383a665777a2a9fb680cb249372ead74 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 24 May 2024 07:51:54 -0700 Subject: [PATCH] aider: Added condition to display date for blog posts in `_layouts/default.html`. # Aider chat conversation: USER: if the page is a blog post, show the date ASSISTANT: To show the date if the page is a blog post, we need to modify the `_layouts/default.html` file. We will add a condition to check if the page is a blog post and then display the date accordingly. Here is the *SEARCH/REPLACE* block: _layouts/default.html ```html <<<<<<< SEARCH {% endif %} ======= {% endif %} {% if page.date %}

{{ page.date | date: "%B %d, %Y" }}

{% endif %} >>>>>>> REPLACE ``` This will display the date in the format "Month Day, Year" if the `page.date` variable is set, which is typically the case for blog posts. --- _layouts/default.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_layouts/default.html b/_layouts/default.html index 40e958283..06667d67a 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -37,6 +37,9 @@

{{ page.title | default: site.title | default: site.github.repository_name }}

{{ page.description | default: site.description | default: site.github.project_tagline }}

{% endif %} + {% if page.date %} +

{{ page.date | date: "%B %d, %Y" }}

+ {% endif %} Home Blog {% if site.github.is_project_page %}