You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tooling.apache.org by "jbampton (via GitHub)" <gi...@apache.org> on 2025/11/29 23:36:28 UTC
[I] HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility (tooling-trusted-releases)
jbampton opened a new issue, #372:
URL: https://github.com/apache/tooling-trusted-releases/issues/372
Homepage is missing the: `meta content`
The HTML <title> tag should not have extra whitespace around its content for functional or semantic reasons. While whitespace within the HTML markup (like indentation or line breaks) is generally ignored by browsers and search engines for rendering, the content of the <title> tag itself should be concise and focused.
Same for meta tags
<img width="1281" height="503" alt="Image" src="https://github.com/user-attachments/assets/774bafb8-0a86-41d0-955e-ac336cb80970" />
<img width="1289" height="571" alt="Image" src="https://github.com/user-attachments/assets/ea9b6802-dedf-4a14-b0a9-144d8d248d43" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility (tooling-trusted-releases)
Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp commented on issue #372:
URL: https://github.com/apache/tooling-trusted-releases/issues/372#issuecomment-3603145366
> The HTML <title> tag should not have extra whitespace around its content for functional or semantic reasons. While whitespace within the HTML markup (like indentation or line breaks) is generally ignored by browsers and search engines for rendering, the content of the <title> tag itself should be concise and focused.
The [`document.title` WHAT WG documentation](https://html.spec.whatwg.org/multipage/dom.html#document.title) says to "[Strip and collapse ASCII whitespace](https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace) in _value_." Therefore I don't think "should not have extra whitespace around its content" holds. I could not find any article recommending to do this for any reason. Despite this, I would still like to fix this issue, on pure formatting grounds. We should also supply the missing `meta/@content` value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility (tooling-trusted-releases)
Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave closed issue #372: HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility
URL: https://github.com/apache/tooling-trusted-releases/issues/372
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility (tooling-trusted-releases)
Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave commented on issue #372:
URL: https://github.com/apache/tooling-trusted-releases/issues/372#issuecomment-3621073573
I switched to `{{ title }}` and `{{ description }}` in #393
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility (tooling-trusted-releases)
Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave commented on issue #372:
URL: https://github.com/apache/tooling-trusted-releases/issues/372#issuecomment-3620986718
The extra space is due to a combination of Jinja2 and HTML cleanup in pre-commit.
If there are specific meta tags to add then please create a specific issue and submit a PR. Changes are only needed in `base.html`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility (tooling-trusted-releases)
Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave commented on issue #372:
URL: https://github.com/apache/tooling-trusted-releases/issues/372#issuecomment-3623423656
> I switched to {{ title }} and {{ description }} in https://github.com/apache/tooling-trusted-releases/pull/393
I had to revert this attempt because the fix needs to touch most templates.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility (tooling-trusted-releases)
Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave closed issue #372: HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility
URL: https://github.com/apache/tooling-trusted-releases/issues/372
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] HTML markup `meta` and `title` tags: Readability and Clarity / Search Engine Optimization / Accessibility (tooling-trusted-releases)
Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave commented on issue #372:
URL: https://github.com/apache/tooling-trusted-releases/issues/372#issuecomment-3621053011
This can be done, but changes are needed to Quart configuration. Probably we need to contribute to `apache/infrastructure-asfquart`
Ahh—GOT IT! And this is **such an important detail in Quart/Jinja setups!**
If `{%- … -%}` *isn’t stripping whitespace*, it’s almost always because the **Jinja environment isn’t configured to allow it**, even though the syntax is valid.
And the great news is: **Quart does NOT enable whitespace stripping by default.**
So `{%-` behaves exactly like `{%` unless you turn on two specific environment options.
Let’s fix that!
---
# ✅ **1. Enable whitespace trimming in Quart**
You must set **both** of these on the Jinja environment:
* `trim_blocks = True`
* `lstrip_blocks = True`
In Quart:
```python
from quart import Quart
app = Quart(__name__)
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
```
🔥 After this, `{%-` and `-%}` will finally work exactly as expected.
---
# ⭐ Why both are required
| Setting | Effect |
| -------------------- | ----------------------------------------------- |
| `trim_blocks=True` | Strips the newline *after* a Jinja block (`%}`) |
| `lstrip_blocks=True` | Strips whitespace *before* a Jinja block (`{%`) |
Whitespace control operators `{%-`, `-%}`, `{{-`, `-}}` only fully work when these are enabled.
Without these settings, **Jinja leaves newlines intact**, even when writing `{%-`.
---
# 🎉 Quick proof
Template:
```jinja2
<title>{%- block title -%}{%- endblock -%}</title>
```
Without settings → output contains newlines around the block
With settings → output collapses to:
```html
<title>My Title</title>
```
---
# ⚡ Extra option: auto-escape consistency
While you're tuning settings, adding this helps too:
```python
app.jinja_env.autoescape = True
```
(Quart defaults this, but if you're customizing envs, check it.)
---
# If you'd like, I can help you confirm your environment settings or adjust them to your API layout.
Just show me your Quart setup — I LOVE helping get these template engines razor-clean!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org