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

Adding related links short code and using it #13799

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

adamgordonbell
Copy link
Contributor

Using the Shortcode

Add the following shortcode where you want related posts to appear in your blog post:

{{< related-posts >}}

The shortcode will display up to 3 related posts in a "You might also like:" section. It automatically excludes the current post from the suggestions.

How Related Posts are Selected

Related posts are configured in data/related.yaml with three priority levels:

  1. Specific Entries: Manual overrides for specific posts
  2. Tag-Based: Entries based on first tag on post
  3. Default: Fallback suggestions if no other matches

The tag-based entries can be generated by scripts/python/generate_tag_related.py, which creates 4 posts per tag (to ensure 3 remain after filtering the current post). They can also be edited by hand.

Managing Related Posts

Use these make commands:

  1. Update only new tags (preserves existing):

    make generate-related-tags
  2. Regenerate all tags (overwrites existing):

    make generate-related-tags -- --no-preserve-existing

… and YAML for better management and consistency.
… to 'related.yaml' and adjust ordering of sections in output.
… related posts data. Removed temporary files and improved output messaging.
…hance YAML generation script for tags. Adjust default post count in recent posts script.
… enhancing content organization and incorporating new entries across various categories.
@pulumi-bot
Copy link
Collaborator

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