<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ubuntu on Melabit</title>
    <link>https://static.233.196.69.159.clients.your-server.de/en/tags/ubuntu/</link>
    <description>Recent content in Ubuntu on Melabit</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 11 Feb 2025 06:00:00 +0000</lastBuildDate>
    <atom:link href="https://static.233.196.69.159.clients.your-server.de/en/tags/ubuntu/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>From melabit to melabit: Jekyll, installation and basic configuration</title>
      <link>https://static.233.196.69.159.clients.your-server.de/en/2025/02/11/from-melabit-to-melabit-jekyll-installation-and-basic-configuration/</link>
      <pubDate>Tue, 11 Feb 2025 06:00:00 +0000</pubDate>
      <guid>https://static.233.196.69.159.clients.your-server.de/en/2025/02/11/from-melabit-to-melabit-jekyll-installation-and-basic-configuration/</guid>
      <description>&lt;p&gt;This post is not meant to be a detailed guide on installing and configuring &lt;a href=&#34;https://jekyllrb.com/&#34;&gt;Jekyll&lt;/a&gt;; for that, there are excellent guides listed below.&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;p&gt;Instead, this post is a commented collection of notes I took while developing &lt;a href=&#34;https://melabit.com/en/&#34;&gt;melabit.com/posts/en&lt;/a&gt;. They are the result of days and days of trial and error, changes in direction, and research to find the &lt;em&gt;right&lt;/em&gt; command. These notes were useful for me to remember what I had done and how I had solved the issues that arose from time to time. They might be useful for you to get everything done more quickly and smoothly.&lt;/p&gt;&#xA;&lt;h4 id=&#34;installing-jekyll&#34;&gt;Installing Jekyll&lt;/h4&gt;&#xA;&lt;p&gt;To experiment with Jekyll, there is nothing better than using a virtual machine, preferably with a lightweight Linux server version. A good alternative is a virtual cloud server, even a cheap one, like &lt;a href=&#34;https://upcloud.com/products/cloud-servers&#34;&gt;UpCloud&lt;/a&gt;, &lt;a href=&#34;https://cloud.google.com/products/compute&#34;&gt;Google Compute Engine&lt;/a&gt;, &lt;a href=&#34;https://aws.amazon.com/ec2/?nc2=h_ql_prod_fs_ec2&#34;&gt;Amazon EC2&lt;/a&gt;, or similar. However, for serious work, it is much more convenient and faster to use a &lt;em&gt;real&lt;/em&gt; machine, especially since following these instructions makes the risk of damage almost nil. Luckily, I had an old Mac available, which allowed me to try and retry, knowing that if any issues arose, I could easily reset it.&lt;/p&gt;&#xA;&lt;p&gt;The best guide for installing Jekyll is undoubtedly &lt;a href=&#34;https://jekyllrb.com/docs/installation/&#34;&gt;the official one&lt;/a&gt;, with specific instructions for the most common operating systems.&lt;/p&gt;&#xA;&lt;p&gt;The &lt;a href=&#34;https://jekyllrb.com/docs/installation/macos/&#34;&gt;guide for macOS&lt;/a&gt; is well-done, but the installation requires &lt;a href=&#34;https://brew.sh/&#34;&gt;Homebrew&lt;/a&gt; and a number of steps to be followed carefully. On Linux, the installation is much easier, while on Windows, the best approach is to install the &lt;a href=&#34;https://learn.microsoft.com/en-us/windows/wsl/about&#34;&gt;Windows Subsystem for Linux (WSL)&lt;/a&gt; and then work &lt;a href=&#34;https://jekyllrb.com/docs/installation/windows/&#34;&gt;essentially in a Linux environment&lt;/a&gt;.&lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;p&gt;An important detail missing from the macOS instructions—but present in those for &lt;a href=&#34;https://jekyllrb.com/docs/installation/freebsd/&#34;&gt;Ubuntu&lt;/a&gt;, &lt;a href=&#34;https://jekyllrb.com/docs/installation/freebsd/&#34;&gt;FreeBSD&lt;/a&gt;, and &lt;a href=&#34;https://jekyllrb.com/docs/installation/other-linux/&#34;&gt;other Linux distributions&lt;/a&gt;—is that before executing the final command &lt;code&gt;gem install jekyll&lt;/code&gt; (or even before starting the Jekyll installation), it is advisable to add these lines to the &lt;code&gt;~/.bashrc&lt;/code&gt; or &lt;code&gt;~/.zshrc&lt;/code&gt; file (depending on the shell used):&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#--- Install Ruby gems in the user account, e.g., in ~/.gems ---&#xA;export GEM_HOME=&amp;#34;$HOME/.gems&amp;#34;&#xA;export PATH=&amp;#34;$HOME/.gems/bin:$PATH&amp;#34;&#xA;#--- end ---&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then, execute &lt;code&gt;source ~/.bashrc&lt;/code&gt; or &lt;code&gt;source ~/.zshrc&lt;/code&gt; to activate the new environment variables (I usually just close and reopen the Terminal).&lt;/p&gt;&#xA;&lt;p&gt;What are these lines for? They instruct &lt;a href=&#34;https://www.ruby-lang.org/en/&#34;&gt;RubyGems&lt;/a&gt;, Ruby’s package manager, to install all its &lt;em&gt;gems&lt;/em&gt;,&lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt; including Jekyll, in the user account instead of system-wide. This is a good practice as it separates the native &lt;code&gt;Ruby&lt;/code&gt; installation within the operating system from everything we install ourselves, allowing us to fix inevitable errors without risking system integrity.&lt;/p&gt;&#xA;&lt;p&gt;At this point, you can proceed with the actual Jekyll installation,&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ gem install jekyll&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Immediately after, install another very useful gem, &lt;a href=&#34;https://rubygems.org/gems/bundler&#34;&gt;Bundler&lt;/a&gt;,&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ gem install bundler&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;which, inexplicably, is completely omitted from the macOS instructions.&lt;/p&gt;&#xA;&lt;p&gt;To instruct &lt;code&gt;bundler&lt;/code&gt; to install everything within the user account, execute&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ bundle config set --local path $GEM_HOME&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Finally, if you are using a virtual machine or cloud server and your main operating system is macOS, install this gem,&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ gem install rmate&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;which will allow you to use &lt;a href=&#34;https://macromates.com/&#34;&gt;TextMate&lt;/a&gt;, which I consider the best overall editor for macOS, to edit files remotely instead of using &lt;code&gt;nano&lt;/code&gt;, &lt;code&gt;vim&lt;/code&gt;, or &lt;code&gt;emacs&lt;/code&gt; directly on the virtual/cloud machine (being a Linux server version, it lacks a graphical interface).&lt;sup id=&#34;fnref:4&#34;&gt;&lt;a href=&#34;#fn:4&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;4&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;h4 id=&#34;your-first-jekyll-site&#34;&gt;Your first Jekyll site&lt;/h4&gt;&#xA;&lt;p&gt;After installing Jekyll, all guides suggest creating a new site with&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ jekyll new my-new-blog&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;which creates a new &lt;code&gt;my-new-blog&lt;/code&gt; folder in the current directory. Moving into the new folder and starting Jekyll’s built-in web server,&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ cd my-new-blog&#xA;$ bundle exec jekyll serve --host=0.0.0.0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;will allow you to view the new site at &lt;code&gt;http://localhost:4000&lt;/code&gt; if using a real machine. With a virtual/cloud machine, you should point the browser to the public URL provided by the server, always using port 4000.&lt;/p&gt;&#xA;&lt;img src=&#34;https://static.233.196.69.159.clients.your-server.de/img/2025-02-11-da-melabit-a-melabit-jekyll-installazione-e-configurazione-di-base/jekyll-new-site.png&#34; alt=&#34;&#34;&gt;&lt;p&gt;This procedure is useful for verifying that everything works, and &lt;a href=&#34;https://github.com/jekyll/minima&#34;&gt;Minima&lt;/a&gt;, the default theme, is very clean and elegant. If Minima is enough for you, you can stop here, simply add a site title and content, and you’re ready to go.&lt;/p&gt;&#xA;&lt;p&gt;However, this process gives only a vague idea of what Jekyll can &lt;em&gt;really&lt;/em&gt; do since its features are tightly integrated with its themes.&lt;/p&gt;&#xA;&lt;h4 id=&#34;jekyll-and-its-themes&#34;&gt;Jekyll and its themes&lt;/h4&gt;&#xA;&lt;p&gt;Minima is an example of a &lt;em&gt;gem-based&lt;/em&gt; theme, installed outside the site’s folder and theoretically easily replaceable with another &lt;em&gt;gem&lt;/em&gt; theme, like the one shown below.&lt;/p&gt;&#xA;&lt;img src=&#34;https://static.233.196.69.159.clients.your-server.de/img/2025-02-11-da-melabit-a-melabit-jekyll-installazione-e-configurazione-di-base/jekyll-new-site-gem.png&#34; alt=&#34;&#34;&gt;&lt;p&gt;However, such themes are rare, generally minimalistic, and harder to modify or extend. Worse yet, they are often designed for outdated Jekyll versions and may not work with the latest ones.&lt;sup id=&#34;fnref:5&#34;&gt;&lt;a href=&#34;#fn:5&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;&#xA;&lt;p&gt;Most &lt;a href=&#34;http://jekyllthemes.org/&#34;&gt;Jekyll themes&lt;/a&gt; instead come in a format that combines content and design within a single folder. This is very convenient when you find the &lt;em&gt;right&lt;/em&gt; theme but makes changing themes later much more complicated.&lt;/p&gt;&#xA;&lt;p&gt;Installing most Jekyll themes essentially means installing an entire pre-built site, then replacing the default posts and images with your own. Therefore, it is best to &lt;em&gt;first&lt;/em&gt; choose a theme that suits your needs and &lt;em&gt;then&lt;/em&gt; start customizing it.&lt;/p&gt;&#xA;&lt;p&gt;But this will be the topic of the&lt;a href=&#34;https://melabit.com/en/2025/03/01/from-melabit-to-melabit-developing-a-web-site-in-jekyll/&#34;&gt; next post&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h4 id=&#34;if-you-no-longer-like-jekyll&#34;&gt;If you no longer like Jekyll&lt;/h4&gt;&#xA;&lt;p&gt;Then you need to uninstall everything. The &lt;a href=&#34;https://emaxime.com/2018/how-to-uninstall-all-ruby-gems&#34;&gt;modern way to do this&lt;/a&gt; is with&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ gem uninstall --all --ignore-dependencies --executables --verbose&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;or, for those who love compact commands&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;$ gem uninstall -aIxV&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you followed the initial advice of installing everything in the user account, no admin privileges are needed. Otherwise, you’ll have to prepend &lt;code&gt;sudo&lt;/code&gt; as a penalty for your mistake.&lt;/p&gt;&#xA;&lt;p&gt;After uninstalling all gems, you could also remove &lt;code&gt;ruby&lt;/code&gt; and related packages using Homebrew on macOS or the package manager for your Linux distribution. But with today’s large disks, is it really worth the effort just to save a few MB?&lt;/p&gt;&#xA;&lt;h4 id=&#34;until-next-time&#34;&gt;Until next time&lt;/h4&gt;&#xA;&lt;p&gt;This post is already too long, so let’s end it here. The &lt;a href=&#34;https://melabit.com/en/2025/03/01/from-melabit-to-melabit-developing-a-web-site-in-jekyll/&#34;&gt;next post&lt;/a&gt; will dive into the actual development of a Jekyll site. See you soon!&lt;/p&gt;&#xA;&lt;div class=&#34;footnotes&#34; role=&#34;doc-endnotes&#34;&gt;&#xA;&lt;hr&gt;&#xA;&lt;ol&gt;&#xA;&lt;li id=&#34;fn:1&#34;&gt;&#xA;&lt;p&gt;With Jekyll’s extensive documentation, the real challenge is distinguishing useful guides from time-wasters.&amp;#160;&lt;a href=&#34;#fnref:1&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:2&#34;&gt;&#xA;&lt;p&gt;From now on, I won’t mention Windows, as the necessary instructions are identical to those for Linux.&amp;#160;&lt;a href=&#34;#fnref:2&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:3&#34;&gt;&#xA;&lt;p&gt;A &lt;em&gt;gem&lt;/em&gt; is a program or a library written in &lt;code&gt;Ruby&lt;/code&gt; that contains everything needed to run it or to develop new programs that utilize its functions. Gems are installed using the standard package manager, RubyGems, whose &lt;code&gt;gem&lt;/code&gt; command allows performing all installation, update, and uninstallation processes for various gems.&amp;#160;&lt;a href=&#34;#fnref:3&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:4&#34;&gt;&#xA;&lt;p&gt;Of course, this is irrelevant for &lt;code&gt;vim&lt;/code&gt; or &lt;code&gt;emacs&lt;/code&gt; masters.&amp;#160;&lt;a href=&#34;#fnref:4&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li id=&#34;fn:5&#34;&gt;&#xA;&lt;p&gt;When I say &amp;ldquo;often,&amp;rdquo; I am not exaggerating at all.&amp;#160;&lt;a href=&#34;#fnref:5&#34; class=&#34;footnote-backref&#34; role=&#34;doc-backlink&#34;&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/div&gt;&#xA;</description>
    </item>
  </channel>
</rss>
