bep / docuapi

Beautiful multilingual API documentation theme for Hugo
https://docuapi.netlify.app/
Other
750 stars 200 forks source link

Failed with baseURL that contains a path. #27

Closed ldez closed 5 years ago

ldez commented 5 years ago

The theme fail when a baseURL contains a path.

Works:

baseURL = "https://mydomain.com/"

Doesn't works:

baseURL = "https://mydomain.com/content/"

Configuration:

baseURL = "https://mydomain.com/content/"
languageCode = "en-us"
title = "test"
theme = "github.com/bep/docuapi"

disableKinds = ["taxonomyTerm"]

# Code higlighting settings
pygmentsCodefences = true
pygmentsCodeFencesGuesSsyntax = false
pygmentsOptions = ""
pygmentsStyle = "monokai"
pygmentsUseClasses = false

[params]
  search = true

Logs:

ERROR 2019/08/15 19:17:56 Lib not found: "//= require ./all_nosearch"
ERROR 2019/08/15 19:17:56 Lib not found: "//= require ./app/_search"
ERROR 2019/08/15 19:17:56 Lib not found: "//= require ./lib/_energize"
ERROR 2019/08/15 19:17:56 Lib not found: "//= require ./app/_toc"
ERROR 2019/08/15 19:17:56 Lib not found: "//= require ./app/_lang"
Total in 1149 ms
Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: _default/list.html:9:7: executing "_default/list.html" at <partial "js.html" .>: error calling partial: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/bep/docuapi@v1.2.0/layouts/partials/js.html:10:33": execute of template failed: template: partials/js.html:5:13: executing "partials/js.html" at <partialCached "funcs/get_and_concat.html" (dict "imports" $importsAll "target" "js/all.js") "all">: error calling partialCached: "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/bep/docuapi@v1.2.0/layouts/partials/funcs/get_and_concat.html:10:33": execute of template failed: template: partials/funcs/get_and_concat.html:10:33: executing "partials/funcs/get_and_concat.html" at <resources.Concat>: error calling Concat: slice []interface {} not supported in concat
bep commented 5 years ago

That is ... strange.

bep commented 5 years ago

OK; I see the flaw.

ldez commented 5 years ago

FYI the theme doesn't with hugo mod vendor because some files are missing (like postcss.config.js).

Also, I have to add a package.json file with the following content:

{
  "name": "@ldez/hugo-local",
  "private": true,
  "dependencies": {
    "autoprefixer": "^9.6.1",
    "postcss-cli": "^6.1.3"
  }
}
ldez commented 5 years ago

And thanks for the quick fix :+1:

bep commented 5 years ago

Yes, I understand the postCSS etc. issues; I have a note in the README and a mental note about doing something about it, but time is ...

bep commented 5 years ago

... also, I welcome any PR to improve this.