Skip to content

Commit f18ffd1

Browse files
pourmand1376alshedivat
authored andcommitted
add jekyll target blank plugin (alshedivat#404)
* add jekyll target blank * Remove manual target blank from everywhere * Update README.md * Set ruby version to 3.0.2 in the deploy script Co-authored-by: Maruan Al-Shedivat <[email protected]>
1 parent cfcce35 commit f18ffd1

20 files changed

+62
-58
lines changed

.github/workflows/deploy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup Ruby
2020
uses: actions/setup-ruby@v1
2121
with:
22-
ruby-version: '2.7'
22+
ruby-version: '3.0.2'
2323
- name: Enable bundler cache
2424
uses: actions/cache@v2
2525
with:

Gemfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ group :jekyll_plugins do
66
gem 'jekyll-github-metadata'
77
gem 'jekyll-paginate-v2'
88
gem 'jekyll-scholar'
9-
gem 'jekyll-twitter-plugin'
109
gem 'jekyll-sitemap'
10+
gem 'jekyll-target-blank'
11+
gem 'jekyll-twitter-plugin'
1112
gem 'jemoji'
1213
gem 'unicode_utils'
1314
gem 'webrick'

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ $ bundle exec jekyll serve
111111
```
112112

113113
Now, feel free to customize the theme however you like (don't forget to change the name!).
114-
After you are done, **commit** your final changes.
114+
115+
**Important:**
116+
- Make sure to change `url` field in `_config.yml` to `<your-github-username>.github.io`.
117+
- After you are done, **commit** your final changes.
115118

116119
#### Deployment
117120

_config.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,14 @@ keep_files:
135135

136136
# Plug-ins
137137
plugins:
138+
- jekyll/scholar
138139
- jekyll-email-protect
139-
- jekyll-github-metadata
140140
- jekyll-feed
141+
- jekyll-github-metadata
141142
- jekyll-paginate-v2
142-
- jekyll/scholar
143-
- jekyll-twitter-plugin
144143
- jekyll-sitemap
144+
- jekyll-target-blank
145+
- jekyll-twitter-plugin
145146
- jemoji
146147

147148
# Extras

_includes/projects.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="grid-item">
22
{% if project.redirect %}
3-
<a href="{{ project.redirect }}" target="_blank">
3+
<a href="{{ project.redirect }}">
44
{% else %}
55
<a href="{{ project.url | relative_url }}">
66
{% endif %}
@@ -15,7 +15,7 @@ <h2 class="card-title text-lowercase">{{ project.title }}</h2>
1515
{% if project.github %}
1616
<div class="github-icon">
1717
<div class="icon" data-toggle="tooltip" title="Code Repository">
18-
<a href="{{ project.github }}" target="_blank"><i class="fab fa-github gh-icon"></i></a>
18+
<a href="{{ project.github }}"><i class="fab fa-github gh-icon"></i></a>
1919
</div>
2020
{% if project.github_stars %}
2121
<span class="stars" data-toggle="tooltip" title="GitHub Stars">

_includes/projects_horizontal.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="card-item col">
22
{% if project.redirect %}
3-
<a href="{{ project.redirect }}" target="_blank">
3+
<a href="{{ project.redirect }}">
44
{% else %}
55
<a href="{{ project.url | relative_url }}">
66
{% endif %}
@@ -21,7 +21,7 @@ <h3 class="card-title text-lowercase">{{ project.title }}</h3>
2121
{% if project.github %}
2222
<div class="github-icon">
2323
<div class="icon" data-toggle="tooltip" title="Code Repository">
24-
<a href="{{ project.github }}" target="_blank"><i class="fab fa-github gh-icon"></i></a>
24+
<a href="{{ project.github }}"><i class="fab fa-github gh-icon"></i></a>
2525
</div>
2626
{% if project.github_stars %}
2727
<span class="stars" data-toggle="tooltip" title="GitHub Stars">

_includes/social.html

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
{% if site.email %}<a href="mailto:{{ site.email | encode_email }}"><i class="fas fa-envelope"></i></a>{% endif %}
2-
{% if site.orcid_id %}<a href="https://orcid.org/{{ site.orcid_id }}" target="_blank" title="ORCID"><i class="ai ai-orcid"></i></a>{% endif %}
3-
{% if site.scholar_userid %}<a href="https://scholar.google.com/citations?user={{ site.scholar_userid }}" target="_blank" title="Google Scholar"><i class="ai ai-google-scholar"></i></a>{% endif %}
4-
{% if site.publons_id %}<a href="https://publons.com/a/{{ site.publons_id }}/" target="_blank" title="Publons"><i class="ai ai-publons"></i></a>{% endif %}
5-
{% if site.research_gate_profile %}<a href="https://www.researchgate.net/profile/{{site.research_gate_profile}}/" target="_blank" title="ResearchGate"><i class="ai ai-researchgate"></i></a>{% endif %}
6-
{% if site.github_username %}<a href="https://github.com/{{ site.github_username }}" target="_blank" title="GitHub"><i class="fab fa-github"></i></a>{% endif %}
7-
{% if site.linkedin_username %}<a href="https://www.linkedin.com/in/{{ site.linkedin_username }}" target="_blank" title="LinkedIn"><i class="fab fa-linkedin"></i></a>{% endif %}
8-
{% if site.twitter_username %}<a href="https://twitter.com/{{ site.twitter_username }}" target="_blank" title="Twitter"><i class="fab fa-twitter"></i></a>{% endif %}
9-
{% if site.medium_username %}<a href="https://medium.com/@{{ site.medium_username }}" target="_blank" title="Medium"><i class="fab fa-medium"></i></a>{% endif %}
10-
{% if site.quora_username %}<a href="https://www.quora.com/profile/{{ site.quora_username }}" target="_blank" title="Quora"><i class="fab fa-quora"></i></a>{% endif %}
11-
{% if site.blogger_url %}<a href="{{ site.blogger_url }}" target="_blank" title="Blogger"><i class="fab fa-blogger-b"></i></a>{% endif %}
12-
{% if site.work_url %}<a href="{{ site.work_url }}" target="_blank" title="Work"><i class="fas fa-briefcase"></i></a>{% endif %}
13-
{% if site.wikidata_id %}<a href="https://www.wikidata.org/wiki/{{ site.wikidata_id }}" target="_blank" title="Wikidata"><i class="fas fa-barcode"></i></a>{% endif %}
14-
{% if site.strava_userid %}<a href="https://www.strava.com/athletes/{{ site.strava_userid }}" target="_blank" title="Strava"><i class="fab fa-strava"></i></a>{% endif %}
15-
{% if site.keybase_username %}<a href="https://keybase.io/{{ site.keybase_username }}" target="_blank" title="Keybase"><i class="fab fa-keybase"></i></a>{% endif %}
16-
{% if site.gitlab_username %}<a href="https://gitlab.com/{{ site.gitlab_username }}" target="_blank" title="GitLab"><i class="fab fa-gitlab"></i></a>{% endif %}
17-
{% if site.dblp_url %}<a href="{{ site.dblp_url }}" target="_blank" title="DBLP"><i class="ai ai-dblp"></i></a>{% endif %}
18-
{% if site.stackoverflow_id %}<a href="https://stackoverflow.com/users/{{ site.stackoverflow_id }}" target="_blank" title="Stackoverflow"><i class="fab fa-stack-overflow"></i></a>{% endif %}
19-
2+
{% if site.orcid_id %}<a href="https://orcid.org/{{ site.orcid_id }}" title="ORCID"><i class="ai ai-orcid"></i></a>{% endif %}
3+
{% if site.scholar_userid %}<a href="https://scholar.google.com/citations?user={{ site.scholar_userid }}" title="Google Scholar"><i class="ai ai-google-scholar"></i></a>{% endif %}
4+
{% if site.publons_id %}<a href="https://publons.com/a/{{ site.publons_id }}/" title="Publons"><i class="ai ai-publons"></i></a>{% endif %}
5+
{% if site.research_gate_profile %}<a href="https://www.researchgate.net/profile/{{site.research_gate_profile}}/" title="ResearchGate"><i class="ai ai-researchgate"></i></a>{% endif %}
6+
{% if site.github_username %}<a href="https://github.com/{{ site.github_username }}" title="GitHub"><i class="fab fa-github"></i></a>{% endif %}
7+
{% if site.linkedin_username %}<a href="https://www.linkedin.com/in/{{ site.linkedin_username }}" title="LinkedIn"><i class="fab fa-linkedin"></i></a>{% endif %}
8+
{% if site.twitter_username %}<a href="https://twitter.com/{{ site.twitter_username }}" title="Twitter"><i class="fab fa-twitter"></i></a>{% endif %}
9+
{% if site.medium_username %}<a href="https://medium.com/@{{ site.medium_username }}" title="Medium"><i class="fab fa-medium"></i></a>{% endif %}
10+
{% if site.quora_username %}<a href="https://www.quora.com/profile/{{ site.quora_username }}" title="Quora"><i class="fab fa-quora"></i></a>{% endif %}
11+
{% if site.blogger_url %}<a href="{{ site.blogger_url }}" title="Blogger"><i class="fab fa-blogger-b"></i></a>{% endif %}
12+
{% if site.work_url %}<a href="{{ site.work_url }}" title="Work"><i class="fas fa-briefcase"></i></a>{% endif %}
13+
{% if site.wikidata_id %}<a href="https://www.wikidata.org/wiki/{{ site.wikidata_id }}" title="Wikidata"><i class="fas fa-barcode"></i></a>{% endif %}
14+
{% if site.strava_userid %}<a href="https://www.strava.com/athletes/{{ site.strava_userid }}" title="Strava"><i class="fab fa-strava"></i></a>{% endif %}
15+
{% if site.keybase_username %}<a href="https://keybase.io/{{ site.keybase_username }}" title="Keybase"><i class="fab fa-keybase"></i></a>{% endif %}
16+
{% if site.gitlab_username %}<a href="https://gitlab.com/{{ site.gitlab_username }}" title="GitLab"><i class="fab fa-gitlab"></i></a>{% endif %}
17+
{% if site.dblp_url %}<a href="{{ site.dblp_url }}" title="DBLP"><i class="ai ai-dblp"></i></a>{% endif %}
18+
{% if site.stackoverflow_id %}<a href="https://stackoverflow.com/users/{{ site.stackoverflow_id }}" title="Stackoverflow"><i class="fab fa-stack-overflow"></i></a>{% endif %}

_layouts/bib.html

+16-16
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="col-sm-2 abbr">
66
{% if entry.abbr %}
77
{% if site.data.venues[entry.abbr] %}
8-
<abbr class="badge"><a href="{{site.data.venues[entry.abbr].url}}" target="_blank">{{entry.abbr}}</a></abbr>
8+
<abbr class="badge"><a href="{{site.data.venues[entry.abbr].url}}">{{entry.abbr}}</a></abbr>
99
{% else %}
1010
<abbr class="badge">{{entry.abbr}}</abbr>
1111
{% endif %}
@@ -47,7 +47,7 @@
4747
<em>{{author.last}}, {{author.first}}</em>,
4848
{% else %}
4949
{% if coauthor_url %}
50-
<a href="{{coauthor_url}}" target="_blank">{{author.last}}, {{author.first}}</a>,
50+
<a href="{{coauthor_url}}">{{author.last}}, {{author.first}}</a>,
5151
{% else %}
5252
{{author.last}}, {{author.first}},
5353
{% endif %}
@@ -57,7 +57,7 @@
5757
and <em>{{author.last}}, {{author.first}}</em>
5858
{% else %}
5959
{% if coauthor_url %}
60-
and <a href="{{coauthor_url}}" target="_blank">{{author.last}}, {{author.first}}</a>
60+
and <a href="{{coauthor_url}}">{{author.last}}, {{author.first}}</a>
6161
{% else %}
6262
and {{author.last}}, {{author.first}}
6363
{% endif %}
@@ -84,50 +84,50 @@
8484
<a class="abstract btn btn-sm z-depth-0" role="button">Abs</a>
8585
{% endif %}
8686
{% if entry.arxiv %}
87-
<a href="http://arxiv.org/abs/{{ entry.arxiv }}" class="btn btn-sm z-depth-0" role="button" target="_blank">arXiv</a>
87+
<a href="http://arxiv.org/abs/{{ entry.arxiv }}" class="btn btn-sm z-depth-0" role="button">arXiv</a>
8888
{% endif %}
8989
{% if entry.bibtex_show %}
9090
<a class="bibtex btn btn-sm z-depth-0" role="button">Bib</a>
9191
{% endif %}
9292
{% if entry.html %}
93-
<a href="{{ entry.html }}" class="btn btn-sm z-depth-0" role="button" target="_blank">HTML</a>
93+
<a href="{{ entry.html }}" class="btn btn-sm z-depth-0" role="button">HTML</a>
9494
{% endif %}
9595
{% if entry.pdf %}
9696
{% if entry.pdf contains '://' %}
97-
<a href="{{ entry.pdf }}" class="btn btn-sm z-depth-0" role="button" target="_blank">PDF</a>
97+
<a href="{{ entry.pdf }}" class="btn btn-sm z-depth-0" role="button">PDF</a>
9898
{% else %}
99-
<a href="{{ entry.pdf | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button" target="_blank">PDF</a>
99+
<a href="{{ entry.pdf | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">PDF</a>
100100
{% endif %}
101101
{% endif %}
102102
{% if entry.supp %}
103103
{% if entry.supp contains '://' %}
104-
<a href="{{ entry.supp }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Supp</a>
104+
<a href="{{ entry.supp }}" class="btn btn-sm z-depth-0" role="button">Supp</a>
105105
{% else %}
106-
<a href="{{ entry.supp | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Supp</a>
106+
<a href="{{ entry.supp | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Supp</a>
107107
{% endif %}
108108
{% endif %}
109109
{% if entry.blog %}
110-
<a href="{{ entry.blog }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Blog</a>
110+
<a href="{{ entry.blog }}" class="btn btn-sm z-depth-0" role="button">Blog</a>
111111
{% endif %}
112112
{% if entry.code %}
113-
<a href="{{ entry.code }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Code</a>
113+
<a href="{{ entry.code }}" class="btn btn-sm z-depth-0" role="button">Code</a>
114114
{% endif %}
115115
{% if entry.poster %}
116116
{% if entry.poster contains '://' %}
117-
<a href="{{ entry.poster }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Poster</a>
117+
<a href="{{ entry.poster }}" class="btn btn-sm z-depth-0" role="button">Poster</a>
118118
{% else %}
119-
<a href="{{ entry.poster | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Poster</a>
119+
<a href="{{ entry.poster | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Poster</a>
120120
{% endif %}
121121
{% endif %}
122122
{% if entry.slides %}
123123
{% if entry.slides contains '://' %}
124-
<a href="{{ entry.slides }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Slides</a>
124+
<a href="{{ entry.slides }}" class="btn btn-sm z-depth-0" role="button">Slides</a>
125125
{% else %}
126-
<a href="{{ entry.slides | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Slides</a>
126+
<a href="{{ entry.slides | prepend: '/assets/pdf/' | relative_url }}" class="btn btn-sm z-depth-0" role="button">Slides</a>
127127
{% endif %}
128128
{% endif %}
129129
{% if entry.website %}
130-
<a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button" target="_blank">Website</a>
130+
<a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button">Website</a>
131131
{% endif %}
132132
</div>
133133

_pages/projects.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ horizontal: false
1111
{% if site.enable_project_categories and page.display_categories %}
1212
<!-- Display categorized projects -->
1313
{% for category in page.display_categories %}
14-
<h2 class="category">{{category}}</h2>
14+
<h2 class="category">{{ category }}</h2>
1515
{% assign categorized_projects = site.projects | where: "category", category %}
1616
{% assign sorted_projects = categorized_projects | sort: "importance" %}
1717
<!-- Generate cards for each project -->

_posts/2015-03-15-formatting-and-links.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: a post with formatting and links
44
date: 2015-03-15 16:40:16
55
description: march & april, looking forward to summer
66
---
7-
Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptown vinyl kitsch. Four loko meh 8-bit, tousled banh mi tilde forage Schlitz dreamcatcher twee 3 wolf moon. Chambray asymmetrical paleo salvia, sartorial umami four loko master cleanse drinking vinegar brunch. <a href="https://www.pinterest.com" target="blank">Pinterest</a> DIY authentic Schlitz, hoodie Intelligentsia butcher trust fund brunch shabby chic Kickstarter forage flexitarian. Direct trade <a href="https://en.wikipedia.org/wiki/Cold-pressed_juice" target="blank">cold-pressed</a> meggings stumptown plaid, pop-up taxidermy. Hoodie XOXO fingerstache scenester Echo Park. Plaid ugh Wes Anderson, freegan pug selvage fanny pack leggings pickled food truck DIY irony Banksy.
7+
Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptown vinyl kitsch. Four loko meh 8-bit, tousled banh mi tilde forage Schlitz dreamcatcher twee 3 wolf moon. Chambray asymmetrical paleo salvia, sartorial umami four loko master cleanse drinking vinegar brunch. <a href="https://www.pinterest.com">Pinterest</a> DIY authentic Schlitz, hoodie Intelligentsia butcher trust fund brunch shabby chic Kickstarter forage flexitarian. Direct trade <a href="https://en.wikipedia.org/wiki/Cold-pressed_juice">cold-pressed</a> meggings stumptown plaid, pop-up taxidermy. Hoodie XOXO fingerstache scenester Echo Park. Plaid ugh Wes Anderson, freegan pug selvage fanny pack leggings pickled food truck DIY irony Banksy.
88

99
#### Hipster list
1010
<ul>

_posts/2015-10-20-math.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: a post with math
44
date: 2015-10-20 11:12:00-0400
55
description: an example of a blog post with some math
66
---
7-
This theme supports rendering beautiful math in inline and display modes using [MathJax 3](https://www.mathjax.org/){:target="\_blank"} engine. You just need to surround your math expression with `$$`, like `$$ E = mc^2 $$`. If you leave it inside a paragraph, it will produce an inline expression, just like $$ E = mc^2 $$.
7+
This theme supports rendering beautiful math in inline and display modes using [MathJax 3](https://www.mathjax.org/) engine. You just need to surround your math expression with `$$`, like `$$ E = mc^2 $$`. If you leave it inside a paragraph, it will produce an inline expression, just like $$ E = mc^2 $$.
88

99
To use display mode, again surround your expression with `$$` and place it as a separate paragraph. Here is an example:
1010

@@ -22,4 +22,4 @@ MathJax will automatically number equations:
2222

2323
and by adding `\label{...}` inside the equation environment, we can now refer to the equation using `\eqref`.
2424

25-
Note that MathJax 3 is [a major re-write of MathJax](https://docs.mathjax.org/en/latest/upgrading/whats-new-3.0.html){:target="\_blank"} that brought a significant improvement to the loading and rendering speed, which is now [on par with KaTeX](http://www.intmath.com/cg5/katex-mathjax-comparison.php){:target="\_blank"}.
25+
Note that MathJax 3 is [a major re-write of MathJax](https://docs.mathjax.org/en/latest/upgrading/whats-new-3.0.html) that brought a significant improvement to the loading and rendering speed, which is now [on par with KaTeX](http://www.intmath.com/cg5/katex-mathjax-comparison.php).

_posts/2018-12-22-distill.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ If you are interested in correctly adding dark mode support for distill, please
4747

4848
## Equations
4949

50-
This theme supports rendering beautiful math in inline and display modes using [MathJax 3](https://www.mathjax.org/){:target="\_blank"} engine.
50+
This theme supports rendering beautiful math in inline and display modes using [MathJax 3](https://www.mathjax.org/) engine.
5151
You just need to surround your math expression with `$$`, like `$$ E = mc^2 $$`.
5252
If you leave it inside a paragraph, it will produce an inline expression, just like $$ E = mc^2 $$.
5353

@@ -58,7 +58,7 @@ $$
5858
\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
5959
$$
6060

61-
Note that MathJax 3 is [a major re-write of MathJax](https://docs.mathjax.org/en/latest/upgrading/whats-new-3.0.html){:target="\_blank"} that brought a significant improvement to the loading and rendering speed, which is now [on par with KaTeX](http://www.intmath.com/cg5/katex-mathjax-comparison.php){:target="\_blank"}.
61+
Note that MathJax 3 is [a major re-write of MathJax](https://docs.mathjax.org/en/latest/upgrading/whats-new-3.0.html) that brought a significant improvement to the loading and rendering speed, which is now [on par with KaTeX](http://www.intmath.com/cg5/katex-mathjax-comparison.php).
6262

6363

6464
***

_posts/2020-09-28-github-metadata.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A sample blog page that demonstrates the accessing of github meta data.
1919

2020
## Additional Reading
2121
* If you're recieving incorrect/missing data, you may need to perform a Github API<a href="https://github.com/jekyll/github-metadata/blob/master/docs/authentication.md"> authentication</a>.
22-
* Go through this <a href="https://jekyll.github.io/github-metadata/" target="blank">README</a> for more details on the topic.
22+
* Go through this <a href="https://jekyll.github.io/github-metadata/">README</a> for more details on the topic.
2323
* <a href= "https://github.com/jekyll/github-metadata/blob/master/docs/site.github.md">This page</a> highlights all the feilds you can access with github-metadata.
2424
<br />
2525

_posts/2020-09-28-twitter.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ An example of pulling from a timeline:
1515
{% twitter https://twitter.com/jekyllrb maxwidth=500 limit=3 %}
1616

1717
# Additional Details
18-
For more details on using the plugin visit: [jekyll-twitter-plugin](https://github.com/rob-murray/jekyll-twitter-plugin){:target="\_blank"}
18+
For more details on using the plugin visit: [jekyll-twitter-plugin](https://github.com/rob-murray/jekyll-twitter-plugin)

0 commit comments

Comments
 (0)