hextra icon indicating copy to clipboard operation
hextra copied to clipboard

Mermaid diagram not working for index page

Open temiraevpg opened this issue 1 year ago • 13 comments

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:

  1. Hugo Modules (Recommended)
  2. 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

temiraevpg avatar Feb 08 '24 03:02 temiraevpg

Hi can you provide a little more details, like the commands you use and some screenshots?

imfing avatar Feb 08 '24 14:02 imfing

terminal: image index file: image hugo.yaml image site page: image

temiraevpg avatar Feb 09 '24 06:02 temiraevpg

Can you use the template repository hugo.yaml config file?

https://github.com/imfing/hextra-starter-template

imfing avatar Feb 09 '24 08:02 imfing

hugo server did not start image

temiraevpg avatar Feb 09 '24 09:02 temiraevpg

can you try commenting out the module section in the config file?

imfing avatar Feb 09 '24 10:02 imfing

got this result image image

temiraevpg avatar Feb 09 '24 12:02 temiraevpg

Copied content files to the created site from exampleSite image

It may be necessary to update the template installation information. Repeating steps from the instructions does not bring the desired result

temiraevpg avatar Feb 09 '24 12:02 temiraevpg

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 avatar Feb 09 '24 15:02 temiraevpg

@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.

imfing avatar Feb 11 '24 13:02 imfing

@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.

image

Let me know if this works.

imfing avatar Feb 11 '24 13:02 imfing

You are completely right it works. Doesn't work on the main page.

temiraevpg avatar Feb 12 '24 03:02 temiraevpg

@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 avatar Sep 13 '24 14:09 DragonStorm97

@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

imfing avatar Sep 14 '24 07:09 imfing