Link Search Menu Expand Document

Publishing Your Site

VSCode

Pre-requisites

  • This assumes you have a github repository.
    • If not, you can create one here from your existing workspace

Create a github repo

  • Follow the instructions here to create a repository named {username}.github.io where {username} is your username on Github

Add your notes

Follow the instructions to push to an existing repository

Turn on github pages

Go to settings

Go down to github pages and select the main branch

Select the docs folder and click save.

Configure your notes for publication

In order for to build your notes for publication, you'll have to tweak a few settings first. Open the command prompt and type >Dendron: Configure (yaml)

You should see something like the following

version: 1
vaults:
    -
        fsPath: vault
site:
    copyAssets: true
    siteHierarchies:
        - root
    siteRootDir: docs
    usePrettyRefs: true
    title: Dendron

Make the following modification under site:

...
site:
    ...
    siteUrl: {SITE_URL}
  • NOTE: you can get your SITE_URL from the settings page in github. (As in the example screen cap below, the url shown is https://kevinslin.github.io/dendron-publish-sample/, then the SITE_URL would be https://kevinslin.github.io)
  • NOTE:
    • if you setup your github repository name as {username}.github.io, your SITE_URL will be {username}.github.io
    • if you use an arbitrary name for your github repository (as in the example above, the repo name is dendron-publish-sample)
      • your SITE_URL will be {username}.github.io
      • And you will need to add the suffix using the assetsPrefix property (eg. assetsPrefix: dendron-publish-sample)

Examples

  • publishing the repo named kevinslin.github.io
site:
    siteUrl: https://kevinslin.github.io
  • publishing the repo named dendron-publish-sample
site:
    assetsPrefix: dendron-publish-sample
    siteUrl: https://kevinslin.github.io

Build your notes for publication

In order to have Dendron generate your website, you open the Command Palette (Cmd+Shift+P) and use the Dendron: Site Build command.

Publish your notes

You open the Command Palette (Cmd+Shift+P) and use the Workspace: Sync command.

Or you can calmly type in your terminal to commit all your changes (git add . then git commit) and perform a git push.

GitHub will synchronize all changes and publish your notes everytime you push.

opit add .
git commit -m "first dendron page"
git push

When you are done, you should see a page like the one here

Congratulations, you just published your first note 🌱