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

Put Wiki Content into Open Graph Descriptions #1896

Merged
merged 8 commits into from
Jun 28, 2024

Conversation

Masterjun3
Copy link
Collaborator

@Masterjun3 Masterjun3 commented Jun 27, 2024

Relevant to #1644 .

Basically, our meta tag descriptions on wiki pages currently show when the page was last edited. Which isn't really useful.
What would be useful instead is to take the first few lines of the wiki and put the text of that into the description!

So this was the idea (before | after):
image

Now, our wiki system is quite complicated. And we don't know if we want to add even more complexity to it. I basically tried to minimize the changes, and I made 3 commits that build upon each other, but are self-contained and can be run on their own.

  • 1st commit: Use the existing Wiki-To-Youtube text conversion.

Problem: The Youtube renderer renders links. But that isn't really useful for meta tag descriptions. This is somewhat solved by the 2nd commit.

  • 2nd commit: Write my own renderer, but still use the existing WriteTextAsync methods on the INode implementations.

Problem: All the big things like TOCs and Tabs are rendered at the start, which makes the meta tag description useless again.

  • 3rd commit: Write my own renderer, and also make my own WriteMetaDescriptionAsync in the INode implementations.

Finally it looks good to me.

However

However, this is quite the complexity added. If this is too much or we want to implement it differently, maybe after a rewrite or refactor of wiki stuff, then this PR can be closed. I just wanted to try how much it really is, because I do enjoy the results:

More examples:
image
image
image

@adelikat adelikat requested a review from nattthebear June 27, 2024 22:36
Copy link
Collaborator

@nattthebear nattthebear left a comment

Choose a reason for hiding this comment

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

This is a solid implementation. There's a complexity increase, but it's not significant and we gain useful value. Many commercial wiki products have significantly worse open graph description renderers than this 😅.

I've left a few suggestions.

TASVideos.WikiEngine/Node.cs Show resolved Hide resolved
@Masterjun3
Copy link
Collaborator Author

Masterjun3 commented Jun 28, 2024

Good review @nattthebear . It makes sense. If I use optimization as a reason to not follow convention, then I should properly optimize everywhere. I will resolve this in a few hours, when I have more time.

@Masterjun3
Copy link
Collaborator Author

Those commits should do it.

@adelikat adelikat requested a review from nattthebear June 28, 2024 19:15
Copy link
Collaborator

@nattthebear nattthebear left a comment

Choose a reason for hiding this comment

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

This is a great feature. Thanks for building it.

@adelikat adelikat merged commit 38543e1 into main Jun 28, 2024
1 check passed
@adelikat adelikat deleted the wikicontent-in-metadescription branch June 28, 2024 22:37
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