a-brasch
a-brasch

Reputation: 11

Icon hyperlinks no longer visible in R markdown using YAML html_document: includes: before_body: ./header.html

I previously had success adding headers and footers to my R markdown HTML files using guidance found here: Pimp my RMD - footer and header. No changes have been made to my header.html, but now the icon hyperlinks are no longer visible when knit via RStudio. Strangely, the hyperlink via my name is still visible and functioning. When the header.html file is opened in Chrome, the hyperlink icons are present and visible. Why would the hyperlink icons no longer be visible in the markdown HTML?

My YAML looks like this:

title: "TITLE"
author: "NAME/ORGANIZATION"
date: "DD/MM/YYYY"
output:
  html_document:
    includes:
      before_body: ./header.html
      after_body: ./footer.html
    code_folding: hide
    highlight: zenburn
    self_contained: yes
    theme: darkly
etc.

My header.html file looks like this:

<p style="text-align: right;"><a href="mailto:MyEmailAddress">Alex Brasch</a></p>
<!-- Add icon library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<!-- Add font awesome icons -->
<p style="text-align: right;">
    <a href="https://www.flo-analytics.com/staff/alex-brasch-2/" class="fas fa-chart-bar"></a>
    <a href="https://www.linkedin.com/in/alex-brasch-b5231743/" class="fab fa-linkedin"></a>
    <a href="https://github.com/a-brasch" class="fab fa-github"></a>
</p>

Thanks for any suggestions.

Upvotes: 0

Views: 179

Answers (1)

a-brasch
a-brasch

Reputation: 11

Solution found here: https://github.com/rstudio/rmarkdown/issues/1924

Adding the following setup did solve the issue.

htmltools::tagList(rmarkdown::html_dependency_font_awesome())

I did not have to update my header/footer.html files, but to remove redundancy or potential confusion, I removed the following:

<!-- Add icon library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">

Upvotes: 1

Related Questions