Introducing the Wix Blog Post Page API!

@eugene-m Hi, check out this piece of code:

import wixLocation from 'wix-location'

async function setPostTitle() {
 let postData = await $w('#post1').getPost();
 let postTitle = postData.title;
 $w('#postTitle').text = postTitle;
}

$w.onReady(function () {
 try {
        setPostTitle();
    } catch (error) {
        console.log(error);
    }

    wixLocation.onChange(async (location) => {
 try {
            setPostTitle();
        } catch (error) {
            console.log(error);
        }
    })
});

You need to do the action of changing the post twice - when the page loads and when navigating to another post (the second one you achieve using wixLocation.onChange).

Please let me know if you have any other questions.