Add static prefix to title of your Obsidian Digital Garden pages

If you want to have a static prefix in front of all pages/notes in your Obsidian digital garden, just add a Javascript file to your Git repository at src/site/_data/metadata.js. In there you can define the prefix (in my case 'Björn Stierand - ') as seen in the code below.

module.exports = {
  title: "Björn Stierand - "
};

Now you hava to modify the Nunjucks template at src/site/_includes/layouts/note.njk (which is used to render each node) to include the metadata.title element you defined above.

[..]

<!DOCTYPE html>
<html lang="{{ meta.mainLanguage }}">
  <head>
    <title>{% if title %}{{ metadata.title }}{{ title }}{% else %}{{ metadata.title }}{{ page.fileSlug }}{% endif %}</title>

[..]

After the next Eleventy run (either triggered by deploying a note from within Obsidian or from the hosting provider), all notes will have a static prefix in front of their title.