1

I have been working on my webpage, created in a Jekyll template and hosted by Github.

When I try to include the date in the YAML of a .rmd document, the commit fails. There is no error message, but it does not update the webpage.

This YAML is failing.

---
title: "My Title"
author: "Author"
date: "`r format(Sys.time(), '%d %B, %Y')`"
layout: default
permalink: /pages/Folder/Name/
output: html_document
---

However, when I try to add the date as the author, it appears without any problem (i.e., the commit is successful, and the page is updated).

---
title: "My Title"
author: 
- "Author"
- "`r format(Sys.time(), '%d %B, %Y')`"
layout: default
permalink: /pages/Folder/Name/
output: html_document
---

So, the last option works, but it is not cooler.

Could someone tell me what document should I modify? I have tried multiple formats for: date: "April 20, 2017" 'r format(Sys.time(), '%d %B, %Y')'

Thanks in advance.

Kirds
  • 131
  • 7
  • It works without any problems on my PC, also look there ↓ – manro Nov 15 '21 at 11:26
  • Does this answer your question? [YAML current date in rmarkdown](https://stackoverflow.com/questions/23449319/yaml-current-date-in-rmarkdown) – manro Nov 15 '21 at 11:27
  • @manro, thanks for your comment. However, I already tried it without success. Thanks again – Kirds Nov 16 '21 at 04:30
  • I'm pretty sure that the problem is the quotation marks. Only use the backticks around the `R` code. – Kat Jan 22 '22 at 00:33

0 Answers0