cljoly / gohugo-asciinema

⏯️ Insert the Asciinema Player in your Hugo site with ease.
https://cj.rs/gohugo-asciinema
16 stars 3 forks source link

Error with vector's key locally #2

Closed PierreMarchand20 closed 2 years ago

PierreMarchand20 commented 2 years ago

The module seems to work fine when deployed, but for some reasons, locally I have this error:

image

Any ideas why ?

By the way, I still have the error mentioned in #1 (locally and after deployment):

image
cljoly commented 2 years ago

Hi, sorry I missed this. I'll take a deeper look hopefully tomorrow.

cljoly commented 2 years ago

The module seems to work fine when deployed, but for some reasons, locally I have this error:

Could you please share the exact shortcode code you are using in your markdown file when you get this error? I would imagine it looks something like this (for instance):

{{< asciicast src="/telescope-repo-nvim/telescope.json" poster="npt:0:04" autoplay="true" loop="true" >}}
cljoly commented 2 years ago

By the way, I still have the error mentioned in #1 (locally and after deployment):

You get this from the master branch, right? It’s only fixed on the beta branch, I’ve edited https://github.com/cljoly/gohugo-asciinema/issues/1#issuecomment-1019236256 to make it clearer. I have also created #3 to consider backporting the fix to master.

PierreMarchand20 commented 2 years ago

The module seems to work fine when deployed, but for some reasons, locally I have this error:

Could you please share the exact shortcode code you are using in your markdown file when you get this error? I would imagine it looks something like this (for instance):

{{< asciicast src="/telescope-repo-nvim/telescope.json" poster="npt:0:04" autoplay="true" loop="true" >}}

It is something like

{{< asciicast src="/casts/2020_CTCW_2_git/setup.cast" rows="30" preload="1" theme="solarized-dark" title="Setup git">}}
PierreMarchand20 commented 2 years ago

By the way, I still have the error mentioned in #1 (locally and after deployment):

You get this from the master branch, right? It’s only fixed on the beta branch, I’ve edited #1 (comment) to make it clearer. I have also created #3 to consider backporting the fix to master.

I see, it may be better to use the beta branch then ? I am not sure how I can choose between both versions with hugo.

cljoly commented 2 years ago

Hey thanks for providing these details, I'll try to reproduce your error and document things some more this weekend.

PierreMarchand20 commented 2 years ago

Thanks! and thank you for this module, it is indeed better than everyone doing its own thing (like I did on my webpage) :-)

cljoly commented 2 years ago

I see, it may be better to use the beta branch then ? I am not sure how I can choose between both versions with hugo.

It’s a much smaller player in the new version, but it’s also considered beta by their developer and as such might be less stable so 🤷🏼. Given that you can easily go back and forth between the two versions, I think you can give it a try and see for yourself.

I’ve improved the doc in the readme of the 3beta branch.

Tldr:

To go to the beta version, run:

hugo mod get -u -v cj.rs/gohugo-asciinema@3beta

and to go back

hugo mod get -u -v cj.rs/gohugo-asciinema

(we are simply using the go version query suffix)

Does that make sense?

cljoly commented 2 years ago

Unfortunately, I couldn’t reproduce your error, neither with Chrome nor Firefox. I run

hugo serve

And I use

{{< asciicast src="/telescope.cast" rows="30" preload="1" theme="solarized-dark" title="Setup git">}}

with this file (renamed).

cljoly commented 2 years ago

Maybe the issue is related to your particular asciicast?

PierreMarchand20 commented 2 years ago

I actually retried after a update of safari (I should have said I am using safari...), and now I get this error:

image

I guess I am missing something? And this happens with both versions.

cljoly commented 2 years ago

Hum that's weird

PierreMarchand20 commented 2 years ago

I have the same issue with Firefox, could it be an issue with Hugo on my laptop? Like a wrong path or something, but it does find the module, otherwise I would have an error when calling hugo serve.

You can find my webpage here: https://github.com/PierreMarchand20/personal_webpage/tree/brouillon

cljoly commented 2 years ago

Ok, now I’ve got the error on your website (on page http://localhost:1313/post/2020_ctcw_2_git/ from branch brouillon)

image

With Firefox and hugo version:

hugo v0.95.0+extended linux/amd64 BuildDate=unknown
cljoly commented 2 years ago

Turns out the scratchpad is not working as intended and the sources of the player don’t get inserted.

cljoly commented 2 years ago

Ok, so with hugo serve on your website, using Firefox:

PierreMarchand20 commented 2 years ago

May be it is because of the theme I used? Before I had to add in the config file the js and css files, but I thought it was unnecessary now with Hugo modules.

PierreMarchand20 commented 2 years ago

Here: https://wowchemy.com/docs/hugo-tutorials/extending-wowchemy/ do you agree that this kind of things should be unnecessary with Hugo modules ?

cljoly commented 2 years ago

do you agree that this kind of things should be unnecessary with Hugo modules ?

Provided there is a suitable Hugo module for each third party script, I would think it’s unnecessary indeed.

PierreMarchand20 commented 2 years ago

mmmm ok, so I do not see why the asciinema do not get loaded properly :-/

PierreMarchand20 commented 2 years ago

And, as I said at the beginning, when deployed it works: https://deploy-preview-2--pierremarchand.netlify.app/post/2020_ctcw_2_git/

cljoly commented 2 years ago

Found another problem: on the beta version, somehow, an empty file is produced. There must be a problem with the way I produce the resource…

cljoly commented 2 years ago

Found another problem: on the beta version, somehow, an empty file is produced. There must be a problem with the way I produce the resource…

And that does not happen on my personal website.

cljoly commented 2 years ago

Ah found the problem, on your brouillon branch, you have a file assets/js/asciinema-player.min.js that’s empty. I removed it and it worked. It was overwriting the asciinema JS provided by my module 😄 .

cljoly commented 2 years ago

I think I have a working version for you, let me refine it and make a PR to your website…

PierreMarchand20 commented 2 years ago

Ah good catch! at some point I had some troubles to install this hugo module, so I tried to copy this file from somewhere...

PierreMarchand20 commented 2 years ago

Deleting this file makes it working on my laptop, but I can let you do a PR (and close the issue).

PierreMarchand20 commented 2 years ago

What is the issue with master branch of https://github.com/cljoly/gohugo-asciinema ? It seems to work on my laptop.

PierreMarchand20 commented 2 years ago

(the player is a bit weird on safari with the beta of asciinema:)

image
cljoly commented 2 years ago

(the player is a bit weird on safari with the beta of asciinema:)

image

With Firefox as well :)

cljoly commented 2 years ago

What is the issue with master branch of https://github.com/cljoly/gohugo-asciinema ? It seems to work on my laptop.

I couldn’t get it to play the asciicast, but if it works, all good. Let’s close that issue then.

Thanks for taking the time to open that issue and for your cooperation debugging this!