Ggplot(diamonds, aes(carat, price)) + geom_smooth() + You can specify that a specific plot should be used as the preview image using the preview chunk option. Preview thumbnail images are generated automatically based on the first plot encountered within your post. Note that the listing for our example above includes a preview image for each post. Note that if you use a date-prefixed post directory you are not required to specify an explicit date field within your post’s metadata. The benefits of this scheme are that post names are given additional uniqueness (to guard against colliding names over the long term) and are also automatically listed in order when browsing the _posts directory. One popular scheme for organizing blog posts is to use a date prefix for the post directory names. You can have all posts at the top level or you can create subdirectories to create groupings of posts. You can use whatever scheme you like to organize the _posts directory. Note that if you’ve already defined a repository_url field in _site.yml you can just use source_url: true and your repository_url will be used for the link.
name : "distill" title : "Distill for R Markdown" navbar : logo : image : images/logo.png href : source_url :. You can enable support for Disqus comments and sharing links for Twitter, LinkedIn, and other services by adding options to the collection:posts section of _site.yml.įor example, the following options provide the Disqus shortname for a site and specify that we want sharing buttons for Twitter and LinkedIn. Readers will likely want to comment on and share articles they read on your blog. The article on blog post workflow describes these options in more detail. When you are ready to publish the post, either remove the draft option or set it to false, then build the website.īeyond support for drafts, Distill has a number of additional features to accommodate a variety of post authoring and contribution workflows, including importing posts published elsewhere on the web (e.g. on RPubs, in a Git repository, or on another blog). We'll demonstrate importing stock data, building a portfolio, and then calculating the Sharpe Ratio. title : "The Sharpe Ratio" description : | In this post we present a classic finance use case using the PerformanceAnalytics, quantmod, and dygraphs packages.
#Distill web monitor css update#
You can use the rename_post_dir() function to update the date and/or title slug reflected in the directory name. If you work on a post over the course of a few days and/or if you change your post’s title after you begin working on it, you may want to rename the post directory. Note that the date prefix is not strictly required, but is done by default as a convenience so that posts appear in chronological order within the filesystem. Posts are stored within the _posts sub-directory of your site, and have a directory name that reflects the date which you created the post along with the post’s title slug. This is because posts are often expensive to render and have R package dependencies that may be difficult to satisfy as time goes on. This is in fact the only way to update post content - posts are considered standalone documents that are not re-rendered when the site is built. You work on blog posts independent of the enclosing website (use Knit to render and preview the post just like any R Markdown document). Why? Given that R package upgrades have a tendency to break older code, continuously re-rendering old posts is nearly impossible to do without errors, especially over longer periods of time.Ĭreate_post ( "The Sharpe Ratio", draft = TRUE ) Each blog article has to be rendered on its own, with intent. Workflow difference: Furthermore, website pages and root pages of blogs are re-rendered when the site is rebuilt but blog articles are not. Distill blogs are a distill website with added blog posts. Structure difference: Websites are just collections of pages you can navigate to via the menu, whereas blogs have collections of posts that can be indexed and syndicated (via their RSS feed).
To create a blog you author a collection of posts (located in the _posts sub-directory of your website) and then dedicate a page (usually the website homepage) to a listing of all of your posts. Distill for R Markdown websites include integrated support for blogging.