GithubHelp home page GithubHelp logo

Comments (8)

Tytrobot avatar Tytrobot commented on June 22, 2024 1

from toolbelt.blazor.headelement.

jsakamoto avatar jsakamoto commented on June 22, 2024

but on an SEO check, my page descriptions stopped working.

This library should work fine in the environment that you told me about in this issue.

Could you tell me about more details what was happened?

For example,

  • Was it no error but the page descriptions were not rendered as you expected? If that is so, could you tell me what was rendered as the page descriptions?
  • Did it show an error message or returned an HTTP 500 Internal server error something like an unhandled exception? If that is so, could you tell me the error message or stack trace of that exception?
  • If you can, could you send the source code to me that can reproduce this problem?

As you know, I'm sorry that there is nothing I can do if I could not get enough information about the problem.
Thank you for your understanding. πŸ˜ƒ

from toolbelt.blazor.headelement.

Tytrobot avatar Tytrobot commented on June 22, 2024

from toolbelt.blazor.headelement.

jsakamoto avatar jsakamoto commented on June 22, 2024

@Tytrobot
Sorry to late,

As to the page description, it appear to be blank, no listing.
No errors that I could see.

Hum... it looks like the server-side pre-rendering feature doesn't work correctly.
Could you show me the source code of the Startup.cs of your web app?

from toolbelt.blazor.headelement.

Tytrobot avatar Tytrobot commented on June 22, 2024

from toolbelt.blazor.headelement.

jsakamoto avatar jsakamoto commented on June 22, 2024

@Tytrobot

Is pre-rendering needed for the meta tags to work?

Yes, especially to make it to be recognized by internet crawlers.

If you don't use the "HeadElementService - Server Pre-rendering", the "description" meta tag that you inject by marking up the <Meta /> component (or by using the IHeadElementHelper service) has appeared after when the client-side part of the Blazor runtime's initial tasks are finished.

You can see that on a Web browser's developer tools.

By the way, generic internet crawlers don't process client-side script (there are some exceptions, but anyway).

This means internet crawlers just parse the text that was responded from the server-side of your Blazor Server app - that text is the result of the _Host.cshtml rendered.

As long as you don't enable the "HeadElementService - Server Pre-rendering", the text that the result of the _Host.cshtml rendered doesn't include the result of the <Meta /> component or the IHeadElementHelper service.

So, you have to enable the "HeadElementService - Server Pre-rendering" to make the "description" meta tag that is injected by marking up the <Meta /> component (or by using the IHeadElementHelper service) can be recognized by the internet crawlers.

from toolbelt.blazor.headelement.

jsakamoto avatar jsakamoto commented on June 22, 2024

@Tytrobot

To enable the "HeadElementService - Server Pre-rendering", please see the following instructions.

from toolbelt.blazor.headelement.

jsakamoto avatar jsakamoto commented on June 22, 2024

I'm glad to resolve this issue. πŸ˜ƒ

Happy coding!

from toolbelt.blazor.headelement.

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.