dgraph-io / badger

Fast key-value DB in Go.

Home Page:https://dgraph.io/badger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Documentation]: Doc is missing

vinicius73 opened this issue · comments

What version of Badger is the target?

No response

Documentation.

The actual doc is missing (404)

https://dgraph.io/docs/badger
https://dgraph.io/open-source

Additional information.

No response

@vinicius73 Probably the issue is related to Hugo build. Trying to build the site I see this error:

➜ hugo server
Start building sites … 
hugo v0.104.3+extended darwin/arm64 BuildDate=unknown
...
ERROR 2023/08/26 13:01:18 render of "section" failed: "<mydir>/badger/docs/themes/hugo-docs/layouts/_default/section.html:1:3": execute of template failed: template: _default/section.html:1:3: executing "_default/section.html" at <partial "header.html" .>: error calling partial: "<mydir>/badger/docs/themes/hugo-docs/layouts/partials/header.html:6:12": execute of template failed: template: partials/header.html:6:12: executing "partials/header.html" at <.Hugo.Generator>: can't evaluate field Hugo in type *hugolib.pageState
Error: Error building site: failed to render pages: render of "home" failed: "<mydir>/badger/docs/themes/hugo-docs/layouts/index.html:1:3": execute of template failed: template: index.html:1:3: executing "index.html" at <partial "header.html" .>: error calling partial: "<mydir>/badger/docs/themes/hugo-docs/layouts/partials/header.html:6:12": execute of template failed: template: partials/header.html:6:12: executing "partials/header.html" at <.Hugo.Generator>: can't evaluate field Hugo in type *hugolib.pageState
Built in 17 ms

I'm not very familiar with Hugo, but after a small search it seems that a issue is in partials/header.html:

-    {{ .Hugo.Generator }}
+    {{ hugo.Generator }}

additionally, partials/sidebar.html and partials/request-edit.html are calling getenv for disallowed environment variables.

Allowing VERSIONS and CURRENT_BRANCH in config.toml should be enough:

[security]
  [security.funcs]
    getenv = ['^HUGO_', '^VERSIONS$', '^CURRENT_BRANCH$']

After making these changes I'm building the site without errors.

Hi @vinicius73 , sorry for the inconvenience. For now you can find the docs hosted here. We are doing some maintenance work on our website and not everything has been updated yet.

Thanks @marcozac , that's a good catch. We build the site with a slightly older version of Hugo (v0.85) which doesn't run into that particular issue, but that does look like a good fix for building on the latest Hugo.