Bookshelves

Next week we’re officially launching a feature that has been in testing for the last month: the ability to keep track of books you are reading to make it easier to include them on your blog, or post a new microblog post about a book. I want to document a few things about that feature here.

For an introduction, see the video I blogged about here.

You can use bookshelves as private lists of books, or you can have Micro.blog automatically include a book list at the bottom of a page on your blog. For example, I created a page called “Reading”, and then I select that when editing a bookshelf:

When you use this option, Micro.blog generates some basic HTML for you. It includes class names in the HTML so that you can customize the style of the book list. Click Design → “Edit CSS”. For my blog, I’ve added a little more spacing and made the book title bolder:

.bookshelf_book {
  padding-bottom: 7px;
}

.bookshelf_title {
  font-weight: 500;
}

.bookshelf_author {
}

If you need complete control, use a custom theme instead. Micro.blog makes book data available as Hugo data so that the data is available in templates:

{{ range .Site.Data.bookshelves.currentlyreading }}
   <a href="https://micro.blog/books/{{ .isbn }}">
     {{ .title }} by {{ .author }}
   </a>
{{ end }}

The bookshelf is referenced as a lowercased version of the name without any spaces. The data fields available are: title, author, isbn, and cover_url.

Happy reading! This feature will go live on June 1st, 2021.

6 Likes

Q: So the bookshelves are for my benefit. And then I create posts to share from them. correct?

Correct. They are private just for your own use until you either create a new post for a book, or choose the option to include a bookshelf in one of your blog post pages.

If you want to control placement (i.e. not bottom of page), do you have to use Hugo? Can you use that inline in the standard Pages editor?

You’ll have to use Hugo to have full control, and unfortunately that doesn’t work in the Pages editor. Hugo tags only work in templates in custom themes.

With Bookshelves we wanted the very simple use case (“just include these books on a page”) to be easy, and the hard things possible, but admittedly there’s not really a good middle-ground for simple customizations.

What if each book’s page on Micro.blog had links to Micro.blog posts on that book?

For example, when someone clicks on my Micro.blog post about “Set Boundaries, Find Peace” they would not only see details about the book itself but how it has reverberated through the Micro.blog community.

1 Like

Will Bookshelves make it’s way into the mobile app. Half the time I hear about a new book the phone is the only device I have around?

1 Like

Funny you ask, I was just thinking about that today. I have some ideas to explore, maybe separate from the main iOS app.

1 Like

Nice! looking foreward to hear what comes of it.

Here’s a quick survey to get some feedback about this topic… I’d love to hear what y’all think. Shouldn’t take more than 30 seconds to fill out. https://forms.gle/6mUbvsohRiiSf4ff8

1 Like

the main benefit Bookshelves has over say Italic Type is that it IS integrated into your blogging app.
I would be wary of creating a separate app.
P.s. let me know when Bookshelves Import is ready to receive Italic Type data incl. which Shelf @manton !

this is a fantastic idea!

1 Like

Rookie micro.blog user here and the setup process has been brilliant. Question about adding a bookshelf as a page and displaying to the site automatically: how do I set that up? The only option I see in the drop down is “None.” What am I doing wrong?

Hi and welcome, @MicroDenbow! :wave:

You need to create a page first by going to Pages and clicking New Page. Then, give it a title, fill it with content (if you want), and hit Add Page. Now, go back to your bookshelf, and the newly created page should show up in the list.

That was a prompt reply! Kudos @sod and the micro.blog community. This was a success. Thank you!

@Moondeer has created a plugin to allow multiple bookshelves on a page: Draft Previews (do not share) - Bookshelf
but I don’t think it’s currently ready off shelf: bookshelf names are lowercase which looks weird:

Also any missing cover image ones look poor:

1 Like

It appears as if the names of the bookshelves cannot validly contain numbers when trying to grab them for a theme. For example, I played around with bookshelves named 2020 and r2021. With r2021,

{{- range $bookshelf_key, $bookshelf := site.Data.bookshelves }}

<h2 class="bookshelf-key">{{ $bookshelf_key }}</h2>

Results in an h2 called just r from r2021. My use case is automating my annual reading list, so I want a bookshelves named something like, “Read in 2021, Read in 2022” and to be able to programmatically move through those bookshelves and get a display name. Is there some other property (like display name) that I can use?

I’ve confirmed that Micro.blog is taking out the numbers. I think I was being a little paranoid with those, and I should be able to update it to preserve the numbers. I’ll get that out in the next day or so.

1 Like

@jsonbecker I’ve fixed this so that numbers in bookshelf names are now preserved.

Thanks! This was a big help. Another small feature request on books – I’d love to be able to edit more meta data when viewing a book. For example, if I find that the edition no longer exists or is sold for a book, I can’t edit the ISBN to a currently available edition right now, just name and author. So I end up having to delete and re-add the book. And because ISBN/edition are not super clear when there are multiple results, I end up searching for a book in a different platform (store), getting the current ISBN, and searching by ISBN (or uploading) to Micro.blog to get the right version.

Even just editing ISBN here would help:

(I’m cleaning up a lot of book data from various sources before letting things go live on my blog)