Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove email subject in “Help improve this page” and improve component performance #115

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

remibetin
Copy link
Member

@remibetin remibetin commented Nov 5, 2024

Direct link to preview: https://deploy-preview-115--wai-website-theme.netlify.app/components/teasers/

Currently, an email subject is automatically populated when clicking on email links in “Help improve this page”. See for example the “Help improve this page” section in “Accessibility Fundamentals Overview”.

To help with spam processing, this pull request:

  • stops populating the email subject
  • adds [include a relevant email Subject] to the email body, to encourage users to manually add an email subjet.

Resolves w3c/wai-website#941

I have applied additional improvements to the component:

  • Removed the line creating a col variable: deprecated since bbade4c

  • Used default filter to set a default value for feedbackmail, instead of if/else statements.

  • Cached t.html and box.html includes. To make it work, I have explicitly passed the page language as argument. (See Jekyll Include Cache README)

  • Introduced a plainText argument that can be passed to an t.html include. When present, <span lang="en"></span> is not added around the English text when a translation is missing. Currently, the HTML code was added to the email body...

    Example:

    <span lang="en">[include a relevant email Subject]</span>
    
    [votre commentaire ici...]
    
    J’accepte que ceci soit partagé sur une liste de diffusion archivée publiquement.
    

Test

I built the site before and after the edits: no unexpected changes.

Impact on Render Stats (using --profile flag)

Before caching t.html and box.html includes:

Filename Count Bytes Time
jekyll-remote-theme-20241105-81016-1uqh35/_includes/t.html 12667 534.87K 0.652
jekyll-remote-theme-20241105-81016-1uqh35/_includes/box.html 5272 726.19K 0.167
jekyll-remote-theme-20241105-81016-1uqh35/_includes/feedback-box.html 1106 1470.27K 1.105

After caching t.html and box.html includes:

Filename Count Bytes Time
jekyll-remote-theme-20241105-82502-d57quu/_includes/t.html 5754 231.31K 0.383
jekyll-remote-theme-20241105-82502-d57quu/_includes/box.html 3075 331.72K 0.078
jekyll-remote-theme-20241105-82502-d57quu/_includes/feedback-box.html 1106 1431.32K 0.492

Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for wai-website-theme ready!

Name Link
🔨 Latest commit 73433a0
🔍 Latest deploy log https://app.netlify.com/sites/wai-website-theme/deploys/6729faaa3c0b440008b3e1b8
😎 Deploy Preview https://deploy-preview-115--wai-website-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@remibetin remibetin requested review from shawna-slh and removed request for shawna-slh November 5, 2024 10:30
…en"></span> when no translation exists. This is useful for text inserted in the email body.
@remibetin remibetin requested a review from shawna-slh November 5, 2024 11:09
Copy link
Contributor

@shawna-slh shawna-slh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

From 'Help improve this page' emails, remove subject
2 participants