iamSahdeep/seo_renderer

Any reason for the DivElement only?

Opened this issue Β· 6 comments

t1gu1 commented

Hi and first, thanks for your workaround!

I want to know if there is any reason why it use DivElement only?

  • For a link (a), should it be better if we use LinkElement?
  • For a Text (p) element, should it be better if we use ParagraphElement?
  • For a Heading (h1, h2, etc) element, should it be better if we use HeadingElement? (HeadingElement.h1(), HeadingElement.h2())

We can find it all here: https://api.dart.dev/stable/2.14.2/dart-html/LinkElement-class.html

Here is why Heading tags and Link tags can be important: https://www.greengeeks.ca/blog/html-tags-for-seo/

Thanks to share on this with me.
Maybe I'll do a PR on that if there is no specefic reason. :)

Hi @t1gu1 πŸ’―
There is no specific reason to it, Actually I had very little knowledge of HTML and SEO but was learning and about to make changes for heading tags.
You are right we should be using specific tags for specific use case. I am planning on it first stable release v1.0.0 and would love to have your PR on this.

  • For TextRenderer we are currently not using any Child Element, just putting text to Div as it is., We can add ElementType enum in TextRenderer with values (H1, H2 ... P )with default to P and can use it to identify which Element we should be picking. Or if you have any other better way that would be great.
  • For links I think we should use AnchorElement, I just read and its mentioned that <-link> tag is to specify linked CSS or other resources to HTML but for navigation or links to other webpages we should be using <-a> i.e., AnchorElement. Let me know if I am missing something or if am wrong on it :)
  • Also currently for single Text, Link or Image its wrapped up into their own separate Parent which is DivElement, and I am not sure if we are supposed to do it like that or we should be using single <-div> to put all the elements.

If you can do PR let me know :)πŸ₯‡

t1gu1 commented

Thanks for your quick reply @iamSahdeep!

I could do the PR.
I'm simply really busy lately so it could take a week or two before I start that.

I will let you know in that thread if I got some question for you.
πŸ€œπŸ€›

t1gu1 commented

With that last PR we can now use whatever we want to render text. πŸ₯‡

Next step I could check for the link element that I didn't touch in my PR.

That’s Awesome ✨
Thanks for the PRs πŸ™Œ

Hi,
I saw you included this PR... when will you do a new release?
Thanks

@mgaceanu Hi, I am pushing v1.0.0 soon. Meanwhile these changes are pushed as version v0.3.0