-
-
Notifications
You must be signed in to change notification settings - Fork 642
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
Sections are displayed sorted on title #40
Comments
@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. |
I didn't get it. There is no index.html in includes. Also, where are the sections being hardcoded? |
My bad, it's the index.html layout 😄 |
I've tried changing the order in Just tried it again. |
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. |
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 |
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. |
Exists a problem obtain each page if not use
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:
I don't know many YAML. ¿Any idea for solve this? |
The content in index.html is now sorted in _config.yml pages_list order. * Close le4ker#40 issue * Moved latest-posts to latest-post.html for conflict with blog.html * Changed the ID in sections for page.section-type * Subtracted 50 in offset Scrollspy
Fixed in my latest pull request #56 with:
It is optimizable if the page is directly obtained back to repeat each time. But it works. I refactored some problems. |
Reported by @chipset95 .
The text was updated successfully, but these errors were encountered: