Skip to content

Instantly share code, notes, and snippets.

@emisjerry
Last active January 30, 2023 10:18
Show Gist options
  • Save emisjerry/945d4f21c9fd8c9c65be4e7476dbe5a7 to your computer and use it in GitHub Desktop.
Save emisjerry/945d4f21c9fd8c9c65be4e7476dbe5a7 to your computer and use it in GitHub Desktop.
Obsidian Samples for Buttons plugin

🔅Buttons外掛開啟筆記自動化操作契機⁉️ 範例展示

📑 用樣板建立筆記

name 建立Obsidian筆記
type note(/new-obsidian, split) template
action template-obsidian
color purple
name 建立Windows筆記
type note(/new-windows, split) template
action template-windows
color blue

🔍 動態查詢

name 本日建立的筆記
type note(/!query-today-new, split) template
action template-query-daily-new
name 本日修改的筆記
type note(/!query-today-changed) template
action template-query-daily-changed
name 本周建立的筆記
type note(/!query-week-new) template
action template-query-weekly
name 本月建立的筆記
type note(/!query-month-new) template
action template-query-monthly
name 本月修改的筆記
type note(/!query-month-changed) template
action template-query-monthly-modified
name 最近三個月修改的筆記
type note(/!query-3months-changed) template
action template-query-3months-modified
name 本年修改的筆記
type note(/!query-year-changed) template
action template-query-yearly-modified

✍️ 開啟查詢筆記

  • [[today-new | 查詢:本日建立的筆記]]
  • [[today-changed | 查詢:本日修改的筆記]]
  • [[week-new | 查詢:本周建立的筆記]]
  • [[month-new | 查詢:本月建立的筆記]]
  • [[month-changed | 查詢:本月修改的筆記]]
  • [[year-changed | 查詢:本年修改的筆記]]

🚀 執行Obsidian命令

name 釘選切換
type command
action 釘選切換
class button-default roundbutton
name 顯示檔案瀏覽器
type command
action 在檔案管理器顯示當前筆記
color purple
name 在檔案總管中顯示
type command
action 在檔案總管中顯示

🔗 常用連結

name Buttons說明
type link
action https://github.com/shabegom/buttons#usage
color green
name Dataview說明
type link
action https://github.com/blacksmithgu/obsidian-dataview
color green
name Kanban說明
type link
action https://github.com/mgmeyers/obsidian-kanban
color green
name Tabs說明
type link
action https://github.com/gitobsidiantutorial/obsidian-tabs
color green
name Templater說明
type link
action https://silentvoid13.github.io/Templater/docs/internal-variables-functions/
color green
date aliases description tags blog
<% tp.date.now("YYYY-MM-DD HH:mm") %>
<% tp.file.title %>
timeline
blog
yt-videos
obsidian

<%tp.file.title%>

<% tp.file.title %>

<% tp.web.random_picture("1600x900", tp.file.title) %>

教學影片

<iframe width="650" height="315" src="https://www.youtube.com/embed/$$" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

##

  • 查詢本日 <% tp.date.now() %> 的新筆記
  • [[#^BOTTOM-DN|跳至查詢結束處]]
table file.ctime as 建檔時間,file.mtime as 修改時間,file.path
from ""
where file.ctime>=date(<% tp.date.now() %>) and !contains(file.name, "template-") and !contains(file.name, "!query-")
sort file.ctime

查詢結束 ^BOTTOM-DN


name 刪除本檔
type command
action 刪除當前檔案
color red

本月查詢

  • 查詢本月 <% tp.date.now("YYYY-MM")+"-01" %> 開始的新筆記
  • [[#^BOTTOM-MN|跳至查詢結束處]]
table file.ctime as 建檔時間,file.mtime as 修改時間
from ""
where file.ctime>=date(<% tp.date.now("YYYY-MM")+"-01" %>) and !contains(file.name, "template-") and !contains(file.name, "!query-")
sort file.ctime

查詢結束 ^BOTTOM-MN


name 刪除本檔
type command
action 刪除當前檔案
color red

本周新建筆記查詢

  • 查詢周一 <% tp.date.weekday("YYYY-MM-DD", 0) %> 開始的新筆記
  • [[#^BOTTOM-W|跳至查詢結束處]]
table file.ctime as 建檔時間,file.mtime as 修改時間
from ""
where file.ctime>=date(<% tp.date.weekday("YYYY-MM-DD", 0) %>) and !contains(file.name, "template-") and !contains(file.name, "!query-")
sort file.ctime

查詢結束 ^BOTTOM-W


name 刪除本檔
type command
action 刪除當前檔案
color red
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment