distill uses many custom YAML fields to create some of its unique features,
such as article metadata and citations. In addition to the arguments in
yml_distill_opts(), ymlthis supports distill in a number of other ways.
yml_author() to include these extra used in
distill. For a distill blog, you can specify the listings page a post belongs
to, including an optional vector of other posts to list with it;
distill_listing() is a helper function to pass to the
listing argument to
specify such pages. distill uses the same approach to navbars as R Markdown.
yml_navbar() and friends will help you write the YAML for that. YAML
specifying the site build, like the output field and navbars, can also be
yml_site_opts() for further R Markdown website
build options and
use_site_yml() for creating that file based on a
object. distill's YAML options are discussed in greater detail in the
articles on the distill website.
yml_distill_opts( .yml, draft = yml_blank(), slug = yml_blank(), categories = yml_blank(), listing = yml_blank(), collection = yml_blank(), citation_url = yml_blank(), preview = yml_blank(), repository_url = yml_blank(), base_url = yml_blank(), compare_updates_url = yml_blank(), creative_commons = yml_blank(), twitter_site = yml_blank(), twitter_creator = yml_blank(), journal_title = yml_blank(), journal_issn = yml_blank(), journal_publisher = yml_blank(), volume = yml_blank(), issue = yml_blank(), doi = yml_blank(), resources = yml_blank(), ... ) yml_distill_author( .yml, name = yml_blank(), url = yml_blank(), affiliation = yml_blank(), affiliation_url = yml_blank(), orcid_id = yml_blank() ) distill_listing(listing_name = "posts", slugs = NULL) distill_collection( collection_name = "post", feed_items_max = yml_blank(), disqus_name = yml_blank(), disqus_hidden = yml_blank(), share = yml_blank(), citations = yml_blank(), subscribe = yml_blank() ) distill_resources(include = yml_blank(), exclude = yml_blank())
Logical. Set the post to be a draft? Draft posts won't be published.
The abbreviated version of the citation included in the BibTeX entry. If you don’t provide a slug then one will be automatically generated.
A character vector, the post categories
The listing a post is under; either a character vector, the
distill_listing(), or a named list.
Specify the RSS, sharing, and other settings of a listing;
distill_collection() or a named list.
A URL to the article; automatically generated for blog articles
a path or link to the preview image for your article. You can
also set this by including
preview = TRUE in an R Markdown code chunk in
A URL where the source code for your article can be found
Base (root) URL for the location where the website will be deployed (used for providing preview images for Open Graph and Twitter Card)
a URL that will show the differences between the article’s current version and the version that was initially published
Designate articles that you create as Creative Commons licensed by specifying one of the standard Creative Commons licenses. Common options include "CC BY", "CC BY-SA", "CC BY-ND", and "CC BY-NC". See the distill vignette for more details.
The Twitter handle for the site
The Twitter handle for the creator
The title of the journal
The issn of the journal
The publisher of the journal
The volume the article is on
The issue the article is on
The article Digital Object Identifier (DOI)
Files to include or exclude while publishing. Use
distill_resources() or a named list to specify.
additional named R objects, such as characters or lists, to transform into YAML
A character vector, name of the author(s)
the author URL
The author's affiliation; must match length of
name has length of two,
affiliation must as well; use
you don't want to include an affiliation for a given author.Note that not
all formats support the
the affiliation URL
the author's ORCID ID
A character vector, the name of the listing
A character vector of the posts to include in the listing
A character vector, the name of the collection
Number of articles to include in the RSS feed (default:
FALSE to have no limit on the number of items included in
A shortname for the disqus comments section (
field is required in order to use Disqus)
Logical. Show full text of disqus comments? By default,
FALSE so as not to obscure the bibliography and other appendices.
Share buttons to include. Choices: "twitter", "linkedin",
"facebook", "google-plus", and "pinterest". (
base_url field is required
in order to use sharing links)
Logical. If your
_site.yml file provides a
field, an article citation appendix and related metadata will be included
automatically within all published posts. Set to
FALSE to disable this
a path to a HTML file enabling readers to subscribe. See the distill vignette on blog posts for more details.
a character vector of files to explicitly include or exclude when publishing a post. Can use wild cards, such as "*.csv".
post_listing <- distill_listing( slugs = c( "2016-11-08-sharpe-ratio", "2017-11-09-visualizing-asset-returns", "2017-09-13-asset-volatility" ) ) yml() %>% yml_title("Gallery of featured posts") %>% yml_distill_opts(listing = post_listing) #> --- #> date: '`r format(Sys.Date())`' #> title: Gallery of featured posts #> listing: #> posts: #> - 2016-11-08-sharpe-ratio #> - 2017-11-09-visualizing-asset-returns #> - 2017-09-13-asset-volatility #> --- #> yml_empty() %>% yml_title("Reproducible Finance with R") %>% yml_description("Exploring reproducible finance with the R statistical, computing environment.") %>% yml_site_opts(name = "reproducible-finance-with-r") %>% yml_distill_opts( base_url = "https://beta.rstudioconnect.com/content/3776/", collection = distill_collection( feed_items_max = 30, disqus_name = "reproducible-finance-with-r", disqus_hidden = FALSE, share = c("twitter", "linkedin") ) ) #> --- #> title: Reproducible Finance with R #> description: |- #> Exploring reproducible finance with the R statistical, #> computing environment. #> name: reproducible-finance-with-r #> collection: #> post: #> feed_items_max: 30.0 #> disqus: #> shortname: reproducible-finance-with-r #> hiden: false #> share: #> - twitter #> - linkedin #> base_url: https://beta.rstudioconnect.com/content/3776/ #> --- #>