-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
feat: use wordpress for static pages #10596
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10596 +/- ##
==========================================
- Coverage 49.54% 49.08% -0.46%
==========================================
Files 67 78 +11
Lines 20650 22226 +1576
Branches 4980 5302 +322
==========================================
+ Hits 10231 10910 +679
- Misses 9131 9981 +850
- Partials 1288 1335 +47 ☔ View full report in Codecov by Sentry. |
Looks great to me, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First thanks for this great work !
I would prefer the cache to be handled differently, I think this way is problematic.
@4nt0ineB it would be important also to write a procedure on how to migrate from openfoodfacts-web to wordpress content progressively (how to replace a page). I think it could go with implementing #10539 (so basically, you would create page in wordpress and publish, then put a redirect to content/new-page in openfoodfacts-web).
Co-authored-by: Alex Garel <[email protected]>
Would it be possible to have the WordPress id and/or slug and/or custom properties exposed to ProductOpener so that we can create deep links like: "Help translate this article on Crowdin" or "Help translate the 2 associated visuals on Canva". |
I haven't looked into Crowdin integration yet. But if a crowdin_id field is stored and exposed in the WPML api then I guess its possible. |
I think what's missing in the PR is how we handle the different URLs slugs that are translated. e.g. if we create a page "A new page", we want it to be available at world.openfoodfacts.org/content/a-new-page but also fr.openfoodfacts.org/content/a-new-page when a new French translation is added, we want it to be available at fr.openfoodfacts.org/content/une-nouvelle-page , and fr.openfoodfacts.org/content/a-new-page should redirect to it. but we shouldn't have to edit the .redirect file (as described here: https://wiki.openfoodfacts.org/Open_Food_Facts_Contents ) each time someone adds a translation.. am I missing something? Ideally PO should find out from wordpress which pages are available, which are translated and what are their urls. Then we use that in the routing and displaying of the translated content if available, and the English content if not. We could then automatically replace things like <content_url:a-new-page> to https://fr.openfoodfacts.org/content/une-nouvelle-page |
Yes what I did is that PO fetches all the available translations. I think the redirection was done for SEO purposes. |
Quality Gate passedIssues Measures |
Sorry for coming late to this but should we consider loading the wordpress content from the browser so that we are reducing the amount of traffic that flows through ProductOpener? |
Yes it was considered, but we didn't want to maintain a specific layout on wordpress, and we wanted to have the menu and so on… |
You can use module federation with a micro frontend to achieve this |
Closing in favour of #10992 |
What
Experience of using Wordpress as a CMS for static pages. Page content is retrieved from the API.
The goal is to render the page as close as it is displayed in the Gutenberg editor.
Screenshot
Related issue(s) and discussion