hextra
hextra copied to clipboard
Mermaid diagram not working for index page
I'm starting to learn hugo. When using hextra via https://github.com/imfing/hextra-starter-template and cloning the repository on a PC, the test page with mermaid diagrams works, but I'm confused by the absence of the rest of the hugo folders in the project. Installation according to instructions:
- Hugo Modules (Recommended)
- Git Submodule
mermaid diagrams doesn't work
- v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended windows/amd64 BuildDate=2024-01-26T15:54:24Z VendorInfo=gohugoio
- Chrome, Windows
- 0.7.2
Hi can you provide a little more details, like the commands you use and some screenshots?
terminal:
index file:
hugo.yaml
site page:
Can you use the template repository hugo.yaml
config file?
https://github.com/imfing/hextra-starter-template
hugo server did not start
can you try commenting out the module
section in the config file?
got this result
Copied content files to the created site from exampleSite
It may be necessary to update the template installation information. Repeating steps from the instructions does not bring the desired result
I copied all the files from the folders \my-site\themes\hextra: /assets, /data, /images, /layouts, /static and everything worked. The instructions for getting a working website are different from what we already have. It is not clear how to automatically update the theme files; when they are updated, this operation will have to be done manually, this is not the result that I expect.
@temiraevpg I recommend using the Hugo modules to initialize the site: https://imfing.github.io/hextra/docs/getting-started/#setup-hextra-as-hugo-module
or simply create a repo using the imfing/hextra-starter-template
I will look into the issue with using Git submodules.
@temiraevpg I think it was by design that Mermaid will not be enabled in the homepage. I will provide an option to override this behavior in the future.
In the meantime, if you follow the initial steps, and put the mermaid block in docs/_index.md
which would display as normal.
Let me know if this works.
You are completely right it works. Doesn't work on the main page.
@imfing, is there anything we can do to get Mermaid working for the index page? I see this commit that disabled it: https://github.com/imfing/hextra/commit/666ad3f79f123f25ad8a8e86227d40f784d59d1b
I don't see a mention as to why it was disabled, and so far everything works without the check for the main page in my tests
@DragonStorm97
it was disabled on the home page due to a weird behavior
https://github.com/imfing/hextra/blob/086af4d173388016ef7717d94df58e1b6b7ed57b/layouts/partials/scripts.html#L35-L36
if you need mermaid in the homepage, I think you could insert these lines in your index page Markdown file.
https://mermaid.js.org/intro/getting-started.html