hugo-obsidian/README.md

41 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

# Obsidian Link Scraper
2021-07-18 16:32:13 -04:00
Used by [Quartz](https://github.com/jackyzha0/quartz)
2021-07-17 14:18:57 -04:00
This repository comes to you in two parts.
2022-02-15 19:37:02 -05:00
1. GitHub Action (scrapes links into a `.json` file)
2. Hugo Partial (turns `.json` file into graphs and tables)
2021-07-17 01:06:39 -04:00
2021-07-17 14:18:57 -04:00
## GitHub Action
2022-02-15 19:37:02 -05: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 14:18:57 -04:00
### Example Usage (Binary)
2022-02-15 19:37:02 -05: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 01:06:39 -04:00
```shell
2021-07-17 11:39:53 -04:00
# Installation
go install github.com/jackyzha0/hugo-obsidian@latest
2021-07-17 11:39:53 -04:00
# Run
2021-10-24 22:50:53 -07:00
hugo-obsidian -input=content -output=data -index=true
2021-07-17 11:39:53 -04:00
```
2021-07-17 14:18:57 -04:00
### Example Usage (GitHub Action)
2021-07-17 22:37:49 -04:00
Add 'Build Link Index' as a build step in your workflow file (e.g. `.github/workflows/deploy.yaml`)
```yaml
...
2021-07-17 14:18:57 -04:00
2021-07-17 22:37:49 -04:00
jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Build Link Index
2021-07-18 16:31:31 -04:00
uses: jackyzha0/hugo-obsidian@v2.1
2021-07-17 22:37:49 -04:00
with:
input: content # input folder
output: data # output folder
2021-10-24 22:50:53 -07:00
index: true # whether to index content
2021-07-17 22:37:49 -04:00
...
2021-10-24 22:56:24 -07:00
```