[24] 옵시디언 사이드바에 노트 배치 및 날짜 링크 자동 생성
shunnna

Lv.1 shunnna (136.♡.34.121)

2024년 5월 10일 AM 06:25 · 수정됨(15:25)

조회 497 공감 0


![[2023-09-27 Wednesday]]%%embed%%

```dataviewjs
// The date format for your periodic/daily notes
const dateFormat = 'YYYY-MM-DD dddd'
// Get the current file
const file = app.vault.getAbstractFileByPath(dv.current().file.path)
// Get the text contents of the current file
let contents = await app.vault.read(file)
// Update any text on the line before %%embed%% to be an embedded link to today's note
contents = contents.replace(/^.*?%%embed%%$/m, '![[' + moment().format(dateFormat) + ']]%%embed%%')
// Save the new contents back to the current file
await app.vault.modify(file, contents)
```

댓글 (4)

  • Iam9root

    Iam9root Lv.1

    24.05.10 · 39.♡.156.101

    dataview가 자주 보이네요.
    조금 한가해지면 추천 글 하나씩 정독하면서 따라해봐야겠습니다.
  • shunnna

    shunnna Lv.1 → Iam9root 작성자

    24.05.10 · 39.♡.222.244

    네, Dataview 플러그인이 아무래도 핵심적으로 많이 사용되서 관련 자료들이 더 많아보입니다.ㅎ 생각지도 못한 방법으로 많이들 사용하더군요~
  • G

    gaguri Lv.1

    24.05.10 · 115.♡.146.47

    좋은 글 잘 보고 있습니다. 감사합니다
  • shunnna

    shunnna Lv.1 → gaguri 작성자

    24.05.10 · 136.♡.34.114

    좋게 봐주셔서 감사합니다 {emo:damoang-emo-000.gif:40}

댓글을 작성하려면 이 필요합니다.