2021-07-17 08:06:39 +03:00
# Obsidian Link Scrapper
2021-07-18 23:32:13 +03:00
Used by [Quartz ](https://github.com/jackyzha0/quartz )
2021-07-17 21:18:57 +03:00
This repository comes to you in two parts.
2022-02-16 03:37:02 +03:00
1. GitHub Action (scrapes links into a `.json` file)
2. Hugo Partial (turns `.json` file into graphs and tables)
2021-07-17 08:06:39 +03:00
2021-07-17 21:18:57 +03:00
## GitHub Action
2022-02-16 03:37:02 +03:00
GitHub action and binary to scrape [Obsidian ](http://obsidian.md/ ) vault for links and exposes them as a `.json` file for easy consumption by [Hugo ](https://gohugo.io/ ).
2021-07-17 21:18:57 +03:00
### Example Usage (Binary)
2022-02-16 03:37:02 +03:00
Read Markdown from the `/content` folder and place the resulting `linkIndex.json` (and `contentIndex.yaml` if the `index` flag is enabled) into `/data`
2021-07-17 08:06:39 +03:00
```shell
2021-07-17 18:39:53 +03:00
# Installation
2022-08-10 05:25:49 +03:00
go install github.com/jackyzha0/hugo-obsidian@latest
2021-07-17 18:39:53 +03:00
# Run
2021-10-25 08:50:53 +03:00
hugo-obsidian -input=content -output=data -index=true
2021-07-17 18:39:53 +03:00
```
2021-07-17 21:18:57 +03:00
### Example Usage (GitHub Action)
2021-07-18 05:37:49 +03:00
Add 'Build Link Index' as a build step in your workflow file (e.g. `.github/workflows/deploy.yaml` )
```yaml
...
2021-07-17 21:18:57 +03:00
2021-07-18 05:37:49 +03:00
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build Link Index
2021-07-18 23:31:31 +03:00
uses: jackyzha0/hugo-obsidian@v2.1
2021-07-18 05:37:49 +03:00
with:
input: content # input folder
output: data # output folder
2021-10-25 08:50:53 +03:00
index: true # whether to index content
2021-07-18 05:37:49 +03:00
...
2021-10-25 08:56:24 +03:00
```