hwayne / learntla

A TLA+ guide
http://www.learntla.com
Creative Commons Attribution 4.0 International
278 stars 57 forks source link

fix(shortcode): Use strings instead of int #82

Closed robzienert closed 4 years ago

robzienert commented 4 years ago

Environment:

$ hugo server
Building sites … WARN 2020/03/05 13:11:09 Page.Hugo is deprecated and will be removed in a future release. Use the global hugo function.
WARN 2020/03/05 13:11:09 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url
WARN 2020/03/05 13:11:09 Page.UniqueID is deprecated and will be removed in a future release. Use .File.UniqueID
WARN 2020/03/05 13:11:09 .File.UniqueID on zero object. Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}
Built in 64 ms
Error: Error building site: "/Users/rzienert/scratch/learntla/content/introduction/example/_index.md:56:1": failed to render shortcode "code": failed to process shortcode: "/Users/rzienert/scratch/learntla/layouts/shortcodes/code.html:2:29": execute of template failed: template: shortcodes/code.html:2:29: executing "shortcodes/code.html" at <readFile $path>: error calling readFile: file "content/introduction/example/tla/%!s(int=3).tla" does not exist

After changing these ints to strings, the site compiles successfully:

Building sites … WARN 2020/03/05 13:12:32 Page.Hugo is deprecated and will be removed in a future release. Use the global hugo function.
WARN 2020/03/05 13:12:32 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url
WARN 2020/03/05 13:12:32 Page.UniqueID is deprecated and will be removed in a future release. Use .File.UniqueID
WARN 2020/03/05 13:12:32 .File.UniqueID on zero object. Wrap it in if or with: {{ with .File }}{{ .UniqueID }}{{ end }}

                   | EN
-------------------+-----
  Pages            | 69
  Paginator pages  |  0
  Non-page files   | 58
  Static files     | 69
  Processed images |  0
  Aliases          |  0
  Sitemaps         |  1
  Cleaned          |  0

Built in 67 ms