15 July: Variables, redesigned search, better diff view and more

Create and add reusable variables to your docs, plus a redesigned search experience for your published docs, and other editor improvements

✨ New and noteworthy

Introducing variables in GitBook

With this release we’re introducing variables.

If you repeat the same name, phrase or version number multiple times within your content, you can create a variable to help keep all those instances in sync and accurate — which is useful if you ever need to update them, or they’re complex and often mistyped.

You can create variables scoped to a specific page or a specific space, and then use them as many times as you like within a space by adding inline expressions.

For example, you might want to add variables such as:

  • product_name

  • version_number

  • email_support

  • account_type

By using variables like these, you could easily update a product name or version number across your entire docs, simply by updating the variable itself.

To view, add and edit your variables, click the Variables icon in the header bar within a change request.

You can then use a variable to your content by adding an expression. Hit / and choose Expression from the list, then double-click the expression to open up the expression editor where you can choose the variable you want to add.

Variables are super useful on their own, but become even more powerful when paired with adaptive content. We’ll talk about this combination more in the coming weeks.

Search gets a new design on docs sites

We’ve improved the search experience for published sites, with the Ask or search… bar now holding the search experience in one place, without overlapping all of your content.

Before, the search panel would sit centrally over all of your page content, blocking users from seeing it while they searched.

Now, users type directly into the search bar — which holds both the standard keyword search and the GitBook AI search experiences.

Diff view for title and description

Diff view helps you and other reviewers see what’s been edited within a change request. And now it also shows when a page’s title or description has changed!

Better breadcrumbs when editing a space

We’ve improved the breadcrumbs in the editor to make it easier for you to quickly access site settings directly from a space.

When you’re editing a published space, you can click the icon of your site in the top-left of the editor to open a new site menu.

Here, you can instantly access your main site overview, insights, customization and settings. You can also visit the site or copy the site’s URL, saving you time clicking into different parts of the GitBook app.

Not only does this make it easier to jump to important areas right from your content — it also saves space in the header — and we think it looks great, too.

Improved
  • We’ve improved the flow around adding new sections to a site. Adding a new section will now open a menu that lets you choose different kinds of content — whether you want to use an existing space, important content or start from a blank page.

  • We’ve added an animation to the site dashboard to show the your site preview is loading. Before it showed a grey square that looked like an error — now it’ll show a simple loading animation to show that something is happening.

  • If your site is published using share links, it’s now easier to view your site from the dashboard. We’ve added the share links themselves to the dashboard so you can quickly click one to jump to the published content.

  • We’ve improved the way that GitBook handles OpenAPI specifications when you first upload. It will now detect content types and the proxy worker to serve specs with the correct types.

  • If you choose to disable web-crawler indexing on a page (for platforms like Google and ChatGPT), you’ll now see a small icon next to the page title in the table of contents with a tooltip to indicate it’s not being indexed.

  • When you’re viewing a merged change request, there’s now an clear and easy way to get back to your primary content. A new button in the top-right of the window takes you right back so you can see the current version of your space.

  • We’ve restored the option to add relative links to the table of contents. That means you can link to other pages or spaces from the TOC, and they’ll resolve into proper links in your site. But if you update the location or slug of the linked page or space, the link in the TOC will update automatically so you won’t need to edit it manually.

  • The Share dialog has improved within a space. Along with a new button and tooltip, along with a new option in the Space actions menu.

Fixed
  • Fixed a bug that meant LaTex characters would be lost when parsing Markdown or HTML. They should now render correctly in the editor.

  • Fixed a couple of issues with Git Sync that meant the progress bar wasn’t updating properly, and the installation screen wouldn’t show the correct state.

  • Fixed an issue with tables nested inside expandable blocks that meant table blocks couldn’t be selected or edited using the keyboard.

  • Fixed a bug that was causing the ‘conflict view’ — aka the view that appears when an updated change request has conflicts with the main branch — to crash.

  • Fixed a bug that meant @ mentions in comments weren’t working. Now they’ll function as expected!

  • Fixed an issue that meant relative links to other spaces or pages within reusable content would not resolve when the reusable content was added to other spaces. Links should now work as expected.

  • Fixed an issue that deselected blocks and scrolled up to the top of the page too easily when clicking outside the block palette.

  • Fixed an issue that meant page descriptions would be overwritten by page titles.

  • Fixed a bug that sometimes caused the page to scroll to the top when exiting the images menu or an image caption


We’re constantly working to improve the way you and your team work in GitBook, and value your input on features, bugs, and more. Make sure you head to our official GitBook community to join the discussion.

Last updated

Was this helpful?