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

Side Bars #811

Merged
merged 6 commits into from
Mar 27, 2024
Merged

Side Bars #811

merged 6 commits into from
Mar 27, 2024

Conversation

adamgordonbell
Copy link
Contributor

@adamgordonbell adamgordonbell commented Mar 27, 2024

This is the change to add related items and earthly tie ins to the side bars of the blog posts. Test on makefile posts shows this very likely increases time spent on site.

Related items are found using OpenAI embedding API and cosine simularity. Posts have between 0 and 15 related posts, depending on how many we've written in that area.

Changes made:

  • Table of contents defaults on
  • TOC turns off in cases it doesn't look good or breaks the related item tie in
  • Wide images turned off on posts where wide image would now break the layout of sidebar ( because its near the top)

Still to do:

  • Related items is calculated in suggested_posts.py and written to related_articles.yml. Need some automation do this for new articles.

Posts vary in a number of way: Some have TOC and are in a series:

Examples:
With TOC and part of series:
https://66045cfe5c4d842fe219540d--ephemeral-narwhal-3ac3b2.netlify.app/blog/g++-makefile/

No TOC but series:
https://66045cfe5c4d842fe219540d--ephemeral-narwhal-3ac3b2.netlify.app/blog/thought-leaders/

TOC but no series:
https://66045cfe5c4d842fe219540d--ephemeral-narwhal-3ac3b2.netlify.app/blog/why-developer-platform/

No TOC or Series:
https://66045cfe5c4d842fe219540d--ephemeral-narwhal-3ac3b2.netlify.app/blog/on-star-history/

@adamgordonbell adamgordonbell marked this pull request as ready for review March 27, 2024 18:06
@@ -68,7 +64,7 @@ In this tutorial, you will be learning how to use PyScript via [the website](htt

Create a HTML file and fill the code as you normally would, to display text in your browser.

~~~{.bash caption=">_"}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated clean up of code examples in this blog post.

@@ -2,6 +2,7 @@
title: "Earthly on Software Engineering Daily"
categories:
- News
toc: false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling table of contents, where it is just one item, way way too many items, or somehow blows up page layout.

@thtmnisamnstr
Copy link
Contributor

I'm slightly confused about the difference between the "Recommended for You", "Spotlight on Related Content", and "Discover More" sections. They seem kinda redundant.

Also, in the Series sections, the title always fits and is never truncated (or so it seems), but in all 3 of the previously mentioned sections, the title frequently truncates. It seems like we should be able to make them not truncate as well.

@adamgordonbell
Copy link
Contributor Author

I'm slightly confused about the difference between the "Recommended for You", "Spotlight on Related Content", and "Discover More" sections. They seem kinda redundant.

There is no difference, its 0-3 in teh first section, 4-8 in the next and 9 to 15 in the last. Just a way to break it up visually for the user. If you have better idea for naming it, let me know.

Also, in the Series sections, the title always fits and is never truncated (or so it seems), but in all 3 of the previously mentioned sections, the title frequently truncates. It seems like we should be able to make them not truncate as well.

This is because when you make a series, you have to write a shorter version of the title to go with it and put it in navigation.yml. So we'd need a way to write 450 shorter titles to make that work.

@vladaionescu
Copy link
Member

Great! I have similar questions as Gavin. Re truncation - at the very least we could make it show the full title as a tool tip on link hover? It would be nice if we didn't need truncation at all.

@thtmnisamnstr
Copy link
Contributor

We could include shorter titles in the headmatter in each mdx file, but a way to generate 450 of them that are accurate is more difficult.

Instead of "Recommended for You" and "Spotlight on Related Content" on the same side and "Discover More" on the right side, how about we just include one on the left and one on the right. As far as naming for each section, I don't have any good ideas. Maybe "Related Content" and the left and "Discover More" on the right.

@adamgordonbell
Copy link
Contributor Author

I guess the way to get shorter titles it to write another job that using an LLM to come up with shorter titles for each blog post and that runs periodically to fill in items as they post. Alternatively can find a way to call the LLM during building the site, and cache results, but might slow down the build process.

@vladaionescu
Copy link
Member

Hmm.. I don't know if I would change the titles in the links necessarily. It might have negative SEO influence if the links don't match the title of the page.

@adamgordonbell adamgordonbell merged commit d7bc9ec into agbell/related-posts Mar 27, 2024
1 check passed
@adamgordonbell adamgordonbell deleted the agbell/related-posts2 branch March 27, 2024 20:16
adamgordonbell pushed a commit that referenced this pull request Mar 28, 2024
* WIP

* seperating out sidebar

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* archive-single caching

* WIP

* WIP

* cache is now persistent between runs of --incremental

* WIP

* WIP

* WIP

* WIP

* Side Bars (#811)

* WIP

* WIP

* WIP

* updating posts

* lint

* move to 5 & 5 recommendations

* WIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants