<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Asciinema on Clément Joly – Open-Source, Rust &amp; SQLite</title><link>https://cj.rs/tags/asciinema/</link><description>Recent content in Asciinema on Clément Joly – Open-Source, Rust &amp; SQLite</description><image><title>Clément Joly – Open-Source, Rust &amp; SQLite</title><url>https://cj.rs/images/open-graph-pages.jpg</url><link>https://cj.rs/images/open-graph-pages.jpg</link></image><generator>Hugo</generator><language>en</language><copyright>Clément Joly</copyright><lastBuildDate>Thu, 28 May 2026 23:48:29 +0000</lastBuildDate><atom:link href="https://cj.rs/tags/asciinema/index.xml" rel="self" type="application/rss+xml"/><item><title>New Asciinema Hugo Module Versions</title><link>https://cj.rs/blog/new-asciinema-hugo-module-versions/</link><pubDate>Thu, 07 Mar 2024 07:35:45 +0000</pubDate><guid>https://cj.rs/blog/new-asciinema-hugo-module-versions/</guid><description>&lt;p&gt;I’ve just added the last 8 versions of the &lt;a href="https://github.com/asciinema/asciinema-player/"&gt;Asciinema player&lt;/a&gt; to &lt;a href="https://cj.rs/gohugo-asciinema/"&gt;gohugo-asciinema&lt;/a&gt;, my &lt;a href="https://gohugo.io/"&gt;Hugo&lt;/a&gt; module to easily integrate the Asciinema player to your website.
Lots of exciting new features, like improved decoding and rendering efficiency as well as some support for streaming asciicasts.
See the &lt;a href="#changelogs"&gt;changelog links below&lt;/a&gt; for details of the changes.
There were no changes made to the Hugo module itself, besides copying the JS &amp;amp; CSS from the Asciinema player.&lt;/p&gt;</description><content:encoded><![CDATA[<p>I’ve just added the last 8 versions of the <a href="https://github.com/asciinema/asciinema-player/">Asciinema player</a> to <a href="/gohugo-asciinema/">gohugo-asciinema</a>, my <a href="https://gohugo.io/">Hugo</a> module to easily integrate the Asciinema player to your website.
Lots of exciting new features, like improved decoding and rendering efficiency as well as some support for streaming asciicasts.
See the <a href="#changelogs">changelog links below</a> for details of the changes.
There were no changes made to the Hugo module itself, besides copying the JS &amp; CSS from the Asciinema player.</p>
<p>Security note: all the releases are <a href="/open-source/docs/security/">signed</a>.
You can even check that the files JS and CSS file in the plugin match the ones uploaded in release pages.
Thanks to <a href="https://github.com/ku1ik">@ku1ik</a> for providing these files directly!</p>
<h2 id="updating-in-hugo">Updating in Hugo</h2>
<p>As usual to get the latest version the player on your website, you can run:</p>
<pre tabindex="0"><code>hugo mod get -u cj.rs/gohugo-asciinema
</code></pre><h2 id="changelogs">Changelogs</h2>
<p>Here is the changelogs in the upstream Asciinema player for the updated versions:</p>
<ul>
<li><a href="https://github.com/asciinema/asciinema-player/releases/tag/v3.7.0">3.7.0</a></li>
<li><a href="https://github.com/asciinema/asciinema-player/releases/tag/v3.6.4">3.6.4</a></li>
<li><a href="https://github.com/asciinema/asciinema-player/releases/tag/v3.6.3">3.6.3</a></li>
<li><a href="https://github.com/asciinema/asciinema-player/releases/tag/v3.6.2">3.6.2</a></li>
<li><a href="https://github.com/asciinema/asciinema-player/releases/tag/v3.6.1">3.6.1</a></li>
<li><a href="https://github.com/asciinema/asciinema-player/releases/tag/v3.5.0">3.5.0</a></li>
<li><a href="https://github.com/asciinema/asciinema-player/releases/tag/v3.4.0">3.4.0</a></li>
<li><a href="https://github.com/asciinema/asciinema-player/releases/tag/v3.3.0">3.3.0</a></li>
</ul>
<h2 id="delay-updating-the-css-and-js-files">Delay Updating the CSS and JS Files</h2>
<p>I apologize for the delay in updating those versions in my Hugo module.
I do have alerts set up when a new version comes in but I’m still testing manually to make sure that the updated version works well.
This Hugo module being a side-project, I did not get the chance to do the testing any earlier.
I’ve tested all those versions against various pages of my website, and it all worked well.
But please feel free to <a href="https://github.com/cljoly/gohugo-asciinema/issues/new/choose">report</a> any problem you may encounter.</p>
<p>Moving forward, I’ll rely <a href="https://github.com/cljoly/gohugo-asciinema/blob/abb45e1c71409f195ab1d25d20bd548f12291e0c/update.fish">on a script</a> to automate the bulk of the update, that should help updating only a few days after the release.
That script is not perfect and will be improved incrementally.</p>
<p>Since this is a release related to Asciinema, here is an asciicast of that new script downloading the latest CSS and JS, making a commit and tagging it.</p>
<div id="demo3"></div>
<script>
AsciinemaPlayer.create("./update.json", document.getElementById('demo3'), {
"poster": "npt:0:05",
});
</script>
<noscript><blockquote><p>To run this asciicast without javascript, use <code>asciinema play https://cj.rs/update.json</code> with <a href="https://asciinema.org/">Asciinema</a></p></blockquote></noscript>

<p>Please feel free to use this script and open a PR if you spot an update before I do in the future 😁.</p>
]]></content:encoded></item><item><title>GoHugo Asciinema</title><link>https://cj.rs/gohugo-asciinema/</link><pubDate>Sat, 21 Aug 2021 16:25:33 +0100</pubDate><guid>https://cj.rs/gohugo-asciinema/</guid><description>⏯️ Insert the Asciinema Player in your Hugo site with ease.</description><content:encoded><![CDATA[
<p style="display: flex; justify-content: space-between">
  <a href="https://github.com/cljoly/gohugo-asciinema" data-goatcounter-click="ext-github-gohugo-asciinema" data-goatcounter-title="cljoly/gohugo-asciinema">
    <span class="svgicon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
    stroke-linecap="round" stroke-linejoin="round">
    <path
        d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22">
    </path>
</svg></span>&nbsp;cljoly/gohugo-asciinema
  </a>
  <a class="badges" href="https://github.com/cljoly/gohugo-asciinema" data-goatcounter-click="ext-stargithub-gohugo-asciinema" data-goatcounter-title="stars cljoly/gohugo-asciinema">
    <img src="https://img.shields.io/github/stars/cljoly/gohugo-asciinema?style=social" alt="Github stars for g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nNmb3JtPSJzY2FsZSguMSkiIGZpbGw9IiNmZmYiIHRleHRMZW5ndGg9IjQ5MCI+d2l0aCBSU1M8L3RleHQ+PC9nPjwvc3ZnPg=="></a>
<a href="https://github.com/cljoly/gohugo-asciinema/tags/">
<img alt="Asciinema Player Version" loading="lazy" src="https://img.shields.io/github/v/tag/cljoly/gohugo-asciinema?label=asciinema%20player%20version&logo=asciinema"></a>
<a href="https://cj.rs/riss">

  <img alt="Powered by RISS (cj.rs/riss)" loading="lazy" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDQiIGhlaWdodD0iMjAiIHJvbGU9ImltZyIgYXJpYS1sYWJlbD0icG93ZXJlZCBieTogcmlzcyI+PHRpdGxlPnBvd2VyZWQgYnk6IHJpc3M8L3RpdGxlPjxmaWx0ZXIgaWQ9ImJsdXIiPjxmZUdhdXNzaWFuQmx1ciBpbj0iU291cmNlR3JhcGhpYyIgc3RkRGV2aWF0aW9uPSIxNiIvPjwvZmlsdGVyPjxsaW5lYXJHcmFkaWVudCBpZD0icyIgeDI9IjAiIHkyPSIxMDAlIj48c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNiYmIiIHN0b3Atb3BhY2l0eT0iLjEiLz48c3RvcCBvZmZzZXQ9IjEiIHN0b3Atb3BhY2l0eT0iLjEiLz48L2xpbmVhckdyYWRpZW50PjxjbGlwUGF0aCBpZD0iciI+PHJlY3Qgd2lkdGg9IjEwNCIgaGVpZ2h0PSIyMCIgcng9IjMiIGZpbGw9IiNmZmYiLz48L2NsaXBQYXRoPjxnIGNsaXAtcGF0aD0idXJsKCNyKSI+PHJlY3Qgd2lkdGg9Ijc1IiBoZWlnaHQ9IjIwIiBmaWxsPSIjNTU1Ii8+PHJlY3QgeD0iNzUiIHdpZHRoPSIyOSIgaGVpZ2h0PSIyMCIgZmlsbD0iIzkzOTM5MyIvPjxyZWN0IHdpZHRoP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ic2NhbGUoLjEpIiB0ZXh0TGVuZ3RoPSIxOTAiPnJpc3M8L3RleHQ+PHRleHQgeD0iODg1IiB5PSIxNDAiIHRyYW5zZm9ybT0ic2NhbGUoLjEpIiBmaWxsPSIjZmZmIiB0ZXh0TGVuZ3RoPSIxOTAiPnJpc3M8L3RleHQ+PC9nPjwvc3ZnPg=="></a></p>

</div>

<p>Want to insert a short demo of your tool or of a command execution on your website?
You could insert a video, but then visitors can’t copy text, and it’ll make your page quite heavy.
The <a href="https://github.com/asciinema/asciinema-player">Asciinema player</a> solves all of that, by replaying a terminal session stored in a text file.</p>
<p>This Hugo module makes it very easy to use the Asciinema Player on your Hugo-powered static website.</p>
<h2 id="install">Install</h2>
<h3 id="hugo-module">Hugo Module</h3>
<ol>
<li>
<p>Make sure the <a href="https://go.dev">go compiler</a> is installed as well as <a href="https://gohugo.io">Hugo</a>.
To check that, run the commands below. If the programs are installed, they should not return an error. Otherwise, see the <a href="https://go.dev/doc/install">go install instructions</a> and <a href="https://gohugo.io/getting-started/quick-start/">Hugo install instructions</a>:</p>
<pre tabindex="0"><code>go version
</code></pre><pre tabindex="0"><code>hugo version
</code></pre></li>
<li>
<p>If you haven’t already, you need to initialize Hugo modules:</p>
<pre tabindex="0"><code>hugo mod init example.com/my-awesome-website
</code></pre><p>This needs to be done once per Hugo site.
Read the <a href="https://gohugo.io/hugo-modules/use-modules/">Hugo documentation</a> for details and background.</p>
</li>
</ol>
<h3 id="install-this-module">Install This Module</h3>
<p>Once Hugo modules are set up (see the <a href="#hugo-module">previous section</a>), you can install the asciinema module itself.</p>
<ol>
<li>
<p>Run:</p>
<pre tabindex="0"><code>hugo mod get -u -v cj.rs/gohugo-asciinema
</code></pre></li>
<li>
<p>Edit your Hugo config to add the module reference.</p>
<p>For instance, if you use a <code>config.toml</code> config file, add:</p>
<div class="highlight"><pre tabindex="0" style="color:#abb2bf;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-toml" data-lang="toml"><span style="display:flex;"><span>[<span style="color:#e06c75">module</span>]
</span></span><span style="display:flex;"><span>[[<span style="color:#e06c75">module</span>.<span style="color:#e06c75">imports</span>]]
</span></span><span style="display:flex;"><span><span style="color:#e06c75">path</span> = <span style="color:#98c379">&#34;cj.rs/gohugo-asciinema&#34;</span>
</span></span></code></pre></div><p>For <code>config.yml</code>, add:</p>
<div class="highlight"><pre tabindex="0" style="color:#abb2bf;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#e06c75">module</span>:
</span></span><span style="display:flex;"><span><span style="color:#e06c75">imports</span>:
</span></span><span style="display:flex;"><span>    - <span style="color:#e06c75">path</span>: cj.rs/gohugo-asciinema
</span></span></code></pre></div></li>
</ol>
<h2 id="use">Use</h2>
<p>Use this <a href="https://gohugo.io/content-management/shortcodes/">shortcode</a>:</p>
<div class="highlight"><pre tabindex="0" style="color:#abb2bf;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-md" data-lang="md"><span style="display:flex;"><span>{{&lt; asciicast src=&#34;https://cj.rs/blog/cargo-info-in-neovim/demo.json&#34; poster=&#34;npt:0:04&#34; autoPlay=true loop=true &gt;}}
</span></span></code></pre></div><p>It&rsquo;s rendered like this:
<div id="demo3"></div>
<script>
AsciinemaPlayer.create("/blog/cargo-info-in-neovim/demo.json", document.getElementById('demo3'), {
"autoPlay":  true ,"loop":  true ,"poster": "npt:0:04",
});
</script>
<noscript><blockquote><p>To run this asciicast without javascript, use <code>asciinema play https://cj.rs/blog/cargo-info-in-neovim/demo.json</code> with <a href="https://asciinema.org/">Asciinema</a></p></blockquote></noscript>
</p>
<h3 id="defaults">Defaults</h3>
<p>You can set default values for the player in your <code>config.toml</code> or <code>params.toml</code> etc.. For example:</p>
<h4 id="configtoml"><code>config.toml</code></h4>
<div class="highlight"><pre tabindex="0" style="color:#abb2bf;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-toml" data-lang="toml"><span style="display:flex;"><span>[<span style="color:#e06c75">params</span>.<span style="color:#e06c75">asciinema</span>.<span style="color:#e06c75">defaults</span>]
</span></span><span style="display:flex;"><span><span style="color:#e06c75">theme</span> = <span style="color:#98c379">&#34;solarized-dark&#34;</span>
</span></span><span style="display:flex;"><span><span style="color:#e06c75">loop</span> = <span style="color:#e5c07b">true</span>
</span></span><span style="display:flex;"><span><span style="color:#e06c75">autoPlay</span> = <span style="color:#e5c07b">true</span>
</span></span><span style="display:flex;"><span><span style="color:#e06c75">speed</span> = <span style="color:#d19a66">5.0</span>
</span></span></code></pre></div><h4 id="paramstoml"><code>params.toml</code></h4>
<div class="highlight"><pre tabindex="0" style="color:#abb2bf;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-toml" data-lang="toml"><span style="display:flex;"><span>[<span style="color:#e06c75">asciinema</span>.<span style="color:#e06c75">defaults</span>]
</span></span><span style="display:flex;"><span><span style="color:#e06c75">theme</span> = <span style="color:#98c379">&#34;solarized-dark&#34;</span>
</span></span><span style="display:flex;"><span><span style="color:#e06c75">loop</span> = <span style="color:#e5c07b">true</span>
</span></span><span style="display:flex;"><span><span style="color:#e06c75">autoPlay</span> = <span style="color:#e5c07b">true</span>
</span></span><span style="display:flex;"><span><span style="color:#e06c75">speed</span> = <span style="color:#d19a66">5.0</span>
</span></span></code></pre></div><h3 id="notes">Notes</h3>




  
  
  
  

  <div class="alert alert-note">
    <p class="alert-heading">
      ℹ️
      
        Note
      
    </p>
    <p><code>src</code> is the only required argument. All the other arguments are parameters in the object passed as the third argument of <a href="https://docs.asciinema.org/manual/player/quick-start/#basic-usage"><code>AsciinemaPlayer.create</code></a>.</p>
  </div>







  
  
  
  

  <div class="alert alert-warning">
    <p class="alert-heading">
      ⚠️
      
        Warning
      
    </p>
    <p><code>src</code> is known to sometimes cause problem with relative URLs. Your best bet is to use absolute URLs or at least from the root of the site, as in the above example.</p>
  </div>







  
  
  
  

  <div class="alert alert-important">
    <p class="alert-heading">
      🟣
      
        Important
      
    </p>
    <p>Numbers and booleans should be passed <strong>without</strong> being enclosed in <code>&quot;</code>, i.e. <code>autoPlay=true</code>, <em>not</em> <code>autoPlay=&quot;true&quot;</code>.</p>
  </div>



<h3 id="advanced-features">Advanced Features</h3>
<h4 id="preloading">Preloading</h4>
<p>If you want to instruct the browser to <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload">preload</a> the CSS and JS of the Asciinema Player, only when the page contains an asciicast, you can add the following line in the <code>&lt;head&gt;</code> tag of your template:</p>
<pre tabindex="0"><code>{{- partial &#34;asciinema_css_js_smart_preload&#34; . -}}
</code></pre><p>Themes often offer ways to do this easily.
For instance with <a href="https://github.com/adityatelange/hugo-PaperMod/">Hugo PaperMod</a>, it’s in <a href="https://github.com/adityatelange/hugo-PaperMod/blob/b5f7118d826e663bfe76f56eba2baa028a384325/layouts/partials/extend_head.html">this file</a>.</p>
<p>This partial will also cause <a href="https://developers.cloudflare.com/pages/configuration/early-hints/">some services</a> to send <a href="https://developers.cloudflare.com/pages/platform/early-hints/">Early Hints</a>.
That can further improve the page load time.</p>
<h2 id="features">Features</h2>
<ul>
<li>Displays a message when JavaScript is disabled in the user browser</li>
<li>Fingerprinted assets, to improve caching and ultimately your site performance</li>
<li>Optional <a href="#preloading">preloading</a> of JS and CSS assets</li>
<li>Easy update with <code>hugo mod get -u cj.rs/gohugo-asciinema</code></li>
</ul>
<h2 id="how-are-the-sources-of-the-player-generated">How Are the Sources of the Player Generated?</h2>
<p>The Asciinema Player version is fetched from the official repository in the corresponding version.
Then, if prebuilt JS/CSS files are provided they are used, so that you can verify that this module is actually distributing the original code.
If not, these files are generated following the instructions from Asciinema Player Readme.</p>
<h2 id="contribute">Contribute</h2>
<p>Contributions (documentation or code improvements in particular) are welcome, see <a href="https://cj.rs/docs/contribute/">contributing</a>!</p>
<p>To test your code changes locally, you can change your configuration so that your local version is loaded.
Here is an example in TOML:</p>
<div class="highlight"><pre tabindex="0" style="color:#abb2bf;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-toml" data-lang="toml"><span style="display:flex;"><span>[<span style="color:#e06c75">module</span>]
</span></span><span style="display:flex;"><span><span style="color:#e06c75">replacements</span> = <span style="color:#98c379">&#34;cj.rs/gohugo-asciinema -&gt; /some/path/gohugo-asciinema&#34;</span>
</span></span><span style="display:flex;"><span>[[<span style="color:#e06c75">module</span>.<span style="color:#e06c75">imports</span>]]
</span></span><span style="display:flex;"><span><span style="color:#e06c75">path</span> = <span style="color:#98c379">&#34;cj.rs/gohugo-asciinema&#34;</span>
</span></span></code></pre></div><p>Please consider sending a PR with your patches, it’s always appreciated and will save you the trouble of maintaining the changes on your own!</p>
<h3 id="license">License</h3>
<p>The code of this module (everything but the folder <code>assets</code>) is under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>, like the asciinema player itself.</p>
<p>The <code>assets</code> folder contains the asciinema player. This code is Copyright Marcin Kulik, licensed under the <a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>. See the <a href="https://github.com/asciinema/asciinema-player">upstream repository</a> for the full sources.</p>
]]></content:encoded></item></channel></rss>