add faust plugin to rewrite non-admin pages to use frontend
set auth token cookie frontend can use to get draft content
remove unused theme template files
To Review
[x] Set up your local dev for the front end using branch in PRX/theworld.org#432
...then...
[x] Checkout Branch.
[x] Add TW_PREVIEWS_SECRET_KEY to your .env file. Get its value from WordPress Salt generator (copy string contents from one of the defines' second parameter.)
[x] Run lando rebuild (needed to get new environment variable into lando containers.)
[x] Run npm run local (or npm run refresh if you want a fresh database.)
[x] Set Front-end site URL to http://the-world-wp.lndo.site:3000.
[x] Check Enable Post and Category URL rewrites.
[x] Check Enable public route redirects.
[x] Save settings.
...then...
[x] Go to Posts. Ensure preview links on draft items take you to the front-end URL and its path uses the permalink pattern, but ends with /preview/[post_id]. Cmd click the preview link to open in new tab.
[x] Ensure you are taken to your local frontend site and the page renders with the draft content.
[x] Close tab and go back to Posts list in admin.
[x] Add a new post. Add a title and some content. You should be able to preview your changes before clicking Save Draft link.
[x] After ensuring pre-save preview works, close preview tab, go back to tab with add post form, then click Save Draft.
[x] Once it is save, ensure preview link still works. Close preview tab.
[x] The same should be true of edits, as long as you use the Preview in new tab option from preview menu.
[x] Publish post when you are done testing draft edits.
[x] View links should now take you to the published post on the frontend.
[x] Edit the title, then click Preview in new tab. Make sure you had already closed any previous preview tabs.
[x] Click Update button. Viewing post should now show updated content at published URL.
[x] Repeat review of preview links when creating and editing an Episode.
[x] Repeat review of preview links when creating and editing an Segment.
[x] Repeat review of preview links when creating and editing an Newsletter.
[x] Repeat review of preview links when creating and editing an Page.
Closes #130
To Review
TW_PREVIEWS_SECRET_KEY
to your.env
file. Get its value from WordPress Salt generator (copy string contents from one of the defines' second parameter.)lando rebuild
(needed to get new environment variable into lando containers.)npm run local
(ornpm run refresh
if you want a fresh database.)http://the-world-wp.lndo.site:3000
./preview/[post_id]
. Cmd click the preview link to open in new tab.