Page MenuHomePhabricator

[e.cash] Add blog post page
ClosedPublic

Authored by johnkuney on Jul 5 2023, 16:41.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC31e75323f8ff: [e.cash] Add blog post page
Summary

Adding the page constructor for the individual blog posts

Test Plan

preview the site and go to /blog page
click on some of the links and see if the post pages render correct
also try navigating directly to some of the post pages
note: some images are still broken on the post pages, this is not an issue here they just need to be
added to strapi still

Diff Detail

Repository
rABC Bitcoin ABC
Branch
ecash-posts-pages
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 24376
Build 48361: Build Diff
Build 48360: arc lint + arc unit

Event Timeline

Noticed a few weirdnesses the look like broken images

from here: http://51.68.37.192:41826/blog/ecash-aliases-development-sneak-peek-june-2023

image.png (239×506 px, 21 KB)

Weirdly cropped image here: http://51.68.37.192:41826/blog/what-the-future-holds-for-ecash

image.png (649×936 px, 297 KB)

And another broken-looking image here: http://51.68.37.192:41826/blog/ecash-monthly-recap-may-2023

image.png (450×702 px, 21 KB)

Yeah for the broken images see the note in the description, those are broken on the cms side not here.
Basically the transfered webflow data just had relative image paths (ie: '/images/filename.jpg') so will need to go through and update those in strapi.
That is add the image to strapi and update the image in the content section
Will be a tedious job, but hopefully can divide it up? everyone take 20 posts or something

As for the cropping, will check that out

bytesofman requested changes to this revision.Jul 5 2023, 22:03

fit image better

looks better on desktop:

image.png (782×1 px, 243 KB)

Could use different margins on mobile:

image.png (782×489 px, 62 KB)

This revision now requires changes to proceed.Jul 5 2023, 22:03

Yeah for the broken images see the note in the description, those are broken on the cms side not here.

Basically the transfered webflow data just had relative image paths (ie: '/images/filename.jpg') so will need to go through and update those in strapi.
That is add the image to strapi and update the image in the content section
Will be a tedious job, but hopefully can divide it up? everyone take 20 posts or something

What's the workflow to take this on?

What's the workflow to take this on?

Yeah so basically

  • Get an account setup in strapi
  • Download the images from the webflow post
  • Upload the images to strapi
  • Replace the image paths in the content section of each post in strapi with the correct uploaded image

Figure theres like at least five of us that could split it up? so about 17 posts each

Other jank but faster solution is just download all of the images and put them in the next.js images folder and the image paths should all work lol, but figured we dont want that

bytesofman requested changes to this revision.Jul 6 2023, 04:05
bytesofman added inline comments.
web/e.cash/pages/blog/[slug].js
41 ↗(On Diff #41280)

This is hardcoded more than once in this component. Can define it somewhere, const STRAPI_URL =

Seems to appear throughout the app in various places. Ideally would be defined in one place in case we change our strapi backend at some point.

At the very least, define it in this component.

65 ↗(On Diff #41280)

var for hard coded url

This revision now requires changes to proceed.Jul 6 2023, 04:05

make strapi url a variable

For sure, I added it here for now, but will make an issue to replace it globally as it is being used in a lot of places

bytesofman requested changes to this revision.Jul 6 2023, 15:20

standard practice to not store url with trailing '/'

web/e.cash/pages/blog/[slug].js
22
44–46
This revision now requires changes to proceed.Jul 6 2023, 15:20

Figure theres like at least five of us that could split it up? so about 17 posts each

Can we get a script to automate this ? So a single person can run it all in seconds, at the cost of a few minutes/hours of dev. That would be a huge man/hour gain.

web/e.cash/pages/blog/[slug].js
1 ↗(On Diff #41297)

Is the file name normal ?

22 ↗(On Diff #41297)

That's better, but it would be even better in a config file so we can update at all the places at once

Figure theres like at least five of us that could split it up? so about 17 posts each

Can we get a script to automate this ? So a single person can run it all in seconds, at the cost of a few minutes/hours of dev. That would be a huge man/hour gain.

typical approach for blog migration would be

  • download all the images
  • upload them all with the same name
  • run a script to change the base url in all the href links

unfortunately, here's the URL of a typical blog image: https://assets-global.website-files.com/60d1114fcb4e3e7fbb5115ad/6388d5f13da41f37032adf10_hRvZoMZLSednx3mHjFmxPk_fxRhb83V4D1eHxlfzCy5_-cs3LHzRQJBeO5aFkqh8EdCUTitdaxIgXdKhviepF5t9xgL5A9bPyRLepawwpPa9X0ctBHZsRm-E1Yn_jN0HdBQ_Ak6Qyr-9hbCyGctXF6bEnXPjOTX9zapEIm7kYyyIyu4WnCZjgK4Bv6CT1A.jpeg

imo probably not desirable to preserve this naming convention. Also, when you export them from webflow, they aren't named that way...so even if you wanted to preserve the names, you need to manually download them all.

...so, it is scriptable, but probably better to just work through it one page at a time. get better seo and maintainability with better image names.

Can we get a script to automate this ? So a single person can run it all in seconds, at the cost of a few minutes/hours of dev. That would be a huge man/hour gain.

Yeah a script would be great. Im not sure I can knock something like that out in minutes/hours though, or at all, Im not sure there is a way around the manual media uploads in strapi

web/e.cash/pages/blog/[slug].js
1 ↗(On Diff #41297)

I saw it in an example, and it is using the slug for its path....but open to better options

22 ↗(On Diff #41297)

Yes I was going to do that in another diff. Seemed out of scope here

web/e.cash/pages/blog/[slug].js
1 ↗(On Diff #41297)

so [slug] is a placeholder ?

22 ↗(On Diff #41297)

OK

web/e.cash/pages/blog/[slug].js
1 ↗(On Diff #41297)

oh were you asking if the brackets are normal? the brackets are normal, and required for generated pages like this in next.js.
If you're talking about the slug name, thats what I have unless you have a specific suggestion

green tho still some tasks left to get the blog up to speed

  • image uploads
  • code formatting (e.g. blog/building-on-ecash-january-2023)
This revision is now accepted and ready to land.Jul 11 2023, 18:28
This revision was automatically updated to reflect the committed changes.