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

Reduce loops for metatags in head #14

Open
MarauderXtreme opened this issue Feb 27, 2022 · 0 comments
Open

Reduce loops for metatags in head #14

MarauderXtreme opened this issue Feb 27, 2022 · 0 comments
Assignees
Labels
optimisation Optimise about everything: performance, render-speed, html, css, js, seo, …

Comments

@MarauderXtreme
Copy link
Owner

I have identified three scopes where metatags can be defined.
List from broadest to narrowest:

  1. "global" - general definitions, no i18n - reside in data/metatags.yml
  2. "i18n" - definitions for i18n - reside in i18n/LANG.yml
  3. "page" - definitions on page level, i18n and no i18n - reside in front-matter or defaults scope

To allow for overrides on narrower level I loop through every scope from narrow to broad and save the key to prevent overriding from broader scopes.

Since there are three general types of metatags (name, property, rel) I have created three includes accordingly.
To reduce loops it needs to be checked if merging of arrays is somewhat possible or implement it manually.
This helps to ease handling of special cases like og:image.

@MarauderXtreme MarauderXtreme added the optimisation Optimise about everything: performance, render-speed, html, css, js, seo, … label Feb 27, 2022
@MarauderXtreme MarauderXtreme self-assigned this Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimisation Optimise about everything: performance, render-speed, html, css, js, seo, …
Projects
None yet
Development

No branches or pull requests

1 participant