Skip to content

Commit

Permalink
Correct config variable for enabling latest_posts on about page (alsh…
Browse files Browse the repository at this point in the history
…edivat#2243)

I noticed disabling latest_posts in `_config.yml` didn't work because
the variable in the liquid template was seemingly incorrect. This should
fix that.

---------

Co-authored-by: Jake Nabasny <jake@nabasny.com>
  • Loading branch information
2 people authored and Suraj-Bhor committed Aug 13, 2024
1 parent 4952317 commit c50e968
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions _layouts/about.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ layout: default
{% include news.liquid limit=true %}
{% endif %}

{% comment %} <!-- Latest posts -->
{% if page.latest_posts %}
<!-- Latest posts -->
{% if site.latest_posts.enabled %}
<h2>
<a href="{{ '/blog/' | relative_url }}" style="color: inherit">latest posts</a>
</h2>
Expand Down
1 change: 0 additions & 1 deletion _pages/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ profile:
news: true # includes a list of news items
latest_posts: true # includes a list of the newest posts
selected_papers: true # includes a list of papers marked as "selected={true}"
social: true # includes social icons at the bottom of the page
---
Expand Down
18 changes: 18 additions & 0 deletions assets/js/jupyter_new_tab 2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$(document).ready(function () {
// Let external links in jupyter notebooks open in new tab
let jupyterNotebooks = $(".jupyter-notebook-iframe-container");
jupyterNotebooks.each(function () {
let iframeBody = $(this).find("iframe").get(0).contentWindow.document.body;
// Get all <a> elements in the bodyElement
let links = $(iframeBody).find("a");

// Loop through each <a> element
links.each(function () {
// Check if the <a> element has an 'href' attribute
if ($(this).attr("href")) {
// Set the 'target' attribute to '_blank' to open the link in a new tab/window
$(this).attr("target", "_blank");
}
});
});
});

0 comments on commit c50e968

Please sign in to comment.