Page Style Templates

Once upon a time, I thought it was kind of cool to prefix my page names with emoji. Those who have seen early demo videos, will remember me using a :closed_book: for books, and :person_curly_hair: for people.

Obviously, this still works, but Iā€™ve been thinking of other ways to tweak the visuals of page links and pages.

Let me dump a concept of how this may work and see what you all think:

Although Iā€™m not 100% convinced of how to do this, the best one I have so far is to ā€œabuseā€ template hooks for this purpose. It could look as follows:

Youā€™d create a template e.g. named ā€œBook styleā€ with the following frontmatter:

tags: template
hooks.pageStyle:
  where: ā€˜tags = ā€œbookā€ā€™
  icon: šŸ“•
  linkColor: red
  linkBgColor: green
  pageBgColor: yellow

As a result, any link to a page that was tagged with ā€œbookā€ (see the where attribute) would now be decorated:

  • It would be prefixed with a book emoji
  • Its link color would be red
  • Its link background color would be green

The pages itself would use yellow as a background color. And the icon would also appear in the page title.

Thoughts?

What I like:

  • Building on the concept of ā€œhooksā€ into the SB UI
  • Reusing the ā€œwhereā€ attribute that is also used for Live Template Widgets to decide whether these widgets should appear in a particular page or not.
  • Extensible: I just threw the ā€œiconā€, ā€œlinkColorā€ and ā€œlinkBgColorā€ in here as examples, but if weā€™d come up with other ways to decorate pages ā€” different fonts for the page. This would be easy to add.

My concern:

  • Iā€™m abusing templates for whatā€™s really not a template, but a type of configuration. The body of this ā€œtemplateā€ would be ignored. Soā€¦ itā€™s kinda weird.
1 Like

I am a Silverbullet old-timer so I have 100+ pages with icons, between daily/weekly pages, people, projects, etc.

I cannot wait for this implementation to be available and clean my files (I would love them to have no special characters in the filename, as it will make it much easier to work with from the terminal and/or other tools).

I would suggest to move all this to STYLES, it feels a more logical place to me than a template.

Another way would be to create a style-type page, maybe DECORATIONS and refer to it from the SETTINGS page.

Lastly, Iā€™d love the icon: parameter to have flexibility. Example:

icon: "šŸ§‘ "

(notice the space)

This would give us the option to have the same user experience as right now, i.e, customize it at will

Iā€™ve updated the original post a bit probably while you were replying. Centralizing it in one page is an option, but what I like about the template approach is that it would also be natural to distribute these via Libraries this way and they can be split out and grouped with other templates. Like a meeting page template, a meeting snippet template and now a meeting style template.

I see the point with your ā€œiconā€ with the space thing. I was contemplating of calling this ā€œprefixā€ or something to allow any prefix text. Whether itā€™s emoji or something else. Butā€¦ I can only really see the use case of emoji, not free form text. And if thatā€™s the only thing youā€™d put there, deciding on a space there or not. Not sure.

Why wouldnā€™t you be able to centralize STYLE into a Library?
I believe we can link to it in ā€˜SETTINGSā€™ regardless of where it is in the space, no?

I do like the sharing approach, maybe we can merge both ideas.
If not, I obviously would go for your approach too.

As for the prefix, I just used the ā€˜spaceā€™ as an example but others may have other needs. I am very simple, an icon works for me though, I just want a bit of space between it and the title :joy: