<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Academic | Pinaki Bhattacharyya</title><link>https://academic-devops.netlify.app/tag/academic/</link><atom:link href="https://academic-devops.netlify.app/tag/academic/index.xml" rel="self" type="application/rss+xml"/><description>Academic</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>Copyright © 2021 Me</copyright><lastBuildDate>Tue, 25 May 2021 00:00:00 +0000</lastBuildDate><image><url>https://academic-devops.netlify.app/media/icon_hu6b7e85408e3ea23d94c9220dcd22ef66_88376_512x512_fill_lanczos_center_2.png</url><title>Academic</title><link>https://academic-devops.netlify.app/tag/academic/</link></image><item><title>testing reading time</title><link>https://academic-devops.netlify.app/post/testing-reading-time/</link><pubDate>Tue, 25 May 2021 00:00:00 +0000</pubDate><guid>https://academic-devops.netlify.app/post/testing-reading-time/</guid><description>
&lt;script src="https://academic-devops.netlify.app/post/testing-reading-time/index_files/header-attrs/header-attrs.js">&lt;/script>
&lt;p>Fancy (re-)creating your website using Hugo, with or without blogdown?
Feeling &lt;a href="https://twitter.com/OscarBaruffa/status/1233133764282322945">a bit anxious&lt;/a>?
This post is aimed at being the Hugo equivalent of &lt;em>“What to know before you adopt a pet”&lt;/em>.
We shall go through things that can/will break in the future, and what you can do to prevent future pain.&lt;/p>
&lt;p>&lt;em>I’m writing this post with R users in mind, which means I shall use R analogies and mentioning &lt;code>blogdown&lt;/code>,
but I hope some aspects are generalizable to other potential Hugo adopters.&lt;/em>
&lt;em>Some aspects are specific to deploying your website using git and an online git platform such as GitHub.&lt;/em>&lt;/p>
&lt;div id="why-hugoblogdown" class="section level1">
&lt;h1>Why Hugo/blogdown?&lt;/h1>
&lt;p>If you’re reading this you’ve probably heard of Hugo somewhere.
It’s getting quite popular in the R community thanks to the &lt;code>blogdown&lt;/code> package, whose associated book features an &lt;a href="https://bookdown.org/yihui/blogdown/static-sites.html">excellent intro to why Hugo (and &lt;code>blogdown&lt;/code>)&lt;/a>.&lt;/p>
&lt;p>I myself have used Hugo for this website (with a bit of &lt;code>blogdown&lt;/code>) and dived into more details whilst &lt;a href="https://ropensci.org/technotes/2019/01/09/hugo/">working on tweaks to the rOpenSci website&lt;/a>.
I really enjoy working with this website generator, partly because it’s fast and open-source&lt;a href="#fn1" class="footnote-ref" id="fnref1">&lt;sup>1&lt;/sup>&lt;/a>.&lt;/p>
&lt;/div>
&lt;div id="what-can-break-or-evolve" class="section level1">
&lt;h1>What can break or evolve?&lt;/h1>
&lt;p>When you have a website created with Hugo, there are two to four main actors:&lt;/p>
&lt;ul>
&lt;li>&lt;p>Hugo itself which you could think of as R;&lt;/p>&lt;/li>
&lt;li>&lt;p>A Hugo &lt;em>theme&lt;/em> which defines the layout and style of your website. You could think of the theme as an R package. Your theme is a folder inside your website folder. You need one, no matter how minimal.&lt;/p>&lt;/li>
&lt;li>&lt;p>the other things your website theme might depend on, such as Font Awesome.&lt;/p>&lt;/li>
&lt;li>&lt;p>potential fourth actor: your tweaks to the theme which might be your editing an R package source; or maintaining a script/a second package on to of that R package to add some syntactic sugar or so to the existing functions of the package.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>So what’s going to break and evolve?&lt;/p>
&lt;ul>
&lt;li>&lt;p>Just like R packages need to keep up with changes to R sometimes, Hugo themes need to keep up with Hugo changes. Hugo is a trustworthy framework, that keeps improving, which however means sometimes removing support for some things or ways of doing them. Example: &lt;a href="https://github.com/yoshiharuyamashita/blackburn/commit/123ebe8bb4fd3708fc51dab42613e6a3a7d37d4c">this commit to the theme I’m using made a small change for making the theme compatible with Hugo&amp;gt;0.57&lt;/a>.&lt;/p>&lt;/li>
&lt;li>&lt;p>Just like R packages need to keep up with changes to their external dependencies (web APIs, data format standard), Hugo themes need to keep with changes to external dependencies (font providers, JS scripts, etc). Example: &lt;a href="https://github.com/yoshiharuyamashita/blackburn/commit/fef095af788816dbc27f040ca98eee3df6b60c1c">a commit to the theme I’m using that updates the templates to use the new syntax for Font Awesome icons&lt;/a>.&lt;/p>&lt;/li>
&lt;li>&lt;p>Just like R packages often improve with time, Hugo themes evolve. And just as you might like updating packages to get the best new tools, you might like getting the fancy features offered by a new version of your theme. For instance look at &lt;a href="https://sourcethemes.com/academic/updates/v4.6.0/">this release notes for some version of Hugo academic theme&lt;/a>: there are bug fixes but also cool improvements!&lt;/p>&lt;/li>
&lt;li>&lt;p>Just like your taste or needs of R packages in your script might evolve, e.g. you might want to update old scripts to use &lt;code>data.table&lt;/code> instead of &lt;code>dplyr&lt;/code>, you might even want to switch themes!&lt;/p>&lt;/li>
&lt;/ul>
&lt;/div>
&lt;div id="how-to-reduce-the-likelihood-of-breakages" class="section level1">
&lt;h1>How to reduce the likelihood of breakages?&lt;/h1>
&lt;div id="choose-your-theme-wisely-and-keep-in-touch" class="section level2">
&lt;h2>Choose your theme wisely and keep in touch!&lt;/h2>
&lt;p>When choosing a theme i.e. a collection of layouts for your website,
you’ll have aesthetics and practicalities in mind.
E.g. if you’re a prolific blogger you’ll want the posts to be quite prominent.
As the blogdown book mentions, &lt;a href="https://bookdown.org/yihui/blogdown/themes.html">also look at the theme’s popularity and activity&lt;/a> before adopting it.
This way you can have more trust in the theme’s responding to Hugo changes and to bug reports.&lt;/p>
&lt;p>Now, you’ll have to know when the theme gets updated. How?&lt;/p>
&lt;ul>
&lt;li>&lt;p>You could go hardcore git and make the theme &lt;a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">a git submodule&lt;/a> of your website repo.&lt;/p>&lt;/li>
&lt;li>&lt;p>You could &lt;a href="https://help.github.com/en/github/receiving-notifications-about-activity-on-github/watching-and-unwatching-releases-for-a-repository">watch i.e. subscribe to the GitHub releases of that theme&lt;/a>, or, if the maintainer(s) use a less formal workflow, watch all activity from that repo.&lt;/p>&lt;/li>
&lt;li>&lt;p>Any other idea? Maybe involving GitHub Actions, Dependabot, something else?
Maybe just a reminder to have a coffee date with your theme repo once in a while?&lt;/p>&lt;/li>
&lt;/ul>
&lt;/div>
&lt;div id="what-if-your-theme-gets-orphaned" class="section level2">
&lt;h2>What if your theme gets orphaned?&lt;/h2>
&lt;p>What if you chose your theme wisely but it lost its maintainer(s)?
In that case you’ll need to look into adopting it or rolling out your own version, or changing themes.&lt;/p>
&lt;/div>
&lt;div id="make-well-defined-tweaks-to-the-theme" class="section level2">
&lt;h2>Make well-defined tweaks to the theme&lt;/h2>
&lt;p>Although you’ve adopted a theme, you’ll probably want to personalize it a bit.
If you do so, do it with a good file structure and documentation hygiene!
As &lt;a href="https://bookdown.org/yihui/blogdown/custom-layouts.html">very well explained in the &lt;code>blogdown&lt;/code> book&lt;/a>,&lt;/p>
&lt;ul>
&lt;li>&lt;p>some tweaks are directly supported by the theme via the website config file (think of it as an R function parameters) e.g. adding your name to the homepage rather than Jane Doe’s;&lt;/p>&lt;/li>
&lt;li>&lt;p>some tweaks require your writing layout files (think of it as writing a wrapper for an R package/re-writing your own version of some functions) e.g. adding some fun sentence to the footer which the original theme doesn’t support. In this case you should store your custom layouts, like the fancy footer partial template, in a folder called &lt;code>layouts/&lt;/code> at the root of your website folder; &lt;em>not&lt;/em> in the theme folder. &lt;a href="https://gohugo.io/templates/lookup-order/">Hugo will give priority to &lt;code>layouts/&lt;/code> stuff when defined&lt;/a>, to use them on top of theme stuff; and you’ll easily see what you changed. Your future self will probably find much joy in your present self’s documenting the why and how of your custom layouts in some sort of developer notes. The more custom layouts you write, the greater your future responsability.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>&lt;em>If you define CSS and JS files, they’d live in &lt;code>static/&lt;/code> and be referred to in the website config file.&lt;/em>&lt;/p>
&lt;/div>
&lt;div id="imho-have-your-content-as-markdown-not-html-files" class="section level2">
&lt;h2>IMHO Have your content as Markdown, not html files&lt;/h2>
&lt;p>With &lt;code>blogdown&lt;/code> you can use .Rmd, .RMarkdown or .md as your website source, refer to &lt;a href="https://bookdown.org/yihui/blogdown/output-format.html">this exhaustive and clear comparison&lt;/a>.
I am strongly in favour of never using .Rmd in a blogdown site because its output is an html file, not a .markdown/.md file. html files seem less portable to me. I like the idea of being able to take my Markdown content and rather easily move them to a new theme (or even a new framework, like when I migrated this website &lt;a href="https://bookdown.org/yihui/blogdown/from-jekyll.html">from Jekyll&lt;/a>).&lt;/p>
&lt;p>Now, as explained in the table mentioned above, using .RMarkdown/.md has its limitations.
For html widgets I can recommend looking at &lt;a href="https://www.reconlearn.org/post/tutorial-post-creation.html#html-widgets-plotly-leaflet">the setup Steph Locke created for the RECON learn website&lt;/a>.&lt;/p>
&lt;/div>
&lt;div id="update-your-theme" class="section level2">
&lt;h2>Update your theme&lt;/h2>
&lt;p>So if you’ve tweaked cleanly, you can update your theme when needed!
If you work with version control, and &lt;a href="https://happygitwithr.com/">you probably should&lt;/a>, make a branch and work on the update in that branch.
If you don’t, backup your website’s current state first.&lt;/p>
&lt;p>To “update your theme”, you need to replace the theme folder of your website folder with the new theme files.&lt;/p>
&lt;p>You could do update the theme manually, or use &lt;code>blogdown::install_theme()&lt;/code> with &lt;code>force = TRUE&lt;/code>.&lt;/p>
&lt;p>Build your website, look at what needs to be changed:&lt;/p>
&lt;ul>
&lt;li>&lt;p>maybe the config parameter names changed (like an R function which would have renamed one of the parameters);&lt;/p>&lt;/li>
&lt;li>&lt;p>your custom layout might need some work too.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>To figure out what needs to be changed, you’ll probably want to read the changelog (or commit history) of your theme, and maybe even Hugo changelog.&lt;/p>
&lt;p>Often, changes in your theme, and work needed on your website, won’t be dramatic: the theme folder update, maybe one config parameter, a few lines diff in your custom layouts.&lt;/p>
&lt;/div>
&lt;div id="follow-hugo-news" class="section level2">
&lt;h2>Follow Hugo news?&lt;/h2>
&lt;p>If you wrote no custom layouts and use a very well maintained theme, you might never need to keep up with Hugo changes yourself.
However, if you’ve written Hugo custom layouts, or strive to become a contributor to your theme, you might want to read &lt;a href="https://gohugo.io/news/">Hugo changelogs&lt;/a>, follow &lt;a href="https://github.com/gohugoio/hugo">Hugo’s source repository&lt;/a>, or &lt;a href="https://twitter.com/GoHugoIO">Hugo’s Twitter account&lt;/a>, etc.&lt;/p>
&lt;p>Edit in May 2020. After asking on the Hugo forum how to follow Hugo more automatically for websites I (co-)maintain on GitHub, I ended up &lt;a href="https://discourse.gohugo.io/t/how-to-follow-install-hugo-updates-more-automatically/24950/4">creating a GitHub Actions workflow&lt;/a> that will look for Hugo updates once a month, and if needed open a PR amending Hugo version in the Netlify config file.&lt;/p>
&lt;/div>
&lt;div id="dont-live-on-the-edge" class="section level2">
&lt;h2>Don’t live on the edge&lt;/h2>
&lt;p>If you have a workflow on a continuous integration system updating your website every day from an external data source, &lt;a href="https://www.noamross.net/2019/08/09/a-new-website/">like Noam Ross&lt;/a> and &lt;a href="https://www.jimhester.com/">Jim Hester&lt;/a> do (yes that’s a very cool and very fancy setup!), use a specific Hugo version there, don’t let the workflow install Hugo’s latest version because it could break your website without your noticing.
Update Hugo with intent, after reading a bit and/or testing it doesn’t break your website.&lt;/p>
&lt;/div>
&lt;div id="what-if-i-just-never-update-hugo-or-my-theme" class="section level2">
&lt;h2>What if I just never update Hugo or my theme?&lt;/h2>
&lt;p>No, it’s not a good solution in my opinion.
Never updating Hugo (neither locally nor on say Netlify) nor your theme probably means your website will still build as it used to.
However, updates to Hugo/themes contain both improvements and &lt;strong>bug fixes&lt;/strong> so it’s better to know you’ll probably update the tools at least once in a while.&lt;/p>
&lt;/div>
&lt;/div>
&lt;div id="quick-fixes-to-bad-news" class="section level1">
&lt;h1>Quick fixes to bad news&lt;/h1>
&lt;p>Imagine you made yourself a pretty website to showcase your cool posts and informative slidedecks.
In the meantime, you changed laptops and today Saturday you want to post the link to your talk from last week,
before you head out for a barbecue with friends.
Your laptop doesn’t have Hugo installed so you install its latest version using &lt;code>blogdown::install_hugo()&lt;/code>, add your talk page, build the website, look at the preview and… notice it all looks wonky! Your website is broken!
If you remember the beginning of this post, what happened is probably an update in Hugo breaking your theme version. You’ll eventually need to update your theme.&lt;/p>
&lt;p>But you don’t have time right now before your barbecue to do that, let alone to learn how to do that if it’s the first time, so what can you do apart from not posting your talk content?&lt;/p>
&lt;div id="if-your-site-is-deployed-by-gh-pages" class="section level2">
&lt;h2>If your site is deployed by gh-pages&lt;/h2>
&lt;p>I.e. your build your website locally and then push the rendered content to a gh-pages branch of a GitHub repo, you need to retrograde Hugo before doing that. Note that &lt;code>blogdown::install_hugo()&lt;/code> has a &lt;code>version&lt;/code> argument, refer to Hugo changelogs to see what version you had last used.&lt;/p>
&lt;/div>
&lt;div id="if-your-site-is-deployed-by-netlify" class="section level2">
&lt;h2>If your site is deployed by Netlify&lt;/h2>
&lt;p>If you’re lucky, you can just push your content, and since the Hugo version of your Netlify’s config file hasn’t changed, your website will build smoothly. You could make a PR to your own website to get a preview there before merging.&lt;/p>
&lt;/div>
&lt;div id="later" class="section level2">
&lt;h2>Later&lt;/h2>
&lt;p>Eventually, one day soon, get to updating Hugo again, looking at your theme’s changes, if needed extracting your tweaks from the theme folder if you made them there (I’ve done that, and now I sure stick to using the &lt;code>layouts/&lt;/code> folder as mentioned earlier).
Use some of the tips of the beginning of the post to reduce the likelihood of the scenario happening again.&lt;/p>
&lt;/div>
&lt;/div>
&lt;div id="conclusion" class="section level1">
&lt;h1>Conclusion&lt;/h1>
&lt;p>In this blog post I presented what the maintenance of a Hugo website entails in my experience.
I haven’t mentioned other possible sources of breakage that are not specific to Hugo:&lt;/p>
&lt;ul>
&lt;li>&lt;p>&lt;a href="https://ropensci.org/technotes/2019/12/19/urls-tidying/">URLs in the content getting obsolete&lt;/a>;&lt;/p>&lt;/li>
&lt;li>&lt;p>Your changing deploy workflows (so use your own domain instead of a Netlify’s one?);&lt;/p>&lt;/li>
&lt;li>&lt;p>Your website source disappearing (so use backups);&lt;/p>&lt;/li>
&lt;li>&lt;p>etc.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>Coming back to Hugo, if you encounter problems I’d unsurprisingly recommend &lt;a href="https://gohugo.io/documentation/">Hugo docs&lt;/a> and &lt;a href="https://discourse.gohugo.io/">Hugo forum&lt;/a>.&lt;/p>
&lt;p>Now, if this all sounds overwhelming, I don’t think these tech skills are harder than R skills but time is a limited resource so maybe you could outsource some of your website’s creating and maintenance.
Maybe you can hire someone, or do a skill swap?&lt;/p>
&lt;p>Don’t hesitate to share your own experience and advice on maintaining Hugo websites!&lt;/p>
&lt;/div>
&lt;div class="footnotes">
&lt;hr />
&lt;ol>
&lt;li id="fn1">&lt;p>Also because I love the font of &lt;a href="https://gohugo.io/documentation/">its docs website&lt;/a> and looking at pages full of curly braces.&lt;a href="#fnref1" class="footnote-back">↩︎&lt;/a>&lt;/p>&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>testing reading time</title><link>https://academic-devops.netlify.app/posts/testing-reading-time/</link><pubDate>Tue, 25 May 2021 00:00:00 +0000</pubDate><guid>https://academic-devops.netlify.app/posts/testing-reading-time/</guid><description>
&lt;script src="https://academic-devops.netlify.app/posts/testing-reading-time/index_files/header-attrs/header-attrs.js">&lt;/script>
&lt;p>Fancy (re-)creating your website using Hugo, with or without blogdown?
Feeling &lt;a href="https://twitter.com/OscarBaruffa/status/1233133764282322945">a bit anxious&lt;/a>?
This post is aimed at being the Hugo equivalent of &lt;em>“What to know before you adopt a pet”&lt;/em>.
We shall go through things that can/will break in the future, and what you can do to prevent future pain.&lt;/p>
&lt;p>&lt;em>I’m writing this post with R users in mind, which means I shall use R analogies and mentioning &lt;code>blogdown&lt;/code>,
but I hope some aspects are generalizable to other potential Hugo adopters.&lt;/em>
&lt;em>Some aspects are specific to deploying your website using git and an online git platform such as GitHub.&lt;/em>&lt;/p>
&lt;div id="why-hugoblogdown" class="section level1">
&lt;h1>Why Hugo/blogdown?&lt;/h1>
&lt;p>If you’re reading this you’ve probably heard of Hugo somewhere.
It’s getting quite popular in the R community thanks to the &lt;code>blogdown&lt;/code> package, whose associated book features an &lt;a href="https://bookdown.org/yihui/blogdown/static-sites.html">excellent intro to why Hugo (and &lt;code>blogdown&lt;/code>)&lt;/a>.&lt;/p>
&lt;p>I myself have used Hugo for this website (with a bit of &lt;code>blogdown&lt;/code>) and dived into more details whilst &lt;a href="https://ropensci.org/technotes/2019/01/09/hugo/">working on tweaks to the rOpenSci website&lt;/a>.
I really enjoy working with this website generator, partly because it’s fast and open-source&lt;a href="#fn1" class="footnote-ref" id="fnref1">&lt;sup>1&lt;/sup>&lt;/a>.&lt;/p>
&lt;/div>
&lt;div id="what-can-break-or-evolve" class="section level1">
&lt;h1>What can break or evolve?&lt;/h1>
&lt;p>When you have a website created with Hugo, there are two to four main actors:&lt;/p>
&lt;ul>
&lt;li>&lt;p>Hugo itself which you could think of as R;&lt;/p>&lt;/li>
&lt;li>&lt;p>A Hugo &lt;em>theme&lt;/em> which defines the layout and style of your website. You could think of the theme as an R package. Your theme is a folder inside your website folder. You need one, no matter how minimal.&lt;/p>&lt;/li>
&lt;li>&lt;p>the other things your website theme might depend on, such as Font Awesome.&lt;/p>&lt;/li>
&lt;li>&lt;p>potential fourth actor: your tweaks to the theme which might be your editing an R package source; or maintaining a script/a second package on to of that R package to add some syntactic sugar or so to the existing functions of the package.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>So what’s going to break and evolve?&lt;/p>
&lt;ul>
&lt;li>&lt;p>Just like R packages need to keep up with changes to R sometimes, Hugo themes need to keep up with Hugo changes. Hugo is a trustworthy framework, that keeps improving, which however means sometimes removing support for some things or ways of doing them. Example: &lt;a href="https://github.com/yoshiharuyamashita/blackburn/commit/123ebe8bb4fd3708fc51dab42613e6a3a7d37d4c">this commit to the theme I’m using made a small change for making the theme compatible with Hugo&amp;gt;0.57&lt;/a>.&lt;/p>&lt;/li>
&lt;li>&lt;p>Just like R packages need to keep up with changes to their external dependencies (web APIs, data format standard), Hugo themes need to keep with changes to external dependencies (font providers, JS scripts, etc). Example: &lt;a href="https://github.com/yoshiharuyamashita/blackburn/commit/fef095af788816dbc27f040ca98eee3df6b60c1c">a commit to the theme I’m using that updates the templates to use the new syntax for Font Awesome icons&lt;/a>.&lt;/p>&lt;/li>
&lt;li>&lt;p>Just like R packages often improve with time, Hugo themes evolve. And just as you might like updating packages to get the best new tools, you might like getting the fancy features offered by a new version of your theme. For instance look at &lt;a href="https://sourcethemes.com/academic/updates/v4.6.0/">this release notes for some version of Hugo academic theme&lt;/a>: there are bug fixes but also cool improvements!&lt;/p>&lt;/li>
&lt;li>&lt;p>Just like your taste or needs of R packages in your script might evolve, e.g. you might want to update old scripts to use &lt;code>data.table&lt;/code> instead of &lt;code>dplyr&lt;/code>, you might even want to switch themes!&lt;/p>&lt;/li>
&lt;/ul>
&lt;/div>
&lt;div id="how-to-reduce-the-likelihood-of-breakages" class="section level1">
&lt;h1>How to reduce the likelihood of breakages?&lt;/h1>
&lt;div id="choose-your-theme-wisely-and-keep-in-touch" class="section level2">
&lt;h2>Choose your theme wisely and keep in touch!&lt;/h2>
&lt;p>When choosing a theme i.e. a collection of layouts for your website,
you’ll have aesthetics and practicalities in mind.
E.g. if you’re a prolific blogger you’ll want the posts to be quite prominent.
As the blogdown book mentions, &lt;a href="https://bookdown.org/yihui/blogdown/themes.html">also look at the theme’s popularity and activity&lt;/a> before adopting it.
This way you can have more trust in the theme’s responding to Hugo changes and to bug reports.&lt;/p>
&lt;p>Now, you’ll have to know when the theme gets updated. How?&lt;/p>
&lt;ul>
&lt;li>&lt;p>You could go hardcore git and make the theme &lt;a href="https://git-scm.com/book/en/v2/Git-Tools-Submodules">a git submodule&lt;/a> of your website repo.&lt;/p>&lt;/li>
&lt;li>&lt;p>You could &lt;a href="https://help.github.com/en/github/receiving-notifications-about-activity-on-github/watching-and-unwatching-releases-for-a-repository">watch i.e. subscribe to the GitHub releases of that theme&lt;/a>, or, if the maintainer(s) use a less formal workflow, watch all activity from that repo.&lt;/p>&lt;/li>
&lt;li>&lt;p>Any other idea? Maybe involving GitHub Actions, Dependabot, something else?
Maybe just a reminder to have a coffee date with your theme repo once in a while?&lt;/p>&lt;/li>
&lt;/ul>
&lt;/div>
&lt;div id="what-if-your-theme-gets-orphaned" class="section level2">
&lt;h2>What if your theme gets orphaned?&lt;/h2>
&lt;p>What if you chose your theme wisely but it lost its maintainer(s)?
In that case you’ll need to look into adopting it or rolling out your own version, or changing themes.&lt;/p>
&lt;/div>
&lt;div id="make-well-defined-tweaks-to-the-theme" class="section level2">
&lt;h2>Make well-defined tweaks to the theme&lt;/h2>
&lt;p>Although you’ve adopted a theme, you’ll probably want to personalize it a bit.
If you do so, do it with a good file structure and documentation hygiene!
As &lt;a href="https://bookdown.org/yihui/blogdown/custom-layouts.html">very well explained in the &lt;code>blogdown&lt;/code> book&lt;/a>,&lt;/p>
&lt;ul>
&lt;li>&lt;p>some tweaks are directly supported by the theme via the website config file (think of it as an R function parameters) e.g. adding your name to the homepage rather than Jane Doe’s;&lt;/p>&lt;/li>
&lt;li>&lt;p>some tweaks require your writing layout files (think of it as writing a wrapper for an R package/re-writing your own version of some functions) e.g. adding some fun sentence to the footer which the original theme doesn’t support. In this case you should store your custom layouts, like the fancy footer partial template, in a folder called &lt;code>layouts/&lt;/code> at the root of your website folder; &lt;em>not&lt;/em> in the theme folder. &lt;a href="https://gohugo.io/templates/lookup-order/">Hugo will give priority to &lt;code>layouts/&lt;/code> stuff when defined&lt;/a>, to use them on top of theme stuff; and you’ll easily see what you changed. Your future self will probably find much joy in your present self’s documenting the why and how of your custom layouts in some sort of developer notes. The more custom layouts you write, the greater your future responsability.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>&lt;em>If you define CSS and JS files, they’d live in &lt;code>static/&lt;/code> and be referred to in the website config file.&lt;/em>&lt;/p>
&lt;/div>
&lt;div id="imho-have-your-content-as-markdown-not-html-files" class="section level2">
&lt;h2>IMHO Have your content as Markdown, not html files&lt;/h2>
&lt;p>With &lt;code>blogdown&lt;/code> you can use .Rmd, .RMarkdown or .md as your website source, refer to &lt;a href="https://bookdown.org/yihui/blogdown/output-format.html">this exhaustive and clear comparison&lt;/a>.
I am strongly in favour of never using .Rmd in a blogdown site because its output is an html file, not a .markdown/.md file. html files seem less portable to me. I like the idea of being able to take my Markdown content and rather easily move them to a new theme (or even a new framework, like when I migrated this website &lt;a href="https://bookdown.org/yihui/blogdown/from-jekyll.html">from Jekyll&lt;/a>).&lt;/p>
&lt;p>Now, as explained in the table mentioned above, using .RMarkdown/.md has its limitations.
For html widgets I can recommend looking at &lt;a href="https://www.reconlearn.org/post/tutorial-post-creation.html#html-widgets-plotly-leaflet">the setup Steph Locke created for the RECON learn website&lt;/a>.&lt;/p>
&lt;/div>
&lt;div id="update-your-theme" class="section level2">
&lt;h2>Update your theme&lt;/h2>
&lt;p>So if you’ve tweaked cleanly, you can update your theme when needed!
If you work with version control, and &lt;a href="https://happygitwithr.com/">you probably should&lt;/a>, make a branch and work on the update in that branch.
If you don’t, backup your website’s current state first.&lt;/p>
&lt;p>To “update your theme”, you need to replace the theme folder of your website folder with the new theme files.&lt;/p>
&lt;p>You could do update the theme manually, or use &lt;code>blogdown::install_theme()&lt;/code> with &lt;code>force = TRUE&lt;/code>.&lt;/p>
&lt;p>Build your website, look at what needs to be changed:&lt;/p>
&lt;ul>
&lt;li>&lt;p>maybe the config parameter names changed (like an R function which would have renamed one of the parameters);&lt;/p>&lt;/li>
&lt;li>&lt;p>your custom layout might need some work too.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>To figure out what needs to be changed, you’ll probably want to read the changelog (or commit history) of your theme, and maybe even Hugo changelog.&lt;/p>
&lt;p>Often, changes in your theme, and work needed on your website, won’t be dramatic: the theme folder update, maybe one config parameter, a few lines diff in your custom layouts.&lt;/p>
&lt;/div>
&lt;div id="follow-hugo-news" class="section level2">
&lt;h2>Follow Hugo news?&lt;/h2>
&lt;p>If you wrote no custom layouts and use a very well maintained theme, you might never need to keep up with Hugo changes yourself.
However, if you’ve written Hugo custom layouts, or strive to become a contributor to your theme, you might want to read &lt;a href="https://gohugo.io/news/">Hugo changelogs&lt;/a>, follow &lt;a href="https://github.com/gohugoio/hugo">Hugo’s source repository&lt;/a>, or &lt;a href="https://twitter.com/GoHugoIO">Hugo’s Twitter account&lt;/a>, etc.&lt;/p>
&lt;p>Edit in May 2020. After asking on the Hugo forum how to follow Hugo more automatically for websites I (co-)maintain on GitHub, I ended up &lt;a href="https://discourse.gohugo.io/t/how-to-follow-install-hugo-updates-more-automatically/24950/4">creating a GitHub Actions workflow&lt;/a> that will look for Hugo updates once a month, and if needed open a PR amending Hugo version in the Netlify config file.&lt;/p>
&lt;/div>
&lt;div id="dont-live-on-the-edge" class="section level2">
&lt;h2>Don’t live on the edge&lt;/h2>
&lt;p>If you have a workflow on a continuous integration system updating your website every day from an external data source, &lt;a href="https://www.noamross.net/2019/08/09/a-new-website/">like Noam Ross&lt;/a> and &lt;a href="https://www.jimhester.com/">Jim Hester&lt;/a> do (yes that’s a very cool and very fancy setup!), use a specific Hugo version there, don’t let the workflow install Hugo’s latest version because it could break your website without your noticing.
Update Hugo with intent, after reading a bit and/or testing it doesn’t break your website.&lt;/p>
&lt;/div>
&lt;div id="what-if-i-just-never-update-hugo-or-my-theme" class="section level2">
&lt;h2>What if I just never update Hugo or my theme?&lt;/h2>
&lt;p>No, it’s not a good solution in my opinion.
Never updating Hugo (neither locally nor on say Netlify) nor your theme probably means your website will still build as it used to.
However, updates to Hugo/themes contain both improvements and &lt;strong>bug fixes&lt;/strong> so it’s better to know you’ll probably update the tools at least once in a while.&lt;/p>
&lt;/div>
&lt;/div>
&lt;div id="quick-fixes-to-bad-news" class="section level1">
&lt;h1>Quick fixes to bad news&lt;/h1>
&lt;p>Imagine you made yourself a pretty website to showcase your cool posts and informative slidedecks.
In the meantime, you changed laptops and today Saturday you want to post the link to your talk from last week,
before you head out for a barbecue with friends.
Your laptop doesn’t have Hugo installed so you install its latest version using &lt;code>blogdown::install_hugo()&lt;/code>, add your talk page, build the website, look at the preview and… notice it all looks wonky! Your website is broken!
If you remember the beginning of this post, what happened is probably an update in Hugo breaking your theme version. You’ll eventually need to update your theme.&lt;/p>
&lt;p>But you don’t have time right now before your barbecue to do that, let alone to learn how to do that if it’s the first time, so what can you do apart from not posting your talk content?&lt;/p>
&lt;div id="if-your-site-is-deployed-by-gh-pages" class="section level2">
&lt;h2>If your site is deployed by gh-pages&lt;/h2>
&lt;p>I.e. your build your website locally and then push the rendered content to a gh-pages branch of a GitHub repo, you need to retrograde Hugo before doing that. Note that &lt;code>blogdown::install_hugo()&lt;/code> has a &lt;code>version&lt;/code> argument, refer to Hugo changelogs to see what version you had last used.&lt;/p>
&lt;/div>
&lt;div id="if-your-site-is-deployed-by-netlify" class="section level2">
&lt;h2>If your site is deployed by Netlify&lt;/h2>
&lt;p>If you’re lucky, you can just push your content, and since the Hugo version of your Netlify’s config file hasn’t changed, your website will build smoothly. You could make a PR to your own website to get a preview there before merging.&lt;/p>
&lt;/div>
&lt;div id="later" class="section level2">
&lt;h2>Later&lt;/h2>
&lt;p>Eventually, one day soon, get to updating Hugo again, looking at your theme’s changes, if needed extracting your tweaks from the theme folder if you made them there (I’ve done that, and now I sure stick to using the &lt;code>layouts/&lt;/code> folder as mentioned earlier).
Use some of the tips of the beginning of the post to reduce the likelihood of the scenario happening again.&lt;/p>
&lt;/div>
&lt;/div>
&lt;div id="conclusion" class="section level1">
&lt;h1>Conclusion&lt;/h1>
&lt;p>In this blog post I presented what the maintenance of a Hugo website entails in my experience.
I haven’t mentioned other possible sources of breakage that are not specific to Hugo:&lt;/p>
&lt;ul>
&lt;li>&lt;p>&lt;a href="https://ropensci.org/technotes/2019/12/19/urls-tidying/">URLs in the content getting obsolete&lt;/a>;&lt;/p>&lt;/li>
&lt;li>&lt;p>Your changing deploy workflows (so use your own domain instead of a Netlify’s one?);&lt;/p>&lt;/li>
&lt;li>&lt;p>Your website source disappearing (so use backups);&lt;/p>&lt;/li>
&lt;li>&lt;p>etc.&lt;/p>&lt;/li>
&lt;/ul>
&lt;p>Coming back to Hugo, if you encounter problems I’d unsurprisingly recommend &lt;a href="https://gohugo.io/documentation/">Hugo docs&lt;/a> and &lt;a href="https://discourse.gohugo.io/">Hugo forum&lt;/a>.&lt;/p>
&lt;p>Now, if this all sounds overwhelming, I don’t think these tech skills are harder than R skills but time is a limited resource so maybe you could outsource some of your website’s creating and maintenance.
Maybe you can hire someone, or do a skill swap?&lt;/p>
&lt;p>Don’t hesitate to share your own experience and advice on maintaining Hugo websites!&lt;/p>
&lt;/div>
&lt;div class="footnotes">
&lt;hr />
&lt;ol>
&lt;li id="fn1">&lt;p>Also because I love the font of &lt;a href="https://gohugo.io/documentation/">its docs website&lt;/a> and looking at pages full of curly braces.&lt;a href="#fnref1" class="footnote-back">↩︎&lt;/a>&lt;/p>&lt;/li>
&lt;/ol>
&lt;/div></description></item><item><title>Testing surver archetypes 2</title><link>https://academic-devops.netlify.app/survey/testing-surver-archetypes-2/</link><pubDate>Tue, 25 May 2021 00:00:00 +0000</pubDate><guid>https://academic-devops.netlify.app/survey/testing-surver-archetypes-2/</guid><description>
&lt;script src="https://academic-devops.netlify.app/survey/testing-surver-archetypes-2/index_files/header-attrs/header-attrs.js">&lt;/script>
&lt;p>&lt;strong>doi:&lt;/strong> &lt;a href="http://localhost:4321/survey/testing-surver-archetypes-2/" class="uri">http://localhost:4321/survey/testing-surver-archetypes-2/&lt;/a>&lt;/p>
&lt;p>&lt;strong>Abstract:&lt;/strong>
We developed the neural estimator for entropy production (NEEP), a novel type of estimator that evaluates entropy production from the trajectories of system variables by deep learning. In the macroscopic world, entropy never decreases as time moves forward; for instance, spilled water will not spontaneously jump back into its cup. However, entropy can in fact transiently decrease in small systems due to environmental fluctuations. Physicists have found that such an entropy difference, called entropy production (EP), can be measured by estimating the probability that a time-reversed trajectory, which is like playing a recorded video from an experiment backward, will be observed. Various EP estimators based on this method have been developed, but the required trajectory data needs to first be divided into discrete microstates. In contrast to these conventional methods, NEEP does not require such detailed information to estimate the probability of time-reversed trajectories, and further, NEEP can efficiently learn EP from data even in high-dimensional space. We additionally verified that our approach is even applicable to time-series data with unobservable variables. We expect NEEP to be beneficial in applications to intricately organized systems where numerous variables are entangled and hidden, such as biological systems, active matter, and others, for a deeper look into their complex dynamics.&lt;/p>
&lt;hr />
&lt;div id="summary-notes" class="section level1">
&lt;h1>Summary Notes&lt;/h1>
&lt;/div>
&lt;div id="further-reading" class="section level1">
&lt;h1>Further Reading&lt;/h1>
&lt;/div></description></item><item><title>testing survey archetype</title><link>https://academic-devops.netlify.app/post/testing-survey-archetype/</link><pubDate>Tue, 25 May 2021 00:00:00 +0000</pubDate><guid>https://academic-devops.netlify.app/post/testing-survey-archetype/</guid><description>
&lt;script src="https://academic-devops.netlify.app/post/testing-survey-archetype/index_files/header-attrs/header-attrs.js">&lt;/script>
&lt;p>&lt;strong>doi:&lt;/strong> &lt;a href="https://doi.org/10.1103/PhysRevLett.125.140604https://" class="uri">https://doi.org/10.1103/PhysRevLett.125.140604https://&lt;/a>
&lt;strong>Abstract:&lt;/strong>
This Letter presents a neural estimator for entropy production (NEEP), that estimates entropy production (EP) from trajectories of relevant variables without detailed information on the system dynamics. For steady state, we rigorously proved that the estimator, which can be built up from different choices of deep neural networks, provides stochastic EP by optimizing the objective function proposed here. We verify the NEEP with the stochastic processes of the bead spring and discrete flashing ratchet models and also demonstrate that our method is applicable to high-dimensional data and can provide coarse-grained EP for Markov systems with unobservable states.&lt;/p>
&lt;div id="summary-notes" class="section level1">
&lt;h1>Summary Notes&lt;/h1>
&lt;p>My Own Notes and key takeaways.&lt;/p>
&lt;/div>
&lt;div id="further-reading" class="section level1">
&lt;h1>Further Reading&lt;/h1>
&lt;p>Or better bibtex type citations?
* &lt;a href="">Reference 1 title&lt;/a>
* &lt;a href="">Reference 2 title&lt;/a>&lt;/p>
&lt;/div></description></item><item><title>Welcome to Wowchemy, the website builder for Hugo</title><link>https://academic-devops.netlify.app/post/getting-started/</link><pubDate>Sun, 13 Dec 2020 00:00:00 +0000</pubDate><guid>https://academic-devops.netlify.app/post/getting-started/</guid><description>&lt;h2 id="overview">Overview&lt;/h2>
&lt;ol>
&lt;li>The Wowchemy website builder for Hugo, along with its starter templates, is designed for professional creators, educators, and teams/organizations - although it can be used to create any kind of site&lt;/li>
&lt;li>The template can be modified and customised to suit your needs. It&amp;rsquo;s a good platform for anyone looking to take control of their data and online identity whilst having the convenience to start off with a &lt;strong>no-code solution (write in Markdown and customize with YAML parameters)&lt;/strong> and having &lt;strong>flexibility to later add even deeper personalization with HTML and CSS&lt;/strong>&lt;/li>
&lt;li>You can work with all your favourite tools and apps with hundreds of plugins and integrations to speed up your workflows, interact with your readers, and much more&lt;/li>
&lt;/ol>
&lt;h2 id="get-started">Get Started&lt;/h2>
&lt;ul>
&lt;li>👉 &lt;a href="https://wowchemy.com/templates/" target="_blank" rel="noopener">&lt;strong>Create a new site&lt;/strong>&lt;/a>&lt;/li>
&lt;li>📚 &lt;a href="https://wowchemy.com/docs/" target="_blank" rel="noopener">&lt;strong>Personalize your site&lt;/strong>&lt;/a>&lt;/li>
&lt;li>💬 &lt;a href="https://discord.gg/z8wNYzb" target="_blank" rel="noopener">Chat with the &lt;strong>Wowchemy community&lt;/strong>&lt;/a> or &lt;a href="https://discourse.gohugo.io" target="_blank" rel="noopener">&lt;strong>Hugo community&lt;/strong>&lt;/a>&lt;/li>
&lt;li>🐦 Twitter: &lt;a href="https://twitter.com/wowchemy" target="_blank" rel="noopener">@wowchemy&lt;/a> &lt;a href="https://twitter.com/GeorgeCushen" target="_blank" rel="noopener">@GeorgeCushen&lt;/a> &lt;a href="https://twitter.com/search?q=%28%23MadeWithWowchemy%20OR%20%23MadeWithAcademic%29&amp;amp;src=typed_query" target="_blank" rel="noopener">#MadeWithWowchemy&lt;/a>&lt;/li>
&lt;li>💡 &lt;a href="https://github.com/wowchemy/wowchemy-hugo-modules/issues" target="_blank" rel="noopener">Request a &lt;strong>feature&lt;/strong> or report a &lt;strong>bug&lt;/strong> for &lt;em>Wowchemy&lt;/em>&lt;/a>&lt;/li>
&lt;li>⬆️ &lt;strong>Updating Wowchemy?&lt;/strong> View the &lt;a href="https://wowchemy.com/docs/guide/update/" target="_blank" rel="noopener">Update Guide&lt;/a> and &lt;a href="https://wowchemy.com/updates/" target="_blank" rel="noopener">Release Notes&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="crowd-funded-open-source-software">Crowd-funded open-source software&lt;/h2>
&lt;p>To help us develop this template and software sustainably under the MIT license, we ask all individuals and businesses that use it to help support its ongoing maintenance and development via sponsorship.&lt;/p>
&lt;h3 id="-click-here-to-become-a-sponsor-and-help-support-wowchemys-future-httpswowchemycomplans">&lt;a href="https://wowchemy.com/plans/" target="_blank" rel="noopener">❤️ Click here to become a sponsor and help support Wowchemy&amp;rsquo;s future ❤️&lt;/a>&lt;/h3>
&lt;p>As a token of appreciation for sponsoring, you can &lt;strong>unlock &lt;a href="https://wowchemy.com/plans/" target="_blank" rel="noopener">these&lt;/a> awesome rewards and extra features 🦄✨&lt;/strong>&lt;/p>
&lt;h2 id="ecosystem">Ecosystem&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>&lt;a href="https://github.com/wowchemy/hugo-academic-cli" target="_blank" rel="noopener">Hugo Academic CLI&lt;/a>:&lt;/strong> Automatically import publications from BibTeX&lt;/li>
&lt;/ul>
&lt;h2 id="inspiration">Inspiration&lt;/h2>
&lt;p>&lt;a href="https://academic-demo.netlify.com/" target="_blank" rel="noopener">Check out the latest &lt;strong>demo&lt;/strong>&lt;/a> of what you&amp;rsquo;ll get in less than 10 minutes, or &lt;a href="https://wowchemy.com/user-stories/" target="_blank" rel="noopener">view the &lt;strong>showcase&lt;/strong>&lt;/a> of personal, project, and business sites.&lt;/p>
&lt;h2 id="features">Features&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Page builder&lt;/strong> - Create &lt;em>anything&lt;/em> with &lt;a href="https://wowchemy.com/docs/page-builder/" target="_blank" rel="noopener">&lt;strong>widgets&lt;/strong>&lt;/a> and &lt;a href="https://wowchemy.com/docs/writing-markdown-latex/" target="_blank" rel="noopener">&lt;strong>elements&lt;/strong>&lt;/a>&lt;/li>
&lt;li>&lt;strong>Edit any type of content&lt;/strong> - Blog posts, publications, talks, slides, projects, and more!&lt;/li>
&lt;li>&lt;strong>Create content&lt;/strong> in &lt;a href="https://wowchemy.com/docs/writing-markdown-latex/" target="_blank" rel="noopener">&lt;strong>Markdown&lt;/strong>&lt;/a>, &lt;a href="https://wowchemy.com/docs/import/jupyter/" target="_blank" rel="noopener">&lt;strong>Jupyter&lt;/strong>&lt;/a>, or &lt;a href="https://wowchemy.com/docs/install-locally/" target="_blank" rel="noopener">&lt;strong>RStudio&lt;/strong>&lt;/a>&lt;/li>
&lt;li>&lt;strong>Plugin System&lt;/strong> - Fully customizable &lt;a href="https://wowchemy.com/docs/customization/" target="_blank" rel="noopener">&lt;strong>color&lt;/strong> and &lt;strong>font themes&lt;/strong>&lt;/a>&lt;/li>
&lt;li>&lt;strong>Display Code and Math&lt;/strong> - Code highlighting and &lt;a href="https://en.wikibooks.org/wiki/LaTeX/Mathematics" target="_blank" rel="noopener">LaTeX math&lt;/a> supported&lt;/li>
&lt;li>&lt;strong>Integrations&lt;/strong> - &lt;a href="https://analytics.google.com" target="_blank" rel="noopener">Google Analytics&lt;/a>, &lt;a href="https://disqus.com" target="_blank" rel="noopener">Disqus commenting&lt;/a>, Maps, Contact Forms, and more!&lt;/li>
&lt;li>&lt;strong>Beautiful Site&lt;/strong> - Simple and refreshing one page design&lt;/li>
&lt;li>&lt;strong>Industry-Leading SEO&lt;/strong> - Help get your website found on search engines and social media&lt;/li>
&lt;li>&lt;strong>Media Galleries&lt;/strong> - Display your images and videos with captions in a customizable gallery&lt;/li>
&lt;li>&lt;strong>Mobile Friendly&lt;/strong> - Look amazing on every screen with a mobile friendly version of your site&lt;/li>
&lt;li>&lt;strong>Multi-language&lt;/strong> - 34+ language packs including English, 中文, and Português&lt;/li>
&lt;li>&lt;strong>Multi-user&lt;/strong> - Each author gets their own profile page&lt;/li>
&lt;li>&lt;strong>Privacy Pack&lt;/strong> - Assists with GDPR&lt;/li>
&lt;li>&lt;strong>Stand Out&lt;/strong> - Bring your site to life with animation, parallax backgrounds, and scroll effects&lt;/li>
&lt;li>&lt;strong>One-Click Deployment&lt;/strong> - No servers. No databases. Only files.&lt;/li>
&lt;/ul>
&lt;h2 id="themes">Themes&lt;/h2>
&lt;p>Wowchemy and its templates come with &lt;strong>automatic day (light) and night (dark) mode&lt;/strong> built-in. Alternatively, visitors can choose their preferred mode - click the moon icon in the top right of the &lt;a href="https://academic-demo.netlify.com/" target="_blank" rel="noopener">Demo&lt;/a> to see it in action! Day/night mode can also be disabled by the site admin in &lt;code>params.toml&lt;/code>.&lt;/p>
&lt;p>&lt;a href="https://wowchemy.com/docs/customization" target="_blank" rel="noopener">Choose a stunning &lt;strong>theme&lt;/strong> and &lt;strong>font&lt;/strong>&lt;/a> for your site. Themes are fully customizable.&lt;/p>
&lt;h2 id="license">License&lt;/h2>
&lt;p>Copyright 2016-present &lt;a href="https://georgecushen.com" target="_blank" rel="noopener">George Cushen&lt;/a>.&lt;/p>
&lt;p>Released under the &lt;a href="https://github.com/wowchemy/wowchemy-hugo-modules/blob/master/LICENSE.md" target="_blank" rel="noopener">MIT&lt;/a> license.&lt;/p></description></item></channel></rss>