<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Webdev on</title><link>http://salopst.yearl.us/categories/webdev/</link><description>Recent content in Webdev on</description><generator>Hugo</generator><language>en</language><copyright>&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener"&gt;CC BY-NC 4.0&lt;/a&gt;</copyright><lastBuildDate>Tue, 21 Sep 2021 02:22:00 +0100</lastBuildDate><atom:link href="http://salopst.yearl.us/categories/webdev/index.xml" rel="self" type="application/rss+xml"/><item><title>Scratch notes on Hugo (and this implementation)</title><link>http://salopst.yearl.us/scratch-notes-on-hugo/</link><pubDate>Mon, 18 May 2020 14:33:57 +0100</pubDate><guid>http://salopst.yearl.us/scratch-notes-on-hugo/</guid><description>&lt;img src="http://salopst.yearl.us/img/uploads/leaping-baby-brown-trout.jpg" alt="Brown trout are the best trout" class="center" style="border-radius: 50px;" /&gt;&#10;&#10;&#10;&lt;h3 id="-this-image-above-is-not-in-the-general-template-for-a-post-file-it-is-added-with"&gt;^^^ This image above is not in the general template for a post file. It is added with:&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;{{&amp;lt; image src=&amp;#34;/img/uploads/leaping-baby-brown-trout.jpg&amp;#34; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; alt=&amp;#34;Hello Friendo&amp;#34;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; position=&amp;#34;center&amp;#34; &#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; style=&amp;#34;border-radius: 50px;&amp;#34; &amp;gt;}}&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;strong&gt;Escaping&lt;/strong&gt; the shortcode such that it would not be executed was non-obvious. It is done with &lt;code&gt;/*&lt;/code&gt; and &lt;code&gt;*/&lt;/code&gt; &lt;em&gt;immediately inside&lt;/em&gt; the shortcode&amp;rsquo;s &lt;code&gt;{{&lt;/code&gt; and &lt;code&gt;}}&lt;/code&gt;&amp;hellip; hpwever you slice it, that can haardly be considered concise.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Hugo&amp;rsquo;s default markdown flavour was blackfriday: &lt;a href="https://github.com/russross/blackfriday"&gt;https://github.com/russross/blackfriday&lt;/a&gt; until Hugo version v0.60.0 adopted goldmark: &lt;a href="https://libs.garden/go/yuin/goldmark"&gt;https://libs.garden/go/yuin/goldmark&lt;/a&gt;. So, to deal with raw inline HTML in your Markdown files we need to enable the unsafe mode in &lt;code&gt;config.toml&lt;/code&gt;.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>About this site</title><link>http://salopst.yearl.us/about/</link><pubDate>Sat, 09 Apr 2011 00:00:00 +0000</pubDate><guid>http://salopst.yearl.us/about/</guid><description>&lt;p&gt;The current incarnation of whatever dross this is is implemented by &lt;a href="https://gohugo.io"&gt;Hugo&lt;/a&gt;, allegedly the &lt;strong&gt;world’s fastest framework for building websites&lt;/strong&gt;. It is written in Go.&lt;/p&gt;&#10;&lt;p&gt;There are many websites like it, but this one is mine. At one point it was hosted on Tumbler (I think), then Blogger, and more recently Wordpress, but a snafu with the hosting provider&amp;ndash; to whom I had foolishly entrusted my Nextclouds&amp;ndash; led me to think about an alternative. Why, I don&amp;rsquo;t rightly know since there&amp;rsquo;s nothing much here anyway. And what is here is mostly odd and old notes of various things that may not all render consistently given their history.&lt;/p&gt;</description></item><item><title>Eek! CodeColorer Wordpress plugin and PHP 7.1</title><link>http://salopst.yearl.us/eek-codecolorer-wordpress-plugin-and-php-7-1/</link><pubDate>Wed, 01 Mar 2017 14:33:33 +0000</pubDate><guid>http://salopst.yearl.us/eek-codecolorer-wordpress-plugin-and-php-7-1/</guid><description>&lt;p&gt;Having used the most excellent &lt;a href="http://he.net/"&gt;Hurricane Electric&lt;/a&gt; for the longest time I decided to relocate. In so doing I realised that I was moving from a PHP 5.2 to a PHP 7.1 environment. Gulp! Has it been that long. Expecting lots o&amp;rsquo; issues, but amazingly no. Just the tiniest of tiny issues:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PHP Warning: preg_replace&lt;span style="color:#f92672"&gt;()&lt;/span&gt;: The /e modifier is no longer supported, use preg_replace_callback instead in /var/www/wp-content/plugins/codecolorer/codecolorer-core.php on line &lt;span style="color:#ae81ff"&gt;50&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="so-comment-out"&gt;So, comment out:&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;BeforeHighlightCodeBlock&lt;/span&gt;($content) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;preg_replace&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;#(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[/cc\2\](\s*)#sie&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;$this-&amp;gt;PerformHighlightCodeBlock(\&amp;#39;\\4\&amp;#39;, \&amp;#39;\\3\&amp;#39;, $content, \&amp;#39;\\2\&amp;#39;, \&amp;#39;\\1\&amp;#39;, \&amp;#39;\\5\&amp;#39;);&amp;#39;&lt;/span&gt;, $content);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;preg_replace&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;#(\s*)\(.*?)\(\s*)#sie&amp;#39;&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;$this-&amp;gt;PerformHighlightCodeBlock(\&amp;#39;\\3\&amp;#39;, \&amp;#39;\\2\&amp;#39;, $content, \&amp;#39;\&amp;#39;, \&amp;#39;\\1\&amp;#39;, \&amp;#39;\\4\&amp;#39;);&amp;#39;&lt;/span&gt;, $content);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; $content;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="adding"&gt;adding&lt;/h3&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;BeforeHighlightCodeBlock&lt;/span&gt;($content) {&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;preg_replace_callback&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;#(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[/cc\2\](\s*)#si&amp;#39;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt;($matches){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; $this&lt;span style="color:#f92672"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;PerformHighlightCodeBlock&lt;/span&gt;($matches[&lt;span style="color:#ae81ff"&gt;4&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;3&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;5&lt;/span&gt;]);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }, $content);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; $content &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;preg_replace_callback&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#39;#(\s*)\(.*?)\(\s*)#si&amp;#39;&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;function&lt;/span&gt;($matches){&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; $this&lt;span style="color:#f92672"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:#a6e22e"&gt;PerformHighlightCodeBlock&lt;/span&gt;($matches[&lt;span style="color:#ae81ff"&gt;3&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt;], &lt;span style="color:#e6db74"&gt;&amp;#39;&amp;#39;&lt;/span&gt;, $matches[&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;], $matches[&lt;span style="color:#ae81ff"&gt;4&lt;/span&gt;]);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }, $content);&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; $content;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#a6e22e"&gt;php&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item></channel></rss>