refactor: use page.subtitle instead of page.excerpt

* Source file (.md) looks a bit clearer this way.
* Remove unused options in openGraph.js
This commit is contained in:
curben 2019-06-08 17:31:39 +09:30
parent 68cb50a0ab
commit fb36bca7f1
31 changed files with 52 additions and 135 deletions

View File

@ -1,5 +1,6 @@
---
title: Firefox, Cross-Origin and AliExpress
subtitle: AliExpress login doesn't show up on Firefox when there is a strict cross-origin policy.
date: 2019-02-28
lastUpdated: 2019-04-29
tags:
@ -8,8 +9,6 @@ tags:
AliExpress login doesn't show up on Firefox when there is a strict cross-origin policy (i.e. `network.http.referer.XOriginPolicy`). Here's how to whitelist it.
<!-- more -->
## Background
> Click [**here**](#My-Orders) to go straight to the workarounds.

View File

@ -1,5 +1,6 @@
---
title: Default binaries in Alpine docker image
subtitle: Here is the list of binaries shipped with the Docker image of Alpine Linux.
date: 2018-10-10
tags:
- Linux
@ -8,8 +9,6 @@ tags:
Here is the list of binaries shipped with the Docker image of Alpine Linux `alpine:3.8`
<!-- more -->
[Pastebin](https://bin.disroot.org/?f85ebb52e17968ea#uvKnHjd1monx3ENkEL+jN1zKfWBYGI0jfaLbhvb7zoQ=)
- acpid

View File

@ -1,14 +1,11 @@
---
title: How to disable Control+Alt+S shortcut in MATE
subtitle: The shortcut conflicts with Notepad++, here's how to disable it.
date: 2018-10-24
tags:
- Linux
---
The default Control+Alt+S shortcut conflicts with Notepad++ 'Save As' shortcut, here's how to disable it.
<!-- more -->
Control+Alt+S shortcut is used for toggling shaded state in MATE desktop environment. Once toggled, a window's content is hidden except for the title bar. It's useful for peeking at the content behind a window. I personally never use it as I usually just Alt+Tab or place two windows side by side. I prefer to disable it so I can use the 'Save As' shortcut in Notepad++.
There are two methods of disabling the shortcut. Use the [second](#Method-2) method if Compiz is enabled with CCSM (CompizConfig Settings Manager).

View File

@ -1,5 +1,6 @@
---
title: DNS-over-TLS/DNS-over-HTTPS does not protect your privacy
subtitle: DoT/DoH does not completely eliminate ISP surveillance.
date: 2019-04-04
tags:
- Privacy
@ -7,10 +8,6 @@ tags:
- DoH
---
DoT/DoH does not completely eliminate ISP surveillance.
<!-- more -->
Recently I stumbled upon this [bug report](https://lists.zx2c4.com/pipermail/wireguard/2019-February/003902.html), and as a side note, the reporter wants to use DNS-over-TLS (DoT) for privacy reasons; to prevent the ISP from knowing visited website. It turns out many also believe this after a brief search for news articles on DoT or DNS-over-HTTPS (DoH). Actually, DoT/DoH does not completely eliminate ISP surveillance.
ISP still knows what **IP address** you are connecting to. Even with HTTPS and DoT/DoH, ISP currently can sniff the website domain you are visiting/visited including the complete URL due to a security weakness in the [Server Name Indication](https://en.wikipedia.org/wiki/Server_Name_Indication). This weakness can be fixed by using [Encrypted SNI](https://blog.cloudflare.com/esni/) (ESNI).

View File

@ -1,5 +1,6 @@
---
title: Edit multiple questions on LimeSurvey
subtitle: List Questions view allows you to edit multiple questions at the same time.
date: 2018-10-18
lastUpdated: 2018-10-26
tags:
@ -7,10 +8,6 @@ tags:
- LimeSurvey
---
**List Questions** view allows you to edit multiple questions at the same time.
<!-- more -->
On LimeSurvey, making minor edits to multiple questions can be quite a chore. `List Questions` view allows you to edit multiple questions at the same time.
**List Questions** view allows you to delete, set 'mandatory', 'other', CSS class, and randomise multiple questions at the same time.

View File

@ -1,15 +1,12 @@
---
title: Embed SVG without using img tag
subtitle: Using img tag prevents the use of CSS to change property of SVG. There is a workaround.
date: 2019-06-01
tags:
- SVG
- Web
---
Using `<img>` tag prevents the use of CSS to change property of SVG. Use `<use>` instead.
<!-- more -->
Website usually embed SVG using `<img>` tag or directly use the `<svg>` tag. Using `<img>` tag prevents the use of CSS to change property of SVG. As for inline `<svg>`, I prefer to have a separate file that is easier to keep track.
## Embed SVG file

View File

@ -1,15 +1,12 @@
---
title: Access Facebook/Instagram/Whatsapp/Google in China
subtitle: Data roaming, commercial VPN provider to rolling your own VPN.
date: 2018-12-31
lastUpdated: 2019-01-13
tags:
- Security
---
Data roaming, commercial VPN provider to rolling your own VPN.
<!-- more -->
Facebook/Instagram/Whatsapp/Google are blocked in China. You can either use data roaming or VPN to access them. Roll your own VPN if you don't trust commercial VPN provider.
## Data Roaming

View File

@ -1,5 +1,6 @@
---
title: Cloudflare in Firefox is not the end of the world
subtitle: It's not enabled by default and you can easily switch to other providers.
date: 2019-05-25
tags:
- Firefox
@ -8,10 +9,6 @@ tags:
- DoH
---
It's not enabled by default and you can easily switch to other providers.
<!-- more -->
Many criticise Firefox for using Cloudflare by default in DNS-over-HTTPS. In reality, it's **not enabled** by default and you can **easily switch** to other providers.
{% cloudinary '20190525/firefox-doh.png' "'DNS over HTTPS' setting in Firefox" %}

View File

@ -1,15 +1,12 @@
---
title: How to run more than one Firefox instance
subtitle: Using Firefox profiles, you can use more than two instances.
date: 2019-04-07
tags:
- Firefox
- Privacy
---
Using Firefox profiles, you can use more than two instances.
<!-- more -->
Running more than one Firefox instance allows you to use multiple cookies for a website. By default, you are limited to two separate cookies through *regular* and *private* windows. Using Firefox's **profiles**, you can use more than two.
For example, you are looking for item A and B at a shopping website using the private window but you prefer to keep the browsing separate as not to let the website knows that you are browsing both of them. Or you want to login to more than two accounts of a website.

View File

@ -1,5 +1,6 @@
---
title: GNU vs BusyBox Unix tools
subtitle: Alpine uses BusyBox while Ubuntu uses GNU tools, and they behave differently.
date: 2018-10-13
lastUpdated: 2018-10-31
tags:
@ -7,10 +8,6 @@ tags:
- Alpine
---
Alpine uses BusyBox while Ubuntu uses GNU tools, and they behave differently.
<!-- more -->
## Intro
> Skip to the [list](#List).

View File

@ -1,14 +1,11 @@
---
title: How to create a Hexo blog on GitHub Pages
subtitle: Host your Hexo blog for free on GitHub Pages.
date: 2018-11-10
tags:
- Hexo
---
Host your Hexo blog for free on GitHub Pages.
<!-- more -->
In {% post_link how-to-create-a-hexo-blog 'previous post' %}, I showed you how to create a blog using [Hexo](https://hexo.io) and host it on [GitLab Pages](https://about.gitlab.com/features/pages/). Here's how to host it on [GitHub Pages](https://pages.github.com/):
## GitHub repository

View File

@ -1,14 +1,11 @@
---
title: Hide folders of Caja side pane
subtitle: How to hide them.
date: 2018-10-02
tags:
- Linux
---
How to hide them.
<!-- more -->
Caja is a file manager originally forked from Nautilus. It's used in MATE desktop environment, found in Ubuntu MATE or Linux Mint. Since it shares similar base with Nautilus, following guide also applies to Nautilus too (I haven't tested it though).
The side pane of Caja shows many media folders by default. You might not have all the media types or not important enough to bookmark it.

View File

@ -1,5 +1,6 @@
---
title: How to create a Hexo blog on GitLab Pages
subtitle: Create a website/blog using Hexo on GitLab Pages for free using this detailed guide.
date: 2018-09-21
lastUpdated: 2018-11-10
tags:
@ -7,10 +8,6 @@ tags:
- GitLab
---
Create a website/blog using Hexo on GitLab Pages for free using this detailed guide.
<!-- more -->
Create a website/blog using Hexo on [GitLab Pages](https://about.gitlab.com/features/pages/) for free using the following guide. Refer to my {% post_link hexo-blog-github 'another guide' %} for [GitHub Pages](https://pages.github.com/).
## GitLab project

View File

@ -1,15 +1,12 @@
---
title: How to remove Windows 10 default apps
subtitle: How to get rid of these bloatware.
date: 2018-09-26
lastUpdated: 2019-03-01
tags:
- Microsoft
---
How to get rid of these bloatware.
<!-- more -->
Windows 10 comes bundled with many unused apps. Worse, it even install third-party apps from time to time by *itself* (even after you remove it!). Here's how to get rid of these bloatware.

View File

@ -1,15 +1,12 @@
---
title: Make Hexo blog smaller
subtitle: Static site serves html, css, javascript and images. These files can be compressed to reduce bandwidth and speed up the website.
date: 2018-09-28
lastUpdated: 2018-10-06
tags:
- Hexo
---
Static site serves html, css, javascript and images. These files can be compressed to reduce bandwidth and speed up the website.
<!-- more -->
# Minify
[Minify](https://en.wikipedia.org/wiki/Minification_(programming)) html, css, js and svg to remove characters that are not required for the code to function. This process involves removing white space/tab, line break and comments. I read somewhere that Google saves gigabytes of bandwidth just by removing line break, which surprised me how much line break alone costs when you have the popularity of Google.com.
In Hexo, there are two approaches.

View File

@ -1,14 +1,11 @@
---
title: Make PDF files smaller
subtitle: Convert to grayscale and reduce the resolution.
date: 2019-01-05
tags:
- PDF
---
Convert to grayscale and reduce the resolution.
<!-- more -->
The most effective ways of reducing the file size of a PDF is by converting to grayscale and reduce the resolution.
Requirement: ghostscript (installed by default in Ubuntu)

View File

@ -1,15 +1,12 @@
---
title: microG, a replacement for the proprietary Google Play Services
subtitle: The core of the Android OS is open source, but much of the core apps, libraries and APIs are proprietary.
date: 2019-01-12
lastUpdated: 2019-04-30
tags:
- Android
---
The core of the Android OS is open source, but much of the core apps, libraries and APIs are proprietary.
<!-- more -->
[microG](https://microg.org/) is an open source re-implementation of Google Play Service/Services Framework. While the core of the Android OS is still open source, much of the core apps, libraries and APIs are proprietary. Refer to [this article](https://arstechnica.com/gadgets/2018/07/googles-iron-grip-on-android-controlling-open-source-by-any-means-necessary/) for more info.
Adding to this issue is having all the APIs packaged into a single monolithic Play Services APK. So, all the APIs are loaded at all time, even though some APIs like Cast is not going to be used 24/7. This leads to memory bloat. Despite [effort](https://arstechnica.com/gadgets/2017/09/android-8-0-oreo-thoroughly-reviewed/8/#h3) to split it into separate APKs, subsequent [updates](https://www.apkmirror.com/apk/google-inc/google-play-services/) are seldom smaller. The current version (as of writing) is [40+ MB](https://www.apkmirror.com/apk/google-inc/google-play-services/google-play-services-14-7-99-release/), while microG's implementation is merely [2.6 MB](https://microg.org/download.html).

View File

@ -1,15 +1,12 @@
---
title: Recommended Android apps
subtitle: Apps I'm currently using and recommend to everyone.
date: 2019-01-07
lastUpdated: 2019-04-30
tags:
- Android
---
Apps I'm currently using and recommend to everyone.
<!-- more -->
Following my switch to [microG](https://microg.org/) (an open source re-implementation of Google Play), some Google Apps stopped working ({% post_link microg-google-play-replacement 'read here' %}). During my search for replacements, I discover many open source alternatives. These are the apps I'm currently using and recommend to everyone.
Aside from the below list, check out the NanoDroid's [list](https://gitlab.com/Nanolx/NanoDroid/blob/master/doc/Applications.md) of other great open source alternatives.

View File

@ -1,15 +1,12 @@
---
title: You should switch to these replacements of TrueCrypt/KeePassX/Adblock Plus
subtitle: Some have been discontinued while others have been commercialised.
date: 2019-01-15
tags:
- Linux
- Web
---
Some have been discontinued while others have been commercialised.
<!-- more -->
TrueCrypt and KeePassX have been discontinued while Adblock Plus has been [commercialised](https://en.wikipedia.org/wiki/Adblock_Plus#Controversy_over_ad_filtering_and_ad_whitelisting). Their replacements are [VeraCrypt](https://www.veracrypt.fr/), [KeePassXC](https://keepassxc.org/) and [uBlock Origin](https://github.com/gorhill/uBlock/) respectively.
## VeraCrypt

View File

@ -1,14 +1,11 @@
---
title: Running locally installed node packages
subtitle: How to run binaries of locally installed node packages.
date: 2018-10-24
tags:
- Node
---
How to run binaries of locally installed node packages.
<!-- more -->
Installing a package with `--global` introduce more trouble than convenience. Here's how to run binaries of locally installed node packages.
By default, `npm install` installs packages as listed in `package.json` at 'node_modules' of your project folder. When a package ships with executables/binaries, usually user would install it globally using `sudo npm install --global/-g`.

View File

@ -1,5 +1,6 @@
---
title: Secure node modules with Snyk
subtitle: The package dependency on Node can cause security issue. Here's how to use Snyk to mitigate it.
date: 2018-10-01
lastUpdated: 2019-03-09
tags:
@ -8,10 +9,6 @@ tags:
- Security
---
The package dependency on Node can cause security issue. Here's how to use Snyk to mitigate it.
<!-- more -->
## Intro
> Click [here](#Installation) to go straight to installation guide.

View File

@ -1,5 +1,6 @@
---
title: Snyk failed to patch in Alpine docker
subtitle: Synk depends on GNU version of patch utility.
date: 2018-10-31
lastUpdated: 2019-03-09
tags:
@ -9,10 +10,6 @@ tags:
- Alpine
---
Synk depends on GNU version of `patch` utility.
<!-- more -->
Snyk initially runs fine on Alpine, until you try to `snyk protect` to patch the modules. Turns out Synk depends on GNU version of `patch` utility.
***Edit:*** Snyk [v1.131.0](https://github.com/snyk/snyk/releases/tag/v1.131.0) onwards no longer use `patch`.

View File

@ -1,15 +1,12 @@
---
title: Change spellcheck language in Ghostwriter
subtitle: It supports Hunspell dictionaries for spellcheck of other languages.
date: 2018-10-14
lastUpdated: 2019-06-06
tags:
- Markdown
---
It supports Hunspell dictionaries for spellcheck of other languages.
<!-- more -->
Ghostwriter is a Markdown editor with html preview. Previously I used [StackEdit](https://stackedit.io/app), but it's web-based.
It has built-in US English spellcheck. It supports [Hunspell](https://hunspell.github.io/) dictionaries for other languages.

View File

@ -1,14 +1,11 @@
---
title: Which statistical test should I use?
subtitle: Choosing a suitable statistical test depends on the design of the experiment, notably the number and the type of variables.
date: 2019-02-09
tags:
- Stats
---
Choosing a suitable statistical test depends on the design of the experiment, notably the number and the type of variables.
<!-- more -->
Note: The previews are displayed in dark theme, but hi-res downloads are in light theme.
## Parametric and non-parametric tests

View File

@ -1,14 +1,11 @@
---
title: Use Unix line endings in Unix tools
subtitle: Before you use any Unix tools to process some file, make sure the file only use Unix line endings.
date: 2018-11-08
tags:
- Linux
---
Before you use any Unix tools to process some file, make sure the file only use Unix line endings.
<!-- more -->
Before you use any Unix tools to process some file, make sure the file only use Unix [line endings](https://en.wikipedia.org/wiki/Newline#Representation).
Note that many text files you downloaded most probably use Windows line endings.

View File

@ -1,14 +1,11 @@
---
title: How to check validity of GitLab CI config
subtitle: How to verify/lint the config.
date: 2018-10-25
tags:
- GitLab
---
How to verify/lint the config.
<!-- more -->
It can be frustrating after you push the changes you made to `.gitlab-ci.yml`, only to discover later that it's invalid on gitlab.com. Here's how to verify/lint the config.
Login to GitLab.com and navigate to any of your repo or project. It must be under your account. If you don't have one, simply create a new project or fork one.

View File

@ -1,15 +1,12 @@
---
title: Prevent word break in array question on LimeSurvey
subtitle: In array type question, when you add many answer options, some words might break into next line, especially when the word is long.
date: 2018-10-31
tags:
- Stats
- LimeSurvey
---
In array type question, when you add many answer options, some words might break into next line, especially when the word is long.
<!-- more -->
When you have many answer options, the word can break into next line, like this:
{% cloudinary '20181031/break-word' 'Part of a word break into next line in LimeSurvey' %}

View File

@ -3,7 +3,7 @@
<header class="archive-article-header">
<span class="archive-article-date"><%- partial('post/date') %></span>
<%- partial('post/title', {class_name: 'archive-article-title'}) %>
<%- post.excerpt %>
<span><%- post.subtitle %></span>
</header>
</div>
</article>

View File

@ -1,8 +1,3 @@
<% if (pagination === 2) { %>
<% page.posts.each((post) => { %>
<%- partial('article', {post: post, index: true}) %>
<% }) %>
<% } else { %>
<% let last %>
<% page.posts.each((post, i) => { %>
<% const year = post.date.year() %>
@ -19,12 +14,11 @@
<% if (page.posts.length) { %>
</div></section>
<% } %>
<% } %>
<% if (page.total > 1) { %>
<nav id="page-nav" class="page-nav">
<%
let prev_text = "&laquo; " + __('prev')
let next_text = __('next') + " &raquo;"
let prev_text = '&laquo; ' + __('prev')
let next_text = __('next') + ' &raquo;'
%>
<%- paginator({
prev_text: prev_text,

View File

@ -9,8 +9,8 @@
</header>
<% } %>
<div class="article-entry typo" itemprop="articleBody">
<%- toc(page.more, {list_number: false}) %>
<%- post.more %>
<%- toc(page.content, {list_number: false}) %>
<%- post.content %>
</div>
<footer class="article-footer">
<ul class="article-meta">

View File

@ -38,15 +38,15 @@ function og (name, content, escape) {
function openGraphHelper (options = {}) {
if (!cheerio) cheerio = require('cheerio')
const { config, page } = this
const { config, page, theme } = this
const { content } = page
let images = options.image || options.images || page.photos || []
let description = options.description || page.description || page.excerpt || content || config.description
let images = page.photos || []
let description = page.subtitle || theme.description
const keywords = page.keywords || (page.tags && page.tags.length ? page.tags : undefined) || config.keywords
const title = options.title || page.title || config.title
const type = options.type || (this.is_post() ? 'article' : 'website')
const url = options.url || this.url
const siteName = options.site_name || config.title
const title = page.title || theme.nickname
const type = (this.is_post() ? 'article' : 'website')
const url = this.url
const siteName = theme.nickname
const twitterCard = options.twitter_card || 'summary'
const published = page.date || false
const updated = page.lastUpdated || false