zimbatm / wiki

This content has moved to Notion
https://zimbatm.com/
Other
31 stars 7 forks source link

Personal wiki & journal + automatic GitHub pages publication

vimwiki <3 GithubPages.

Goals

How to create your own wiki

1. Setup vim

  1. Install the vimwiki plugin
  2. Optionally install the Calendar plugin
  3. Add the following in your ~/.vimrc:
let wiki_1 = {}
let wiki_1.path = '~/vimwiki'
let wiki_1.ext = '.md'
let wiki_1.syntax = 'markdown'
let wiki_1.auto_toc = 1
" Create posts automatically
let wiki_1.diary_rel_path = '_posts'
let g:vimwiki_list = [wiki_1]
let g:vimwiki_dir_link = 'index'
let g:vimwiki_use_calendar = 1

2. Setup GitHub Pages

  1. Create a new repo
  2. Set "master" as the gh-pages branch: xxx
  3. Add a _config.yml (see this repo)

Known issues

jekyll: no autolink in markdown

This is fixed by switching the markdown rendered in the _config.yml:

markdown: CommonMarkGhPages
# see https://github.com/gjtorikian/commonmarker#parse-options
commonmark:
  options:
    - FOOTNOTES
    - SMART
  extensions:
    - autolink
    - strikethrough
    - table

jekyll: posts are not listed

Jekyll requires the post to also contain a slug name.

But since this is a journal it doesn't make sense to have a title for every day. And vimwiki doesn't support it anyways.

This will become possible once https://github.com/jekyll/jekyll/pull/7649 is merged in.

vimwiki: no auto-commit-and-push

It's easy to forget to commit and push the changes.

:Gwrite + :Gcommit + :Gpush from vim fugitive is quite handy but still a bit too many commands.

vimwiki: fix the link converter

By default vimwiki turns Foo into [Foo](Foo) but GitHub doesn't know how to follow those links. It would be better if it was [Foo](Foo.md) instead.

This will be fixed once https://github.com/vimwiki/vimwiki/pull/529 is merged in (currently in the dev branch, not master).

vimwiki: wiki links from diary are annoying

I don't think this is going to change.

When linking to the wiki from the diary, add a slash in front of the page name. Then type Enter to expand it.

Eg: /Foo will convert to [Foo](/Foo)