themsaid/wink

Unable to Preview Post

skino2019 opened this issue · 3 comments

I don't use this often as i write everything using Stackedit.io for markdown at the moment. but for some reason if i click on the preview post icon live or local i get a 404.

when i checked the preview post last time i noticed that it had change the URL to https://www.raspada-blog.co.uk/post-name when it should be https://www.raspada-blog.co.uk/blog/post-name

if i manually update the URL it still gives me the 404.

any ideas?

I have a similar issue. This post url would be different for everyone as per his/her convenience. Eg: For me its https://domain.name/post/post_slug.

I am not sure if this issue needs so much attention, but I guess this could be doable while config, where we can provide a route and what column you are using to fetch a single post.

My suggestion would be:

// web.php
Route::get('/post/{slug}', [PostController::class, 'show'])->name('post.single');

//wink.php - can have this as an option
'route_preview_config' => [
'route_name' => 'post.single', //
'route_param' => 'slug', // we can also provide, 'id' as an option, if someone prefers id over slug to display the post
]

My Bad. The option already exists in wink.php

@skino2019 - you just need to update the preview_path as /blog/{postSlug} in wink.php

'preview_path' => '/blog/{postSlug}',

If you have already done this and you are still getting 404, then you got to check your log files to get more details. For me it worked smoothly.

This was spot on and fixed my issue!