<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>blogdown | F. Leblanc</title>
    <link>https://lebf3-4090c9.netlify.app/tag/blogdown/</link>
      <atom:link href="https://lebf3-4090c9.netlify.app/tag/blogdown/index.xml" rel="self" type="application/rss+xml" />
    <description>blogdown</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Mon, 29 Jun 2020 00:00:00 +0000</lastBuildDate>
    <image>
      <url>https://lebf3-4090c9.netlify.app/images/icon_hufe976c661fb6135bd1164f77aadbc1d5_99438_512x512_fill_lanczos_center_2.png</url>
      <title>blogdown</title>
      <link>https://lebf3-4090c9.netlify.app/tag/blogdown/</link>
    </image>
    
    <item>
      <title>How I built this website</title>
      <link>https://lebf3-4090c9.netlify.app/post/how-i-built-this-website/</link>
      <pubDate>Mon, 29 Jun 2020 00:00:00 +0000</pubDate>
      <guid>https://lebf3-4090c9.netlify.app/post/how-i-built-this-website/</guid>
      <description>&lt;h2 id=&#34;why-this-post&#34;&gt;Why this post&lt;/h2&gt;
&lt;p&gt;As a first post, it seemed appropriate to document the process of building this website and regroup resources for future use and help some other users. I entertained the idea of a personal website since I started my graduate studies in bioinformatics to showcase my work, but also build a platform that will extend outside the frame of my thesis. Using RMarkdown as my main work document, the package 
&lt;a href=&#34;https://bookdown.org/yihui/blogdown/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;blogdown&lt;/strong&gt;&lt;/a&gt; is the perfect fit (almost).&lt;/p&gt;
&lt;h2 id=&#34;resources-i-used&#34;&gt;Resources I used&lt;/h2&gt;
&lt;details&gt;
  &lt;summary&gt;Videos&lt;/summary&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;This 
&lt;a href=&#34;https://www.youtube.com/watch?v=vVHZ76OwPow&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;video&lt;/strong&gt;&lt;/a&gt; (and others in this series) shows how to get your site running on 
&lt;a href=&#34;https://app.netlify.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;netlify&lt;/strong&gt;&lt;/a&gt; for free!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;This 
&lt;a href=&#34;https://www.youtube.com/watch?v=ox_Ue9yzf-0&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;video&lt;/strong&gt;&lt;/a&gt; goes trough the customization options of the academic theme.&lt;/p&gt;
&lt;br&gt; 
&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;details&gt;
	&lt;summary&gt;Web resources&lt;/summary&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;
&lt;a href=&#34;https://bookdown.org/yihui/blogdown/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;blogdown&lt;/strong&gt;&lt;/a&gt; R book details most steps to get you going.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;
&lt;a href=&#34;https://sourcethemes.com/academic/docs/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;Academic&lt;/strong&gt;&lt;/a&gt; details how to customize this Hugo theme within the parameters they have made easy to modify.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;br&gt;
&lt;p&gt;There are many themes available, from complex to simple on 
&lt;a href=&#34;https://themes.gohugo.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;Hugo site&lt;/strong&gt;&lt;/a&gt;. The current theme is 
&lt;a href=&#34;https://themes.gohugo.io/academic/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;Academic&lt;/strong&gt;&lt;/a&gt;, a complex theme. It conveniently has many templates and functions that allow referencing publications, projects or posts and sharing them. The downside of it&amp;rsquo;s complexity is that customizing it is difficult. One feature I tryed (and failed) to change is allowing a TOC to be displayed with posts rendered from .Rmd or .RMarkdown files.&lt;/p&gt;
&lt;p&gt;I found a solution for .md files 
&lt;a href=&#34;https://github.com/gcushen/hugo-academic/issues/1520&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;. So for now, I simply set &lt;code&gt;toc: true&lt;/code&gt; if the file is .md and &lt;code&gt;toc: false&lt;/code&gt; if it is a .Rmd since the &lt;code&gt;&amp;lt;root dir&amp;gt;/layouts/_default/single.htm&lt;/code&gt; has to be the same for both files.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-html&#34;&gt;{{- define &amp;quot;main&amp;quot; -}}
{{ if .Params.toc }}
&amp;lt;div class=&amp;quot;container-fluid docs&amp;quot;&amp;gt;
    &amp;lt;div class=&amp;quot;row flex-xl-nowrap&amp;quot;&amp;gt;
      &amp;lt;div class=&amp;quot;d-none d-xl-block col-xl-2 docs-toc&amp;quot;&amp;gt;
        &amp;lt;ul class=&amp;quot;nav toc-top&amp;quot;&amp;gt;
          &amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;#&amp;quot; id=&amp;quot;back_to_top&amp;quot; class=&amp;quot;docs-toc-title&amp;quot;&amp;gt;{{ i18n &amp;quot;on_this_page&amp;quot; }}&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
        &amp;lt;/ul&amp;gt;
        {{ .TableOfContents }}
        {{ partial &amp;quot;docs_toc_foot&amp;quot; . }}
      &amp;lt;/div&amp;gt;
      &amp;lt;main class=&amp;quot;col-12 col-md-0 col-xl-10 py-md-3 pl-md-5 docs-content&amp;quot; role=&amp;quot;main&amp;quot;&amp;gt;
{{ end }}
        &amp;lt;article class=&amp;quot;article&amp;quot;&amp;gt;
            {{ partial &amp;quot;page_header&amp;quot; . }}
            &amp;lt;div class=&amp;quot;article-container&amp;quot;&amp;gt;
              &amp;lt;div class=&amp;quot;article-style&amp;quot;&amp;gt;
                {{ .Content }}
              &amp;lt;/div&amp;gt;
              {{ partial &amp;quot;page_footer&amp;quot; . }}
            &amp;lt;/div&amp;gt;
        &amp;lt;/article&amp;gt;
  {{ if .Params.toc }}
      &amp;lt;/main&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  {{ end }}
{{- end -}}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;the-few-issues-i-had-that-may-save-you-time&#34;&gt;The few issues I had (&lt;em&gt;that may save you time&lt;/em&gt;)&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Change the URL in &lt;code&gt;&amp;lt;root dir&amp;gt;/config.toml&lt;/code&gt; for the site after netlify is running to have sharable posts working.&lt;/li&gt;
&lt;li&gt;Create new posts, courses or add publications with the addin button of Rstudio.&lt;/li&gt;
&lt;li&gt;If you have a lot of changes (new files) to commit, git may crash when you try to stage them in Rstudio. I use the Tools&amp;gt;shell&amp;hellip; &lt;code&gt;git add .&lt;/code&gt; then commit either from Rstudio or from the shell and it should work. If git crashed, you may have to go delete the &lt;code&gt;.git/index.lock&lt;/code&gt; by command line (if you are using windows the directory won&amp;rsquo;t be visible) &lt;code&gt;cd &amp;lt;root dir&amp;gt;/.git/&lt;/code&gt; then &lt;code&gt;rm index.lock&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If you have accents in you path (even before your &lt;code&gt;root dir&lt;/code&gt; where the website project is located), git won&amp;rsquo;t work properly and you may end up with a blank git tab in Rstudio.&lt;/li&gt;
&lt;/ol&gt;
</description>
    </item>
    
  </channel>
</rss>
