'+ title + '
' + summary +'
├── .github
└── workflows
│ ├── index.yml
│ └── publish.yml
├── .gitignore
├── LICENSE
├── README.md
├── cinder
├── 404.html
├── __init__.py
├── base.html
├── content.html
├── css
│ ├── base.css
│ ├── base.min.css
│ ├── bootstrap-custom.css
│ ├── bootstrap-custom.min.css
│ ├── cinder.css
│ ├── cinder.min.css
│ ├── highlight.css
│ └── highlight.min.css
├── fonts
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ └── fontawesome-webfont.woff
├── img
│ ├── favicon.ico
│ ├── grid1.png
│ ├── grid10.png
│ ├── grid11.png
│ ├── grid12.png
│ ├── grid13.png
│ ├── grid14.png
│ ├── grid15.png
│ ├── grid16.png
│ ├── grid17.png
│ ├── grid18.png
│ ├── grid19.png
│ ├── grid2.png
│ ├── grid20.png
│ ├── grid3.png
│ ├── grid4.png
│ ├── grid5.png
│ ├── grid6.png
│ ├── grid7.png
│ ├── grid8.png
│ └── grid9.png
├── js
│ ├── base.js
│ └── bootstrap-3.0.3.min.js
├── keyboard-modal.html
├── main.html
├── mkdocs_theme.yml
├── nav-sub.html
├── nav.html
├── search-modal.html
└── toc.html
├── docs
├── CNAME
├── Changelog.md
├── Cloud
│ ├── Google Cloud Setup Notes.md
│ └── index.md
├── Databases
│ ├── Database GUIs.md
│ ├── Databases.md
│ ├── PostgreSQL Tools.md
│ ├── PostgreSQL.md
│ ├── Views vs. Materialized Views.md
│ └── index.md
├── Developer Tools
│ ├── Web Browsers
│ │ ├── Firefox Developer Edition.md
│ │ ├── Web Browsers.md
│ │ └── index.md
│ └── index.md
├── Docker
│ ├── Docker Compose Reference Docs.md
│ ├── Docker.md
│ └── index.md
├── Documentation
│ ├── MkDocs.md
│ └── index.md
├── GCP
│ ├── Google Cloud APIs.md
│ ├── Google Cloud Setup Notes.md
│ ├── Install gcloud SDK on Ubuntu.md
│ ├── Install gcloud SDK on Windows.md
│ ├── Setup Cloud SQL for PostgreSQL in Production.md
│ └── index.md
├── Git
│ ├── Git Tools.md
│ └── index.md
├── Github
│ ├── Github Actions for R.md
│ └── index.md
├── Lists
│ ├── Recurring Shopping List.md
│ └── index.md
├── Obsidian
│ ├── Mermaid Diagrams.md
│ ├── Obsidian Git Plugin Notes.md
│ ├── Obsidian.md
│ ├── Publishing Workflow.md
│ ├── Templater Plugin Notes.md
│ └── index.md
├── PKM
│ ├── PKM.md
│ └── index.md
├── Powwater
│ ├── Database Documentation.md
│ └── index.md
├── Productivity
│ ├── Notes on Finishing Projects.md
│ ├── Productivity.md
│ ├── Time Management.md
│ └── index.md
├── Project Management
│ ├── Ludicrously Complex Projects in Software Development.md
│ ├── Project Management Pipeline.md
│ ├── Project Management.md
│ ├── Taming a Chaotic Project.md
│ └── index.md
├── Python
│ ├── Python.md
│ └── index.md
├── R
│ ├── Base Package Hidden Gems in R.md
│ ├── Data Validation Packages in R.md
│ ├── Databases with R Resources.md
│ ├── Databases with R
│ │ ├── Using Pool.md
│ │ └── index.md
│ ├── EDA Packages in R.md
│ ├── Plumber Logging.md
│ ├── Plumber REST APIs in R.md
│ ├── Plumber Resources.md
│ ├── R Books.md
│ ├── R Development.md
│ ├── R Miscellaneous Notes.md
│ ├── R Shiny Packages.md
│ ├── RStudio Configuration Notes.md
│ ├── Shiny Apps as Packages in R.md
│ ├── Tools Package Hidden Gems in R.md
│ ├── Useful Packages in R List.md
│ ├── Utils Package Hidden Gems in R.md
│ └── index.md
├── README.md
├── System Design
│ ├── System Design Primer.md
│ ├── System Design.md
│ └── index.md
├── Tools
│ ├── Web Browsers
│ │ ├── Firefox Developer Edition.md
│ │ ├── Web Browsers.md
│ │ └── index.md
│ └── index.md
├── WSL
│ ├── WSL Commands and Installs.md
│ ├── WSL Ubuntu on Windows Community Preview.md
│ ├── WSL.md
│ ├── WSLg.md
│ └── index.md
├── Web Development
│ ├── APIs.md
│ ├── Backend Web Architecture.md
│ ├── HTTP Requests Notes.md
│ ├── Javascript.md
│ ├── WebDev Resource List.md
│ └── index.md
├── Windows
│ ├── How to Cleanup Windows from Command Line.md
│ ├── SFC and DISM Commands.md
│ ├── Using diskusage Command in Windows.md
│ ├── WinGet CLI Setup and Settings.md
│ ├── Windows Command Line Commands Overview.md
│ ├── images
│ │ ├── 30a735f876001d6cee61a4dcc976f71a.png
│ │ ├── 75fd153f5ebcd65f454177ebe73be758.png
│ │ └── Windows-10-SFC-Scannow-in-action.png
│ └── index.md
├── _assets
│ ├── Pasted image 20210501120642.png
│ ├── Pasted image 20210501123611.png
│ ├── Pasted image 20210501123655.png
│ ├── Pasted image 20210501123722.png
│ ├── wsl-comm-preview.png
│ └── zapier-introduction-to-apis.pdf
├── _attachments
│ ├── Pasted image 20210501120642.png
│ ├── Pasted image 20210501123611.png
│ ├── Pasted image 20210501123655.png
│ ├── Pasted image 20210501123722.png
│ └── zapier-introduction-to-apis.pdf
├── _daily
│ ├── .pages
│ ├── 2020-04-20.md
│ ├── 2021-04-21.md
│ ├── 2021-04-22.md
│ ├── 2021-04-23.md
│ ├── 2021-04-24.md
│ ├── 2021-04-25.md
│ ├── 2021-04-28.md
│ ├── 2021-04-29.md
│ ├── 2021-05-01.md
│ ├── 2021-05-02.md
│ ├── 2021-05-03.md
│ ├── 2021-05-04.md
│ └── index.md
├── index.md
└── setup.md
├── mkdocs.yml
└── site
├── CNAME
├── Changelog
└── index.html
├── Cloud
├── Google Cloud Setup Notes
│ └── index.html
└── index.html
├── Databases
├── Database GUIs
│ └── index.html
├── Databases
│ └── index.html
├── PostgreSQL Tools
│ └── index.html
├── PostgreSQL
│ └── index.html
├── Views vs. Materialized Views
│ └── index.html
└── index.html
├── Developer Tools
└── Web Browsers
│ ├── Firefox Developer Edition
│ └── index.html
│ └── Web Browsers
│ └── index.html
├── Docker
├── Docker Compose Reference Docs
│ └── index.html
├── Docker
│ └── index.html
└── index.html
├── Documentation
├── MkDocs
│ └── index.html
└── index.html
├── GCP
├── Google Cloud APIs
│ └── index.html
├── Google Cloud Setup Notes
│ └── index.html
├── Install gcloud SDK on Ubuntu
│ └── index.html
├── Install gcloud SDK on Windows
│ └── index.html
└── Setup Cloud SQL for PostgreSQL in Production
│ └── index.html
├── Git
├── Git Tools
│ └── index.html
└── index.html
├── Github
├── Github Actions for R
│ └── index.html
└── index.html
├── Lists
└── Recurring Shopping List
│ └── index.html
├── Obsidian
├── Mermaid Diagrams
│ └── index.html
├── Obsidian Git Plugin Notes
│ └── index.html
├── Obsidian
│ └── index.html
├── Publishing Workflow
│ └── index.html
├── Templater Plugin Notes
│ └── index.html
└── index.html
├── PKM
├── PKM
│ └── index.html
└── index.html
├── Powwater
├── Database Documentation
│ └── index.html
└── index.html
├── Productivity
├── Notes on Finishing Projects
│ └── index.html
├── Productivity
│ └── index.html
├── Time Management
│ └── index.html
└── index.html
├── Project Management
├── Ludicrously Complex Projects in Software Development
│ └── index.html
├── Project Management Pipeline
│ └── index.html
├── Project Management
│ └── index.html
├── Taming a Chaotic Project
│ └── index.html
└── index.html
├── Python
├── Python
│ └── index.html
└── index.html
├── R
├── Base Package Hidden Gems in R
│ └── index.html
├── Data Validation Packages in R
│ └── index.html
├── Databases with R Resources
│ └── index.html
├── Databases with R
│ └── Using Pool
│ │ └── index.html
├── EDA Packages in R
│ └── index.html
├── Plumber Logging
│ └── index.html
├── Plumber REST APIs in R
│ └── index.html
├── Plumber Resources
│ └── index.html
├── R Books
│ └── index.html
├── R Development
│ └── index.html
├── R Miscellaneous Notes
│ └── index.html
├── R Shiny Packages
│ └── index.html
├── RStudio Configuration Notes
│ └── index.html
├── Shiny Apps as Packages in R
│ └── index.html
├── Tools Package Hidden Gems in R
│ └── index.html
├── Useful Packages in R List
│ └── index.html
├── Utils Package Hidden Gems in R
│ └── index.html
└── index.html
├── System Design
├── System Design Primer
│ └── index.html
├── System Design
│ └── index.html
└── index.html
├── Tools
├── Web Browsers
│ ├── Firefox Developer Edition
│ │ └── index.html
│ ├── Web Browsers
│ │ └── index.html
│ └── index.html
└── index.html
├── WSL
├── WSL Commands and Installs
│ └── index.html
├── WSL Ubuntu on Windows Community Preview
│ └── index.html
├── WSL
│ └── index.html
├── WSLg
│ └── index.html
└── index.html
├── Web Development
├── APIs
│ └── index.html
├── Backend Web Architecture
│ └── index.html
├── HTTP Requests Notes
│ └── index.html
├── Javascript
│ └── index.html
├── WebDev Resource List
│ └── index.html
└── index.html
├── Windows
├── How to Cleanup Windows from Command Line
│ └── index.html
├── SFC and DISM Commands
│ └── index.html
├── Using diskusage Command in Windows
│ └── index.html
├── WinGet CLI Setup and Settings
│ └── index.html
├── Windows Command Line Commands Overview
│ └── index.html
├── images
│ ├── Windows-10-SFC-Scannow-in-action.png
│ ├── image-20210327021344936.png
│ └── image-20210327021421066.png
└── index.html
├── _assets
├── Pasted image 20210501120642.png
├── Pasted image 20210501123611.png
├── Pasted image 20210501123655.png
├── Pasted image 20210501123722.png
├── wsl-comm-preview.png
└── zapier-introduction-to-apis.pdf
├── _attachments
├── Pasted image 20210501120642.png
├── Pasted image 20210501123611.png
├── Pasted image 20210501123655.png
├── Pasted image 20210501123722.png
└── zapier-introduction-to-apis.pdf
├── _daily
├── 2020-04-20
│ └── index.html
├── 2021-04-21
│ └── index.html
├── 2021-04-22
│ └── index.html
├── 2021-04-23
│ └── index.html
├── 2021-04-24
│ └── index.html
├── 2021-04-25
│ └── index.html
├── 2021-04-28
│ └── index.html
├── 2021-04-29
│ └── index.html
├── 2021-05-01
│ └── index.html
├── 2021-05-02
│ └── index.html
├── 2021-05-03
│ └── index.html
├── 2021-05-04
│ └── index.html
└── index.html
├── css
├── base.css
├── base.min.css
├── bootstrap-custom.css
├── bootstrap-custom.min.css
├── cinder.css
├── cinder.min.css
├── highlight.css
├── highlight.min.css
└── timeago.css
├── fonts
├── fontawesome-webfont.eot
├── fontawesome-webfont.svg
├── fontawesome-webfont.ttf
└── fontawesome-webfont.woff
├── img
├── favicon.ico
├── grid1.png
├── grid10.png
├── grid11.png
├── grid12.png
├── grid13.png
├── grid14.png
├── grid15.png
├── grid16.png
├── grid17.png
├── grid18.png
├── grid19.png
├── grid2.png
├── grid20.png
├── grid3.png
├── grid4.png
├── grid5.png
├── grid6.png
├── grid7.png
├── grid8.png
└── grid9.png
├── index.html
├── js
├── base.js
├── bootstrap-3.0.3.min.js
├── timeago.min.js
└── timeago_mkdocs_material.js
├── search
├── lunr.js
├── main.js
├── search_index.json
└── worker.js
├── setup
└── index.html
├── sitemap.xml
└── sitemap.xml.gz
/.github/workflows/index.yml:
--------------------------------------------------------------------------------
1 | name: Create markdown indexes
2 |
3 | # Controls when the action will run.
4 | on:
5 | # Triggers the workflow on push or pull request events but only for the master branch
6 | # push:
7 | # branches:
8 | # - master
9 | # - main
10 | workflow_dispatch:
11 |
12 | jobs:
13 | build:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: actions/checkout@v2.3.4
17 | - uses: DaanV2/Markdown-Action-Create-Indexes@v1.5.13
18 | with:
19 | folder: ${{github.workspace}}/docs
20 | - name: Commit changes
21 | continue-on-error: true
22 | run: |
23 | cd ${{github.workspace}}
24 | git config --global user.email "Bot@Blockception.com"
25 | git config --global user.name "Blockception Bot"
26 | git add .
27 | git commit -m "auto: Generated typescript includes"
28 | git push
29 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish Vault
2 | on:
3 | push:
4 | branches:
5 | - master
6 | - main
7 | jobs:
8 | deploy:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@v2
12 | - uses: actions/setup-python@v2
13 | with:
14 | python-version: 3.x
15 | - run: pip install mkdocs
16 | - run: pip install mkdocs-roamlinks-plugin
17 | - run: pip install mkdocs-awesome-pages-plugin
18 | - run: pip install mkdocs-git-revision-date-localized-plugin
19 | - run: pip install mkdocs-monorepo-plugin
20 | - run: pip install mkdocs-minify-plugin
21 | - run: mkdocs build --clean
22 | - run: mkdocs gh-deploy --force
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode/settings.json
2 |
3 | .history/
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Published Vault
2 |
3 | [](https://github.com/jimbrig/obsidian_published/actions/workflows/index.yml)
4 |
5 | [](https://github.com/jimbrig/obsidian_published/actions/workflows/publish.yml)
6 | ## Setup
7 |
8 | ### MkDocs
9 |
10 | ```powershell
11 | pip install mkdocs
12 | mkdocs build
13 | mkdocs serve
14 | mkdocs gh-deploy
15 | ```
16 |
17 | ### Plugins
18 |
19 | | Plugin | Version |
20 | | :---------------------------------------: | :-----: |
21 | | mkdocs | 1.1.2 |
22 | | mkdocs-autolinks-plugin | 0.4.0 |
23 | | mkdocs-awesome-pages-plugin | 2.5.0 |
24 | | mkdocs-git-revision-date-localized-plugin | 0.9.2 |
25 | | mkdocs-minify-plugin | 0.4.0 |
26 | | mkdocs-monorepo-plugin | 0.4.14 |
27 | | mkdocs-roamlinks-plugin | 0.1.3 |
28 |
29 | #### Installations
30 |
31 | ```powershell
32 | $ pip install mkdocs /
33 | mkdocs-autolinks-plugin /
34 | mkdocs-awesome-pages-plugin /
35 | mkdocs-git-revision-date-localized-plugin /
36 | mkdocs-monorepo-plugin /
37 | mkdocs-roamlinks-plugin /
38 | mkdocs-minify-plugin
39 |
40 | $ pip list | grep mkdocs-*
41 | mkdocs 1.1.2
42 | mkdocs-autolinks-plugin 0.4.0
43 | mkdocs-awesome-pages-plugin 2.5.0
44 | mkdocs-git-revision-date-localized-plugin 0.9.2
45 | mkdocs-minify-plugin 0.4.0
46 | mkdocs-monorepo-plugin 0.4.14
47 | mkdocs-roamlinks-plugin 0.1.3
48 | ```
49 |
50 | #### Configuration
51 |
52 | ```yaml
53 | plugins:
54 | - search
55 | - autolinks
56 | - roamlinks
57 | - awesome-pages
58 | - git-revision-date-localized:
59 | type: timeago
60 | - minify:
61 | minify_html: true
62 | markdown_extensions:
63 | - toc:
64 | permalink: ⚑
65 | baselevel: 2
66 | - codehilite:
67 | linenums: false
68 | guess_lang: true
69 | - footnotes
70 | - abbr
71 | - admonition
72 | - meta
73 | - def_list
74 | ```
75 |
76 | ### Apendix: Publish Obsidian Notes with MkDocs (template)
77 |
78 | Would you like to make some of your [Obsidian](https://obsidian.md/) notes public?
79 |
80 | This template gives you an easy way to publish your Obsidian notes using Github pages.
81 |
82 | With this template, you get these out-of-the-box:
83 |
84 | - an awesome website based on Material theme, complete with a search bar (Checkout this template published [here](https://jobindj.github.io/obsidian-mkdocs/))
85 | - get the Obsidian/Roam style `[[wikilinks]]` from your vault in your published notes
86 | - Toggle between light and dark mode
87 |
88 | #### How to get started?
89 |
90 | 1. Create a new github repository using [this template](https://github.com/jobindj/obsidian-mkdocs/generate)
91 | - Give a name to your public notes repository in this step. By default your notes will be published at `
```mermaid
15 | sequenceDiagram
16 | Alice->>+John: Hello John, how are you?
17 | Alice->>+John: John, can you hear me?
18 | John-->>-Alice: Hi Alice, I can hear you!
19 | John-->>-Alice: I feel great!
20 | ```
21 |
22 | ```mermaid
23 | sequenceDiagram
24 | Alice->>+John: Hello John, how are you?
25 | Alice->>+John: John, can you hear me?
26 | John-->>-Alice: Hi Alice, I can hear you!
27 | John-->>-Alice: I feel great!
28 | ```
29 |
30 | ***
31 | Links:
32 | Source:
33 |
34 |
--------------------------------------------------------------------------------
/docs/Obsidian/Obsidian Git Plugin Notes.md:
--------------------------------------------------------------------------------
1 | ---
2 | creation date: 2021-04-20 10:49
3 | modification date: Tuesday 20th April 2021 10:49:45
4 | tags: "#note"
5 | author: Jimmy Briggs
6 | ---
7 |
8 | # Obsidian Git Plugin Notes
9 |
10 | ## Initialize with `Git`
11 |
12 | ```
13 | git init
14 | gh repo create --private
15 | touch .gitignore
16 | notepad .gitignore
17 | git add *
18 | git commit -m "init"
19 | git push --set-upstream origin master
20 | ```
21 |
22 | ***
23 | Links: [[Obsidian]]
24 | ***
25 | Source:
26 |
27 | - [denolehov/obsidian-git: Backup your Obsidian.md vault with git (github.com)](https://github.com/denolehov/obsidian-git)
28 | - [obsidian-git-tut-windows/README.md at main · gitobsidiantutorial/obsidian-git-tut-windows (github.com)](https://github.com/gitobsidiantutorial/obsidian-git-tut-windows/blob/main/README.md)
29 | - [ssh agent - How can I run ssh-add automatically, without a password prompt? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/90853/how-can-i-run-ssh-add-automatically-without-a-password-prompt/90869#90869)
30 | - [Adding an existing project to GitHub using the command line - GitHub Docs](https://docs.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line)
31 | ***
32 |
--------------------------------------------------------------------------------
/docs/Obsidian/Publishing Workflow.md:
--------------------------------------------------------------------------------
1 | ---
2 | creation date: 2021-05-02 15:42
3 | modification date: Sunday 2nd May 2021 15:42:09
4 | tags: ["#note"]
5 | author: Jimmy Briggs
6 | ---
7 |
8 | # Publishing Workflow
9 |
10 | Instead of paying for the built-in [Obsidian Publish Feature](https://obsidian.md/publish) this workflow utilizes the fast, simple, and nice looking [MkDocs](https://www.mkdocs.org/) static sit generator to publish an Obsidian Vault.
11 |
12 | ## Initial Setup
13 |
14 | 1. Fork the Obsidian-MkDocs Github repo template from [jobindj/obsidian-mkdocs](https://github.com/jobindj/obsidian-mkdocs)
15 | - Note: if your obsidian vault is already a git repository you may want to utilize `git submodules` instead of nesting git repo's.
16 | 2. Clone the newly forked repo into your local obsidian vault
17 | 3. Move any notes you want published into the `' + summary +'
No results found
"); 41 | } 42 | } 43 | 44 | function doSearch () { 45 | var query = document.getElementById('mkdocs-search-query').value; 46 | if (query.length > min_search_length) { 47 | if (!window.Worker) { 48 | displayResults(search(query)); 49 | } else { 50 | searchWorker.postMessage({query: query}); 51 | } 52 | } else { 53 | // Clear results for short queries 54 | displayResults([]); 55 | } 56 | } 57 | 58 | function initSearch () { 59 | var search_input = document.getElementById('mkdocs-search-query'); 60 | if (search_input) { 61 | search_input.addEventListener("keyup", doSearch); 62 | } 63 | var term = getSearchTermFromLocation(); 64 | if (term) { 65 | search_input.value = term; 66 | doSearch(); 67 | } 68 | } 69 | 70 | function onWorkerMessage (e) { 71 | if (e.data.allowSearch) { 72 | initSearch(); 73 | } else if (e.data.results) { 74 | var results = e.data.results; 75 | displayResults(results); 76 | } else if (e.data.config) { 77 | min_search_length = e.data.config.min_search_length-1; 78 | } 79 | } 80 | 81 | if (!window.Worker) { 82 | console.log('Web Worker API not supported'); 83 | // load index in main thread 84 | $.getScript(joinUrl(base_url, "search/worker.js")).done(function () { 85 | console.log('Loaded worker'); 86 | init(); 87 | window.postMessage = function (msg) { 88 | onWorkerMessage({data: msg}); 89 | }; 90 | }).fail(function (jqxhr, settings, exception) { 91 | console.error('Could not load worker.js'); 92 | }); 93 | } else { 94 | // Wrap search in a web worker 95 | var searchWorker = new Worker(joinUrl(base_url, "search/worker.js")); 96 | searchWorker.postMessage({init: true}); 97 | searchWorker.onmessage = onWorkerMessage; 98 | } 99 | -------------------------------------------------------------------------------- /site/search/worker.js: -------------------------------------------------------------------------------- 1 | var base_path = 'function' === typeof importScripts ? '.' : '/search/'; 2 | var allowSearch = false; 3 | var index; 4 | var documents = {}; 5 | var lang = ['en']; 6 | var data; 7 | 8 | function getScript(script, callback) { 9 | console.log('Loading script: ' + script); 10 | $.getScript(base_path + script).done(function () { 11 | callback(); 12 | }).fail(function (jqxhr, settings, exception) { 13 | console.log('Error: ' + exception); 14 | }); 15 | } 16 | 17 | function getScriptsInOrder(scripts, callback) { 18 | if (scripts.length === 0) { 19 | callback(); 20 | return; 21 | } 22 | getScript(scripts[0], function() { 23 | getScriptsInOrder(scripts.slice(1), callback); 24 | }); 25 | } 26 | 27 | function loadScripts(urls, callback) { 28 | if( 'function' === typeof importScripts ) { 29 | importScripts.apply(null, urls); 30 | callback(); 31 | } else { 32 | getScriptsInOrder(urls, callback); 33 | } 34 | } 35 | 36 | function onJSONLoaded () { 37 | data = JSON.parse(this.responseText); 38 | var scriptsToLoad = ['lunr.js']; 39 | if (data.config && data.config.lang && data.config.lang.length) { 40 | lang = data.config.lang; 41 | } 42 | if (lang.length > 1 || lang[0] !== "en") { 43 | scriptsToLoad.push('lunr.stemmer.support.js'); 44 | if (lang.length > 1) { 45 | scriptsToLoad.push('lunr.multi.js'); 46 | } 47 | for (var i=0; i < lang.length; i++) { 48 | if (lang[i] != 'en') { 49 | scriptsToLoad.push(['lunr', lang[i], 'js'].join('.')); 50 | } 51 | } 52 | } 53 | loadScripts(scriptsToLoad, onScriptsLoaded); 54 | } 55 | 56 | function onScriptsLoaded () { 57 | console.log('All search scripts loaded, building Lunr index...'); 58 | if (data.config && data.config.separator && data.config.separator.length) { 59 | lunr.tokenizer.separator = new RegExp(data.config.separator); 60 | } 61 | 62 | if (data.index) { 63 | index = lunr.Index.load(data.index); 64 | data.docs.forEach(function (doc) { 65 | documents[doc.location] = doc; 66 | }); 67 | console.log('Lunr pre-built index loaded, search ready'); 68 | } else { 69 | index = lunr(function () { 70 | if (lang.length === 1 && lang[0] !== "en" && lunr[lang[0]]) { 71 | this.use(lunr[lang[0]]); 72 | } else if (lang.length > 1) { 73 | this.use(lunr.multiLanguage.apply(null, lang)); // spread operator not supported in all browsers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator#Browser_compatibility 74 | } 75 | this.field('title'); 76 | this.field('text'); 77 | this.ref('location'); 78 | 79 | for (var i=0; i < data.docs.length; i++) { 80 | var doc = data.docs[i]; 81 | this.add(doc); 82 | documents[doc.location] = doc; 83 | } 84 | }); 85 | console.log('Lunr index built, search ready'); 86 | } 87 | allowSearch = true; 88 | postMessage({config: data.config}); 89 | postMessage({allowSearch: allowSearch}); 90 | } 91 | 92 | function init () { 93 | var oReq = new XMLHttpRequest(); 94 | oReq.addEventListener("load", onJSONLoaded); 95 | var index_path = base_path + '/search_index.json'; 96 | if( 'function' === typeof importScripts ){ 97 | index_path = 'search_index.json'; 98 | } 99 | oReq.open("GET", index_path); 100 | oReq.send(); 101 | } 102 | 103 | function search (query) { 104 | if (!allowSearch) { 105 | console.error('Assets for search still loading'); 106 | return; 107 | } 108 | 109 | var resultDocuments = []; 110 | var results = index.search(query); 111 | for (var i=0; i < results.length; i++){ 112 | var result = results[i]; 113 | doc = documents[result.ref]; 114 | doc.summary = doc.text.substring(0, 200); 115 | resultDocuments.push(doc); 116 | } 117 | return resultDocuments; 118 | } 119 | 120 | if( 'function' === typeof importScripts ) { 121 | onmessage = function (e) { 122 | if (e.data.init) { 123 | init(); 124 | } else if (e.data.query) { 125 | postMessage({ results: search(e.data.query) }); 126 | } else { 127 | console.error("Worker - Unrecognized message: " + e); 128 | } 129 | }; 130 | } 131 | -------------------------------------------------------------------------------- /site/sitemap.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimbrig/obsidian_published/0865fce060307cb6aadd041d88e29c864a62e8ef/site/sitemap.xml.gz --------------------------------------------------------------------------------