Created
June 10, 2020 19:38
-
-
Save ryandejaegher/d7e96e60816a4cf76d1d69b9c162ed09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| var projectTitle; | |
| var projectTitleText = document.querySelector('.centered-content > h4'); | |
| var checkGallery = document.querySelector('.gallery-section') | |
| var link = window.location.href + '?format=json-pretty'; | |
| fetch(link).then(response => { | |
| console.log('success', response); | |
| return response.json(); | |
| }).then(data => { | |
| console.log(data.collection.title); | |
| projectTitle = data.collection.title; | |
| if(projectTitle !== "HOME" && checkGallery !== null) { | |
| projectTitleText.textContent = projectTitle; | |
| } | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment