gokarna-theme / gokarna-hugo

A minimal opinionated theme for Hugo
https://gokarna-hugo.netlify.app
GNU General Public License v3.0
357 stars 139 forks source link

Add new-page param for target=blank #190

Closed zerodahero closed 12 months ago

zerodahero commented 1 year ago

This PR allows specifying nav menu links to be opened in a new tab.

Config:

  [[menu.main]]
    identifier = "github"
    url = "https://github.com/zerodahero"
    weight = 4
    # We use feather-icons: https://feathericons.com/
    pre = "<span data-feather='github'></span>"
    [menu.main.params]
      newPage = true

Will open the "github" link in a new tab (depending on browser behavior).

If there's an easier way than going through the params, that might be nice as well. I think the "official" Hugo approach may be to use a rel = external param for the menu item--happy to go that route as well if that's more widely understood.

netlify[bot] commented 1 year ago

Deploy Preview for gokarna-hugo ready!

Name Link
Latest commit e91b2ffafccc6c083238c815bb73e9f331aecf8c
Latest deploy log https://app.netlify.com/sites/gokarna-hugo/deploys/64d560dfc81f2b00082a0070
Deploy Preview https://deploy-preview-190--gokarna-hugo.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

zerodahero commented 11 months ago

Hi @zerodahero sorry for the delayed response.

Thanks for submitting the PR. The changes look good to me. Could please document your feature in the Theme Documentation - Advanced page? :) cc @yashmehrotra

Hi, sorry, been out on vacation. Thanks, @mansoorbarri for taking care of the doc update!