When I updated tt-rss, also known as TinyTinyRSS, to the latest version with git pull, it stopped starting up with the error below
PHP UConverter class is missing, it’s provided by the Internationalization (intl) module.
The environment it was running in at that point:
nginx : 1.16.1 PHP(php-fpm) : 7.3 mysql : 5.5.62 Since it is an error related to Internationalization (intl), I checked the package involved, but it was already installed (php73-php-intl)
[Read More]
Why I Switched from WordPress to Hugo, and What It Cost Me
The reasons for leaving WordPress for a static site generator
Why I switched from WordPress to Hugo I had been using WordPress for more than 10 years to write articles, but lately I update it less often, and even so I have to update WordPress itself and its plugins frequently, which is also a nuisance from a security point of view. On top of that, the articles on this site do not really need to be a blog; they are closer to static pages.
[Read More]
Patching Beautifulhugo to Work with Hugo 0.57
Fixing the theme to keep up with the spec changes in the Hugo upgrade
With the Hugo version upgrade it looks like some variable formats will stop working from now on, so I made the theme handle them.
In Beautifulhugo they are not handled in versions from before May, so this may end up being only a temporary fix.
Environment Hugo 0.57
Beautifulhugo :handled from 2019-05-08 onwards (the information below is from before 2019−05-08)
Edited files layouts/_default/list.html layouts/index.html layouts/partials/footer.html layouts/partials/head.html Changes Before After {{ .Hugo.Generator }} {{ hugo.Generator }} {{ .RSSLink }} {{ with .OutputFormats.Get “RSS” }}{{ . RelPermalink }}{{ end }} {{ .Hugo.Version }} {{ .Site.Hugo.Version }} {{ .URL }} {{ .Permalink }}, {{ .RelPermalink }} .Data.Pages .Site.RegularPages Edited sections layouts/_default/list.html Copy @@ -47,12 +47,12 @@ <ul class="pager main-pager"> {{ if .Paginator.HasPrev }} <li class="previous"> - <a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}/">← {{ i18n "newerPosts" }}</a> + <a href="{{ .Permalink }}page/{{ .Paginator.Prev.PageNumber }}/">← {{ i18n "newerPosts" }}</a> </li> {{ end }} {{ if .Paginator.HasNext }} <li class="next"> - <a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} →</a> + <a href="{{ .Permalink }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} →</a> </li> {{ end }} </ul> layouts/index.html Copy @@ -9,7 +9,7 @@ {{ end }} <div class="posts-list"> - {{ $pag := .Paginate (where .Data.Pages "Type" "post") }} + {{ $pag := .Paginate (where .Site.RegularPages "Type" "post") }} {{ range $pag.Pages }} <article class="post-preview"> <a href="{{ .Permalink }}"> @@ -49,12 +49,12 @@ <ul class="pager main-pager"> {{ if .Paginator.HasPrev }} <li class="previous"> - <a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}/">← {{ i18n "newerPosts" }}</a> + <a href="{{ .Permalink }}page/{{ .Paginator.Prev.PageNumber }}/">← {{ i18n "newerPosts" }}</a> </li> {{ end }} {{ if .Paginator.HasNext }} <li class="next"> - <a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} →</a> + <a href="{{ .Permalink }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} →</a> </li> {{ end }} </ul> layouts/partials/footer.html Copy @@ -17,10 +17,8 @@ {{ end }} {{ if .Site.Params.rss }} <li> - {{ if .RSSLink }} - <a href="{{ .RSSLink }}" title="RSS"> - {{ else }} - <a href="{{ .Site.RSSLink }}" title="RSS"> + {{ with .OutputFormats.Get "RSS" }} + <a href='{{ .RelPermalink }}' title='RSS'> {{ end }} layouts/partials/head.html Copy @@ -61,7 +61,7 @@ <meta property="og:type" content="website" /> <meta property="og:site_name" content="{{ .Site.Title }}" /> <!-- Hugo Version number --> - {{ .Hugo.Generator -}} + {{ hugo.Generator -}} References:
[Read More]
How to Delete a File Whose Name Starts with -- (Hyphens)
How to remove things like --filename
While I was working with Hugo, either because I got an argument wrong or because I built in View mode, a directory named “–bind=192.168.1.1” ended up being created
What does not work When you try to delete a file or directory that starts with – (hyphens) like this, commands such as the ones below cannot remove it
Copy $ rm --bind=192.168.1.1 # naturally this is mistaken for an argument, so ☓ $ rm ”--bind=192.168.1.1” ☓ $ rm '--bind=192.168.1.1' ☓ The correct way to delete it You insert “–” (two hyphens) into the command arguments and then specify the file or directory
[Read More]
Installing Ripgrep on Mac, CentOS and Debian
Installing ripgrep
Notes from installing Ripgrep(rg), which searches faster than grep, ack and silver_searcher, on several platforms
Mac Install it straight from homebrew (if homebrew is already installed)
Copy $ brew install ripgrep CentOS 7 On CentOS, ripgrep is not in the standard repositories or in epel, so install it as follows
Copy $ sudo yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo $ sudo yum install ripgrep Debian 10 Copy # apt install ripgrep If your version of Debian9 or Ubuntu is old and the package is not in apt, use the following
[Read More]
Upgrading Debian 9 Stretch to Debian 10 Buster
Major and minor upgrade steps from Debian 9 to Debian 10
Debian Upgrade A major upgrade from Debian 9.x to 10.x
Upgrade procedure Checking the version Copy $ cat /etc/debian_version 9.1 Updating Copy # apt-get update # apt-get upgrade # apt-get dist-upgrade Rewriting sources.list Copy # sed -i 's/stretch/buster/g' /etc/apt/sources.list Running the upgrade Copy # apt-get update # apt-get upgrade If any NFS-related daemons are running, stop them
Copy # systemctl stop rpcbind The final upgrade
[Read More]
Show Invisible Characters in Vim
Show whitespace and tabs while editing in Vim
Once you get used to Python layout and Markdown, there are times you want Vim to visualize blank lines and tabs.
Show them temporarily in Vim
: set list
: set listchars=tab:»-,trail:-,eol:↲,extends:»,precedes:«,nbsp:%,space:_Show them permanently
Add the following to ~/.vimrc
set list
set listchars=tab:»-,trail:-,eol:↲,extends:»,precedes:«,nbsp:%,space:_Turn the display back off
Inside Vim,
:set nolistReference
[Changing listchars colors for tabs, spaces, newlines, and so on in Vim (in Japanese)] (https://qiita.com/pollenjp/items/459a08a2cc59485fa08b )
| Item | Description |
|---|---|
| set list | Show invisible characters |
| set listchars | Configure which characters to use |
| tab | Show tab characters |
| trail | Show trailing spaces |
| eol | Show newlines |
| space | Show spaces |
Things to Decide First When You Start a Hugo Site
Items worth deciding before you build a site with Hugo
A note to myself on the items I want to decide first in Hugo Choosing a theme The way front matter and shortcodes are written differs from theme to theme, and layout and CSS matter too, so I want to take my time at the start and settle on a theme that is easy to customize
Hugo Themes: Complete List Since a Hugo version upgrade can turn some syntax invalid, it may be better to pick a theme that is updated frequently
My personal recommendations would be Academic, Tranquilpeak, Learn and Beautifulhugo
[Read More]
How to Make Hugo Output .html URLs with uglyURLs
How do you make the site output .html?
The output format of a site differs from theme to theme, but when you write an article called content, the output format is normally something like the following.
Copy https://your-site/post/content/ https://your-site/content/ When you want to make this your-site/content.html, that is, end it in .html
Add the following inside config.toml
Copy uglyURLs = true Note: If “url:xxxx” is written in the front matter of an article, it takes precedence, so uglyURLS has no effect and you do not get the html format. If it is written, only that article gets output as something like your-site/xxxx/
[Read More]
How to Write Tables in Markdown
Basic table creation with Markdown
Table notation in Markdown Basically all you do is separate things with |
Basic form Copy |Header 1|Header 2|Header 3| |-------|-------|-------| |Item 1|Item 2|Item 3| Header 1 Header 2 Header 3 Item 1 Item 2 Item 3 The first row is the header The header always seems to end up bold The second row is the separator that sets the attributes Any number of - seems to be fine, but four or more is probably better From the third row onwards, you just keep adding as many items and contents as you like Alignment When you want the headers and items left aligned, right aligned or centred
[Read More]
Posts