Skip to content

Commit

Permalink
Added related posts section (alshedivat#1168)
Browse files Browse the repository at this point in the history
  • Loading branch information
george-gca authored and siantonelli committed Oct 26, 2024
1 parent 0a2439c commit 40dc7d5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Medical Robotics Junior Faculty Forum (ISMR: <a href="https://junior-forum-ismr.
- [Theming](#theming)
- [Social media previews](#social-media-previews)
- [Atom (RSS-like) Feed](#atom-rss-like-feed)
- [Related posts](#related-posts)
* [Contributing](#contributing)
+ [Core Contributors](#core-contributors)
* [License](#license)
Expand Down Expand Up @@ -527,7 +528,7 @@ Assuming you have [Ruby](https://www.ruby-lang.org/en/downloads/) and [Bundler](
$ git clone [email protected]:<your-username>/<your-repo-name>.git
$ cd <your-repo-name>
$ bundle install
$ bundle exec jekyll serve
$ bundle exec jekyll serve --lsi
```

Now, feel free to customize the theme however you like (don't forget to change the name!).
Expand Down Expand Up @@ -575,7 +576,7 @@ uses the `master` branch for the source code and deploys the webpage to `gh-page

If you decide to not use GitHub Pages and host your page elsewhere, simply run:
```bash
$ bundle exec jekyll build
$ bundle exec jekyll build --lsi
```
which will (re-)generate the static webpage in the `_site/` folder.
Then simply copy the contents of the `_site/` foder to your hosting server.
Expand All @@ -595,7 +596,7 @@ Firstly, from the deployment repo dir, checkout the git branch hosting your publ

Then from the website sources dir (commonly your al-folio fork's clone):
```bash
$ bundle exec jekyll build --destination $HOME/repo/publishing-source
$ bundle exec jekyll build --lsi --destination $HOME/repo/publishing-source
```

This will instruct jekyll to deploy the website under `$HOME/repo/publishing-source`.
Expand Down Expand Up @@ -893,6 +894,12 @@ It generates an Atom (RSS-like) feed of your posts, useful for Atom and RSS read
The feed is reachable simply by typing after your homepage `/feed.xml`.
E.g. assuming your website mountpoint is the main folder, you can type `yourusername.github.io/feed.xml`

#### Related posts
By default, there will be a related posts section on the bottom of the blog posts.
These are generated by selecting the `max_related` most recent posts that share at least `min_common_tags` tags with the current post.
If you do not want to display related posts on a specific post, simply add `related_posts: false` to the front matter of the post.
If you want to disable it for all posts, simply set `enabled` to false in the `related_blog_posts` section in `_config.yml`.

## Contributing

Contributions to al-folio are very welcome!
Expand Down
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ related_blog_posts:
enabled: true
max_related: 5

related_blog_posts:
enabled: true
max_related: 5

# Giscus comments (RECOMMENDED)
# Follow instructions on https://giscus.app/ to setup for your repo to fill out
# the information below.
Expand Down
1 change: 1 addition & 0 deletions _posts/2015-10-20-disqus-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ date: 2015-10-20 11:59:00-0400
description: an example of a blog post with disqus comments
categories: sample-posts external-services
disqus_comments: true
related_posts: false
---
This post shows how to add DISQUS comments.
1 change: 1 addition & 0 deletions _posts/2015-10-20-math.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ date: 2015-10-20 11:12:00-0400
description: an example of a blog post with some math
tags: formatting math
categories: sample-posts
related_posts: false
---
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 $$.

Expand Down
2 changes: 2 additions & 0 deletions _posts/2022-02-01-redirect.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ date: 2022-02-01 17:39:00
description: you can also redirect to assets like pdf
redirect: /assets/pdf/example_pdf.pdf
---

Redirecting to another page.
1 change: 1 addition & 0 deletions _posts/2022-12-10-giscus-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ date: 2022-12-10 11:59:00-0400
description: an example of a blog post with giscus comments
categories: sample-posts external-services
giscus_comments: true
related_posts: false
---
This post shows how to add GISCUS comments.

0 comments on commit 40dc7d5

Please sign in to comment.