Discussion, HeadContent development
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
Currently, we have ```` for head tags.
It lacks default values, let's assume we have a tag like this:
``````
We can put it in _Host.cshtml which will be available on every subpage. What if a subpage wants to modify it? There are currently two ways:
1.) Duplication of the value by HeadContent + _Host.cshtml. bad for SEO
2.) Every subpage should be placed in HeadContent, good for seo but bad for programmer. Code duplication and lots of problems
Alternatively, we can create an intermediate code, unfortunately also bad for the programmer. You will need to remember about the implementation on each page, example:
```razor
@AppState.Provider
```
I propose to create a default value during definition. That is:
```razor
```
Then, when compiling the code, razor will detect whether there is already ```` in ````, if so, it will replace its value, if not, it will do nothing.
### Describe the solution you'd like
Let me know what you think about it, I think it's worth discussing this idea and expanding on such a basic thing that has been omitted.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.