diff --git a/config.toml b/config.toml index a10cbb6..a068fa2 100644 --- a/config.toml +++ b/config.toml @@ -21,6 +21,13 @@ contentDir = 'content' weight = 2 title = "Classes by Matsuura Tomoya" +[mediaTypes] + [mediaTypes.'text/ino'] + suffixes = ['ino'] + [mediaTypes.'text/pde'] + suffixes = ['pde'] + + # (Optional) Set Google Analytics if you use it to track your website. # Always put it on the top of the configuration file, otherwise it won't work diff --git a/layouts/shortcodes/preview_code.html b/layouts/shortcodes/preview_code.html new file mode 100644 index 0000000..fe46785 --- /dev/null +++ b/layouts/shortcodes/preview_code.html @@ -0,0 +1,29 @@ +{{ $ref := "" }} +{{ $type := "" }} + +{{ $target := "" }} +{{ with .Get "type" }} + {{ $type = . }} +{{ end }} +{{ with .Get "href" }} + {{ $ref = . }} + {{ $target = "_blank" }} +{{ end }} +{{ with .Get "relref" }} + {{ $ref = relref $ . }} +{{ end }} + +

{{ (path.Base $ref) | .Page.RenderString }}

+ + + DL + + + +{{$page:=.Page}} +{{ with .Page.Resources.GetMatch $ref }} +{{( printf "```%s\n%s\n```\n" $type .Content ) | $page.RenderString}} +{{else}} +

file {{$ref}} not found

+{{ end }} +