Re: Option to remove/hide title and header section of distill_article?

Reply to @mfherman 's Option to remove/hide title and header section of distill_article?

I've been really digging the updates to the distill package for generating websites. I'm wondering if there is a YAML setting or a way to modify the CSS/HTML that would remove the entire header section (Title, Author, Date, etc.). I'm thinking this would be useful for a homepage of website, for example, where you don't necessarily want it.

1 Like

You may try removing the entire header section by seting the value of display to none:

---
output: distill::distill_article
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

```{css}
d-title {
    display: none;
  }
```

Distill is a publication format for scientific and technical writing, native to the web. 

Learn more about using Distill for R Markdown at <https://rstudio.github.io/distill>.

If you want to keep the empty header section use visibility instead:

```{css}
d-title {
    visibility: hidden;
  }
```

I hope this will be of some help.

2 Likes

Hi,

Is this not a matter of just removing the text in the YAML that code for the respective Title, Author, Date etc..?

I was also looking around for a solution for this but found that I could simply delete the Title, Author, Date etc in the YAML

Here is a screenshot where I delete the highlighted section. And this worked fine.

Hi,

If we run your YAML:

---
title: "Introduction"
description: |
  This document is a product of my internship at the World Agroforestry Centre, Nairobi, 2021.
author:
  - first_name: "Magnus Kamau Katana"
    last_name: "Lindhardt"
    url: https://www.linkedin.com/in/magnus-kamau-lindhardt
    affiliation: Intern at The World Agroforestry Centre, Nairobi & Msc student at the Wageningen University, The Netherlands
    affiliation_url: https://www.linkedin.com/in/magnus-kamau-lindhardt
date: "`r Sys.Date()`"
output: 
  distill::distill_article:
    toc: true
    toc_float: true
    toc_depth: 3
    number_sections: true
    code_folding: true
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

Distill is a publication format for scientific and technical writing, native to the web. 

Learn more about using Distill for R Markdown at <https://rstudio.github.io/distill>.

We get perfect distill output:

But if we

simply delete the Title, Author, Date etc in the YAML

---
output: 
  distill::distill_article:
    toc: true
    toc_float: true
    toc_depth: 3
    number_sections: true
    code_folding: true
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```

Distill is a publication format for scientific and technical writing, native to the web. 

Learn more about using Distill for R Markdown at <https://rstudio.github.io/distill>.

We (I) get the following output:

with the following warning/message in Render panel:

3rd

So, the title: element is required by default in distill document.

Here is a screenshot where I delete the highlighted section. And this worked fine.

Yes, but you will still have the title: element/section visible.
Is it more clear now?

BTW, note that toc_float is yet to be implemented in distill acording to the @richpauloo 's request.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.