GithubHelp home page GithubHelp logo

Comments (17)

kgodey avatar kgodey commented on July 22, 2024 1

thanks for creating this @techievivek

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024 1

@nik-gautam All the post/page have content stored in content folder, we can use frontend html-stripping and get first 20 words to be part of meta description tag.
When we do html-stripping it will take care and will return us just the text content.
This is not recommended method as there are speculations that FB wont run JS code, so we will have to test it locally first.

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024

@kgodey Mam, Please add labels to this issue so that somebody can take it.

from creativecommons.github.io-source.

nik-gautam avatar nik-gautam commented on July 22, 2024

Can I work on this issue?

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024

@nik-gautam go ahead.

from creativecommons.github.io-source.

nik-gautam avatar nik-gautam commented on July 22, 2024

@techievivek where can I find the latest code with the previous image fixes that you made?

Thanks.

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024

@nik-gautam Check here #183

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024

@kgodey Can't we use JavaScript here too to add meta description once the DOM content is loaded rather then going for plugins to strip HTML and get excerpt.
It will be easy to implement.
I have gone through some articles on setting meta data using JS, if we can do before the page loads fully there won't be an issue.
We will wait for @nik-gautam if he has any other plans for same.

from creativecommons.github.io-source.

kgodey avatar kgodey commented on July 22, 2024

@techievivek could you link the articles you read here?

from creativecommons.github.io-source.

nik-gautam avatar nik-gautam commented on July 22, 2024

@techievivek I think will be easier to use javascript.
Till now, I have been trying to fix the issue with strip-html-tags plugin.

A problem that I faced was where to get the info from, because as far I saw there is no common p-tag or any other tag that every page has (which contains the info we want to display), so a common script cannot be ran for all.

Also, my mid-sem exams are going on right now, it will take me a few days to really start coding.

Sorry for the delay.

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024

@kgodey Here is one they are doing using Jquery https://stackoverflow.com/questions/9231845/javascript-to-change-metadata-metatags-dynamically
(I have not tested this myself for now). There are some speculations that FB doesn't run JS code. And I have gone through some articles looking for its effect on SEO, but luckily google crawlers can run JavaScript.
Here is from their official developer website:- https://developers.google.com/search/docs/guides/javascript-seo-basics
And here is a report generated by searchengineland team https://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024

@nik-gautam @kgodey It might not be possible with JS https://stackoverflow.com/questions/25420887/does-facebook-crawler-currently-interpret-javascript-before-parsing-the-dom
I will try then locally and will confirm by today. Also if this doesn't we will see for alternate with lektor itself.

from creativecommons.github.io-source.

nik-gautam avatar nik-gautam commented on July 22, 2024

@techievivek js won't work with Facebook crawler...

I did some research, it turns out that fb gets the data by crawling and looking for og meta tags, before loading the DOM. So, any changes via JavaScript on DOM won't work.

Data has to added before generating the static HTML files in lektor.

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024

@nik-gautam Yes, I tested it, it's not working. Try doing it with lektor plugins itself.

from creativecommons.github.io-source.

nik-gautam avatar nik-gautam commented on July 22, 2024

@techievivek @kgodey I have somewhat fixed the issue.

https://github.com/nik-gautam/creativecommons.github.io-source/tree/description_for_social_media_sharing

Can you check it before I make a PR?

from creativecommons.github.io-source.

nik-gautam avatar nik-gautam commented on July 22, 2024

@kgodey @techievivek
Please take a look at this PR.

from creativecommons.github.io-source.

techievivek avatar techievivek commented on July 22, 2024

@nik-gautam It's good. If possible please add a screenshot so that it will easy to see the end result. @kgodey will be available after Tuesday till then you can look for other issues.

from creativecommons.github.io-source.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.