vault backup: 2025-03-07 11:23:07

This commit is contained in:
2025-03-07 11:23:07 +08:00
parent 8bef1e67d9
commit 0c31f9ea89
5 changed files with 433 additions and 44315 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +1,10 @@
{ {
"author": "Vinzent",
"authorUrl": "https://github.com/Vinzent03",
"id": "obsidian-git", "id": "obsidian-git",
"name": "Git", "name": "Git",
"description": "Backup your vault with Git.", "description": "Integrate Git version control with automatic backup and other advanced features.",
"isDesktopOnly": false, "isDesktopOnly": false,
"fundingUrl": "https://ko-fi.com/vinzent", "fundingUrl": "https://ko-fi.com/vinzent",
"js": "main.js", "version": "2.32.0"
"version": "2.23.2"
} }

View File

@@ -0,0 +1,23 @@
#!/bin/sh
PROMPT="$1"
TEMP_FILE="$OBSIDIAN_GIT_CREDENTIALS_INPUT"
cleanup() {
rm -f "$TEMP_FILE" "$TEMP_FILE.response"
}
trap cleanup EXIT
echo "$PROMPT" > "$TEMP_FILE"
while [ ! -e "$TEMP_FILE.response" ]; do
if [ ! -e "$TEMP_FILE" ]; then
echo "Trigger file got removed: Abort" >&2
exit 1
fi
sleep 0.1
done
RESPONSE=$(cat "$TEMP_FILE.response")
echo "$RESPONSE"

View File

@@ -8,20 +8,20 @@
} }
} }
.workspace-leaf-content[data-type='git-view'] .button-border { .workspace-leaf-content[data-type="git-view"] .button-border {
border: 2px solid var(--interactive-accent); border: 2px solid var(--interactive-accent);
border-radius: var(--radius-s); border-radius: var(--radius-s);
} }
.workspace-leaf-content[data-type='git-view'] .view-content { .workspace-leaf-content[data-type="git-view"] .view-content {
padding: 0; padding: 0;
} }
.workspace-leaf-content[data-type='git-history-view'] .view-content { .workspace-leaf-content[data-type="git-history-view"] .view-content {
padding: 0; padding: 0;
} }
.loading>svg { .loading > svg {
animation: 2s linear infinite loading; animation: 2s linear infinite loading;
transform-origin: 50% 50%; transform-origin: 50% 50%;
display: inline-block; display: inline-block;
@@ -39,6 +39,10 @@
margin-right: auto; margin-right: auto;
} }
.obsidian-git-disabled {
opacity: 0.5;
}
.obsidian-git-center-button { .obsidian-git-center-button {
display: block; display: block;
margin: 20px auto; margin: 20px auto;
@@ -77,6 +81,22 @@
height: auto; height: auto;
} }
.is-active .git-tools .buttons > * {
color: var(--nav-item-color-active);
}
.git-author {
color: var(--text-accent);
}
.git-date {
color: var(--text-accent);
}
.git-ref {
color: var(--text-accent);
}
.workspace-leaf-content[data-type="diff-view"] .d2h-d-none { .workspace-leaf-content[data-type="diff-view"] .d2h-d-none {
display: none; display: none;
} }
@@ -228,12 +248,18 @@
} }
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { .theme-light
.workspace-leaf-content[data-type="diff-view"]
.d2h-code-side-line
del {
background-color: #ffb6ba; background-color: #ffb6ba;
} }
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { .theme-dark
.workspace-leaf-content[data-type="diff-view"]
.d2h-code-side-line
del {
background-color: #8d232881; background-color: #8d232881;
} }
@@ -249,13 +275,19 @@
} }
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { .theme-light
.workspace-leaf-content[data-type="diff-view"]
.d2h-code-side-line
ins {
background-color: #97f295; background-color: #97f295;
text-align: left; text-align: left;
} }
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { .theme-dark
.workspace-leaf-content[data-type="diff-view"]
.d2h-code-side-line
ins {
background-color: #1d921996; background-color: #1d921996;
text-align: left; text-align: left;
} }
@@ -376,19 +408,31 @@
color: var(--text-normal); color: var(--text-normal);
} }
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { .theme-light
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-diff
.d2h-del.d2h-change {
background-color: #fdf2d0; background-color: #fdf2d0;
} }
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { .theme-dark
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-diff
.d2h-del.d2h-change {
background-color: #55492480; background-color: #55492480;
} }
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { .theme-light
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-diff
.d2h-ins.d2h-change {
background-color: #ded; background-color: #ded;
} }
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { .theme-dark
.workspace-leaf-content[data-type="diff-view"]
.d2h-file-diff
.d2h-ins.d2h-change {
background-color: rgba(37, 78, 37, 0.418); background-color: rgba(37, 78, 37, 0.418);
} }
@@ -401,7 +445,9 @@
text-decoration: none; text-decoration: none;
} }
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a:visited { .workspace-leaf-content[data-type="diff-view"]
.d2h-file-list-wrapper
a:visited {
color: #3572b0; color: #3572b0;
} }
@@ -427,13 +473,13 @@
padding: 0; padding: 0;
} }
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li { .workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li {
border-bottom: 1px solid var(--background-modifier-border); border-bottom: 1px solid var(--background-modifier-border);
margin: 0; margin: 0;
padding: 5px 10px; padding: 5px 10px;
} }
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li:last-child { .workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child {
border-bottom: none; border-bottom: none;
} }
@@ -501,7 +547,8 @@
background-color: var(--background-secondary); background-color: var(--background-secondary);
} }
.cm-gutterElement.obs-git-blame-gutter > div, .line-author-settings-preview { .cm-gutterElement.obs-git-blame-gutter > div,
.line-author-settings-preview {
/* delegate text color to settings */ /* delegate text color to settings */
color: var(--obs-git-gutter-text); color: var(--obs-git-gutter-text);
font-family: monospace; font-family: monospace;
@@ -510,3 +557,20 @@
padding: 0px 6px 0px 6px; padding: 0px 6px 0px 6px;
white-space: pre; /* Keep spaces and do not collapse them. */ white-space: pre; /* Keep spaces and do not collapse them. */
} }
@media (max-width: 800px) {
/* hide git blame gutter not to superpose text */
.cm-gutterElement.obs-git-blame-gutter {
display: none;
}
}
.git-unified-diff-view,
.git-split-diff-view .cm-deletedLine .cm-changedText {
background-color: #ee443330;
}
.git-unified-diff-view,
.git-split-diff-view .cm-insertedLine .cm-changedText {
background-color: #22bb2230;
}

View File

@@ -277,7 +277,7 @@ Command:
obsidian://adv-uri?vault=<your-vault> obsidian://adv-uri?vault=<your-vault>
``` ```
## Launch URL ## Launch URI
### Browser  ### Browser 
You can simply enter the URI into the search bar. It will ask you to confirm the execution. You can simply enter the URI into the search bar. It will ask you to confirm the execution.
@@ -314,6 +314,14 @@ Use the PowerShell command `Start-Process` to launch an Obsidian URI.
Start-Process "obsidian://adv-uri?filepath=test" Start-Process "obsidian://adv-uri?filepath=test"
``` ```
## 整合到 batch
Now we can write a batch file to pull git and open Obsidian with specific vault.
```bat
cd "<paht_of_your_vault>"
git pull origin master
powershell -Command "Start-Process 'obsidian://adv-uri?vault=<name_of_your_vault>'"
```
# References # References