mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
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 %} <p class="post-date">{{ page.date | date: "%B %d, %Y" }}</p> {% 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.
This commit is contained in:
parent
7d31c02b25
commit
02fd0dab38
1 changed files with 3 additions and 0 deletions
|
@ -37,6 +37,9 @@
|
|||
<h1 class="project-name">{{ page.title | default: site.title | default: site.github.repository_name }}</h1>
|
||||
<h2 class="project-tagline">{{ page.description | default: site.description | default: site.github.project_tagline }}</h2>
|
||||
{% endif %}
|
||||
{% if page.date %}
|
||||
<p class="post-date">{{ page.date | date: "%B %d, %Y" }}</p>
|
||||
{% endif %}
|
||||
<a href="{{ site.url }}/" class="btn">Home</a>
|
||||
<a href="{{ site.url }}/blog/" class="btn">Blog</a>
|
||||
{% if site.github.is_project_page %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue