I have something like this and I want to add an image.png as an icon. Where the image icon should have the same width and length as fontawesome icons. Many thaks in advance.
name: my-website
output_dir: docs
navbar:
title: My Website
left:
- text: Home
href: index.html
- text: About
href: about.html
- text: Readings
icon: DIRECTORY.OF.MY.IMAGE.PNG
menu:
- text: Module 1
icon: fa-pepper-hot # ICON IN THE DROPDOWN MENU IS NOT WORKING.
href: readings-module1.html
- text: Module 2
href: readings-module2.html
- text: Module 3
href: readings-module3.html
- text: Module 4
href: readings-module4.html
output:
html_document:
theme: yeti
You will have to add your custom CSS that has rules to replicate fontawesome icons settings for your PNG image.
Related
I am creating a distill website using rmarkdown and would like to add a submenu in the navigation bar. I found this feature request/issue on GitHub but have not been able to find a solution.
With the below _site.yml and index.Rmd the submenu text appears in the menu dropdown but is greyed-out and not clickable/selectable.
_site.yml:
name: "submenuTest"
title: "Submenu test"
description: |
Submenu test
output_dir: "_site"
navbar:
right:
- text: "Home"
href: index.html
- text: 'Menu'
menu:
- text: 'Page'
href: page.html
- text: 'Submenu'
menu:
- text: 'Sub Page'
href: subpage.html
output: distill::distill_article
index.Rmd:
---
title: "Submenu test"
description: |
Welcome to the website. I hope you enjoy it!
site: distill::distill_website
---
# here is my page content
In a plain rmarkdown .html (can use the above .yml and .Rmd examples but without the output: distill::distill_article and site: distill::distill_website lines) renders with a workable submenu.
I am trying to embed social links on a flexdashboard and I get the following:
---
title: "Dashboard"
output:
flexdashboard::flex_dashboard:
storyboard: true
css: ["default", "assets/css/my-theme.css", "assets/css/my-fonts.css"]
orientation: columns
navbar:
- { icon: "fa-github", href: "https://github.com/", align: center }
- { icon: "fa-youtube", href: "https://www.youtube.com/", align: center}
- { icon: "fa-linkedin", href: "https://www.linkedin.com/", align: center}
vertical_layout: fill
theme:
version: 3
bootswatch: yeti
runtime: shiny
---
Is there a way to properly align it to the right side? Mine appears to be on a newline.
I came from this post: How to define links for social network icons on flexdashboard?
I am using R 4.1.1, blogdown 1.4, and Hugo 0.81. I ran blogdown::check_site() and fixed all issues.
Hello. I have uploaded a PDF file Resume.pdf to my root directory in blogdown. In my YAML file, I have tried put this file in my header using this code:
menu:
main:
- name: Resume
url: "./Resume.pdf"
weight: 1
When I serve my website, if I click on "Resume" in my header from my home directory, the link works fine and I am served my PDF. However, if I click on "Resume" from anywhere else on the website, I am led to a 404.
I have currently gotten around this issue by using an absolute URL. However it would be nice to have a relative URL for efficiency purposes.
Does anyone know why ./Resume.pdf does not work in my YAML file?
Here is my full YAML file, with redacted parts replaced with ---
baseurl: ---
languageCode: en-us
title: Farzad Saif’s Website
theme: hugo-lithium
googleAnalytics: '---'
disqusShortname: ''
ignoreFiles:
- \.Rmd$
- \.Rmarkdown$
- _cache$
- \.knit\.md$
- \.utf8\.md$
permalinks:
post: /:year/:month/:day/:slug/
menu:
main:
- name: About
url: /about/
weight: 1
- name: Papers
url: /papers/
weight: 2
- name: GitHub
url: ---
weight: 3
- name: LinkedIn
url: ---
weight: 4
- name: Resume
url: "./Resume.pdf"
weight: 5
params:
MathJaxCDN: //cdnjs.cloudflare.com/ajax/libs
MathJaxVersion: 3.2.0
description: Hello, I am Farzad Saif. Welcome to my website!
favicon: favicon.ico
highlightjsCDN: //cdnjs.cloudflare.com/ajax/libs
highlightjsLang:
- r
- yaml
highlightjsTheme: github
highlightjsVersion: 9.12.0
logo:
alt: Logo
height: 50
url: logo.png
width: 50
markup:
goldmark:
renderer:
unsafe: true
I have a navbar defined in the _site.yml file:
name: "Rmarkdown with navbar"
output_dir: "."
navbar:
title: "Data Analysis"
type: inverse
right:
- text: "Abstract"
href: https://www.stackoverflow.com
- text: "Data Preparing"
href: https://www.stackoverflow.com
- text: "Related Plots"
href: https://www.stackoverflow.com
- text: "Player Selection"
href: https://www.stackoverflow.com
- text: "Conclusion"
href: https://www.stackoverflow.com
output:
html_document:
theme: spacelab
highlight: textmate
I would like to be able to navigate to each section in my main rmd file, each section is defined as:
<section id="name-of-section">
I tried the following but it doesn't work (in the _site.yml file).
right:
- text: "Abstract"
href: #abstract
I would really appreciate any help. It would be even better if I could add navigation animation when clicking (I know it's achievable using jQuery in websites).
Have you try just adding titles and subtitles to your markdown with '#' and "##' and then search for any section in "online document" (Crtl + Shift + "O")
Or you want a navigation panel on the markdown's output document?
If this is the case, have you try something like this at the beginning of your markdown?
---
title: "El Code-Book de Guibi"
output:
html_document:
toc: yes
toc_depth: 5
toc_float: yes
pdf_document:
toc: yes
toc_depth: '5'
editor_options:
markdown:
wrap: 72
---
In my case, it shows output like this:
I've used the super versatile Rmarkdown package to create a site for a set of seminars extracted and modified using R.
The _site.yml file looks like this
name: "Seminars at Biostatistics, UCPH"
exclude: ["*.Rmd*", "*.json", "Makefile"]
navbar:
title: "Seminars # Biostatistics, UCPH"
left:
- text: "Upcoming seminars"
icon: fa-lightbulb-o
href: index.html
- text: "Previous seminars"
icon: fa-calendar
href: previous.html
right:
- icon: fa-question fa-lg
href: http://biostat.ku.dk
output:
html_document:
theme: readable
highlight: textmate
include:
after_body: footer.html
toc: true
toc_float: true
css: style.css
When the page is printed on paper then the table-of-content is overlapping the main text which makes it rather useless.
Is it possible to remove the toc when printing? Either directly through arguments in the yaml or possibly through css and #media commands
Of course. In your stylesheet:
#media print {
#TOC { display: none; }
}