We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Post redirect?

  • #10574
    Avatar photo[anonymous]

    Sometimes I’d like to post a link to a post on a different site in my feed. It would be nice if clicking through to that post (i.e. “continue reading”) would automatically redirect to that URL, instead of going through a post that consists only of an excerpt and a link. Is there a way to do this in Publii? With or without a plugin? That would be pretty nice.

    Avatar photo[anonymous]

    Hi there! First off, what theme are you using?

    By “in my feed”, do you mean your index/home page with all your posts?

    Avatar photo[anonymous]

    I’m using the Simple theme.

    And yes, I mean on the index/home page (or other post lists, such as a tag page, author page, etc.).

    Avatar photo[anonymous]

    My hunch would be to do the following:

    1) Add a text area to your Post settings via the Theme settings API, and perhaps a switcher.

    2) In the index.hbs file of your site’s files: go to the part of the code where a post’s link is set. Use Handlebars logic to indicate that if the switcher in the Post’s settings is toggled on, use whatever text input as the link URL instead of the post URL.

    3) When you create a post that you want to redirect elsewhere, enable the toggle in Publii, and paste the URL in the text area.

    You may need to browse through the dev docs, but that’s what I assume could work.

    Avatar photo[anonymous]

    Yes, that looks like a good solution. Thanks.

    My first impression after looking through the docs is that it seems pretty straight-forward for someone who actually knows what they’re doing. For an amateur like me, it might be best to hire a developer to actually make it happen, but it seems like a pretty quick job, so I think I can do that.

    Thanks for pointing me in the right direction.