Skip to content

Add devblog #179

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

Merged
merged 16 commits into from
Jul 9, 2025
Merged

Add devblog #179

merged 16 commits into from
Jul 9, 2025

Conversation

gwleuverink
Copy link
Contributor

@gwleuverink gwleuverink commented Jul 8, 2025

Glued the existing blog templates to the back-end.

I added some guards for scheduling posts in the future. Should be handy. Wrote some tests around that too.

Lmk if I need to change anything 👍🏻

@gwleuverink gwleuverink requested a review from simonhamp July 8, 2025 12:49
@gwleuverink gwleuverink self-assigned this Jul 8, 2025
@gwleuverink gwleuverink added the enhancement New feature or request label Jul 8, 2025
Copy link
Collaborator

@steven-fox steven-fox left a comment

Choose a reason for hiding this comment

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

Fantastic PR - thanks @gwleuverink!

Just a few requested changes and then I think we'll be g2g:

  • auto-slug after inputting a title
  • allowing admins to view an unpublished article
  • update article styling for a few element types

@gwleuverink
Copy link
Contributor Author

gwleuverink commented Jul 8, 2025

@steven-fox Your feedback made me reconsider the scheduling input. Having it null by default still shows a date + considering the preview feature it seems it's more in the way than helpful.

I might remove the input altogether and see if I can do this with actions instead.

@steven-fox
Copy link
Collaborator

@steven-fox Your feedback made me reconsider the scheduling input. Having it null by default still shows a date + considering the preview feature it seems it's more in the way than helpful.

I might remove the input altogether and see if I can do this with actions instead.

Hmm. If I modify the DateTimePicker field to set null as the default, I get this:
image
which is fine, to me.

Sure, if I click that calendar icon, it shows today's date & time within the calendar, but that's not a big concern and just an artifact of the HTML5 date picker component.

I think it'll mainly be Simon and Shane writing articles, so we don't have to go crazy with a UX for non-technical users. 😄

@steven-fox
Copy link
Collaborator

Something I didn't bring up in my review (because I think it's kinda overkill right now) is the fact that updating a slug on a published article could lead to dead links. An easy way to get around this is to define the route as Route::get('blog/{article:id}/{slug?}'). Then, the id is the thing actually used to lookup an article (which will never change) while the slug is only there for SEO purposes and can change (or be absent) without issue. This keeps one from having to store previous [article_id, slug] combos in the database for lookups.

@simonhamp Do you have a strong opinion on this right now? Do you want to handle changing slugs and routes now or leave the route defined as 'blog/{article:slug}'?

@gwleuverink
Copy link
Contributor Author

Something I didn't bring up in my review (because I think it's kinda overkill right now) is the fact that updating a slug on a published article could lead to dead links.

I'm down to add this now rather than later. Would save me a redirect script down the line.

Just a personal nit-pick; I don't like id's in public facing url's. If it's okay I can bring in Hashids to obfuscate that

@steven-fox
Copy link
Collaborator

Something I didn't bring up in my review (because I think it's kinda overkill right now) is the fact that updating a slug on a published article could lead to dead links.

I'm down to add this now rather than later. Would save me a redirect script down the line.

Just a personal nit-pick; I don't like id's in public facing url's. If it's okay I can bring in Hashids to obfuscate that

Let's see if Simon has anything to say. I believe he's going to lean more towards the "keep it super simple, we won't alter slugs" approach and I'm also in that camp right now. I didn't intend for this PR to grow in complexity haha. Besides, we can always roll with the setup you implemented now, and if the slug stuff becomes an issue, solve it in a way that supports slug revisions and the old urls.

At the end of the day Willem, the article styling is the ONLY piece of my requested changes that is absolutely necessary before merging the PR as-is. Everything else we're talking about here is an enhancement that can come in future, tiny PR's if/when it's desired by those writing articles.

Why don't we take care of that styling, merge this PR, and then Simon/Shane can be aware of this convo for future tasks. 👍

Copy link
Member

Let's just not change slugs 👍

@gwleuverink
Copy link
Contributor Author

Gotcha 👍🏻

Hmm. If I modify the DateTimePicker field to set null as the default, I get this:
@steven-fox For posterity: Turns out what I saw was a Safari thing

@gwleuverink gwleuverink marked this pull request as draft July 8, 2025 17:30
@gwleuverink gwleuverink marked this pull request as ready for review July 8, 2025 21:08
@gwleuverink
Copy link
Contributor Author

Couldn't help myself and went ahead and added:

  • dark mode colors
  • better auto-slug logic
  • disabled slug updates after publish
  • actions for:
    • preview
    • publish now
    • schedule
    • unpublish
  • tests for preview authorization

Let me know if anything needs adjustment 🙌🏻

Copy link
Collaborator

@steven-fox steven-fox left a comment

Choose a reason for hiding this comment

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

I think this turned out great! Awesome work. 👍

@steven-fox steven-fox merged commit cc081fd into main Jul 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants