From 55d4699930738fcc4b217df046cdfbdd5d5a812d Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 3 Oct 2023 18:16:07 +0200 Subject: [PATCH] Content updates --- common/util.ts | 8 +++++--- website/Getting Started.md | 13 ++----------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/common/util.ts b/common/util.ts index 70e21a10..1493f930 100644 --- a/common/util.ts +++ b/common/util.ts @@ -1,6 +1,7 @@ import { SETTINGS_TEMPLATE } from "./settings_template.ts"; import { YAML } from "./deps.ts"; import { SpacePrimitives } from "./spaces/space_primitives.ts"; +import { template } from "https://esm.sh/v130/handlebars@4.7.7/runtime.d.ts"; export function safeRun(fn: () => Promise) { fn().catch((e) => { @@ -62,9 +63,10 @@ export async function ensureSettingsAndIndex( new TextEncoder().encode( `Hello! And welcome to your brand new SilverBullet space! - -Loading some onboarding content for you (but doing so does require a working internet connection)... -`, +\`\`\`template +page: "[[!silverbullet.md/Getting Started]]" +\`\`\` +`, ), ); } diff --git a/website/Getting Started.md b/website/Getting Started.md index 25b74686..73255810 100644 --- a/website/Getting Started.md +++ b/website/Getting Started.md @@ -18,9 +18,9 @@ Notice that as you move your cursor around on this page and you get close to or Hadn’t we mentioned [[Markdown]] yet? Yeah, that’s the markup language you’ll use to add that dash of markup to your documents. It’s pretty simple to learn if you don’t know it already. -You will notice this whole page section is wrapped in a strange type of block. This is a SilverBullet specific feature called a [[Live Templates]], which embeds another (sometime external) page into the existing one. +You will notice this whole page section is wrapped in a strange type of block. This is a SilverBullet specific feature called a [[Live Templates]], which embeds another (sometime external) page into the existing one. If you hover over this section, you’ll notice a small _refresh_ and _edit_ button. Hit that edit button to reveal the underlying source that renders this content. -But SilverBullet has even more tricks up its sleeve. Consider [[Live Queries]] which allow you to query [[Objects]] in your space easily. +SilverBullet has even more tricks up its sleeve. Consider [[Live Queries]] which allow you to query [[Objects]] in your space easily. Don’t believe me? Check this out, here’s a list of (max 10) pages in your space ordered by name, it updates (somewhat) dynamically 🤯. Create some new pages and come back here to see that it works: @@ -28,15 +28,6 @@ Don’t believe me? Check this out, here’s a list of (max 10) pages in your sp page select name order by name limit 10 ``` -That said, the directive used wrapping this page section is `#use` which uses the content of another page as a template and inlines it. Directives recalculate their bodies in two scenarios: - -1. When you load/switch to a page -2. When you explicitly run the {[Directives: Update]} command - -In the case of `#use` this means the body will again be replaced with the page included, so don’t be surprised when whatever you just updated inside of this directive block will be undone later. Just sayin’. [[🔌 Directive|Directives]] are a powerful feature, so you should definitely look into them once you get comfortable with the basics. - -Feel free to completely remove all content on this page and make it your own, it’s just to get you started. - ## What next? If you are a visual learner, you may [enjoy this introduction video on Youtube](https://youtu.be/VemS-cqAD5k).