VtEcostudies / VAL_Data_Explorers

Other
1 stars 1 forks source link

Illegal document #15

Closed MortenHofft closed 2 years ago

MortenHofft commented 2 years ago

I just noticed that the document as a whole is illegal.

<!-- HEAD react and gbif component -->
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mapbox-gl/2.1.1/mapbox-gl.min.css" integrity="sha512-j4BKLk7HB2Umio2SKGP4gh1L3jouxJDuBxcWoq4kf1fYIkJyXQUGxs9me8yz2wexxAIHIcQHzn64UfPIG232xQ==" crossorigin="anonymous" />
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/openlayers/6.1.1/ol.min.css' />

<!--dynamically include version running in environment-->
<script type="text/javascript" src="https://react-components.gbif.org/lib/gbif-react-components.js"></script>

<!DOCTYPE HTML>

<html>

    <head>

        <meta charset="UTF-8">
...
jloomisVCE commented 2 years ago

Thanks for noticing. I think this is the same issue I am working on with our Wordpress consultant. WP and its PHP template implementation appears to prevent standard CSS-includes that reference the local file system. WP suggests that, rather than including these directly within PHP templates, they are included in a general location.

They sent me this link to understand: https://developer.wordpress.org/themes/basics/including-css-javascript/

I will make changes to our WP templates according to these rules and review this.

jloomisVCE commented 2 years ago

@MortenHofft Friday I attempted to move these page-specific includes to the location recommended by Wordpress, and it did not work, so I restored our current configuration to keep the explorer functional. We have added a WP staging site, which I will use to test these changes this week.

So I understand, where do you see that this page is an illegal document? Thanks.

MortenHofft commented 2 years ago

it is this page https://val.vtecostudies.org/gbif-explorer/ And I just look at the source code. right-click. choose View page source A legal document should start with

<!DOCTYPE html>
<html ... and so on
jloomisVCE commented 2 years ago

Thanks. I assume the issue is the document tags outside the header and before the doctype declaration. My other options in WP are to (1) include those in the general site header or (2) move the includes below the php header. I tried #2 and it looks better.

jloomisVCE commented 2 years ago

@MortenHofft I think I've resolved this in two places - gbif-explorer and gbif-literature - with the above solution, so I'll close this. Let me know if I should reopen it. Thanks.