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

Add rewrite rule for Ghost cards #3077

Merged
merged 3 commits into from
Jan 12, 2025

Conversation

jake-walker
Copy link
Contributor

In Ghost articles, I find it difficult to read some of the links where the author makes use of link cards. After Miniflux's sanitisation the cards get reduced to a bit of a jumbled mess of image previews, favicons, links and descriptions (as shown below).

This PR adds a rewrite rule named fix_ghost_cards which extracts just the title and author from the card and converts it to a simple link.

Before

Screenshot of article using Ghost cards

After

Screenshot of article using Ghost cards with rewrite rule applied

Guidelines

Do you follow the guidelines?

@jake-walker jake-walker changed the title feat: ghost card rewrite rule Add rewrite rule for Ghost cards Jan 11, 2025
@jake-walker jake-walker force-pushed the dev/ghost-rewrite-rule branch from 54f3e71 to cee8cea Compare January 12, 2025 00:22
Copy link
Member

@fguillot fguillot left a comment

Choose a reason for hiding this comment

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

Is it possible to add a unit test?

@jake-walker
Copy link
Contributor Author

Absolutely, I've added in a few unit tests to test the functionality and edge cases

@fguillot
Copy link
Member

Would not be better to use a HTML list (<ul> / <li>) for readability when there are multiple cards? There is no spacing between each link which make it hard to read.

Example with this link: https://selfh.st/newsletter/2025-01-10/

Using fix_ghost_cards rewrite rule in Miniflux:

image

The original website:

image

@jake-walker
Copy link
Contributor Author

I made a small change when adding the tests which messed up the formatting, but they definitely look better in a list. I've changed the code to do that and added a couple more tests:

@jake-walker jake-walker force-pushed the dev/ghost-rewrite-rule branch from 4d0ca66 to 91f821b Compare January 12, 2025 22:22
@jake-walker jake-walker force-pushed the dev/ghost-rewrite-rule branch from 91f821b to 0d6cb64 Compare January 12, 2025 22:23
@fguillot fguillot merged commit 6cbe8c3 into miniflux:main Jan 12, 2025
8 checks passed
@jake-walker jake-walker deleted the dev/ghost-rewrite-rule branch January 12, 2025 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants