@bookshop/hugo-engine 2.4.0-hugo.3 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/.nyc_output/{05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2.json → 05c20625-d974-4cff-8627-ffd39eb87964.json} +0 -0
  2. package/.nyc_output/{6e19d05c-cf57-446d-a6c8-7daaaf0e7db6.json → 1c8dd4f5-9b2f-4218-9c39-615aa7a79f1a.json} +0 -0
  3. package/.nyc_output/{7f3f24c5-d070-4832-a421-c10f43bb42c3.json → 55d11bd3-216d-42c2-970e-55360a3aa1f7.json} +0 -0
  4. package/.nyc_output/{aa72646f-c2f6-4103-b57f-22eacd776b6f.json → bb3f1e57-7efe-4f35-852c-6971836aa288.json} +0 -0
  5. package/.nyc_output/{c924a9c2-577c-44b7-9c5c-b515d364fc95.json → e6440686-4e4c-487d-9abc-bb15eb8663e1.json} +0 -0
  6. package/.nyc_output/processinfo/05c20625-d974-4cff-8627-ffd39eb87964.json +1 -0
  7. package/.nyc_output/processinfo/1c8dd4f5-9b2f-4218-9c39-615aa7a79f1a.json +1 -0
  8. package/.nyc_output/processinfo/55d11bd3-216d-42c2-970e-55360a3aa1f7.json +1 -0
  9. package/.nyc_output/processinfo/bb3f1e57-7efe-4f35-852c-6971836aa288.json +1 -0
  10. package/.nyc_output/processinfo/e6440686-4e4c-487d-9abc-bb15eb8663e1.json +1 -0
  11. package/.nyc_output/processinfo/index.json +1 -1
  12. package/hugo-renderer/build.sh +52 -10
  13. package/hugo-renderer/go.mod +6 -42
  14. package/hugo-renderer/go.sum +2 -49
  15. package/hugo-renderer/helpers/bookshop_modified_content.go +6 -0
  16. package/hugo-renderer/helpers/emoji.go +96 -0
  17. package/hugo-renderer/hugo_renderer.wasm +0 -0
  18. package/hugo-renderer/tpl/bookshop_engine/bookshop_func_importer.go +1 -1
  19. package/hugo-renderer/tpl/collections/collections.go +1 -0
  20. package/hugo-renderer/tpl/fmt/fmt.go +2 -0
  21. package/hugo-renderer/tpl/partials/partials.go +2 -0
  22. package/hugo-renderer/tpl/transform/init.go +106 -0
  23. package/hugo-renderer/tpl/transform/transform.go +113 -0
  24. package/hugo-renderer/update-from-hugo.sh +19 -0
  25. package/lib/engine.js +34 -7
  26. package/lib/hugoIdentifierParser.js +7 -1
  27. package/lib/hugoIdentifierParser.test.js +21 -2
  28. package/lib/translateTextTemplate.js +18 -5
  29. package/lib/translateTextTemplate.test.js +33 -10
  30. package/package.json +2 -2
  31. package/.nyc_output/processinfo/05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2.json +0 -1
  32. package/.nyc_output/processinfo/6e19d05c-cf57-446d-a6c8-7daaaf0e7db6.json +0 -1
  33. package/.nyc_output/processinfo/7f3f24c5-d070-4832-a421-c10f43bb42c3.json +0 -1
  34. package/.nyc_output/processinfo/aa72646f-c2f6-4103-b57f-22eacd776b6f.json +0 -1
  35. package/.nyc_output/processinfo/c924a9c2-577c-44b7-9c5c-b515d364fc95.json +0 -1
@@ -0,0 +1 @@
1
+ {"parent":null,"pid":94690,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/cli.js","-v"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643783907226,"ppid":94689,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/05c20625-d974-4cff-8627-ffd39eb87964.json","externalId":"","uuid":"05c20625-d974-4cff-8627-ffd39eb87964","files":[]}
@@ -0,0 +1 @@
1
+ {"parent":"05c20625-d974-4cff-8627-ffd39eb87964","pid":94691,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643783907793,"ppid":94690,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/1c8dd4f5-9b2f-4218-9c39-615aa7a79f1a.json","externalId":"","uuid":"1c8dd4f5-9b2f-4218-9c39-615aa7a79f1a","files":[]}
@@ -0,0 +1 @@
1
+ {"parent":"05c20625-d974-4cff-8627-ffd39eb87964","pid":94693,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643783907804,"ppid":94690,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/55d11bd3-216d-42c2-970e-55360a3aa1f7.json","externalId":"","uuid":"55d11bd3-216d-42c2-970e-55360a3aa1f7","files":[]}
@@ -0,0 +1 @@
1
+ {"parent":"05c20625-d974-4cff-8627-ffd39eb87964","pid":94692,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643783907805,"ppid":94690,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/bb3f1e57-7efe-4f35-852c-6971836aa288.json","externalId":"","uuid":"bb3f1e57-7efe-4f35-852c-6971836aa288","files":[]}
@@ -0,0 +1 @@
1
+ {"parent":"05c20625-d974-4cff-8627-ffd39eb87964","pid":94694,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643783907813,"ppid":94690,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/e6440686-4e4c-487d-9abc-bb15eb8663e1.json","externalId":"","uuid":"e6440686-4e4c-487d-9abc-bb15eb8663e1","files":[]}
@@ -1 +1 @@
1
- {"processes":{"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2":{"parent":null,"children":["6e19d05c-cf57-446d-a6c8-7daaaf0e7db6","7f3f24c5-d070-4832-a421-c10f43bb42c3","aa72646f-c2f6-4103-b57f-22eacd776b6f","c924a9c2-577c-44b7-9c5c-b515d364fc95"]},"6e19d05c-cf57-446d-a6c8-7daaaf0e7db6":{"parent":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","children":[]},"7f3f24c5-d070-4832-a421-c10f43bb42c3":{"parent":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","children":[]},"aa72646f-c2f6-4103-b57f-22eacd776b6f":{"parent":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","children":[]},"c924a9c2-577c-44b7-9c5c-b515d364fc95":{"parent":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","children":[]}},"files":{},"externalIds":{}}
1
+ {"processes":{"05c20625-d974-4cff-8627-ffd39eb87964":{"parent":null,"children":["1c8dd4f5-9b2f-4218-9c39-615aa7a79f1a","55d11bd3-216d-42c2-970e-55360a3aa1f7","bb3f1e57-7efe-4f35-852c-6971836aa288","e6440686-4e4c-487d-9abc-bb15eb8663e1"]},"1c8dd4f5-9b2f-4218-9c39-615aa7a79f1a":{"parent":"05c20625-d974-4cff-8627-ffd39eb87964","children":[]},"55d11bd3-216d-42c2-970e-55360a3aa1f7":{"parent":"05c20625-d974-4cff-8627-ffd39eb87964","children":[]},"bb3f1e57-7efe-4f35-852c-6971836aa288":{"parent":"05c20625-d974-4cff-8627-ffd39eb87964","children":[]},"e6440686-4e4c-487d-9abc-bb15eb8663e1":{"parent":"05c20625-d974-4cff-8627-ffd39eb87964","children":[]}},"files":{},"externalIds":{}}
@@ -1,16 +1,58 @@
1
- rm -f hugo_renderer.wasm
2
- FILENAME="hugo_renderer_$(date +%s).wasm"
3
- GOOS=js GOARCH=wasm go build -tags nodeploy -o $FILENAME
4
- printf "Built Hugo WASM via $FILENAME : "
5
- ls -lh $FILENAME | awk '{print $5}'
6
- if [ -f hugo_renderer.wasm ]; then
7
- echo "ERROR: previous hugo_renderer.wasm still in directory"
1
+ TMPFILENAME="hugo_renderer_$(date +%s).wasm"
2
+ OUTPUTFILENAME="hugo_renderer.wasm"
3
+
4
+ # Clean
5
+ rm -f $OUTPUTFILENAME
6
+ if [ -f $OUTPUTFILENAME ]; then
7
+ echo "ERROR: previous $OUTPUTFILENAME still in directory"
8
8
  exit 1
9
9
  fi
10
- mv $FILENAME hugo_renderer.wasm
11
- if [ ! -f hugo_renderer.wasm ]; then
10
+
11
+ # Build temp module
12
+ GOOS=js GOARCH=wasm go build -tags nodeploy -o $TMPFILENAME
13
+ printf "Built Hugo WASM via $TMPFILENAME : "
14
+ ls -lh $TMPFILENAME | awk '{print $5}'
15
+
16
+ # Link repo module
17
+ mv $TMPFILENAME $OUTPUTFILENAME
18
+ if [ ! -f $OUTPUTFILENAME ]; then
12
19
  echo "ERROR: hugo_renderer.wasm not complete"
13
20
  exit 1
14
21
  fi
15
- echo "Done. Hugo WASM available at hugo_renderer.wasm"
22
+ echo "Done. Repo Hugo WASM available at hugo_renderer.wasm"
23
+
24
+ # If we're just in a test run we don't want to touch the CDN repo
25
+ if [[ -z "${PUBLISH_BOOKSHOP_CDN}" ]]; then
26
+ echo "Not publishing to CDN."
27
+ exit 0
28
+ fi
29
+
30
+ if [[ -z "${BOOKSHOP_VERSION}" ]]; then
31
+ echo "ERROR: BOOKSHOP_VERSION environment variable does not exist"
32
+ exit 1
33
+ fi
34
+
35
+ CDNFILENAME="../../../../../bookshopcdn/hugo/hugo_renderer_$BOOKSHOP_VERSION.wasm"
36
+
37
+ # Check CDN
38
+ if [ ! -d ../../../../../bookshopcdn/hugo ]; then
39
+ echo "ERROR: bookshopcdn repo does not exist alongside bookshop repo"
40
+ exit 1
41
+ fi
42
+
43
+ # Link CDN module
44
+ cp $OUTPUTFILENAME $CDNFILENAME
45
+ if [ ! -f $CDNFILENAME ]; then
46
+ echo "ERROR: $CDNFILENAME not complete"
47
+ exit 1
48
+ fi
49
+ echo "Done. CDN Hugo WASM available at $CDNFILENAME"
50
+
51
+ cd ../../../../../bookshopcdn
52
+
53
+ git add -A \
54
+ && git commit -m "build: releasing $BOOKSHOP_VERSION" \
55
+ && git tag -a v$BOOKSHOP_VERSION -m "build: releasing $BOOKSHOP_VERSION" \
56
+ && git push --tags && git push
57
+
16
58
  exit 0
@@ -7,49 +7,13 @@ require (
7
7
  github.com/mitchellh/hashstructure v1.1.0
8
8
  github.com/pkg/errors v0.9.1
9
9
  github.com/spf13/cast v1.4.1
10
- gopkg.in/yaml.v2 v2.4.0 // indirect
11
10
  )
12
11
 
13
- require github.com/gobuffalo/flect v0.2.4
14
-
15
12
  require (
16
- github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69 // indirect
17
- github.com/BurntSushi/toml v0.3.1 // indirect
18
- github.com/PuerkitoBio/purell v1.1.1 // indirect
19
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
20
- github.com/alecthomas/chroma v0.9.4 // indirect
21
- github.com/armon/go-radix v1.0.0 // indirect
22
- github.com/bep/debounce v1.2.0 // indirect
23
- github.com/bep/gitmap v1.1.2 // indirect
24
- github.com/bep/gowebp v0.1.0 // indirect
25
- github.com/bep/tmc v0.5.1 // indirect
26
- github.com/cli/safeexec v1.0.0 // indirect
27
- github.com/disintegration/gift v1.2.1 // indirect
28
- github.com/dlclark/regexp2 v1.4.0 // indirect
29
- github.com/gobwas/glob v0.2.3 // indirect
30
- github.com/gohugoio/locales v0.14.0 // indirect
31
- github.com/gohugoio/localescompressed v0.14.0 // indirect
32
- github.com/jdkato/prose v1.2.1 // indirect
33
- github.com/kyokomi/emoji/v2 v2.2.8 // indirect
34
- github.com/mattn/go-isatty v0.0.14 // indirect
35
- github.com/mattn/go-runewidth v0.0.9 // indirect
36
- github.com/miekg/mmark v1.3.6 // indirect
37
- github.com/mitchellh/mapstructure v1.4.2 // indirect
38
- github.com/muesli/smartcrop v0.3.0 // indirect
39
- github.com/niklasfasching/go-org v1.5.0 // indirect
40
- github.com/olekukonko/tablewriter v0.0.5 // indirect
41
- github.com/pelletier/go-toml/v2 v2.0.0-beta.3.0.20210727221244-fa0796069526 // indirect
42
- github.com/rogpeppe/go-internal v1.8.0 // indirect
43
- github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6 // indirect
44
- github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd // indirect
45
- github.com/sanity-io/litter v1.5.1 // indirect
46
- github.com/spf13/afero v1.6.0 // indirect
47
- github.com/spf13/jwalterweatherman v1.1.0 // indirect
48
- github.com/spf13/pflag v1.0.5 // indirect
49
- github.com/yuin/goldmark v1.4.4 // indirect
50
- github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691 // indirect
51
- golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb // indirect
52
- golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
53
- golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365 // indirect
54
- golang.org/x/text v0.3.7 // indirect
13
+ github.com/gobuffalo/flect v0.2.4
14
+ github.com/gomarkdown/markdown v0.0.0-20220114203417-14399d5448c4
15
+ github.com/kyokomi/emoji/v2 v2.2.8
16
+ github.com/sanity-io/litter v1.5.1
55
17
  )
18
+
19
+ require github.com/gobwas/glob v0.2.3 // indirect
@@ -76,23 +76,18 @@ github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsI
76
76
  github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI=
77
77
  github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
78
78
  github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
79
- github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69 h1:+tu3HOoMXB7RXEINRVIpxJCT+KdYiI7LAEAUrOw3dIU=
80
79
  github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69/go.mod h1:L1AbZdiDllfyYH5l5OkAaZtk7VkWe89bPJFmnDBNHxg=
81
- github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
82
80
  github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
83
81
  github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
84
82
  github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0=
85
83
  github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0=
86
84
  github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20191009163259-e802c2cb94ae/go.mod h1:mjwGPas4yKduTyubHvD1Atl9r1rUq8DfVy+gkVvZ+oo=
87
- github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
88
85
  github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
89
- github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
90
86
  github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
91
87
  github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
92
88
  github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
93
89
  github.com/alecthomas/chroma v0.7.2-0.20200305040604-4f3623dce67a/go.mod h1:fv5SzZPFJbwp2NXJWpFIX7DZS4HgV1K4ew4Pc2OZD9s=
94
90
  github.com/alecthomas/chroma v0.8.2/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM=
95
- github.com/alecthomas/chroma v0.9.4 h1:YL7sOAE3p8HS96T9km7RgvmsZIctqbK1qJ0b7hzed44=
96
91
  github.com/alecthomas/chroma v0.9.4/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
97
92
  github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
98
93
  github.com/alecthomas/kong v0.1.17-0.20190424132513-439c674f7ae0/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI=
@@ -104,23 +99,17 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
104
99
  github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
105
100
  github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
106
101
  github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
107
- github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
108
102
  github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
109
103
  github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0=
110
104
  github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
111
105
  github.com/aws/aws-sdk-go v1.31.13/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
112
106
  github.com/aws/aws-sdk-go v1.41.14/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
113
- github.com/bep/debounce v1.2.0 h1:wXds8Kq8qRfwAOpAxHrJDbCXgC5aHSzgQb/0gKsHQqo=
114
107
  github.com/bep/debounce v1.2.0/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0=
115
- github.com/bep/gitmap v1.1.2 h1:zk04w1qc1COTZPPYWDQHvns3y1afOsdRfraFQ3qI840=
116
108
  github.com/bep/gitmap v1.1.2/go.mod h1:g9VRETxFUXNWzMiuxOwcudo6DfZkW9jOsOW0Ft4kYaY=
117
109
  github.com/bep/godartsass v0.12.0/go.mod h1:nXQlHHk4H1ghUk6n/JkYKG5RD43yJfcfp5aHRqT/pc4=
118
110
  github.com/bep/golibsass v1.0.0/go.mod h1:DL87K8Un/+pWUS75ggYv41bliGiolxzDKWJAq3eJ1MA=
119
- github.com/bep/gowebp v0.1.0 h1:4/iQpfnxHyXs3x/aTxMMdOpLEQQhFmF6G7EieWPTQyo=
120
111
  github.com/bep/gowebp v0.1.0/go.mod h1:ZhFodwdiFp8ehGJpF4LdPl6unxZm9lLFjxD3z2h2AgI=
121
- github.com/bep/tmc v0.5.1 h1:CsQnSC6MsomH64gw0cT5f+EwQDcvZz4AazKunFwTpuI=
122
112
  github.com/bep/tmc v0.5.1/go.mod h1:tGYHN8fS85aJPhDLgXETVKp+PR382OvFi2+q2GkGsq0=
123
- github.com/bep/workers v1.0.0 h1:U+H8YmEaBCEaFZBst7GcRVEoqeRC9dzH2dWOwGmOchg=
124
113
  github.com/bep/workers v1.0.0/go.mod h1:7kIESOB86HfR2379pwoMWNy8B50D7r99fRLUyPSNyCs=
125
114
  github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
126
115
  github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
@@ -130,7 +119,6 @@ github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgk
130
119
  github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
131
120
  github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
132
121
  github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
133
- github.com/cli/safeexec v1.0.0 h1:0VngyaIyqACHdcMNWfo6+KdUYnqEr2Sg+bSP1pdF+dI=
134
122
  github.com/cli/safeexec v1.0.0/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q=
135
123
  github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
136
124
  github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
@@ -150,12 +138,10 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
150
138
  github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY=
151
139
  github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
152
140
  github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
153
- github.com/disintegration/gift v1.2.1 h1:Y005a1X4Z7Uc+0gLpSAsKhWi4qLtsdEcMIbbdvdZ6pc=
154
141
  github.com/disintegration/gift v1.2.1/go.mod h1:Jh2i7f7Q2BM7Ezno3PhfezbR1xpUg9dUg3/RlKGr4HI=
155
142
  github.com/djherbis/atime v1.1.0/go.mod h1:28OF6Y8s3NQWwacXc5eZTsEsiMzp7LF8MbXE+XJPdBE=
156
143
  github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
157
144
  github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
158
- github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
159
145
  github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
160
146
  github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
161
147
  github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -177,7 +163,6 @@ github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzP
177
163
  github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og=
178
164
  github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
179
165
  github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
180
- github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
181
166
  github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
182
167
  github.com/getkin/kin-openapi v0.80.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
183
168
  github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
@@ -198,9 +183,7 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69
198
183
  github.com/gohugoio/go-i18n/v2 v2.1.3-0.20210430103248-4c28c89f8013/go.mod h1:3Ltoo9Banwq0gOtcOwxuHG6omk+AwsQPADyw2vQYOJQ=
199
184
  github.com/gohugoio/hugo v0.89.4 h1:mI/y7TQ66mIMFP6fg9QeIGT/YTzvBLlYTsXRVA3DW4g=
200
185
  github.com/gohugoio/hugo v0.89.4/go.mod h1:1DAye8fFlK8nskfCJqk38wkzIFf6wj3CyepPOgxlpX0=
201
- github.com/gohugoio/locales v0.14.0 h1:Q0gpsZwfv7ATHMbcTNepFd59H7GoykzWJIxi113XGDc=
202
186
  github.com/gohugoio/locales v0.14.0/go.mod h1:ip8cCAv/cnmVLzzXtiTpPwgJ4xhKZranqNqtoIu0b/4=
203
- github.com/gohugoio/localescompressed v0.14.0 h1:gP4zzgfF3NFr2rNzwxReD/tDXz98pAGVmrPy3ZCLRDc=
204
187
  github.com/gohugoio/localescompressed v0.14.0/go.mod h1:jBF6q8D7a0vaEmcWPNcAjUZLJaIVNiwvM3WlmTvooB0=
205
188
  github.com/gohugoio/testmodBuilder/mods v0.0.0-20190520184928-c56af20f2e95/go.mod h1:bOlVlCa1/RajcHpXkrUXPSHB/Re1UnlXxD1Qp8SKOd8=
206
189
  github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
@@ -232,9 +215,10 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
232
215
  github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
233
216
  github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
234
217
  github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
235
- github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
236
218
  github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
237
219
  github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
220
+ github.com/gomarkdown/markdown v0.0.0-20220114203417-14399d5448c4 h1:6GlsnS3GQYfrJZTJEUsheoyLE6kLXQJDvQKIKxgL/9Q=
221
+ github.com/gomarkdown/markdown v0.0.0-20220114203417-14399d5448c4/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
238
222
  github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
239
223
  github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
240
224
  github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -303,7 +287,6 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
303
287
  github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
304
288
  github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
305
289
  github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
306
- github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
307
290
  github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
308
291
  github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
309
292
  github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
@@ -312,7 +295,6 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
312
295
  github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
313
296
  github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
314
297
  github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
315
- github.com/jdkato/prose v1.2.1 h1:Fp3UnJmLVISmlc57BgKUzdjr0lOtjqTZicL3PaYy6cU=
316
298
  github.com/jdkato/prose v1.2.1/go.mod h1:AiRHgVagnEx2JbQRQowVBKjG0bcs/vtkGCH1dYAL1rA=
317
299
  github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
318
300
  github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
@@ -336,13 +318,11 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
336
318
  github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
337
319
  github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
338
320
  github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
339
- github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
340
321
  github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
341
322
  github.com/kyokomi/emoji/v2 v2.2.8 h1:jcofPxjHWEkJtkIbcLHvZhxKgCPl6C7MyjTrD4KDqUE=
342
323
  github.com/kyokomi/emoji/v2 v2.2.8/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE=
343
324
  github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
344
325
  github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A=
345
- github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
346
326
  github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
347
327
  github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
348
328
  github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
@@ -355,12 +335,9 @@ github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/
355
335
  github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
356
336
  github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
357
337
  github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
358
- github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
359
338
  github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
360
- github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
361
339
  github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
362
340
  github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
363
- github.com/miekg/mmark v1.3.6 h1:t47x5vThdwgLJzofNsbsAl7gmIiJ7kbDQN5BxwBmwvY=
364
341
  github.com/miekg/mmark v1.3.6/go.mod h1:w7r9mkTvpS55jlfyn22qJ618itLryxXBhA7Jp3FIlkw=
365
342
  github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
366
343
  github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
@@ -373,26 +350,19 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu
373
350
  github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
374
351
  github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
375
352
  github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
376
- github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo=
377
353
  github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
378
354
  github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
379
355
  github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
380
356
  github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
381
357
  github.com/montanaflynn/stats v0.6.3/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
382
- github.com/muesli/smartcrop v0.3.0 h1:JTlSkmxWg/oQ1TcLDoypuirdE8Y/jzNirQeLkxpA6Oc=
383
358
  github.com/muesli/smartcrop v0.3.0/go.mod h1:i2fCI/UorTfgEpPPLWiFBv4pye+YAG78RwcQLUkocpI=
384
359
  github.com/neurosnap/sentences v1.0.6/go.mod h1:pg1IapvYpWCJJm/Etxeh0+gtMf1rI1STY9S7eUCPbDc=
385
- github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
386
360
  github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
387
- github.com/niklasfasching/go-org v1.5.0 h1:V8IwoSPm/d61bceyWFxxnQLtlvNT+CjiYIhtZLdnMF0=
388
361
  github.com/niklasfasching/go-org v1.5.0/go.mod h1:sSb8ylwnAG+h8MGFDB3R1D5bxf8wA08REfhjShg3kjA=
389
362
  github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E=
390
- github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
391
363
  github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
392
364
  github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
393
- github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
394
365
  github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
395
- github.com/pelletier/go-toml/v2 v2.0.0-beta.3.0.20210727221244-fa0796069526 h1:o8tGfr0zuKDD+3qIdzD1pK78melGepDQMb55F4Q6qlo=
396
366
  github.com/pelletier/go-toml/v2 v2.0.0-beta.3.0.20210727221244-fa0796069526/go.mod h1:aNseLYu/uKskg0zpr/kbr2z8yGuWtotWf/0BpGIAL2Y=
397
367
  github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
398
368
  github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -410,10 +380,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
410
380
  github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
411
381
  github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
412
382
  github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
413
- github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6 h1:tlXG832s5pa9x9Gs3Rp2rTvEqjiDEuETUOSfBEiTcns=
414
383
  github.com/russross/blackfriday v1.5.3-0.20200218234912-41c5fccfd6f6/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
415
384
  github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
416
- github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc=
417
385
  github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk=
418
386
  github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
419
387
  github.com/sanity-io/litter v1.5.1 h1:dwnrSypP6q56o3lFxTU+t2fwQ9A+U5qrXVO4Qg9KwVU=
@@ -424,18 +392,14 @@ github.com/shogo82148/go-shuffle v0.0.0-20180218125048-27e6095f230d/go.mod h1:2h
424
392
  github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
425
393
  github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
426
394
  github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
427
- github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
428
395
  github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
429
396
  github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
430
397
  github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
431
398
  github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
432
399
  github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk=
433
400
  github.com/spf13/fsync v0.9.0/go.mod h1:fNtJEfG3HiltN3y4cPOz6MLjos9+2pIEqLIgszqhp/0=
434
- github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
435
401
  github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
436
- github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
437
402
  github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
438
- github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44=
439
403
  github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
440
404
  github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
441
405
  github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
@@ -448,7 +412,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
448
412
  github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
449
413
  github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942 h1:t0lM6y/M5IiUZyvbBTcngso8SZEZICH7is9B6g/obVU=
450
414
  github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
451
- github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
452
415
  github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
453
416
  github.com/tdewolff/minify/v2 v2.9.22/go.mod h1:dNlaFdXaIxgSXh3UFASqjTY0/xjpDkkCsYHA1NCGnmQ=
454
417
  github.com/tdewolff/parse/v2 v2.5.21/go.mod h1:WzaJpRSbwq++EIQHYIRTpbYKNA3gn9it1Ik++q4zyho=
@@ -461,9 +424,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
461
424
  github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
462
425
  github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
463
426
  github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
464
- github.com/yuin/goldmark v1.4.4 h1:zNWRjYUW32G9KirMXYHQHVNFkXvMI7LpgNW2AgYAoIs=
465
427
  github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg=
466
- github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691 h1:VWSxtAiQNh3zgHJpdpkpVYjTPqRE3P6UZCOPa1nRDio=
467
428
  github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691/go.mod h1:YLF3kDffRfUH/bTxOxHhV6lxwIB3Vfj91rEwNMS9MXo=
468
429
  go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
469
430
  go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
@@ -501,7 +462,6 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH
501
462
  golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
502
463
  golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
503
464
  golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
504
- golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb h1:fqpd0EBDzlHRCjiphRR5Zo/RSWWQlWv34418dnEixWk=
505
465
  golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
506
466
  golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
507
467
  golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
@@ -568,7 +528,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
568
528
  golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
569
529
  golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
570
530
  golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
571
- golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
572
531
  golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
573
532
  golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
574
533
  golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -595,7 +554,6 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
595
554
  golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
596
555
  golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
597
556
  golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
598
- golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
599
557
  golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
600
558
  golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
601
559
  golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -649,7 +607,6 @@ golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBc
649
607
  golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
650
608
  golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
651
609
  golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
652
- golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365 h1:6wSTsvPddg9gc/mVEEyk9oOAoxn+bT4Z9q1zx+4RwA4=
653
610
  golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
654
611
  golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
655
612
  golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -660,7 +617,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
660
617
  golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
661
618
  golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
662
619
  golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
663
- golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
664
620
  golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
665
621
  golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
666
622
  golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -859,17 +815,14 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ
859
815
  google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
860
816
  gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
861
817
  gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
862
- gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
863
818
  gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
864
819
  gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
865
- gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
866
820
  gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
867
821
  gopkg.in/neurosnap/sentences.v1 v1.0.6/go.mod h1:YlK+SN+fLQZj+kY3r8DkGDhDr91+S3JmTb5LSxFRQo0=
868
822
  gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
869
823
  gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
870
824
  gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
871
825
  gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
872
- gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
873
826
  gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
874
827
  gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
875
828
  gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
@@ -18,6 +18,7 @@
18
18
  package helpers
19
19
 
20
20
  import (
21
+ "html/template"
21
22
  "strings"
22
23
  "unicode"
23
24
 
@@ -62,3 +63,8 @@ func StripHTML(s string) string {
62
63
  }
63
64
  return b.String()
64
65
  }
66
+
67
+ // BytesToHTML converts bytes to type template.HTML.
68
+ func BytesToHTML(b []byte) template.HTML {
69
+ return template.HTML(string(b))
70
+ }
@@ -0,0 +1,96 @@
1
+ // Copyright 2016 The Hugo Authors. All rights reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ package helpers
15
+
16
+ import (
17
+ "bytes"
18
+ "sync"
19
+
20
+ "github.com/kyokomi/emoji/v2"
21
+ )
22
+
23
+ var (
24
+ emojiInit sync.Once
25
+
26
+ emojis = make(map[string][]byte)
27
+
28
+ emojiDelim = []byte(":")
29
+ emojiWordDelim = []byte(" ")
30
+ emojiMaxSize int
31
+ )
32
+
33
+ // Emoji returns the emojy given a key, e.g. ":smile:", nil if not found.
34
+ func Emoji(key string) []byte {
35
+ emojiInit.Do(initEmoji)
36
+ return emojis[key]
37
+ }
38
+
39
+ // Emojify "emojifies" the input source.
40
+ // Note that the input byte slice will be modified if needed.
41
+ // See http://www.emoji-cheat-sheet.com/
42
+ func Emojify(source []byte) []byte {
43
+ emojiInit.Do(initEmoji)
44
+
45
+ start := 0
46
+ k := bytes.Index(source[start:], emojiDelim)
47
+
48
+ for k != -1 {
49
+
50
+ j := start + k
51
+
52
+ upper := j + emojiMaxSize
53
+
54
+ if upper > len(source) {
55
+ upper = len(source)
56
+ }
57
+
58
+ endEmoji := bytes.Index(source[j+1:upper], emojiDelim)
59
+ nextWordDelim := bytes.Index(source[j:upper], emojiWordDelim)
60
+
61
+ if endEmoji < 0 {
62
+ start++
63
+ } else if endEmoji == 0 || (nextWordDelim != -1 && nextWordDelim < endEmoji) {
64
+ start += endEmoji + 1
65
+ } else {
66
+ endKey := endEmoji + j + 2
67
+ emojiKey := source[j:endKey]
68
+
69
+ if emoji, ok := emojis[string(emojiKey)]; ok {
70
+ source = append(source[:j], append(emoji, source[endKey:]...)...)
71
+ }
72
+
73
+ start += endEmoji
74
+ }
75
+
76
+ if start >= len(source) {
77
+ break
78
+ }
79
+
80
+ k = bytes.Index(source[start:], emojiDelim)
81
+ }
82
+
83
+ return source
84
+ }
85
+
86
+ func initEmoji() {
87
+ emojiMap := emoji.CodeMap()
88
+
89
+ for k, v := range emojiMap {
90
+ emojis[k] = []byte(v)
91
+
92
+ if len(k) > emojiMaxSize {
93
+ emojiMaxSize = len(k)
94
+ }
95
+ }
96
+ }
Binary file
@@ -29,6 +29,6 @@ import (
29
29
  _ "hugo-renderer/tpl/strings" // ———————————————— 🥴 TODO: Only the "Go" title formatting is supported
30
30
  // _ "hugo-renderer/tpl/templates" // ——————————— ❗ TODO: Maybe a rabbit hole
31
31
  // _ "hugo-renderer/tpl/time" // ———————————————— ❗ TODO: This relies on lang stuff that is thus far excluded
32
- // _ "hugo-renderer/tpl/transform" // ——————————— TODO: Definitely a rabbit hole
32
+ _ "hugo-renderer/tpl/transform" // —————————————— 🥴 TODO: Highlight, unmarshal, commonmark compat
33
33
  // _ "hugo-renderer/tpl/urls" // ———————————————— ❗ TODO: Relies on pathspec that relies on FS impls
34
34
  )
@@ -380,6 +380,7 @@ func (ns *Namespace) IsSet(a interface{}, key interface{}) (bool, error) {
380
380
  return av.MapIndex(kv).IsValid(), nil
381
381
  }
382
382
  default:
383
+ // Bookshop: Removed deep Hugo function.
383
384
  // helpers.DistinctErrorLog.Printf("WARNING: calling IsSet with unsupported type %q (%T) will always return false.\n", av.Kind(), a)
384
385
  }
385
386
 
@@ -20,6 +20,8 @@ import (
20
20
  "hugo-renderer/deps"
21
21
  )
22
22
 
23
+ // Bookshop: This file has been stripped due to irrelevancy with live editing.
24
+
23
25
  // New returns a new instance of the fmt-namespaced template functions.
24
26
  func New(d *deps.Deps) *Namespace {
25
27
  return &Namespace{}
@@ -26,6 +26,8 @@ import (
26
26
  "hugo-renderer/deps"
27
27
  )
28
28
 
29
+ // Bookshop: This file has been stripped to only support Bookshop partials when live editing.
30
+
29
31
  // New returns a new instance of the templates-namespaced template functions.
30
32
  func New(deps *deps.Deps) *Namespace {
31
33
  return &Namespace{}
@@ -0,0 +1,106 @@
1
+ // Copyright 2017 The Hugo Authors. All rights reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ package transform
15
+
16
+ import (
17
+ "hugo-renderer/deps"
18
+ "hugo-renderer/tpl/internal"
19
+ )
20
+
21
+ const name = "transform"
22
+
23
+ func init() {
24
+ f := func(d *deps.Deps) *internal.TemplateFuncsNamespace {
25
+ ctx := New(d)
26
+
27
+ ns := &internal.TemplateFuncsNamespace{
28
+ Name: name,
29
+ Context: func(args ...interface{}) (interface{}, error) { return ctx, nil },
30
+ }
31
+
32
+ ns.AddMethodMapping(ctx.Emojify,
33
+ []string{"emojify"},
34
+ [][2]string{
35
+ {`{{ "I :heart: Hugo" | emojify }}`, `I ❤️ Hugo`},
36
+ },
37
+ )
38
+
39
+ ns.AddMethodMapping(ctx.Highlight,
40
+ []string{"highlight"},
41
+ [][2]string{},
42
+ )
43
+
44
+ ns.AddMethodMapping(ctx.HTMLEscape,
45
+ []string{"htmlEscape"},
46
+ [][2]string{
47
+ {
48
+ `{{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | safeHTML}}`,
49
+ `Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;`,
50
+ },
51
+ {
52
+ `{{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>"}}`,
53
+ `Cathal Garvey &amp;amp; The Sunshine Band &amp;lt;cathal@foo.bar&amp;gt;`,
54
+ },
55
+ {
56
+ `{{ htmlEscape "Cathal Garvey & The Sunshine Band <cathal@foo.bar>" | htmlUnescape | safeHTML }}`,
57
+ `Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
58
+ },
59
+ },
60
+ )
61
+
62
+ ns.AddMethodMapping(ctx.HTMLUnescape,
63
+ []string{"htmlUnescape"},
64
+ [][2]string{
65
+ {
66
+ `{{ htmlUnescape "Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;" | safeHTML}}`,
67
+ `Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
68
+ },
69
+ {
70
+ `{{"Cathal Garvey &amp;amp; The Sunshine Band &amp;lt;cathal@foo.bar&amp;gt;" | htmlUnescape | htmlUnescape | safeHTML}}`,
71
+ `Cathal Garvey & The Sunshine Band <cathal@foo.bar>`,
72
+ },
73
+ {
74
+ `{{"Cathal Garvey &amp;amp; The Sunshine Band &amp;lt;cathal@foo.bar&amp;gt;" | htmlUnescape | htmlUnescape }}`,
75
+ `Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;`,
76
+ },
77
+ {
78
+ `{{ htmlUnescape "Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;" | htmlEscape | safeHTML }}`,
79
+ `Cathal Garvey &amp; The Sunshine Band &lt;cathal@foo.bar&gt;`,
80
+ },
81
+ },
82
+ )
83
+
84
+ ns.AddMethodMapping(ctx.Markdownify,
85
+ []string{"markdownify"},
86
+ [][2]string{
87
+ {`{{ .Title | markdownify}}`, `<strong>BatMan</strong>`},
88
+ },
89
+ )
90
+
91
+ ns.AddMethodMapping(ctx.Plainify,
92
+ []string{"plainify"},
93
+ [][2]string{
94
+ {`{{ plainify "Hello <strong>world</strong>, gophers!" }}`, `Hello world, gophers!`},
95
+ },
96
+ )
97
+
98
+ // Bookshop: remarshal has been intentionally removed due to instability
99
+
100
+ // Bookshop: unmarshal has been removed (for now) due to tendrils
101
+
102
+ return ns
103
+ }
104
+
105
+ internal.AddTemplateFuncsNamespace(f)
106
+ }
@@ -0,0 +1,113 @@
1
+ // Copyright 2017 The Hugo Authors. All rights reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+
14
+ // Package transform provides template functions for transforming content.
15
+ package transform
16
+
17
+ import (
18
+ "html"
19
+ "html/template"
20
+
21
+ "github.com/gomarkdown/markdown"
22
+
23
+ "hugo-renderer/deps"
24
+
25
+ "hugo-renderer/helpers"
26
+
27
+ "github.com/spf13/cast"
28
+ )
29
+
30
+ // New returns a new instance of the transform-namespaced template functions.
31
+ func New(deps *deps.Deps) *Namespace {
32
+ // Bookshop: Build listeners & cache intentionally removed
33
+
34
+ return &Namespace{
35
+ deps: deps,
36
+ }
37
+ }
38
+
39
+ // Namespace provides template functions for the "transform" namespace.
40
+ type Namespace struct {
41
+ // Bookshop: Build listeners & cache intentionally removed
42
+ deps *deps.Deps
43
+ }
44
+
45
+ // Emojify returns a copy of s with all emoji codes replaced with actual emojis.
46
+ //
47
+ // See http://www.emoji-cheat-sheet.com/
48
+ func (ns *Namespace) Emojify(s interface{}) (template.HTML, error) {
49
+ ss, err := cast.ToStringE(s)
50
+ if err != nil {
51
+ return "", err
52
+ }
53
+
54
+ return template.HTML(helpers.Emojify([]byte(ss))), nil
55
+ }
56
+
57
+ // Highlight returns a copy of s as an HTML string with syntax
58
+ // highlighting applied.
59
+ func (ns *Namespace) Highlight(s interface{}, lang string, opts ...interface{}) (template.HTML, error) {
60
+ ss, err := cast.ToStringE(s)
61
+ if err != nil {
62
+ return "", err
63
+ }
64
+
65
+ // Bookshop: Highlighting logic intentionally removed for bloat
66
+
67
+ return template.HTML(ss), nil
68
+ }
69
+
70
+ // HTMLEscape returns a copy of s with reserved HTML characters escaped.
71
+ func (ns *Namespace) HTMLEscape(s interface{}) (string, error) {
72
+ ss, err := cast.ToStringE(s)
73
+ if err != nil {
74
+ return "", err
75
+ }
76
+
77
+ return html.EscapeString(ss), nil
78
+ }
79
+
80
+ // HTMLUnescape returns a copy of with HTML escape requences converted to plain
81
+ // text.
82
+ func (ns *Namespace) HTMLUnescape(s interface{}) (string, error) {
83
+ ss, err := cast.ToStringE(s)
84
+ if err != nil {
85
+ return "", err
86
+ }
87
+
88
+ return html.UnescapeString(ss), nil
89
+ }
90
+
91
+ // Markdownify renders a given input from Markdown to HTML.
92
+ func (ns *Namespace) Markdownify(s interface{}) (template.HTML, error) {
93
+ ss, err := cast.ToStringE(s)
94
+ if err != nil {
95
+ return "", err
96
+ }
97
+
98
+ // Bookshop: markdownify implementation has been intentionally modified for bloat
99
+ // This includes using a different (smaller) markdown implementation.
100
+ output := markdown.ToHTML([]byte(ss), nil, nil)
101
+
102
+ return helpers.BytesToHTML(output), nil
103
+ }
104
+
105
+ // Plainify returns a copy of s with all HTML tags removed.
106
+ func (ns *Namespace) Plainify(s interface{}) (string, error) {
107
+ ss, err := cast.ToStringE(s)
108
+ if err != nil {
109
+ return "", err
110
+ }
111
+
112
+ return helpers.StripHTML(ss), nil
113
+ }
@@ -0,0 +1,19 @@
1
+ cd tpl
2
+ HUGO_LOC="../../../../../../../Scratchpad/hugo/tpl"
3
+
4
+ # Check Hugo loc
5
+ if [ ! -d $HUGO_LOC ]; then
6
+ echo "ERROR: hugo repo does not exist (on Liam's machine)"
7
+ exit 1
8
+ fi
9
+
10
+ for LOCAL_FILE in **/*.go; do
11
+ if [[ ! $LOCAL_FILE == *bookshop* ]]; then
12
+ HUGO_FILE="$HUGO_LOC/$LOCAL_FILE"
13
+ if [ ! -f $HUGO_FILE ]; then
14
+ echo "WARN: File $LOCAL_FILE doesn't exist in Hugo as $HUGO_FILE"
15
+ else
16
+ cp $HUGO_FILE $LOCAL_FILE
17
+ fi
18
+ fi
19
+ done
package/lib/engine.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import hugoWasm from "../hugo-renderer/hugo_renderer.wasm";
2
2
  import translateTextTemplate from './translateTextTemplate.js';
3
3
  import { IdentifierParser } from './hugoIdentifierParser.js';
4
+ import { version } from '../package.json';
4
5
 
5
6
  const sleep = (ms = 0) => {
6
7
  return new Promise(r => setTimeout(r, ms));
@@ -24,18 +25,17 @@ export class Engine {
24
25
  this.key = 'hugo';
25
26
  this.name = options.name;
26
27
  this.files = options.files;
28
+ this.origin = document.currentScript?.src || `/bookshop.js`;
27
29
 
28
30
  this.initializeHugo();
29
31
  }
30
32
 
31
33
  async initializeHugo() {
32
- const scriptOrigin = document.currentScript?.src || `/bookshop.js`;
33
- const wasmOrigin = scriptOrigin.replace(/\/[^\.\/]+\.js$/, hugoWasm.replace(/^\./, ''));
34
- const go = new Go();
35
- const response = await fetch(wasmOrigin);
36
- const buffer = await response.arrayBuffer();
37
- const result = await WebAssembly.instantiate(buffer, go.importObject);
38
- go.run(result.instance)
34
+ if (window.CloudCannon?.isMocked) {
35
+ await this.initializeLocalHugo();
36
+ } else {
37
+ await this.initializeRemoteHugo();
38
+ }
39
39
 
40
40
  // TODO: Tidy
41
41
  const mappedFiles = {};
@@ -48,6 +48,33 @@ export class Engine {
48
48
  const success = window.loadHugoBookshopPartials(JSON.stringify(mappedFiles));
49
49
  }
50
50
 
51
+ async initializeRemoteHugo() {
52
+ try {
53
+ const go = new Go();
54
+ const remoteWasmOrigin = `https://cdn.bookshop.build/hugo/hugo_renderer_${version}.wasm`;
55
+ const remoteResponse = await fetch(remoteWasmOrigin);
56
+ const remoteBuffer = await remoteResponse.arrayBuffer();
57
+
58
+ // Check the magic word at the start of the buffer as a way to verify the CDN download worked.
59
+ const isWasm = ([...new Uint8Array(remoteBuffer, 0, 4)]).map(g => g.toString(16).padStart(2, '0')).join('') === "0061736d";
60
+ if (!isWasm) throw "Not WASM";
61
+
62
+ const remoteResult = await WebAssembly.instantiate(remoteBuffer, go.importObject);
63
+ go.run(remoteResult.instance);
64
+ } catch (e) {
65
+ await this.initializeLocalHugo();
66
+ }
67
+ }
68
+
69
+ async initializeLocalHugo() {
70
+ const go = new Go();
71
+ const wasmOrigin = this.origin.replace(/\/[^\.\/]+\.js$/, hugoWasm.replace(/^\./, ''));
72
+ const response = await fetch(wasmOrigin);
73
+ const buffer = await response.arrayBuffer();
74
+ const result = await WebAssembly.instantiate(buffer, go.importObject);
75
+ go.run(result.instance);
76
+ }
77
+
51
78
  getShared(name) {
52
79
  const key = `shared/hugo/${name}.hugo.html`
53
80
  return this.files?.[key];
@@ -22,6 +22,13 @@ export class IdentifierParser {
22
22
 
23
23
  // Some short-circuits for easy to regex patterns to skip the parser
24
24
  tryShortCircuit() {
25
+ // change an index of . to be only the index
26
+ const indexDotFunc = /^\s*\(\s*index\s+(?:\(\s*\.\s*\)|\.)\s+(\d+)\s*\)\s*$/
27
+ if (indexDotFunc.test(this.input)) {
28
+ const [, index] = this.input.match(indexDotFunc);
29
+ return `${index}`;
30
+ }
31
+
25
32
  // change the index function into Bookshop dot notation
26
33
  const indexFunc = /^\s*\(\s*index\s+\(?\.?(.+?)\)?\s+(\d+)\s*\)\s*$/
27
34
  if (indexFunc.test(this.input)) {
@@ -30,7 +37,6 @@ export class IdentifierParser {
30
37
  }
31
38
 
32
39
  // strip the leading . from basic variable references
33
- const variableDot = /^\s*\.([^\.\s])/;
34
40
  if (/^\s*\./.test(this.input)) {
35
41
  return this.input.replace(/^\s*\.([^\.\s])/, '$1');
36
42
  }
@@ -66,7 +66,26 @@ test(`Nested dicts and slices`, async t => {
66
66
  });
67
67
 
68
68
  test(`Converts an index into dot notation`, async t => {
69
- const ident = `(index (.items) 5)`;
70
- const output = (new IdentifierParser(ident)).build();
69
+ let ident = `(index (.items) 5)`;
70
+ let output = (new IdentifierParser(ident)).build();
71
71
  t.deepEqual(output, `items.5`);
72
+
73
+ ident = `(index .array 5)`;
74
+ output = (new IdentifierParser(ident)).build();
75
+ t.deepEqual(output, `array.5`);
76
+
77
+ ident = `(index $variable 5)`;
78
+ output = (new IdentifierParser(ident)).build();
79
+ t.deepEqual(output, `$variable.5`);
80
+ });
81
+
82
+
83
+ test(`Converts a dot index into a JS object property`, async t => {
84
+ let ident = `(index (.) 5)`;
85
+ let output = (new IdentifierParser(ident)).build();
86
+ t.deepEqual(output, `5`);
87
+
88
+ ident = `(index . 1234)`;
89
+ output = (new IdentifierParser(ident)).build();
90
+ t.deepEqual(output, `1234`);
72
91
  });
@@ -5,9 +5,11 @@ const tokens = {
5
5
  BEGIN: /{{\s*(if)/,
6
6
  BEGIN_SCOPED: /{{\s*(range|with|define|block|template)/,
7
7
  LOOP: /{{\s*range\s+(.+?)\s*}}/,
8
+ INDEX_LOOP: /{{\s*range\s+(\$.+), \$.+ := (.+?)\s*}}/,
8
9
  ASSIGN: /{{\s*(\$\S+)\s+:=\s+(.+?)\s*}}/,
9
10
  WITH: /{{\s*with\s+(.+?)\s*}}/,
10
- BOOKSHOP: /{{\s*partial\s+"bookshop(?:_partial)?"\s+\(\s*slice\s+"(.+?)" (.+?)\s*\)\s*}}/,
11
+ BOOKSHOP: /{{\s*partial\s+"bookshop"\s+\(\s*slice\s+"(.+?)" (.+?)\s*\)\s*}}/,
12
+ BOOKSHOP_SCOPED: /{{\s*partial\s+"bookshop"\s+\(?\s*\.\s*\)?\s*}}/,
11
13
  }
12
14
 
13
15
  /**
@@ -39,7 +41,12 @@ const rewriteTag = function (token, src, endTags, liveMarkup) {
39
41
  matchingEnd.text = `{{ \`<!--bookshop-live unstack-->\` | safeHTML }}${matchingEnd.text}`;
40
42
  }
41
43
 
42
- if (liveMarkup && tokens.LOOP.test(raw)) {
44
+ if (liveMarkup && tokens.INDEX_LOOP.test(raw)) {
45
+ let [, index_variable, iterator] = raw.match(tokens.INDEX_LOOP);
46
+ outputToken.text = [`${outputToken.text}`,
47
+ `{{ (printf \`<!--bookshop-live context(.: (index (${iterator}) %d))-->\` ${index_variable}) | safeHTML }}`
48
+ ].join('')
49
+ } else if (liveMarkup && tokens.LOOP.test(raw)) {
43
50
  let [, iterator] = raw.match(tokens.LOOP);
44
51
  outputToken.text = [`{{ $bookshop__live__iterator := 0 }}`,
45
52
  `${outputToken.text}`,
@@ -48,13 +55,19 @@ const rewriteTag = function (token, src, endTags, liveMarkup) {
48
55
  ].join('')
49
56
  } else if (liveMarkup && tokens.ASSIGN.test(raw)) {
50
57
  let [, identifier, value] = raw.match(tokens.ASSIGN);
51
- outputToken.text = `${outputToken.text}{{ \`<!--bookshop-live context(${identifier}: ${value})-->\` | safeHTML }}`
58
+ outputToken.text = `${outputToken.text}{{ \`<!--bookshop-live context(${identifier}: (${value}))-->\` | safeHTML }}`
52
59
  } else if (liveMarkup && tokens.WITH.test(raw)) {
53
60
  let [, value] = raw.match(tokens.WITH);
54
- outputToken.text = `${outputToken.text}{{ \`<!--bookshop-live context(.: ${value})-->\` | safeHTML }}`
61
+ outputToken.text = `${outputToken.text}{{ \`<!--bookshop-live context(.: (${value}))-->\` | safeHTML }}`
55
62
  } else if (liveMarkup && tokens.BOOKSHOP.test(raw)) {
56
63
  let [, name, params] = raw.match(tokens.BOOKSHOP);
57
- outputToken.text = `{{ \`<!--bookshop-live name(${name}) params(.: ${params})-->\` | safeHTML }}${outputToken.text}{{ \`<!--bookshop-live end-->\` | safeHTML }}`
64
+ outputToken.text = `{{ \`<!--bookshop-live name(${name}) params(.: (${params}))-->\` | safeHTML }}${outputToken.text}{{ \`<!--bookshop-live end-->\` | safeHTML }}`
65
+ } else if (liveMarkup && tokens.BOOKSHOP_SCOPED.test(raw)) {
66
+ outputToken.text = [`{{ if reflect.IsSlice . }}{{ (printf \`<!--bookshop-live name(%s) params(.: .)-->\` (index . 0)) | safeHTML }}`,
67
+ `{{- else if reflect.IsMap . -}}{{ (printf \`<!--bookshop-live name(%s) params(.: .)-->\` ._bookshop_name) | safeHTML }}{{ end }}`,
68
+ `${outputToken.text}`,
69
+ `{{ \`<!--bookshop-live end-->\` | safeHTML }}`
70
+ ].join('');
58
71
  }
59
72
 
60
73
  return outputToken;
@@ -4,26 +4,37 @@ import translateTextTemplate from './translateTextTemplate.js';
4
4
  test("add live markup to bookshop tags", t => {
5
5
  const input = `{{ partial "bookshop" (slice "content" (dict "content_html" .Params.note_html "type" "note")) }}`;
6
6
  const expected = [
7
- `{{ \`<!--bookshop-live name(content) params(.: (dict "content_html" .Params.note_html "type" "note"))-->\` | safeHTML }}`,
7
+ `{{ \`<!--bookshop-live name(content) params(.: ((dict "content_html" .Params.note_html "type" "note")))-->\` | safeHTML }}`,
8
8
  `{{ partial "bookshop" (slice "content" (dict "content_html" .Params.note_html "type" "note")) }}`,
9
9
  `{{ \`<!--bookshop-live end-->\` | safeHTML }}`
10
10
  ].join('');
11
11
  t.is(translateTextTemplate(input, {}), expected);
12
12
  });
13
13
 
14
- test("add live markup to bookshop_partial tags", t => {
15
- const input = `{{ partial "bookshop_partial" (slice "helper" (dict "text" "input")) }}`;
14
+ test("add live markup to scoped bookshop tags", t => {
15
+ const input = `{{ partial "bookshop" . }}`;
16
16
  const expected = [
17
- `{{ \`<!--bookshop-live name(helper) params(.: (dict "text" "input"))-->\` | safeHTML }}`,
18
- `{{ partial "bookshop_partial" (slice "helper" (dict "text" "input")) }}`,
17
+ `{{ if reflect.IsSlice . }}{{ (printf \`<!--bookshop-live name(%s) params(.: .)-->\` (index . 0)) | safeHTML }}`,
18
+ `{{- else if reflect.IsMap . -}}{{ (printf \`<!--bookshop-live name(%s) params(.: .)-->\` ._bookshop_name) | safeHTML }}{{ end }}`,
19
+ `{{ partial "bookshop" . }}`,
19
20
  `{{ \`<!--bookshop-live end-->\` | safeHTML }}`
20
21
  ].join('');
21
22
  t.is(translateTextTemplate(input, {}), expected);
22
23
  });
23
24
 
25
+ test("don't add live markup to bookshop_partial tags", t => {
26
+ const input = `{{ partial "bookshop_partial" (slice "helper" (dict "text" "input")) }}`;
27
+ const expected = `{{ partial "bookshop_partial" (slice "helper" (dict "text" "input")) }}`;
28
+ t.is(translateTextTemplate(input, {}), expected);
29
+ });
30
+
24
31
  test("add live markup to assigns", t => {
25
- const input = `{{ $a := .b }}`;
26
- const expected = `{{ $a := .b }}{{ \`<!--bookshop-live context($a: .b)-->\` | safeHTML }}`;
32
+ let input = `{{ $a := .b }}`;
33
+ let expected = `{{ $a := .b }}{{ \`<!--bookshop-live context($a: (.b))-->\` | safeHTML }}`;
34
+ t.is(translateTextTemplate(input, {}), expected);
35
+
36
+ input = `{{ $a := .b | chomp }}`;
37
+ expected = `{{ $a := .b | chomp }}{{ \`<!--bookshop-live context($a: (.b | chomp))-->\` | safeHTML }}`;
27
38
  t.is(translateTextTemplate(input, {}), expected);
28
39
  });
29
40
 
@@ -31,7 +42,7 @@ test("add live markup to withs", t => {
31
42
  const input = `{{ with .b }}<p>{{.}}</p>{{ end }}`;
32
43
  const expected = [`{{ with .b }}`,
33
44
  `{{ \`<!--bookshop-live stack-->\` | safeHTML }}`,
34
- `{{ \`<!--bookshop-live context(.: .b)-->\` | safeHTML }}`,
45
+ `{{ \`<!--bookshop-live context(.: (.b))-->\` | safeHTML }}`,
35
46
  `<p>{{.}}</p>`,
36
47
  `{{ \`<!--bookshop-live unstack-->\` | safeHTML }}`,
37
48
  `{{ end }}`
@@ -53,6 +64,18 @@ test("add live markup to loops", t => {
53
64
  t.is(translateTextTemplate(input, {}), expected);
54
65
  });
55
66
 
67
+ test("add live markup to loops with iterators", t => {
68
+ const input = `{{range $loop_index, $element := .columns}}<p>{{$element}}</p>{{ end }}`;
69
+ const expected = [`{{range $loop_index, $element := .columns}}`,
70
+ `{{ \`<!--bookshop-live stack-->\` | safeHTML }}`,
71
+ `{{ (printf \`<!--bookshop-live context(.: (index (.columns) %d))-->\` $loop_index) | safeHTML }}`,
72
+ `<p>{{$element}}</p>`,
73
+ `{{ \`<!--bookshop-live unstack-->\` | safeHTML }}`,
74
+ `{{ end }}`
75
+ ].join('');
76
+ t.is(translateTextTemplate(input, {}), expected);
77
+ });
78
+
56
79
  test("add live markup to complex end structures", t => {
57
80
  const input = `
58
81
  {{ range .items }}
@@ -73,14 +96,14 @@ test("add live markup to complex end structures", t => {
73
96
  const expected = `
74
97
  {{ $bookshop__live__iterator := 0 }}{{ range .items }}{{ \`<!--bookshop-live stack-->\` | safeHTML }}{{ (printf \`<!--bookshop-live context(.: (index (.items) %d))-->\` $bookshop__live__iterator) | safeHTML }}{{ $bookshop__live__iterator = (add $bookshop__live__iterator 1) }}
75
98
 
76
- {{with .text}}{{ \`<!--bookshop-live stack-->\` | safeHTML }}{{ \`<!--bookshop-live context(.: .text)-->\` | safeHTML }}
99
+ {{with .text}}{{ \`<!--bookshop-live stack-->\` | safeHTML }}{{ \`<!--bookshop-live context(.: (.text))-->\` | safeHTML }}
77
100
  <p>{{ . }}</p>
78
101
  {{ \`<!--bookshop-live unstack-->\` | safeHTML }}{{ end }}
79
102
 
80
103
  {{ if .subtitle }}
81
104
  <h2>{{ .subtitle }}</h2>
82
105
  {{ else }}
83
- {{ with .excerpt }}{{ \`<!--bookshop-live stack-->\` | safeHTML }}{{ \`<!--bookshop-live context(.: .excerpt)-->\` | safeHTML }}
106
+ {{ with .excerpt }}{{ \`<!--bookshop-live stack-->\` | safeHTML }}{{ \`<!--bookshop-live context(.: (.excerpt))-->\` | safeHTML }}
84
107
  <p>{{ . }}</p>
85
108
  {{ \`<!--bookshop-live unstack-->\` | safeHTML }}{{end}}
86
109
  {{ end }}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bookshop/hugo-engine",
3
3
  "packageManager": "yarn@3.0.0",
4
- "version": "2.4.0-hugo.3",
4
+ "version": "2.4.2",
5
5
  "description": "Bookshop frontend Hugo renderer",
6
6
  "type": "module",
7
7
  "sideEffects": false,
@@ -29,7 +29,7 @@
29
29
  "nyc": "^15.1.0"
30
30
  },
31
31
  "dependencies": {
32
- "@bookshop/helpers": "2.4.0-hugo.3",
32
+ "@bookshop/helpers": "2.4.2",
33
33
  "esbuild": "^0.13.10",
34
34
  "liquidjs": "9.28.0"
35
35
  },
@@ -1 +0,0 @@
1
- {"parent":null,"pid":8768,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/cli.js","-v"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643516282634,"ppid":8749,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2.json","externalId":"","uuid":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","files":[]}
@@ -1 +0,0 @@
1
- {"parent":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","pid":8805,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643516283165,"ppid":8768,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/6e19d05c-cf57-446d-a6c8-7daaaf0e7db6.json","externalId":"","uuid":"6e19d05c-cf57-446d-a6c8-7daaaf0e7db6","files":[]}
@@ -1 +0,0 @@
1
- {"parent":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","pid":8806,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643516283171,"ppid":8768,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/7f3f24c5-d070-4832-a421-c10f43bb42c3.json","externalId":"","uuid":"7f3f24c5-d070-4832-a421-c10f43bb42c3","files":[]}
@@ -1 +0,0 @@
1
- {"parent":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","pid":8807,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643516283175,"ppid":8768,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/aa72646f-c2f6-4103-b57f-22eacd776b6f.json","externalId":"","uuid":"aa72646f-c2f6-4103-b57f-22eacd776b6f","files":[]}
@@ -1 +0,0 @@
1
- {"parent":"05cdaf09-20ac-4f20-a9c6-2b88c3a0faf2","pid":8808,"argv":["/Users/liambigelow/.nvm/versions/node/v14.16.0/bin/node","/Users/liambigelow/Projects/CC/bookshop/javascript-modules/node_modules/ava/lib/worker/subprocess.js"],"execArgv":[],"cwd":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine","time":1643516283179,"ppid":8768,"coverageFilename":"/Users/liambigelow/Projects/CC/bookshop/javascript-modules/engines/hugo-engine/.nyc_output/c924a9c2-577c-44b7-9c5c-b515d364fc95.json","externalId":"","uuid":"c924a9c2-577c-44b7-9c5c-b515d364fc95","files":[]}