Skip to content

Commit

Permalink
testVault: add used png
Browse files Browse the repository at this point in the history
  • Loading branch information
julesvirallinen committed Sep 26, 2023
1 parent bd1d6ee commit bdcb6a9
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ src/dg-testVault/*
package-lock.json
package.json

*.md
*.mjs
README.md
13 changes: 8 additions & 5 deletions src/dg-testVault/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"state": {
"type": "markdown",
"state": {
"file": "E Embeds/E02 PNG.md",
"file": "E Embeds/E02 PNG published.md",
"mode": "source",
"source": false
}
Expand Down Expand Up @@ -85,7 +85,7 @@
"state": {
"type": "backlink",
"state": {
"file": "E Embeds/E02 PNG.md",
"file": "E Embeds/E02 PNG published.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -102,7 +102,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "E Embeds/E02 PNG.md",
"file": "E Embeds/E02 PNG published.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand All @@ -125,7 +125,7 @@
"state": {
"type": "outline",
"state": {
"file": "E Embeds/E02 PNG.md"
"file": "E Embeds/E02 PNG published.md"
}
}
}
Expand All @@ -149,5 +149,8 @@
}
},
"active": "f8711fca058d0e01",
"lastOpenFiles": []
"lastOpenFiles": [
"E Embeds/E02 PNG_not_published.md",
"E Embeds/E02 PNG published.md"
]
}
6 changes: 6 additions & 0 deletions src/dg-testVault/E Embeds/E02 PNG published.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
dg-publish: true
---


![[travolta.png]]
File renamed without changes.
7 changes: 7 additions & 0 deletions src/test/snapshot/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ I'm a list of all files in this folder:

{ .block-language-dataview}

---
{"dg-publish":true,"permalink":"/e-embeds/e02-png-published/"}
---



![travolta.png](/img/user/A%20Assets/travolta.png)
---
{"dg-publish":true,"permalink":"/008-pinned-note/","pinned":true}
---
Expand Down
23 changes: 12 additions & 11 deletions src/ui/PublicationCenter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
let childNode = currentNode.children.find(
(child) => child.name === part
(child) => child.name === part,
);
if (!childNode) {
Expand All @@ -54,7 +54,7 @@
function filePathsToTree(
filePaths: string[],
rootName: string = "root"
rootName: string = "root",
): TreeNode {
const root: TreeNode = {
name: rootName,
Expand Down Expand Up @@ -93,14 +93,14 @@
publishStatus &&
filePathsToTree(
publishStatus.publishedNotes.map((note) => note.path),
"Published Notes"
"Published Notes",
);
$: changedNotesTree =
publishStatus &&
filePathsToTree(
publishStatus.changedNotes.map((note) => note.path),
"Changed Notes"
"Changed Notes",
);
$: deletedNoteTree =
Expand All @@ -110,14 +110,14 @@
...publishStatus.deletedNotePaths,
...publishStatus.deletedImagePaths,
],
"Deleted Notes"
"Deleted Notes",
);
$: unpublishedNoteTree =
publishStatus &&
filePathsToTree(
publishStatus.unpublishedNotes.map((note) => note.path),
"Unpublished Notes"
"Unpublished Notes",
);
$: publishProgress =
Expand Down Expand Up @@ -164,21 +164,21 @@
pathsToDelete = traverseTree(deletedNoteTree!);
const notesToDelete = pathsToDelete.filter((path) =>
publishStatus.deletedNotePaths.includes(path)
publishStatus.deletedNotePaths.includes(path),
);
const imagesToDelete = pathsToDelete.filter((path) =>
publishStatus.deletedImagePaths.includes(path)
publishStatus.deletedImagePaths.includes(path),
);
unpublishedToPublish =
publishStatus.unpublishedNotes.filter((note) =>
unpublishedPaths.includes(note.path)
unpublishedPaths.includes(note.path),
) ?? [];
changedToPublish =
publishStatus?.changedNotes.filter((note) =>
changedPaths.includes(note.path)
changedPaths.includes(note.path),
) ?? [];
showPublishingView = true;
Expand All @@ -188,7 +188,7 @@
let isPublished = await publisher.publish(note);
processingPaths = processingPaths.filter(
(path) => path !== note.path
(path) => path !== note.path,
);
if (isPublished) {
Expand All @@ -202,6 +202,7 @@
processingPaths.push(path);
const isNote = path.endsWith(".md");
let isDeleted: boolean;
if (isNote) {
isDeleted = await publisher.deleteNote(path);
} else {
Expand Down

0 comments on commit bdcb6a9

Please sign in to comment.