diff --git a/404.html b/404.html index 370bc40..a73adef 100644 --- a/404.html +++ b/404.html @@ -92,7 +92,7 @@ @@ -126,6 +126,21 @@ src="/uploads/avatar.png">
Samuel Huang
+ +Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+I have two domains registered:
+sghuang.com
, with my initials for English and Chinese first name and last
+name.guanchao.pro
, with my first name in Chinese.Since my portfolio is oriented towards English speakers (for now,) I would like +to point the secondary domain to the primary one while making sure URLs with +paths specified can still be accessed. The primary domain is then used for +this website hosted on GitHub Pages.
+Cloudflare is used as nameserver and to provide some +simple proxy features.
+For secondary domain:
+feiyue.guanchao.pro
is redirected to an external URL (with specific path)example.guanchao.pro/path
is forwarded to example.sghuang.com/path
. Note
+that example
could be www
. In particular, notes.guanchao.pro/note
should
+be correctly handled to access the canonical Obsidian publication.guanchao.pro/path
is also forwarded.For primary domain:
+http://
or https://
or no
+schema.www.
prefix.notes.sghuang.com
sghuang.com
Simply adding A DNS records pointing to the GitHub Pages servers isn’t perfect, +the problems are:
+http://sghuang.com
“, Enforce HTTPS
+option can’t be checked.Full (strict)
mode (instead of Full
) is set for SSL/TLS encryption on
+Cloudflare, certificate error will prevent users from accessing the website.The solution is inspired by + a comment on Reddit. +The problem is caused by proxy setting of Cloudflare:
+Full (strict)
encryption mode.The solution is fairly simple:
+Enforce HTTPS
option can be checked but will be
+automatically unchecked with a red cross displayed.Full (strict)
security setting.Type | +Name | +Content | +
---|---|---|
A | +feiyue |
+192.0.2.1 |
+
CNAME | +@ |
+sghuang.com |
+
CNAME | +www |
+sghuang.com |
+
CNAME | +notes |
+notes.sghuang.com |
+
The A record is resolved to an internal IP address that is conventionally used +as a “dead end”. We need this record to be present for the subsequent forwarding +rules to be applied, otherwise “server not found” error will prevent users from +accessing this URL at the first place.
+The CNAME records with name @
and www
ensures both guanchao.pro
and
+www.guanchao.pro
are resolved to sghuang.com
.
The final CNAME record is straightforward.
+A redirect rule is set to redirect feiyue.guanchao.pro
to an external page.
1 | When... |
A page rule is set to ensure two domain names can be used interchangeably, +i.e. both subdomains and paths are preserved:
+1 | URL = *guanchao.pro/* |
Type | +Name | +Content | +
---|---|---|
A | +@ |
+185.199.108.153 |
+
A | +@ |
+185.199.109.153 |
+
A | +@ |
+185.199.110.153 |
+
A | +@ |
+185.199.111.153 |
+
CNAME | +www |
+sghuang.com |
+
CNAME | +notes |
+publish-main.obsidian.com |
+
Always Use HTTPS
page rules are applied to the following URLs to enforce
+HTTPS:
http://sghuang.com/*
http://notes.sghuang.com/*
Additionally, www.sghuang.com/*
is forwarded to https://sghuang.com/$1
to
+avoid some certificates problems when accessing www
URL.
Samuel Huang
+Samuel Huang
+Samuel Huang
+NexT documentation
+suggested creating a directory for each page, and put content in the index.md
+file under it:
1 | # _config.next.yml |
Where the directory looks like:
+1 | . |
With this setting, both leading and trailing slashes in _config.next/yml
are
+optional.
A more elegant way to achieve the same behavior is:
+1 | . |
There’s no need for subdirectory and index.md
, simply put page.md
under
+source
directory. The configuration in _config.next.yml
stays the same.
NexT Docs achieved two-level header tabs +style with the following configuration:
+1 | # _config.next.yml |
1 | . |
Apparently the authors used path of generated .html
files in the public
+directory to access the tabs. The annoyance of having several subdirectories with
+only index.md
inside arise again when we only need a single level of header
+tabs. A more elegant configuration is as follows:
1 | # _config.next.yml |
1 | . |
Note that in this scenario, both leading and trailing slashes are NEEDED in
+the default:
path for the header tabs to be loaded.
Samuel Huang
+Samuel Huang
+Samuel Huang
+I have two domains registered:
+sghuang.com
, with my initials for English and Chinese first name and last
+name.guanchao.pro
, with my first name in Chinese.Since my portfolio is oriented towards English speakers (for now,) I would like +to point the secondary domain to the primary one while making sure URLs with +paths specified can still be accessed. The primary domain is then used for +this website hosted on GitHub Pages.
+Cloudflare is used as nameserver and to provide some +simple proxy features.
+For secondary domain:
+feiyue.guanchao.pro
is redirected to an external URL (with specific path)example.guanchao.pro/path
is forwarded to example.sghuang.com/path
. Note
+that example
could be www
. In particular, notes.guanchao.pro/note
should
+be correctly handled to access the canonical Obsidian publication.guanchao.pro/path
is also forwarded.For primary domain:
+http://
or https://
or no
+schema.www.
prefix.notes.sghuang.com
sghuang.com
Simply adding A DNS records pointing to the GitHub Pages servers isn’t perfect, +the problems are:
+http://sghuang.com
“, Enforce HTTPS
+option can’t be checked.Full (strict)
mode (instead of Full
) is set for SSL/TLS encryption on
+Cloudflare, certificate error will prevent users from accessing the website.The solution is inspired by + a comment on Reddit. +The problem is caused by proxy setting of Cloudflare:
+Full (strict)
encryption mode.The solution is fairly simple:
+Enforce HTTPS
option can be checked but will be
+automatically unchecked with a red cross displayed.Full (strict)
security setting.Type | +Name | +Content | +
---|---|---|
A | +feiyue |
+192.0.2.1 |
+
CNAME | +@ |
+sghuang.com |
+
CNAME | +www |
+sghuang.com |
+
CNAME | +notes |
+notes.sghuang.com |
+
The A record is resolved to an internal IP address that is conventionally used +as a “dead end”. We need this record to be present for the subsequent forwarding +rules to be applied, otherwise “server not found” error will prevent users from +accessing this URL at the first place.
+The CNAME records with name @
and www
ensures both guanchao.pro
and
+www.guanchao.pro
are resolved to sghuang.com
.
The final CNAME record is straightforward.
+A redirect rule is set to redirect feiyue.guanchao.pro
to an external page.
1 | When... |
A page rule is set to ensure two domain names can be used interchangeably, +i.e. both subdomains and paths are preserved:
+1 | URL = *guanchao.pro/* |
Type | +Name | +Content | +
---|---|---|
A | +@ |
+185.199.108.153 |
+
A | +@ |
+185.199.109.153 |
+
A | +@ |
+185.199.110.153 |
+
A | +@ |
+185.199.111.153 |
+
CNAME | +www |
+sghuang.com |
+
CNAME | +notes |
+publish-main.obsidian.com |
+
Always Use HTTPS
page rules are applied to the following URLs to enforce
+HTTPS:
http://sghuang.com/*
http://notes.sghuang.com/*
Additionally, www.sghuang.com/*
is forwarded to https://sghuang.com/$1
to
+avoid some certificates problems when accessing www
URL.
A simplified configuration for regular custom pages, and custom pages with single level header tabs.
+ +A compiler handwritten in C.
This course project for Digital Image Processing integrates LSB steganography in +images with Hamming Code error correction. I chose this topic because I was +fascinated by the video made by 3Blue1Brown explaining Hamming Code, and I have +a strong interest in bit operations.
+ + +You can learn more about this project by reading the comprehensive + project report.
+This course project for Digital Image Processing integrates LSB steganography in +images with Hamming Code error correction. I chose this topic because I was +fascinated by the video made by 3Blue1Brown explaining Hamming Code, and I have +a strong interest in bit operations.
+ + +You can learn more about this project by reading the comprehensive + project report.
+Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+Samuel Huang
+