okkur / syna

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

Content from config fragment inserted two times #760

Closed c-mauderer closed 4 years ago

c-mauderer commented 4 years ago

Is this a BUG REPORT or FEATURE REQUEST?: bug (most likely)

What happened: The html blocks of a config fragment is inserted two times.

What you expected to happen: Only one insertion.

How to reproduce it (as minimally and precisely as possible): One example where it happened is the official documentation. Take a look at the html code of https://about.okkur.org/syna/fragments/config/ You'll find the following code block:

      <link rel='stylesheet' href='https://bootswatch.com/4/united/bootstrap.min.css'>
        <script>
    document.getElementsByTagName("body")[0].style.cursor = "url('http://wiki-devel.sugarlabs.org/images/e/e2/Arrow.cur'), auto";
  </script>

      <link rel='stylesheet' href='https://bootswatch.com/4/united/bootstrap.min.css'>
        <script>
    document.getElementsByTagName("body")[0].style.cursor = "url('http://wiki-devel.sugarlabs.org/images/e/e2/Arrow.cur'), auto";
  </script>

Environment:

stp-ip commented 4 years ago

This does indeed look like a bug. Also hey fellow Archer ;)

Thanks for reporting. Always happy for PRs as well ;)

c-mauderer commented 4 years ago

This does indeed look like a bug. Also hey fellow Archer ;)

Thanks.

Thanks for reporting. Always happy for PRs as well ;)

I'm a bit out of my usual area of programming. Normally I do embedded C development. I had a tried to find the bug but I'm not really sure why it happens. I can only assume that one of the ranges isn't working like it should: https://github.com/okkur/syna/blob/014ac2baa5ee9d4/layouts/partials/head.html#L89 The same is true for https://github.com/okkur/syna/blob/014ac2baa5ee9d4/layouts/partials/js.html#L48

mpourismaiel commented 4 years ago

Thanks for reporting the issue and narrowing it down. I'll check out what's wrong with the ranges and create a PR. If you want to fix the issue yourself, I'll be happy to help.

c-mauderer commented 4 years ago

Seems that I'm to late. But I think I would have had a very hard time finding that anyway. Beneath that: It's quite out of my usual area. So a big thanks for creating the fix.

mpourismaiel commented 4 years ago

Anytime you want to create a PR, feel free to ask for help. We'll be happy to help.

c-mauderer commented 4 years ago

Thanks for the offer. If I find a bug again where I think that I might can fix it, I'll ask or create a PR.