Updated dashboard pages and improved API slug handling

Author

Fazle Rahman

·

improvement
changelog banner

The Hashnode blog dashboard with our new UI and improved experience gives you full control over your blog and helps you manage it easily. We added the Extra Controls and Newsletter page with our revamped UI.

Simplified extra controls page.

Replacing the previous setup in our old dashboard where the features were bundled with other controls under the Advanced tab, the new Extra Controls page helps you effectively:

  • Enable the text selection sharer feature on all articles
  • Allow ChatGPT to crawl your blog

  • Convert your personal blog to a team blog publication (this is an irreversible action)

Note: Currently, the Extra controls page is only visible to non-headless blogs. You can try it out here.

Improved newsletter experience on the blog dashboard.

The blog dashboard now includes the newsletter page featuring our latest UI, making it easier to create and manage newsletters.

Navigating through newsletter tabs and records is now much easier and faster and now you can:

  • Easily share your articles via email

  • Build and grow your subscriber base

You can access it directly from the dashboard's left sidebar, as shown in the image below.

Updates to GraphQL API.

Hashnode's public GraphQL API enables you to integrate and interact with Hashnode. For example, you can use it to build a blog from scratch among other possibilities.

We've implemented changes to our GraphQL API to streamline slug handling.

These improvements can be utilized in two ways:

Option 1: You can get a post by any previous slug using our newly added Publication.redirectedPost(slug: String!): Post.

Here's how:

query Publication {
  id
  post(slug: "my-slug") {
    id
    slug
  }
  redirectedPost(slug: "my-slug") {
    id
    slug
  }
}

And this is how the supporting code would look like:

const data = await getGqlData()
if (!data.publication.post) {
  if (data.publication.redirectedPost?.slug) {
    // redirect to `/${data.publication.redirectedPost.slug}`
  }
  // 404
}

Option 2: In addition to that, we have a new field Post.previousSlugs that you can use to statically create redirects:

query Publication {
  id
  posts {
    node {
      id
      slug
      previousSlugs
    }
  }
}

And this is how the supporting code would look like:

const data = await getGqlData()
for (const post of data.publication.posts) {
  post.previousSlugs.forEach(previousSlug => {
    // redirect from `previousSlug` to `post.slug`
  })
}

We hope these updates will help improve your experience on Hashnode. If you have any questions or feedback, feel free to post them on our Discord community.