Skip to content

556 auto generate post descriptions #563

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

Merged
merged 9 commits into from
Nov 6, 2024

Conversation

kjaymiller
Copy link
Contributor

@kjaymiller kjaymiller commented Nov 5, 2024

  • add ollama_summarizer.py
  • update requirements
  • update layouts to include descriptions
  • update posts

Issue Link 🔗:

Issue: #[Issue_Number]

UPDATE

While trying to get tests to pass, I ran into an issue where the default post was not being applied. The most verbose fix is to auto apply it when it is missing.

I wrote about this in #564
To fix this I made a somewhat large change.

  • I added the update_layout.py cli tool that checks for a layout field and will apply it if missing (you can supply as many posts to check)
  • created a custom pre-commit hook that runs update_layout on any .md files in _posts that are not updated. this works like all other pre-commit hooks in that the hook will fail, but it will fix the issue.
    I updated the documentation in contributors.md

Type of Change

  • Bug fix 🐞
  • New feature/page
  • Documentation update
  • Other

Description 📋

  • What: Provide an overview of the issue this PR addresses. Explain the context and background information.

This PR uses the ollama_summarizer tool to check all the posts for descriptions, creating new descriptions if they currently do not exist.

It also adds the new descriptions to the meta descriptions as well as the blog lists instead of excerpts...

  • Why: Describe why the changes are being made. Highlight key updates, new features, or bug fixes.

Excerpts were being cutoff in some posts and their HTML was showing. This tool instead can be used to quickly generate descritpions based on the contents and use AI to quickly update.

It's also easy to change the description if there is a report of a bad descriptions.

  • How: Explain how these changes will affect the project or end-users.

This will make our social media links more dynamic and engaging and also it will give folks a summary of the content they are about to explore.

Checklist ✅

  • Followed the Code of Conduct and Contribution Guide
  • Ran pre-commit run --all
  • All tests pass locally
  • Added tests (if applicable)
  • Documentation updated (if applicable)

Additional Notes & Screenshots

Add any additional notes or comments that might be helpful for the reviewers.

@kjaymiller kjaymiller linked an issue Nov 5, 2024 that may be closed by this pull request
@kjaymiller kjaymiller marked this pull request as ready for review November 6, 2024 03:18
@kjaymiller kjaymiller linked an issue Nov 6, 2024 that may be closed by this pull request
@TimOsahenru
Copy link
Contributor

Initially found this really insightful ... wanted to try this and get my hands messy on it 😔. Did we happen to stream this?

@kjaymiller
Copy link
Contributor Author

Initially found this really insightful ... wanted to try this and get my hands messy on it 😔. Did we happen to stream this?

sadly no but I did write this blog post about it late last night - https://kjaymiller.com/blog/i-made-a-precommit-hook-it-wasn-t-that-bad.html

I think the auto-generate posts thing was a temporary fix. I think long term the CLI in pre-commit is the better solution where we fail pre-commit run if there is no description.

@kjaymiller
Copy link
Contributor Author

In the meantime. @TimOsahenru can you review the PR so we can get it pushed?

Copy link
Contributor

@TimOsahenru TimOsahenru left a comment

Choose a reason for hiding this comment

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

Looks good to me! I noticed that some articles still don’t have an author tag. We could consider adding a default, like 'BPD,' for articles without a specified author to keep things consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have a default author for this to make things a bit consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

and this too

Copy link
Contributor

Choose a reason for hiding this comment

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

and this too... we could have "BPD" as a default author for those articles without authors

@kjaymiller
Copy link
Contributor Author

Looks good to me! I noticed that some articles still don’t have an author tag. We could consider adding a default, like 'BPD,' for articles without a specified author to keep things consistent.

Good news is I was the author of these posts so I can update that in a followup issue.

I think a new issue (not to delay this PR) is to have fields that have to be filled in order for pre-commit to pass...

I think we can modify the existing update_layout.py (maybe rename it to posts_validation.py) to look for parameters and optionally set a default.

Again I think that is a different issue. In fact the only reason this was added in this issue was that I wanted to ensure that our tests were passing.

@kjaymiller
Copy link
Contributor Author

In the meantime @TimOsahenru if it's good add your review approval to get this wrapped up.

@TimOsahenru TimOsahenru merged commit 0e0013f into gh-pages Nov 6, 2024
6 checks passed
@kjaymiller kjaymiller deleted the 556-auto-generate-post-descriptions branch April 28, 2025 13:56
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.

No Layout field causing issues with testing Auto generate post descriptions
2 participants