mercredi 8 juillet 2020

website in Rmarkdown: navbar changes color between index and other pages

I am building a simple website for the R functions that I developed, associated to a publication, using Rmarkdown. The site may be found here. It is built with a _site.yml file, and index.Rmd which is converted to a html file, and other Rmd which create the other pages in the navigation bar. However, the color of the navigation bar changes between the index and the other pages.

The navigation bar is black, since I built it with the option type: inverse.

name: "Bernardo B. Niebuhr and Patricia Kerches-Rogeri"
output_dir: "."
navbar:
  title: "SpatIS: spatial individual specialization indices"
  type: inverse
  left:
    - text: "SpatIS tutorial"
      href: spatis_tutorial.html
    - text: "SpatIS scenarios"
      href: spatis_scenarios.html
  right:
    - icon: fa-envelope fa-lg
      href: https://github.com/LEEClab/SpatIS#contact
    - icon: fa-github fa-lg
      href: https://github.com/LEEClab/SpatIS
output:
  html_document:
    theme: paper
    css: "styles.css"

This is what we see in the index file, which uses the default option for the html_output. See below the header of the index.Rmd file and an image of how it is rendered in the website.

---
title: "SpatIS - Spatial Individual Specialization Indices"
author: "Bernardo B. Neibuhr and Patricia Kerches-Rogeri"
output:
  html_document: default
---

index shows the navigation bar correctly

However, when we look at the other pages, the navigation bar changes its color to blue. I tried several things but it only shows correctly (navbar in black) if I remove the TOC and select html_document: default in the file header. See below the header of one of these pages' Rmd file and an image of how it is rendered in the website.

---
title: "Spatial Individual Specialization Indices applied to different contexts"
output:
  html_document: 
    toc: TRUE
    toc_float: TRUE
---

in the page the navbar is shown in blue

Any hints or suggestion on how to show the navbar in the same color? Is there another option I should pay attention to? The complete version of the code for the webpage may be found here.




Aucun commentaire:

Enregistrer un commentaire