Skip to content
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

[HUGO] Highlight related articles at the bottom of a page #12

Closed
jwflory opened this issue Apr 23, 2021 · 4 comments
Closed

[HUGO] Highlight related articles at the bottom of a page #12

jwflory opened this issue Apr 23, 2021 · 4 comments
Labels
I: help wanted Extra attention is needed T: new change Adds new capabilities or functionality

Comments

@jwflory
Copy link
Member

jwflory commented Apr 23, 2021

Summary

Every article should have suggested reading content from elsewhere at the site. The suggested reading/articles should appear at the bottom of an article.

Background

Is your feature request related to a problem? Please describe:

Sometimes pages cover similar but different topics. It would be good to have a way to link out to related articles that might be interesting to a reader.

Describe the solution you'd like:

Best case scenario is using some kind of keyword indexing to determine which articles are related or not. For example, an article could take keywords in the front-matter definition. If keywords in one article match keywords from another, the article would appear at the bottom.

Describe alternatives you've considered:

Alternatively, we could manually specify specific articles in one article's front-matter. This is more manual and requires knowledge of other content in the site, but this would likely be a simpler implementation at the cost of more manual labor.

Details

Front-matter is the meta information at the top of every content. On this page, it looks like this:

---
title: "GPLv2 vs. GPLv3"
weight: 30

---

We could add support to our Hugo theme to look for front-matter tags like keywords, check for other content with the same keywords, and then show 3-5 articles at the bottom that match the keyword.

WordPress sites often have this functionality, and this feature request is partially inspired by seeing this in WordPress blog sites.

Outcome

Easier for readers to discover related content to what they are reading or searching for.

@jwflory jwflory added ?: needs triage Metadata needs to be triaged and updated T: new change Adds new capabilities or functionality labels Apr 23, 2021
@jwflory jwflory self-assigned this Apr 23, 2021
@jwflory jwflory added this to Current sprint in (deprecated) Open Source @ OoI via automation Apr 23, 2021
@jwflory jwflory removed their assignment Apr 23, 2021
@jwflory jwflory added the I: help wanted Extra attention is needed label Apr 23, 2021
@jwflory jwflory moved this from Current sprint to Backlog in (deprecated) Open Source @ OoI Apr 23, 2021
@jwflory jwflory removed the ?: needs triage Metadata needs to be triaged and updated label Apr 23, 2021
@MuluhGodson
Copy link
Contributor

MuluhGodson commented Apr 29, 2021

@jwflory This could be a good feature to add. However, I need more clarification.
Currently, I am able to display related articles according to some keyword indicated in the front matter of each article.
Say in the front matter we have a keyword categories.


---
title: "GPLv2 vs. GPLv3"
weight: 30
image: https://cdn.wccftech.com/wp-content/uploads/2013/10/rage-opengl.jpg
categories: foss
---

With this, I can group articles by this category. However, to filter this grouping in such a way that only articles in this same category are shown on pages in this category, I am running a conditional test matching the value of this category keyword with the parent folder of the article. I noticed in the content folder we have different categories (meta, foss, missions etc...). So an article in the foss folder with the keyword in the front matter as foss will be displayed as a related article ONLY in all other articles that fit this description. Articles in the Meta folder will not be able to display articles which are in the foss folder as related content.

Below is a screenshot from two different categories...(I used dummy images.)

  • This one is for articles with the foss keyword and located in the foss folder.
    related articles

  • This one is for articles with the meta keyword and located in the meta folder.
    meta related

Another way could ignore the folder in which the articles are located in and focus just on the keywords located in the front matter, and group related articles solely on these keywords with some other kind of logic such that only other articles with this specific keyword or set of keywords can be related. An example is shown below.

  • Below both articles are in different folders (design and foss) but are related due to the keyword "cook" found in their front matter. With this way, any articles can be related irrespective of location.
    related 3

What will be your preferred way?

@jwflory
Copy link
Member Author

jwflory commented May 1, 2021

@MuluhGodson Thanks for both your patience and interest on this issue! I prefer the first way, where related articles will only appear in the same category as they are published. This better fits the design pattern of the theme. Let me know if this clarifies your query.

jwflory added a commit that referenced this issue May 8, 2021
This commit updates the git submodule with @MuluhGodson's changes added
in unicef/inventory-hugo-theme#4. Articles can now support front matter
for their categories, and articles sharing the same category may appear
as related articles at the bottom of the page.

Part of #12, but does not yet close it.

Signed-off-by: Justin W. Flory (he/him) [UNICEF Innovation] <jflory@unicef.org>
@jwflory jwflory moved this from Backlog to Waiting on external in (deprecated) Open Source @ OoI May 25, 2021
jwflory added a commit that referenced this issue Aug 10, 2021
…25)

* Content: added categories for related articles

* config: added taxonomies for related content and limit of displayed related articles

Co-authored-by: Justin W. Flory (he/him) [UNICEF Innovation] <jflory@unicef.org>
@jwflory
Copy link
Member Author

jwflory commented Aug 10, 2021

Completed by #25.

@jwflory jwflory closed this as completed Aug 10, 2021
(deprecated) Open Source @ OoI automation moved this from Waiting on external to Done Aug 10, 2021
@MuluhGodson
Copy link
Contributor

Oh my. @jwflory Sorry for not being available. I have been very occupied with other personal commitments. But I am happy to have contributed to this issue. Will be looking at some others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: help wanted Extra attention is needed T: new change Adds new capabilities or functionality
Development

No branches or pull requests

2 participants