fix(image_tag): rename 'cloudinary' tag plugin to 'image'

This commit is contained in:
curben 2019-09-03 20:37:52 +01:00
parent c919e44572
commit 8ba353e726
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
16 changed files with 56 additions and 56 deletions

View File

@ -2,10 +2,10 @@
/* global hexo */
/*
* Put {% cloudinary 'folder/filename.jpg' 'description' %} in your post.
* Put {% image 'folder/filename.jpg' 'description' %} in your post.
*/
hexo.extend.tag.register('cloudinary', (args) => {
hexo.extend.tag.register('image', (args) => {
let [fileName, alt] = args
if (!alt) alt = ''
let modern = fileName

View File

@ -18,21 +18,21 @@ Firefox can restrict the referrer to the same origin only ([docs](https://wiki.m
When you try to login to AliExpress, the login box is just blank.
{% cloudinary '20190228/no-login.png' 'Blank aliexpress login box' %}
{% image '20190228/no-login.png' 'Blank aliexpress login box' %}
In the new design, the loading wheel just keeps spinning.
{% cloudinary '20190228/invalid-login.png' 'Aliexpress login pop-up keeps loading' %}
{% image '20190228/invalid-login.png' 'Aliexpress login pop-up keeps loading' %}
Upon inspection on the blank element (right click on the blank login and select `Inspect Element`), the login box is an iframe of `https://passport.aliexpress.com`. From the Web Console (`Ctrl + Shift + K`), the following error message suggested it's caused by [X-Frame-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options).
{% cloudinary '20190228/iframe.png' 'Aliexpress login page under an iframe' %}
{% image '20190228/iframe.png' 'Aliexpress login page under an iframe' %}
<br />
{% cloudinary '20190228/x-frame.png' 'Console error of Aliexpress login' %}
{% image '20190228/x-frame.png' 'Console error of Aliexpress login' %}
From the Network inspection (`Ctrl + Shift + E`), `https://passport.aliexpress.com` has HTTP header `x-frame-options: SAMEORIGIN` (which I believe stems from the `XOriginPolicy` setting). This restricts the iframe to the same domain. This caused the iframe unable to load because it's different from the login page `https://login.aliexpress.com`.
{% cloudinary '20190228/sameorigin.png' 'Aliexpress x-frame-options is sameorigin' %}
{% image '20190228/sameorigin.png' 'Aliexpress x-frame-options is sameorigin' %}
**Edit:** After pinpoint the issue to `XOriginPolicy`, I suspect AliExpress sends the referrer from `login` to `passport` for tracking purpose, and somehow `passport` could not be loaded if it does not receive any referrer. There are a few options to resolve this.
@ -40,7 +40,7 @@ From the Network inspection (`Ctrl + Shift + E`), `https://passport.aliexpress.c
To use the old login page, mouse-over on the **Account** link at the top right corner and click on **My Orders**. It should redirects to `https://login.aliexpress.com/...`
{% cloudinary '20190228/my-orders.png' "Aliexpress 'My Orders' link" %}
{% image '20190228/my-orders.png' "Aliexpress 'My Orders' link" %}
## Reset XOriginPolicy
@ -56,11 +56,11 @@ To use the old login page, mouse-over on the **Account** link at the top right c
https://passport.aliexpress.com/*
```
{% cloudinary '20190228/whitelist.png' "Add a whitelist to 'Ignore X-Frame-Options'" %}
{% image '20190228/whitelist.png' "Add a whitelist to 'Ignore X-Frame-Options'" %}
That's how the whitelist works on the extension; you add the domain of the iframe not the page's domain. After you add it to the list, refresh the page and you should see the login.
{% cloudinary '20190228/login.png' 'Regular Aliexpress login page' %}
{% image '20190228/login.png' 'Regular Aliexpress login page' %}
## Direct link

View File

@ -20,7 +20,7 @@ If you use Compiz, the shortcut is not shown in Keyboard Shortcuts due to confli
Launch dconf-editor and search (click on the search icon on top right corner or just Ctrl+F) for 'shaded'.
{% cloudinary '20181024/dconf.png' "Search for 'shaded' in dconf-editor" %}
{% image '20181024/dconf.png' "Search for 'shaded' in dconf-editor" %}
Simply navigate into
```
@ -31,4 +31,4 @@ Toggle 'Use default value' to off, and set the custom value as `disabled`.
Finally, disable the shortcut in CCSM. Go to General Options > Key bindings (tab) > Toggle Window Shaded (last value).
{% cloudinary '20181024/ccsm.png' "Disable Shaded Window in CCSM" %}
{% image '20181024/ccsm.png' "Disable Shaded Window in CCSM" %}

View File

@ -14,7 +14,7 @@ ISP still knows what **IP address** you are connecting to. Even with HTTPS and D
But even with all that, I repeat, ISP still *knows* what IP address you are connecting to. A simple reverse DNS lookup or even just by visiting the IP address can reveal what website it belongs to. Reverse DNS lookup is indeed not as easy as ten years ago due to the current proliferation of content delivery network (CDN) like Cloudflare. But it is still possible. For example, A `dig startpage @9.9.9.9` returned `216.218.239.2`. When you go to the IP through a web browser, it redirects to startpage.com. Going to gitlab.com's IP resulted in SSL warning with gitlab.com shown as the valid hostname.
{% cloudinary '20190404/gitlab-ip.png' 'Reverse domain lookup through browser' %}
{% image '20190404/gitlab-ip.png' 'Reverse domain lookup through browser' %}
Websites that are behind Cloudflare can be harder to lookup. For example, `dig is.gd @9.9.9.9` returned `104.25.23.21`, but going to that IP resulted in a Cloudflare error page. So, every website should use Cloudflare, I guess?

View File

@ -14,7 +14,7 @@ On LimeSurvey, making minor edits to multiple questions can be quite a chore. `L
Edit: The view is accessible through (Survey) Settings > Survey menu > List questions.
{% cloudinary '20181018/listquestions.png' 'List all question in LimeSurvey' %}
{% image '20181018/listquestions.png' 'List all question in LimeSurvey' %}
Ignore the rest...
@ -32,8 +32,8 @@ Replace `questiongroups` to `survey` and replace `view` to `listquestions`, so t
This is what ListQuestions view looks like,
{% cloudinary '20181018/limesurvey.png' 'LimeSurvey ListQuestions page' %}
{% image '20181018/limesurvey.png' 'LimeSurvey ListQuestions page' %}
The view is also useful for quickly open multiple questions. Simply ctrl + left click or just middle click on the Edit button to open the question (to edit) in new tab.
{% cloudinary '20181018/limesurvey-edit.png' 'Edit button on LimeSurvey' %}
{% image '20181018/limesurvey-edit.png' 'Edit button on LimeSurvey' %}

View File

@ -11,7 +11,7 @@ tags:
Whenever I try to open an Engadget article, it will automatically redirect me to `guce.advertising.com/...` which is (thankfully) blocked by uBO.
{% cloudinary '20190609/guce-engadget.png' 'uBO blocks Engadget redirect' %}
{% image '20190609/guce-engadget.png' 'uBO blocks Engadget redirect' %}
Initially, I was able to workaround by opening the article in a private window, but it was not reliable. I didn't know why private window worked in the first place (and only found the reason later on). I figured it must be redirected by third-party javascript, so I checked the page source, looked for suspicious domains and block them using uBO. That didn't work, not even disabling javascript.
@ -29,15 +29,15 @@ Firefox can block cookie by website. To block Engadget from setting a cookie, in
2. Navigate to **Privacy & Security** tab on the left.
3. Scroll down to **Cookies & Site Data** section and open **Manage Permissions**.
{% cloudinary '20190609/privacy-settings.png' 'Privacy settings in Firefox' %}
{% image '20190609/privacy-settings.png' 'Privacy settings in Firefox' %}
4. Put `https://www.engadget.com` as the address and click **Block** and save it.
{% cloudinary '20190609/engadget-block-cookie.png' 'Block Engadget cookies' %}
{% image '20190609/engadget-block-cookie.png' 'Block Engadget cookies' %}
5. If you have **Clear history when Firefox enabled** enabled, make sure **Site Preferences** is unchecked.
{% cloudinary '20190609/uncheck-site.png' 'Settings for clearing history' %}
{% image '20190609/uncheck-site.png' 'Settings for clearing history' %}
That's it. If you want to know what is the purpose of `guce.advertising.com`, read on.

View File

@ -27,23 +27,23 @@ privacy.userContext.longPressBehavior;2
Once you enabled it, you should be able to access its setting from `about:preferences#containers`. Here's what the default settings look like:
{% cloudinary '20190812/container-in-preferences.png' "Containers settings in Firefox Preferences" %}
{% image '20190812/container-in-preferences.png' "Containers settings in Firefox Preferences" %}
{% cloudinary '20190812/container-settings.png' "Containers' default setting" %}
{% image '20190812/container-settings.png' "Containers' default setting" %}
The name, icon and colour are customisable.
{% cloudinary '20190812/container-personalisation.png' "Personalise Containers" %}
{% image '20190812/container-personalisation.png' "Personalise Containers" %}
There are two ways of using the Containers. We can open a link on a webpage in a specific container, by right-click → Open Link in New Container Tab.
{% cloudinary '20190812/container-context-menu.png' "Containers right-click menu" %}
{% image '20190812/container-context-menu.png' "Containers right-click menu" %}
We also can open a new container tab by long-pressing the plus (+) button, next to a tab.
{% cloudinary '20190812/containers-tabs.png' "New Container Tab" %}
{% image '20190812/containers-tabs.png' "New Container Tab" %}
{% cloudinary '20190812/containers-tabs.webp' "Container Tab in action" %}
{% image '20190812/containers-tabs.webp' "Container Tab in action" %}
## Facebook Container

View File

@ -11,11 +11,11 @@ tags:
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" %}
{% image '20190525/firefox-doh.png' "'DNS over HTTPS' setting in Firefox" %}
That's right, as of version 66, it's *still* **not** enabled by default. You want to use DNS-over-HTTPS but not to use Cloudflare? Just click on 'Custom' and enter the provider's address. There are a few to choose from. Refer to the lists provided by [AdGuard](https://kb.adguard.com/en/general/dns-providers) and [cURL](https://github.com/curl/curl/wiki/DNS-over-HTTPS).
{% cloudinary '20190525/firefox-doh-animated.webp' "How to enable 'DNS over HTTPS' in Firefox" %}
{% image '20190525/firefox-doh-animated.webp' "How to enable 'DNS over HTTPS' in Firefox" %}
I'm writing this in response to the recent [Opera article](https://arstechnica.com/information-technology/2019/05/review-opera-once-led-web-browser-innovation-it-has-new-ideas-again-with-reborn-3/2/) by Ars Technica,

View File

@ -16,7 +16,7 @@ For example, you are looking for item A and B at a shopping website using the pr
A useful feature of Firefox is that it allows more than one profile, which otherwise would requires multiple operating system accounts. The feature even allows you to run multiple profiles at the same time by having multiple instances.
{% cloudinary '20190407/firefox-error.png' "'Firefox is currently running' error" %}
{% image '20190407/firefox-error.png' "'Firefox is currently running' error" %}
There are two ways of creating profiles: (1) **Fresh** profile and (2) **Clone** existing profile.
@ -30,19 +30,19 @@ firefox --no-remote -P 'new profile name'
2. Click "Create Profile...".
{% cloudinary '20190407/profile-manager.png' 'Firefox Profile Manager' %}
{% image '20190407/profile-manager.png' 'Firefox Profile Manager' %}
3. Click "Next".
{% cloudinary '20190407/profile-wizard.png' 'Wizard to set up new Firefox profile' %}
{% image '20190407/profile-wizard.png' 'Wizard to set up new Firefox profile' %}
4. Name the new profile and click "Finish".
{% cloudinary '20190407/new-profile-name.png' 'Name the new Firefox profile' %}
{% image '20190407/new-profile-name.png' 'Name the new Firefox profile' %}
5. Once you are back to the profile manager, select "default", make sure "Use the selected profile..." and "Start Firefox".
{% cloudinary '20190407/profile-manager-new.png' 'Firefox Profile Manager with a recently added profile' %}
{% image '20190407/profile-manager-new.png' 'Firefox Profile Manager with a recently added profile' %}
6. Launch Firefox with the newly created profile using the same command as above:
@ -52,7 +52,7 @@ firefox --no-remote -P 'new profile name'
***Protip***: Create a launcher or keyboard shortcut to run the command.
{% cloudinary '20190407/launcher.png' 'Create a new launcher for the Firefox profile' %}
{% image '20190407/launcher.png' 'Create a new launcher for the Firefox profile' %}
7. Just launch Firefox as usual for your current profile.
@ -62,7 +62,7 @@ firefox --no-remote -P 'new profile name'
2. Browse to the **~/.mozilla/firefox** folder
3. To clone the default profile, simply select the xxxx.default and duplicate it by **Edit: -> Duplicate**, or copy to another folder, rename and move it back. Rename the cloned folder to desired name. In this example, I named it as *profile z*.
{% cloudinary '20190407/profile-folder.png' 'List of folders in ~/.mozilla/firefox' %}
{% image '20190407/profile-folder.png' 'List of folders in ~/.mozilla/firefox' %}
4. Append the following line to **profiles.ini**, if there is no existing profile (other than the default), use `[Profile1]` instead.
@ -73,7 +73,7 @@ IsRelative=1
Path=profile z
```
{% cloudinary '20190407/profiles-ini.png' 'profile.ini in a text editor' %}
{% image '20190407/profiles-ini.png' 'profile.ini in a text editor' %}
5. Launch Firefox with the newly created profile using the same command as above (note the case-sensitive):

View File

@ -10,7 +10,7 @@ Caja is a file manager originally forked from Nautilus. It's used in MATE deskto
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.
{% cloudinary '20181002/caja-side-pane.png' 'Side pane view of Caja file manager' %}
{% image '20181002/caja-side-pane.png' 'Side pane view of Caja file manager' %}
*from github [issue](https://github.com/mate-desktop/caja/issues/480).*
You can hide some folder through `~/.config/user-dirs.dirs` or `/home/your-username/.config/user-dirs.dirs` (you need to show hidden file/folder if you're going to browse through Caja).

View File

@ -11,13 +11,13 @@ TrueCrypt and KeePassX have been discontinued while Adblock Plus has been [comme
## VeraCrypt
{% cloudinary '20190115/veracrypt.png' 'Screenshot of VeraCrypt' %}
{% image '20190115/veracrypt.png' 'Screenshot of VeraCrypt' %}
VeraCrypt is a fork of the discontinued [TrueCrypt](https://en.wikipedia.org/wiki/TrueCrypt). It includes security improvements and fixes over the original—for example using much higher iterations (327,661-655,331 vs 1,000-2,000) to generate the header key—to make brute force more costly. This improvement along with supporting more ciphers and their combinations, means its storage format is incompatible to the original's. User still has the option to open TrueCrypt volume and (optionally, but recommended) convert it to VeraCrypt format.
## KeePassXC
{% cloudinary '20190115/keepassxc.png' 'Screenshot of KeePassXC' %}
{% image '20190115/keepassxc.png' 'Screenshot of KeePassXC' %}
KeePassXC is a fork of the discontinued [KeePassX](https://www.keepassx.org/). KeePassX started out as a Linux port of (previously Windows-only) KeePass. While both eventually become cross-platform, I stick with KeePassX (even on Windows) for being lighter and quicker to launch. The [Mono](https://www.mono-project.com/)-developed KeePass—like Java—makes it not quite as native as Qt-developed KeePass, thus feels slower on Linux. It last [released](https://www.keepassx.org/news/2016/10/609) in October 2016 with no further update since then.
@ -25,7 +25,7 @@ Notable [improvements](https://keepassxc.org/project/) of KeePassXC including KD
## uBlock Origin
{% cloudinary '20190115/ubo.png' 'Screenshot of uBlock Origin' %}
{% image '20190115/ubo.png' 'Screenshot of uBlock Origin' %}
uBlock Origin (uBO) is a popular ad blocker well-known for its low memory and CPU usage (compared to other ad blockers). The [dynamic filtering](https://github.com/gorhill/uBlock/wiki/Dynamic-filtering:-quick-guide) allows granular control over filtering rules. It supports HOSTS syntax for blocking malicious websites. I created a [blocklist](https://gitlab.com/curben/urlhaus-filter) based on the Abuse.sh [URLhaus](https://urlhaus.abuse.ch/).

View File

@ -38,7 +38,7 @@ Practically, you can use Snyk to patch it, *if* possible like this [hexo-all-min
1. [Sign up](https://app.snyk.io/signup) for a new Snyk account.
2. Snyk only supports [SSO](https://en.wikipedia.org/wiki/Single_sign-on), no e-mail sign up. You need to have GitHub, Bitbucket, or Google account. It can be a separate account from your current GitHub account. Linking your current GitHub repo to Snyk is *optional*.
3. Once you signed up, go to your account setting, grab the API token and save it in your password manager (or somewhere safe).
{% cloudinary '20181001/snyk-api.png' 'Snyk API token' %}
{% image '20181001/snyk-api.png' 'Snyk API token' %}
4. Install Snyk,
```bash
$ npm install snyk
@ -64,7 +64,7 @@ $ echo 'PATH="$PATH:./node_modules/.bin"' >> ~/.profile
Alternatively, you could integrate directly to your remote repo (github/gitlab). This integration allows Snyk to automatically create pull/merge request. Enable this by going to your Snyk account and Integrations tab.
{% cloudinary '20181001/snyk-integration.png' 'Available integrations offered by Snyk' %}
{% image '20181001/snyk-integration.png' 'Available integrations offered by Snyk' %}
More info: [NodeJS](https://snyk.io/docs/snyk-for-nodejs), [GitHub](https://snyk.io/docs/github), [GitLab](https://snyk.io/docs/gitlab)

View File

@ -10,19 +10,19 @@ Note: The previews are displayed in dark theme, but hi-res downloads are in ligh
## Parametric and non-parametric tests
{% cloudinary '20190209/parametric-non-parametric-preview.png' 'Common parametric and non-parametric tests' %}
{% image '20190209/parametric-non-parametric-preview.png' 'Common parametric and non-parametric tests' %}
**Download:** [PDF](https://mega.nz/#!3F81WarB!9aBojWuS6S4_8azMSFdy5ug3UDqCt3UHCKFr77Wpkg0) | [DOCX](https://mega.nz/#!nB9zgCiA!hHHtI-MELou9xVq1dMpkJeE2edXogkP1kEnxE1gr-84)
## Flowchart
{% cloudinary '20190209/statistical-test-flowchart-preview.png' 'Choose a statistical test using a flowchart' %}
{% image '20190209/statistical-test-flowchart-preview.png' 'Choose a statistical test using a flowchart' %}
**Download:** [PDF](https://mega.nz/#!CV8DAYaD!r9NaOEZ4VfeF-peNQm7jbEP6MqO4mRIBsRiHBd2DgsU) | [PNG](https://mega.nz/#!fc9H2KbS!LDp8FmX2W46d58zjIgItZiYDEkmnwkza6EbBxtDSl2g) | [VSDX](https://mega.nz/#!GM0jyKRQ!CEaKcoNBlYmT3bTmEgdatWAkshteinDeby5_FVYcHu8)
## Table
{% cloudinary '20190209/statistical-tests-table-preview.png' 'Statistical tests in a table view' %}
{% image '20190209/statistical-tests-table-preview.png' 'Statistical tests in a table view' %}
**Download:** [PDF](https://mega.nz/#!KN0jjaoS!cqr4sXCabLuD7jIs1GDGUuNrZP0okYRck24-V5QpS8U) | [DOCX](https://mega.nz/#!vV1TXaBb!Rq6x3--CRizMLCJFJ4wgADQmo-NPRMNERSIHeWSwW1o)
@ -30,6 +30,6 @@ Credit: James D. Leeper, Ph.D. (University of Alabama) [(Source)](https://statra
## Statistics mathematical symbols
{% cloudinary '20190209/statistics-mathematical-symbols-preview.png' 'Common mathematical symbols used in statistics' %}
{% image '20190209/statistics-mathematical-symbols-preview.png' 'Common mathematical symbols used in statistics' %}
**Download:** [PDF](https://mega.nz/#!Sc8hUISZ!B-j-ULD7CKDltjBYBRiX7_EPRe0P_YiUDmMzFBLlaEY) | [ODT](https://mega.nz/#!LA0XlAwa!FvU91TB43vgj7fLmNLTq_uMHlSGFHjB1EwVYuv8zlBQ)

View File

@ -20,6 +20,6 @@ https://gitlab.com/curben/blog/-/ci/lint
This is what it looks like,
{% cloudinary '20181025/lint.png' 'Verify .gitlab-ci.yml online' %}
{% image '20181025/lint.png' 'Verify .gitlab-ci.yml online' %}
Simply paste the content of your `.gitlab-ci.yml` and 'Validate'.

View File

@ -9,7 +9,7 @@ tags:
When using [Dark Reader](https://addons.mozilla.org/en-US/firefox/addon/darkreader/) (DR) add-on with "Filter" or "Filter+" mode in Firefox (FF 67 as of writing), you may encounter this issue where only the lower half of an image is shown.
{% cloudinary '20190628/dark-reader-before.png' 'Image is only shown half' %}
{% image '20190628/dark-reader-before.png' 'Image is only shown half' %}
To resolve it, add the following CSS rule to the DR's setting via **Dev tools**. Prepend before the site-specific rules.
@ -21,13 +21,13 @@ To resolve it, add the following CSS rule to the DR's setting via **Dev tools**.
}
```
{% cloudinary '20190628/dark-reader-dev-tools.png' 'Dev tools of Dark Reader' %}
{% image '20190628/dark-reader-dev-tools.png' 'Dev tools of Dark Reader' %}
{% cloudinary '20190628/dev-tools-demo.webp' 'A video of Dev Tools' %}
{% image '20190628/dev-tools-demo.webp' 'A video of Dev Tools' %}
After adding the CSS, you should be able to see the whole image. But the fix is not perfect, the image sticks to the top rather than centred.
{% cloudinary '20190628/dark-reader-after.png' 'Full image is shown' %}
{% image '20190628/dark-reader-after.png' 'Full image is shown' %}
The above CSS is to override the default CSS used by FF to display an image. The default CSS is located at `resource://content-accessible/TopLevelImageDocument.css`, accessible via Style Editor (Shift + F7, don't enable Caret Browsing when prompted). It's used to centre the image. Here is a snippet of "TopLevelImageDocument.css",

View File

@ -9,7 +9,7 @@ tags:
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' %}
{% image '20181031/break-word' 'Part of a word break into next line in LimeSurvey' %}
LimeSurvey does this to have consistent column width size across array question. Personally, I prefer not to have word break than fixed width.
@ -17,16 +17,16 @@ Here's how to prevent word break.
1. Go to the main admin page and then Themes.
{% cloudinary '20181031/theme-button' 'LimeSurvey theme button in admin panel' %}
{% image '20181031/theme-button' 'LimeSurvey theme button in admin panel' %}
2. 'Extend' the theme of your choice. Choose a name of the new *extended* theme.
{% cloudinary '20181031/theme-list' 'LimeSurvey theme list' %}
{% image '20181031/theme-list' 'LimeSurvey theme list' %}
3. It will redirect you to 'Theme editor' page.
4. Go to 'custom.css'.
{% cloudinary '20181031/custom-css' 'Customise LimeSurvey theme through custom.css' %}
{% image '20181031/custom-css' 'Customise LimeSurvey theme through custom.css' %}
5. Paste the following css,
@ -47,4 +47,4 @@ Here's how to prevent word break.
Once the word break is disabled, array answers should look like this,
{% cloudinary '20181031/no-break-word' 'No word break in LimeSurvey' %}
{% image '20181031/no-break-word' 'No word break in LimeSurvey' %}