Hugo-Octopress Demo

Hugo-Octopress demo site - subtitle.

Dec 8, 2017 - 1 minute read - test category3

Codecaption test

Python code highlight
1
2
3
4
5
from base64 import b64encode
from binascii import unhexlify

print b64encode(unhexlify("0a0b0c0d"))
CgsMDQ==
Go highlight
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// zlib inflate (decompress).

package main

import (
	"compress/zlib"
	"io"
	"os"
)

func main() {
	zlibFile, err := os.Open("test.zlib")
	if err != nil {
		panic(err)
	}
	defer zlibFile.Close()

	r, err := zlib.NewReader(zlibFile)
	if err != nil {
		panic(err)
	}
	defer r.Close()

	outFile, err := os.Create("out-zlib")
	if err != nil {
		panic(err)
	}
	defer outFile.Close()

	io.Copy(outFile, r)
}

Python code highlight using the Hugo internal highligh shortcode:

from base64 import b64encode
from binascii import unhexlify

print b64encode(unhexlify("0a0b0c0d"))
CgsMDQ==

test gist1


test gist2

Powershell codecaption highlight:

Hello
1
2
3
4
5
6
# notepad does not have an entry

$ Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad.exe"
False
# chrome does

$ Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe"
True

Indented code block:

# notepad does not have an entry
$ Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad.exe"
False
# chrome does
$ Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe"
True