Aleksi44 / wagtailyoast

Wagtail + Yoast
https://pypi.org/project/wagtailyoast/
GNU General Public License v3.0
34 stars 11 forks source link

Customising the content that are being analysed #1

Open TWOC-WHT opened 3 years ago

TWOC-WHT commented 3 years ago

Currently the content that are being analysed is the whole source code of the preview (Which includes the header, navbar, footer, and other parts of the page) Is there a way to customise or filter the content before analysing?

Aleksi44 commented 3 years ago

Hi @TWOC-WHT

Currently no. It can be done quite simply with this solution :

We can add a new field (like keywords) in the Yoast Wagtail panel, something like this:

# Filter the contents of the preview page with a jQuery selector
filter_selector =  models.CharField(...)

What do you think about this?

TWOC-WHT commented 3 years ago

Hi @Aleksi44 thanks for the reply! That's interesting! Let me see if I get this right: So in the filter_selector, we will fill the part of the content we would like to analyse with a jQuery selector? i.e. if the part that we would like to analyse has the class "content", the filter_selector will be filled ".content"

Aleksi44 commented 3 years ago

@TWOC-WHT

Yes, you got it. Is that what you want?

TWOC-WHT commented 3 years ago

@Aleksi44 ah yes, that could do! Thank you very much!

Aleksi44 commented 3 years ago

@TWOC-WHT

Cool, I'll do it when I have some time (next week I think).

TWOC-WHT commented 3 years ago

@Aleksi44 Great! look forward to it and will definitely try it out! Oh and thank you for creating this package!

TWOC-WHT commented 3 years ago

Hi @Aleksi44 are there any update regarding this? Is there anything that I can help with? I don't mind to look into it myself, although I might need some pointers on where to start (i.e. which files to pay attention to or which documentation I can refer to)

Aleksi44 commented 3 years ago

Hi @TWOC-WHT I have started to do the work on this PR to guide you if you wish to move forward on this subject.

TWOC-WHT commented 3 years ago

@Aleksi44 Thanks! will look into it!