Code Monkey home page Code Monkey logo

Comments (9)

le4ker avatar le4ker commented on June 14, 2024

@chipset95 actually I had a look at the code and the sections are hardcoded, and the navigation bar is not sorted on section tile (I fixed that actually after I forked the timeline repository).

So if someone wants to change the order of the section, he/she has to edit the includes/index.html, which is reasonable given that this the intention is by definition a hard change in the theme πŸ˜„

I'm closing this issue.

from personal-jekyll-theme.

kartikarora avatar kartikarora commented on June 14, 2024

I didn't get it. There is no index.html in includes. Also, where are the sections being hardcoded?

from personal-jekyll-theme.

le4ker avatar le4ker commented on June 14, 2024

My bad, it's the index.html layout πŸ˜„

from personal-jekyll-theme.

kartikarora avatar kartikarora commented on June 14, 2024

I've tried changing the order in _layouts/index.html But the order remains to be About, Blog, Career, Contact.

Just tried it again.

from personal-jekyll-theme.

le4ker avatar le4ker commented on June 14, 2024

You mean that the order in the navigation bard remained the same?

The navigation bar is ordered based on the order that the list in the _config.yml is declared.

from personal-jekyll-theme.

kartikarora avatar kartikarora commented on June 14, 2024

I'm able to change the order in the navigation bar from _config.yml, but I want to change the order in index.html to match the order in navigation bar.

I have this in index.html under layouts right now

<!-- Index Layout Start -->

<!DOCTYPE html>
<html lang="{{ site.lang }}">

  {% include head.html %}

  <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">

    {% include navigation.html %}

    {% include header.html %}

    {% for page in site.pages %}

      {% if page.section-type == "about" %}

        {% include about.html %}

      {% elsif page.section-type == "work" %}

        {% include work.html %}

      {% elsif page.section-type == "contact" %}

        {% include contact.html %}

      {% elsif page.section-type == "latest-post" %}

        {% include latest-post.html %}

      {% endif %}

    {% endfor %}

    {% include footer.html %}

    {% include js.html %}

  </body>
</html>

<!-- Index Layout End -->

And the result of this can be seen here

from personal-jekyll-theme.

le4ker avatar le4ker commented on June 14, 2024

I see. Yes it makes sense, given that they are being rendered based on the order that they exist in the site.pages.

We should be smarter, I think we should iterate over the navigation items, given that each section should anyway be listed in the navigation bar πŸ˜„

Re-opening the issue as a bug.

from personal-jekyll-theme.

joariasl avatar joariasl commented on June 14, 2024

Exists a problem obtain each page if not use {% for page in site.pages %}
I intent obtain the _include file using:

    {% for p in site.pages_list %}
      {% if p == "blog" %}
        {% include latest-post.html %}
      {% else %}
        {% include about.html %}
      {% endif %}
    {% endfor %}

But I do not know as obtain the specific content for the page (for example in about.html in the root path).

The Blogs item is different to the file name, because I added an exeption:

Pages in Home:
'about' => about.html
'blog' => latest-post.html (X)
'career' => career.html
'contact' => contact.html

I don't know many YAML. ΒΏAny idea for solve this?

from personal-jekyll-theme.

joariasl avatar joariasl commented on June 14, 2024

Fixed in my latest pull request #56 with:

    {% for p in site.pages_list %}
      {% for page in site.pages %}
        {% if p[1] == page.section-type%}
          {% include {{ page.path }} %}
        {% endif %}
      {% endfor %}
    {% endfor %}

It is optimizable if the page is directly obtained back to repeat each time. But it works.

I refactored some problems.
The test run: https://www.livecoding.tv/video/personal-jekyll-theme-27/

from personal-jekyll-theme.

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.