Page MenuHomeMusing Studio

Option to put posts on sub-path
Closed, ResolvedPublic

Description

Overview

Allow users to set a blog customization option that has posts live on a sub-path (e.g. /posts/) instead of at the top level of the blog.

Background

Primarily for #fight_back_news. Wider community feedback in this forum topic.

Implementation

  • Add a collection route: "/posts/{slug}" that shows the post.
  • Recognize a new collection attribute: posts_path. If there's any value set, posts live on the sub-path (for now, set to posts)
  • If posts live on the sub-path:
    • Correctly set the posts' canonical URL
    • Link there from the templates: collection.html, collection-tags.html
    • Send user there after publishing post in the web app (TODO: see if the WriteFreely SwiftUI app has correct behavior, or update)
    • (Note: clients may need to start relying on the published post's url value returned from the API)
    • After moving a post to a collection in the web app, send to correct URL
    • Continue showing standard blog post list on the "/" route
    • On the "/{slug}" route, redirect non-pinned posts to sub-path, otherwise maintain current behavior
  • Add a collection route: "/posts/" that shows current standard blog post list (if posts live on sub-path)

Future

  • Support a configurable sub-path
  • Static landing page

Revisions and Commits

Event Timeline

matt triaged this task as High priority.Nov 23 2021, 8:09 PM
matt created this task.

Can the /posts be customizable too, so it would be /{custom subpath}/{slug} this way we could call ours articles, and other publishers might call them chapters, stories, etc

@heyakyra Yep, we can do that. Was thinking that might be a future task and we would hard-code the term for now, but we can probably make it customizable out of the gate.

matt added a commit: Restricted Diffusion Commit.Mar 2 2022, 9:27 AM

This is complete on the backend. Configuration in the UI is tracked in T910: UI for setting posts sub-path.