Using TB to run a website

Is anyone using TB to run a website?

I’d love to hear if anyone is doing this and more importantly how they are doing this?

FWIW, the aTbRef website is created entirely from a single TBX (as have it’s 4 previous incarnations). I’ve also assisted** a number of Tinderbox users in creating quite rich web output.

** consulting work, so I can’t share full detail here

What sort of issues are you stuck on: templates, intra-site links, site layout, use of images, linking to scripts…?

By default, Tinderbox exports a static, hierarchically arranged, set of (folders of) webpages. There are (were?) some affordances for publishing to database-backed websites (e.g. things like Wordpress sites) but I don’t think that avenue was ever very popular.

About the only thing Tinderbox can’t do in web export is to preserve inter-note (i.e. webpage) links where the target of the link is used as an include. IOW, if a page that is a link target is exported as part of a larger composite page.

I was thinking in the realm of a blog with a few sundry pages. The blog would need to be able to handle media (video, Audio and image).

I think that is perfectly possible. Mark B’s own blog, which is pretty complex is made in Tinderbox. What you won’t get in Tinderbox is ‘wizards’ and such, the design approach is you build it. But, once that’s done then you just add content. For videos you’ll likely want to make macros to insert the relevant mark-up on export - you’ll provide the video URL, size, etc., as parameters to that macro. Although Tinderbox now exports inline images, I find it easier for issues of file bulk and maintainability to store pictures outside TB and supply export mark-up to pull them into the exported HTML, but not the note itself. There’s no one right approach.

For thinks like Javascript libraries needed for thinks like audio/video you just link to them as you would writing static pages outside Tinderbox.

Many thanks Mark!

Does anyone have a template or skeleton TBX which would get one started, with basics such as navigation etc examples in the TBX?

I do:

http://markBernstein.org/ has been done in Tinderbox for a decade. It’s a very elaborate site, now made more complex because it’s got an odd combination of legacy and experimental code. Not exemplary.

Tinderbox: The Tool For Notes is also made with Tinderbox. Newer and cleaner.

Once you understand export templates – which should probably take an afternoon or so – I think you’ll find navigation straightforward. A basic grasp of HTML and CSS are probably indispensable.

If you’re very new to export as a whole, I suggest these export exercises as a simple lead into the source-to-output mapping of TB export. The aTbRef source TBX, downloadable from the site has lots of built-in examples as all the templates used to make the site are in the TBX (not in the online website). There are also some non-exporting notes describing how it works.

There used to be some TBXs in the file exchange showing how to make a simple blog site. My concern is the code in those files will all be out of date and use now-deprecated syntax. If there’s a good example (in terms of the output web page structure) I’d be happy to review and update the code. I’m also wondering if the old ‘wizard’ code method still works in v6+ as that too might be a simple way to get someone started (I’m not suggest new dev work if the old wizards aren’t v6-compatible).

I don’t know if this will help or hinder, but here’s the template I used for my Tinderbox-driven blog from a few years ago. Tinderbox Blog (Jack Baty).zip - Droplr.

1 Like

@jackbaty that’s kind of you to share. I’ve taken a quick look and there’s nothing of note amiss (in terms of recent code changes). To aid possible new readers, I’ve checked all the inline code and applied ‘HTML Template’ and ‘Code’ prototypes to the templates and boilerplate and reset the $Text font, margins, etc. I also checked export macros, stamps and code inline in article notes. I’ve added (non-exporting) notes to explain the quick review.

Please, I’ve not changed the meaning or function of the file. Adding the prototypes just makes it a more helpful sandbox for others to experiment. I’ve otherwise left things as @jackbaty wrote them.

The only bona fide error I spotted/corrected was if(^$basicLinks^)^. basicLinks is an export code so needs no $-prefix, so I removed that. FWIW, there is no attribute corresponding to ^basicLinks^, the closest would be to test if($OutboundLinks)^ though that checks both basic and text links.

A link to the lightly revised file is here.

1 Like

Mark, thank you for taking a closer look at the example. I was a little worried that it could lead someone astray due to mistakes or poorly-considered approaches. Hopefully your corrections will help prevent that!

1 Like

I do. I’m currently reorganizing the site, but relevant pages that are produced by Tinderbox are:

My setup is a bit crazy because I originally built the website using jekyll, and it still uses it – only now I use Tinderbox to generate a lot of the markdown that gets run through Jekyll. Eventually I’d like to ditch Jekyll entirely and just use Tinderbox, but that’s a project I’m not ready to tackle just yet (there are about 80 pages on the site that I’d need to convert).

There’s a project called BoxPress that provides a sort of starter setup. I took a look at it a while back but found it to be more complex than I cared for.

I’m not going to share my current .tbx because I’m pretty sure it would cause more confusion than anything, but I’m happy to answer any questions.

I suggest you build up your own export templates rather than using one from someone else (unless they’re REALLY simple). You’ll understand what’s available to you, and be able to make changes / introduce new export types more quickly.