Skip to content

Instantly share code, notes, and snippets.

View exkuretrol's full-sized avatar
😾
Focusing

Chiawei Chen exkuretrol

😾
Focusing
View GitHub Profile
@exkuretrol
exkuretrol / ctex-fontset-windows-tc.def
Created January 26, 2023 17:35
適用於 windows ctex 的繁體中文字體庫。目前只有 XeLaTeX 可以編譯。
\ProvidesExplFile{ctex-fontset-windows-tc.def}{\ExplFileDate}{0.0.1}{\ExplFileDescription}
\ctex_fontset_case:nnn
{ }
{ }
{
\setCJKmainfont { MingLiU } [ BoldFont = Microsoft~JhengHei , ItalicFont = DFKai-SB ]
\setCJKsansfont { Microsoft~JhengHei } [ BoldFont = *~Bold ]
\setCJKmonofont { MingLiU~Regular }
\setCJKfamilyfont { ming } { MingLiU~Regular }
\setCJKfamilyfont { zhhei } { Microsoft~JhengHei }
@exkuretrol
exkuretrol / ctex-fontset-macnew-tc.def
Created January 26, 2023 17:32
適用於 mac ctex 的繁體中文字體庫。目前只有 XeLaTeX 可以編譯。
\ProvidesExplFile{ctex-fontset-macnew-tc.def}{\ExplFileDate}{0.0.1}{\ExplFileDescription}
\ctex_fontset_case:nnnn
{ \ctex_fontset_error:n { mac } }
{ }
{ }
{
\setCJKmainfont { Songti~TC }
[
BoldFont = Songti~TC~Bold,
ItalicFont = Kaiti~TC,
@exkuretrol
exkuretrol / hugo-shortcode-gist.html
Created January 26, 2023 17:19
simple hugo gist shortcode.
<script
src={{ printf "https://gist.github.com/%s/%s.js" (.Get "author") (.Get "hash") }}
></script>
@exkuretrol
exkuretrol / hugo-shortcode-details.html
Created January 26, 2023 17:07
Creates a details HTML element. You can pass your title to summary element to setup `title` argument.
{{ $open := .Get "open" | default "false" }}
{{ $markdownify := .Get "markdownify" | default "true" }}
<details
{{ if eq $open "true"}}
open
{{ end }}
>
<summary>
{{ i18n "click_to_open" | default "Click to Open" }}
@exkuretrol
exkuretrol / hugo-shortcode-table.html
Last active January 26, 2023 16:44
A hugo shortcode table, have 3 optional arguments, id, class and title.
{{ $htmlTable := .Inner | markdownify }}
{{ $label := i18n "table_label" | default "Table" }}
{{ $tag := "<table>" }}
{{ $newTag := "<table" }}
{{ with .Get "id" }}
{{ $newTag = printf "<table id='%s'" . }}
{{ end }}
{{ with .Get "class" }}