This commit is contained in:
kaelta 2022-02-05 21:11:37 +00:00
commit 5097439895
17 changed files with 12770 additions and 0 deletions

51
.github/workflows/Deploy.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: Deploy Site
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup | Node
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
working-directory: _layouts
- name: Get repository name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Build Site
run: yarn build
working-directory: _layouts
env:
PATH_PREFIX: /${{ env.REPOSITORY_NAME }}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./_layouts/public
github_token: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules/
.cache/
public/

26
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
// Foam's own extension
"foam.foam-vscode",
// Prettier for auto formatting code
"esbenp.prettier-vscode",
// GitLens for seeing version history inline
"eamodio.gitlens",
// Tons of markdown goodies (lists, tables of content, so much more)
"yzhang.markdown-all-in-one",
// [[wiki-links]], backlinking etc
"kortina.vscode-markdown-notes",
// Graph visualizer
"tchayen.markdown-links",
// Understated grayscale theme (light and dark variants)
"philipbe.theme-gray-matter"
]
}

0
.vscode/foam.json vendored Normal file
View File

28
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,28 @@
{
"files.autoSave": "onFocusChange",
"editor.minimap.enabled": false,
"editor.wrappingIndent": "indent",
"editor.overviewRulerBorder": false,
"foam.edit.linkReferenceDefinitions": "withExtensions",
"vscodeMarkdownNotes.noteCompletionConvention": "noExtension",
"[markdown]": {
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
}
},
"cSpell.language": "en-GB",
"git.enableSmartCommit": true,
"git.postCommitCommand": "sync",
"spellright.language": [
"en"
],
"spellright.documentTypes": [
"markdown",
"plaintext"
],
"files.exclude": {
"_site/**": true
}
}

2
.vscode/spellright.dict vendored Normal file
View File

@ -0,0 +1,2 @@
Foam
documentation

1
_layouts/.yarnrc Normal file
View File

@ -0,0 +1 @@
registry https://registry.npmjs.org/

View File

@ -0,0 +1,5 @@
import 'prism-themes/themes/prism-nord.css'
import 'katex/dist/katex.min.css'
import './src/styles/main.css'

66
_layouts/gatsby-config.js Normal file
View File

@ -0,0 +1,66 @@
const path = require('path')
const PATH_PREFIX = process.env.PATH_PREFIX
module.exports = {
// pathPrefix: PATH_PREFIX || `/foam-template-gatsby-kb`, // a. If you are using github pages, this should be the name of your repo
pathPrefix: PATH_PREFIX || `/`, // b. If you are using Netlify/Vercel, your can keep it this way
siteMetadata: {
// some SEO configs using by gatsby-theme-kb
title: `Foam`, // Replace it with your site's title
author: `Your Name`, // Replace it with your name
description: `My personal knowledge base`, // Replace it with your site's description
},
plugins: [
{
resolve: `gatsby-theme-kb`,
options: {
rootNote: '/readme',
contentPath: `${__dirname}/..`,
ignore: [
'**/_layouts/**',
'**/.git/**',
'**/.github/**',
'**/.vscode/**',
'**/.cache/**',
],
// this is an option for extending `gatsby-plugin-mdx` options inside `gatsby-theme-kb`,
getPluginMdx(defaultPluginMdx) {
// so you can have your relative referenced files served, e.g. '../assets/img.png'.
defaultPluginMdx.options.gatsbyRemarkPlugins.push({
resolve: `gatsby-remark-copy-linked-files`,
options: {
ignoreFileExtensions: ['md', 'mdx'],
},
})
// an example of syntax highlighting
defaultPluginMdx.options.gatsbyRemarkPlugins.push({
resolve: 'gatsby-remark-prismjs',
options: {
noInlineHighlight: true,
},
})
// add math support
defaultPluginMdx.options.remarkPlugins.push(require('remark-math'))
if (!defaultPluginMdx.options.rehypePlugins) defaultPluginMdx.options.rehypePlugins = []
defaultPluginMdx.options.rehypePlugins.push(require('rehype-katex'))
return defaultPluginMdx
},
},
},
{
// this plugin makes sure your static files will be served by gatsby,
// but of course you need to reference them by absolute path, e.g. '/assets/img.png'.
// if you have multiple directories, copy this plugin section and specify other directory
// check https://github.com/csath/gatsby-plugin-copy-files-enhanced to find docs for this plugin
resolve: 'gatsby-plugin-copy-files-enhanced',
options: {
source: path.resolve(__dirname, `../assets`),
destination: '/assets',
purge: false,
},
},
],
}

27
_layouts/package.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "foam-template-gatsby-kb",
"version": "1.0.0",
"description": "A foam template using gatsby-theme-kb for publishing you knowledge base",
"main": "index.js",
"scripts": {
"dev": "gatsby develop",
"build": "gatsby build --prefix-paths",
"serve": "gatsby serve"
},
"keywords": [
"foam"
],
"author": "chenmin",
"license": "MIT",
"dependencies": {
"gatsby": "^3.13.0",
"gatsby-plugin-copy-files-enhanced": "^1.1.1",
"gatsby-remark-copy-linked-files": "^4.10.0",
"gatsby-remark-prismjs": "^5.10.0",
"gatsby-theme-kb": "^0.8.0",
"prism-themes": "^1.8.0",
"prismjs": "^1.24.1",
"rehype-katex": "^5.0.0",
"remark-math": "^3.0.1"
}
}

View File

@ -0,0 +1,18 @@
/* ---------------- prism override ---------------------- */
pre[class*="language-"] {
margin: 1em 0;
}
.dark-mode pre[class*="language-"] {
background-color: #252931;
}
.light-mode pre[class*="language-"] {
background-color: #2b2727;
}
/* ----------------end prism override ------------------- */
code {
font-size: 0.9em;
}

12445
_layouts/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

BIN
assets/banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

17
inbox.md Normal file
View File

@ -0,0 +1,17 @@
# Inbox
- Here you can write disorganised notes to be categorised later
- Bullet points are useful, but it could be free form text as well
- Sometimes it's better to just get things off your mind quickly, rather than stop to think where it belongs
- But don't let this list get too long
- Move information to more specific documents and link to them.
- This helps you navigate between documents quickly
- For example, you can `Cmd`+`Click` this: [[todo]]
- Some notes don't end up making sense the next day
- That's ok, you can just delete them!
- You can always find them in your git history, if you really need it!
[//begin]: # "Autogenerated link references for markdown compatibility"
[todo]: todo "Todo"
[//end]: # "Autogenerated link references"

15
investigation/OSMTH.md Normal file
View File

@ -0,0 +1,15 @@
# OSMTH | Sovereign Military Order of the Temple of Jerusalem
![banner](../assets/banner.png)
> Ordo Supremus Militaris Templi Hierosolymitani :: Swiss Federal Registry Number CH-660.1.972.999-4
## tags
#people
#places
#locations
#dates

57
readme.md Normal file
View File

@ -0,0 +1,57 @@
# OSMTH | Sovereign Military Order of the Temple of Jerusalem
![banner](./assets/banner.png)
Ordo Supremus Militaris Templi Hierosolymitani
Swiss Federal Registry Number CH-660.1.972.999-4
# Foam
👋 Welcome to your new Foam Workspace!
## Getting started
This documentation assumes that you have a GitHub account and have [Visual Studio Code](https://code.visualstudio.com/) installed on your Linux/MacOS/Windows machine.
1. If you haven't yet, browse over to the main [Foam documentation workspace](https://foambubble.github.io/foam) to get an idea of what Foam is and how to use it.
2. Press "Use this template" button at [foam-template-gatsby-kb](https://github.com/hikerpig/foam-template-gatsby-kb) (that's this repository!) to fork it to your own GitHub account. If you want to keep your thoughts to yourself, remember to set the repository private.
3. [Clone the repository to your local machine](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) and open it in VS Code.
*Open the repository as a folder using the `File > Open...` menu item. In VS Code, "open workspace" refers to [multi-root workspaces](https://code.visualstudio.com/docs/editor/multi-root-workspaces).*
4. When prompted to install recommended extensions, click **Install all** (or **Show Recommendations** if you want to review and install them one by one)
5. Open [_layouts/gatsby-config.js](_layouts/gatsby-config.js) and edit the `pathPrefix` to be the name of the repository.
After setting up the repository, open [.vscode/settings.json](.vscode/settings.json) and edit, add or remove any settings you'd like for your Foam workspace.
To learn more about how to use **Foam**, read the [Recipes](https://foambubble.github.io/foam/recipes) bubbles of the Foam documentation workspace.
## Using Foam
We've created a few Bubbles (markdown documents) to get you started.
- [[inbox]] - a place to write down quick notes to be categorised later
- [[foam-tips]] - tips to get the most out of your Foam workspace
- [[todo]] - a place to keep track of things to do
The demo on Vercel has some of Foam docs and has more usage examples (like images), check the [feature/foam-docs branch](https://github.com/hikerpig/foam-template-gatsby-kb/tree/feature/foam-docs) to see then.
### Important configurations for foam
You may need to configure Foam to work with this template, for the config `foam.edit.linkReferenceDefinitions`:
- `"withoutExtensions"`, this is the default option, the generated definition url will not include the `md` extension part.
- `"off"`, with this option selected, Foam won't generate link definitions in the bottom of the document, this might be inconvenient for you to navigate across your files on Github, but totally fine with gatsby-theme-kb.
## Note on `[[wiki-links]]`
⚠️ Until [foambubble/foam#16](https://github.com/foambubble/foam/issues/16) is resolved, `[[wiki-links]]` links (like the links above) won't work in the GitHub Markdown preview (i.e. this Readme on github.com).
They should work as expected in VS Code, and in rendered GitHub Pages.
If GitHub preview (or general 100% support with all Markdown tools) is a requirement, for the time being you can use the standard `[description](page.md)` syntax.
[//begin]: # "Autogenerated link references for markdown compatibility"
[inbox]: inbox.md "Inbox"
[todo]: todo.md "Todo"
[//end]: # "Autogenerated link references"

9
todo.md Normal file
View File

@ -0,0 +1,9 @@
# Todo
- [x] This is an example of a todo list item that's complete
- [x] Todo lists are useful for keeping organised and focused
- [ ] This one is not completed yet
- [ ] You can mark it completed by pressing `Option`+`C` (or `Alt`+`C`) when your cursor is on this line
- [ ] You can also select multiple lines and mark them all at once!
- [ ] When you press enter at the end of a line, it adds a new todo item on the next line
- [ ] This, and more is provided by the [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) plugin by [Yu Zhang](https://github.com/yzhang-gh)