okkur / syna

Highly customizable open source theme for Hugo based static websites
https://syna.okkur.org/demo/
Apache License 2.0
250 stars 133 forks source link

Particles option wont work on multilang #798

Closed pelloq1 closed 4 years ago

pelloq1 commented 4 years ago

First of all, this theme is awesome ! Great job !

bug

What happened: The particles option wont work if multilang is enabled. Console :

particles.js:18 Uncaught TypeError: Cannot read property 'offsetWidth' of null
    at new pJS (particles.js:18)
    at window.particlesJS (particles.js:1517)
    at eval (hero.js:9)
    at Array.forEach (<anonymous>)
    at eval (hero.js:6)
    at Object../assets/js/hero.js (syna-hero.min.97a3fff0c67d9da74ebdd6af2640d8a9cde6200539e8c3b2c091b7fc6644420e.js:7)
    at __webpack_require__ (syna-hero.min.97a3fff0c67d9da74ebdd6af2640d8a9cde6200539e8c3b2c091b7fc6644420e.js:2)
    at syna-hero.min.97a3fff0c67d9da74ebdd6af2640d8a9cde6200539e8c3b2c091b7fc6644420e.js:4
    at syna-hero.min.97a3fff0c67d9da74ebdd6af2640d8a9cde6200539e8c3b2c091b7fc6644420e.js:5

How to reproduce it (as minimally and precisely as possible): If I use the multilang option and generate my site in EN and FR, on the FR version the particles aren't visibles.

Thanks Cédric

mpourismaiel commented 4 years ago

Is there a place we can see the source code for the project? I can't reproduce the issue. I'm using our own demo. A step by step reproduction would help as well.

pelloq1 commented 4 years ago

Simply create a multilingual version of the demo site, in the _index folder duplicate the hero.md in hero.fr.md :

+++
fragment = "hero"
#disabled = true
date = "2016-09-07"
weight = 50
background = "light" # can influence the text color
particles = true

title = "Titre"
subtitle = "Votre partenaire depuis 1987"

[header]
  image = "header.jpg"

[asset]
  image = "logo.svg"
  width = "500px" # optional - will default to image width
  #height = "150px" # optional - will default to image height

+++

Let me know if you can fix this, then I can apply the fix before the 0.18 release

👍

mpourismaiel commented 4 years ago

Okay this is happening in syna-start and for some reason doesn't happen in syna. Correct me if I'm wrong, the problem arises with or without multilingual mode. Please pull a new version of syna-start and run it and let me know.

pelloq1 commented 4 years ago

Sorry, I do this :

hugo new site test installing the 0.17 Syna based ont the documentation's guide copy my old content and config.toml

particles works on english version / does not work on french version /fr

I dont use syna-start ...

Sorry for this ...

pelloq1 commented 4 years ago

Please see my last post in #799 this is a very similar issue.

Cédric

mpourismaiel commented 4 years ago

Not sure about #799, but #801 will fix this issue. I'll check #799 with the new PR shortly.

edit: #799 still doesn't work.