Git Product home page Git Product logo

Comments (3)

Compizfox avatar Compizfox commented on July 17, 2024 1

Thanks, I see.

I already came across the JS redirect method, but it's a hacky workaround imo. I'd really like to have a proper, direct link in the menu.

I'll look into modifying navbar.liquid!

from type-on-strap.

Compizfox avatar Compizfox commented on July 17, 2024 1

For now, I just added this in navbar.liquid, before the existing loop:

        {% for item in site.data.menu %}
            <li class="separator"> | </li>
            <li>
                <a class="clear" aria-label="{{ item.title }}" title="{{ item.title }}" href="{{ item.url}}">
                    {% if item.icon %} <i class="fas {{ item.icon }}" aria-hidden="true"></i>
                    {% else %} {{ item.title }} {% endif%}
                </a>
            </li>
        {% endfor %}

And create a file _data/menu.yml containing a list of menu items (with title and url).

This isn't perfect, as it constrains your external links to be in front (or after) the internal ones, but it's a start.

from type-on-strap.

sylhare avatar sylhare commented on July 17, 2024

The links in the navigation bar are added automatically based on the pages in the pages folder (with search, tags, portfolio ...).

So you can't just plug an external link there by default. (We could customize the navbar.liquid to display some websites from the config.yml, something that I might look into in the future).

However, If you wish to add a link to an external page, there's a workaround, where you can add a new page which will redirect on load to the external one. For example, adding this github.md in the pages folder, I am able to go to the GitHub repository when clicking on the title in the navbar.

---
layout: page
title: GitHub
permalink: /redirect/
---

### Redirecting to the GitHub page ...

<script type="text/javascript">
    window.location.href = "https://github.com/sylhare/Type-on-Strap"
</script>

from type-on-strap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.