Skip to content

Commit

Permalink
Now blog can be reorganized in header (alshedivat#1996)
Browse files Browse the repository at this point in the history
Fixes alshedivat#1559 alshedivat#1795

Signed-off-by: George Araújo <george.gcac@gmail.com>
  • Loading branch information
george-gca committed Dec 25, 2023
1 parent a390060 commit 955d4cb
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
3 changes: 1 addition & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ lang: en # the language of your site (for example: en, fr, cn, ru, etc.)
icon: ⚛️ # the emoji used as the favicon (alternatively, provide image name in /assets/img/)

url: https://alshedivat.github.io # the base hostname & protocol for your site
baseurl: /al-folio # the subpath of your site, e.g. /blog/
baseurl: /al-folio # the subpath of your site, e.g. /blog/. Leave blank for root
last_updated: false # set to true if you want to display last updated in the footer
impressum_path: # set to path to include impressum link in the footer, use the same path as permalink in a page, helps to conform with EU GDPR

Expand Down Expand Up @@ -121,7 +121,6 @@ bing_site_verification: # out your bing-site-verification ID (Bing Webmaster)
# -----------------------------------------------------------------------------

blog_name: al-folio # blog_name will be displayed in your blog page
blog_nav_title: blog # your blog must have a title for it to be displayed in the nav bar
blog_description: a simple whitespace theme for academics
permalink: /blog/:year/:title/

Expand Down
21 changes: 8 additions & 13 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@
{%- endif -%}
</a>
</li>
{% if site.blog_nav_title %}
<!-- Blog -->
<li class="nav-item {% if page.url contains 'blog' %}active{% endif %}">
<a class="nav-link" href="{{ '/blog/' | relative_url }}">{{ site.blog_nav_title }}
{%- if page.url contains 'blog' -%}
<span class="sr-only">(current)</span>
{%- endif -%}
</a>
</li>
{%- endif %}

<!-- Other pages -->
{%- assign sorted_pages = site.pages | sort: "nav_order" -%}
Expand Down Expand Up @@ -90,9 +80,14 @@
</div>
</li>
{%- else %}
<li class="nav-item {% if page.title == p.title %}active{% endif %}">
<a class="nav-link" href="{{ p.url | relative_url }}">{{ p.title }}
{%- if page.title == p.title -%}
<li class="nav-item {% if page.url contains p.permalink %}active{% endif %}">
{%- if p.permalink contains '/blog/' %}
{%- assign url = '/blog/' -%}
{%- else -%}
{%- assign url = p.url -%}
{%- endif -%}
<a class="nav-link" href="{{ url | relative_url }}">{{ p.title }}
{%- if page.url contains p.url -%}
<span class="sr-only">(current)</span>
{%- endif -%}
</a>
Expand Down
2 changes: 1 addition & 1 deletion _includes/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{%- capture title -%}{{ site.title }}{%- endcapture -%}
{%- endif -%}
{% if page.url == '/blog/index.html' %}
{{ site.blog_nav_title }} | {{ title }}
{{ page.title }} | {{ title }}
{%- elsif page.title != "blank" and page.url != "/" -%}
{%- if page.title == nil or page.title == "" -%}
{{ page.date | date: "%Y" }} | {{ title }}
Expand Down
3 changes: 3 additions & 0 deletions blog/index.html → _pages/blog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
layout: default
permalink: /blog/
title: blog
nav: true
nav_order: 1
pagination:
enabled: true
collection: posts
Expand Down
2 changes: 1 addition & 1 deletion _pages/cv.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: cv
permalink: /cv/
title: cv
nav: true
nav_order: 4
nav_order: 5
cv_pdf: example_pdf.pdf
description: This is a description of the page. You can modify it in '_pages/cv.md'. You can also change or remove the top pdf download button.
toc:
Expand Down
5 changes: 4 additions & 1 deletion _pages/dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
layout: page
title: submenus
nav: true
nav_order: 7
nav_order: 8
dropdown: true
children:
- title: publications
permalink: /publications/
- title: divider
- title: projects
permalink: /projects/
- title: divider
- title: blog
permalink: /blog/
---
2 changes: 1 addition & 1 deletion _pages/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permalink: /people/
title: people
description: members of the lab or group
nav: true
nav_order: 6
nav_order: 7

profiles:
# if you want to include more than one profile, just replicate the following block
Expand Down
2 changes: 1 addition & 1 deletion _pages/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: projects
permalink: /projects/
description: A growing collection of your cool projects.
nav: true
nav_order: 2
nav_order: 3
display_categories: [work, fun]
horizontal: false
---
Expand Down
2 changes: 1 addition & 1 deletion _pages/publications.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permalink: /publications/
title: publications
description: publications by categories in reversed chronological order. generated by jekyll-scholar.
nav: true
nav_order: 1
nav_order: 2
---
<!-- _pages/publications.md -->
<div class="publications">
Expand Down
2 changes: 1 addition & 1 deletion _pages/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permalink: /repositories/
title: repositories
description: Edit the `_data/repositories.yml` and change the `github_users` and `github_repos` lists to include your own GitHub profile and repositories.
nav: true
nav_order: 3
nav_order: 4
---

## GitHub users
Expand Down
2 changes: 1 addition & 1 deletion _pages/teaching.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permalink: /teaching/
title: teaching
description: Materials for courses you taught. Replace this text with your description.
nav: true
nav_order: 5
nav_order: 6
---

For now, this page is assumed to be a static description of your courses. You can convert it to a collection similar to `_projects/` so that you can have a dedicated page for each course.
Expand Down

0 comments on commit 955d4cb

Please sign in to comment.