I have built a website -- j-dunning.net -- using distill for R Markdown. Although I can tweak the CSS code for the website generally, how can I tweak the postcard landing page in isolation?
I would specifically like to remove of the space between the nav bar and the top of my image, and, change the colour of the hyperlink at the foot of the bio.
Any help welcome
Jamie
Global versus local styles
For an all across the site change, add a style sheet to _site.yml. To change an individual page, add a style sheet to the individual page. With the library
distill
, you can run the functioncreate_theme(name = themeMePlease)
in the console. It will create a .css style sheet in your project environment. It will have prefilled content, based on other elements you've indicated in your YAML (YAMLs...?), as well.If you want the changes to be global (the whole website) add the theme to the _site.yml. Obviously include the name, title, and whatever other settings you have. Just keep in mind this is not indented. It should be flush left.
If you want to apply this style sheet to a specific page, add it to that page's YAML. Don't add it to global and another page's YAML. You could add it to more than one page's YAML if it's not in the _site.yml.
To change the hyperlink color, open that style sheet. At the bottom, add the following to control the settings for
<a>
tags. (That's a hyperlink tag.)That worked for everything except the
postcards
built about page. Personal themes, global themes, and in-line styling won't work for this script. The only thing I found that worked was inline Javascript.Take that
postcards
! (I still win.)Reduce the whitespace between the postcard and the navigation bar
In the RMarkdown script that you have your postcard in (most likely about.Rmd), add the following to add a margin to the bottom of the postcard. You won't need to add any libraries, packages, et cetera for this to work. The units
em
are relative, so it should work well when the screen size changes or if more content is added. You can certainly change the units or amount. I will encourage you to avoidpx
and try to stick withvh
,rem
, orem
, since they're relative sizes.Changing the
Postcards
about page hyperlink colorTo change the hyperlink color for the
postcards
generated script, use the following code. Change #B21E28 for the color you want. I recommend using RGB, HSL, or HEX-coded colors.This is a snapshot using the default distill webpage and the default
postcards
build, perhaps some of your site content, along with the changes in this answer: