Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement adding link on logo #17

Closed
shafayetShafee opened this issue Aug 18, 2023 · 0 comments · Fixed by #19
Closed

Implement adding link on logo #17

shafayetShafee opened this issue Aug 18, 2023 · 0 comments · Fixed by #19
Assignees
Labels
enhancement New feature or request

Comments

@shafayetShafee
Copy link
Owner

Implement the following from here,

You can write a JavaScript function to take the rendered logo image and then nest it withing an a tag with the desired hyperlink.

logo-hyperlink.html

<script type="text/javascript">
  function hyperlink_logo() {
    let logo = document.querySelector('img.slide-logo');
    const logo_cloned = logo.cloneNode(true);
    const link = document.createElement('a');
    // -----------------------------------------------------------
    // set the link for the logo here in `link.href` within quotes
    link.href = 'https://stackoverflow.com';
    // -----------------------------------------------------------
    link.target = '_blank';
    link.appendChild(logo_cloned);
    logo.replaceWith(link);
  };
  
  window.document.addEventListener("DOMContentLoaded", function (event) {
    hyperlink_logo();
  });
</script>

Set the link enclosed with quotes for the logo as the value of link.href. And then include this html file to the qmd file.

presentation.qmd

---
title: Testing
format:
    revealjs:
      logo: SO.png
include-after-body: logo-hyperlink.html
---


## Quarto
@shafayetShafee shafayetShafee added the enhancement New feature or request label Aug 18, 2023
@shafayetShafee shafayetShafee self-assigned this Aug 18, 2023
@shafayetShafee shafayetShafee linked a pull request Jan 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant