How do I disable/remove the date from the Docusaurus blog posts?

37 Views Asked by At

I don't want the date to display under each blog post, because we are using the blog component differently, therefore it is not relevant to show the date.

If I leave the date field empty (date: ''), it doesn't work.

What should I do to remove it?

1

There are 1 best solutions below

0
johann On

In Docusaurus, the date in the blog section is usually controlled by the theme that you are using. This solution applies CSS that effectively hides the HTML tag for all blogs.

Therefore, inspect the HTML element and find its class name. In you customCSS.css file add the following line:

.className time {
  display: none;
}

For me className was: container_node_modules-\@docusaurus-theme-classic-lib-theme-BlogPostItem-Header-Info-styles-module