Skip to content

Commit

Permalink
feat: new version
Browse files Browse the repository at this point in the history
  • Loading branch information
kirito41dd committed Dec 16, 2024
1 parent 29d9e5f commit 017aa23
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "hugo-publish",
"name": "Hugo Publish",
"version": "1.0.7",
"version": "1.0.8",
"minAppVersion": "0.15.0",
"description": "Publish your blog to hugo site.",
"author": "kirito",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-sample-plugin",
"version": "1.0.7",
"version": "1.0.8",
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
"main": "main.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,16 @@ export default class HugoPublishPlugin extends Plugin {
const blogs = await util.get_all_blog_md(this.app, this.settings.blog_tag);

// Get excluded directories
const excludeDirs = this.settings.get_exclude_dir();
const exclude_dirs = this.settings.get_exclude_dir().map(v => v.endsWith('/') ? v : v + '/');
console.debug('skip dirs:', exclude_dirs);

for (let i = 0; i < blogs.length; i++) {
const f = blogs[i];
const content = await this.app.vault.read(f);
const stat = await this.app.vault.adapter.stat(f.path);

// Check if the file is in an excluded directory
const isExcluded = excludeDirs.some(dir => f.path.startsWith(dir));
const isExcluded = exclude_dirs.some(dir => f.path.startsWith(dir));
if (isExcluded) {
continue; // Ignore files in excluded directories
}
Expand Down
4 changes: 2 additions & 2 deletions src/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ export class HugoPublishSettingTab extends PluginSettingTab {
this.plugin.settings.export_blog_tag = value;
await this.plugin.saveSettings();
}));
new Setting(containerEl).setName("exclude dir").setDesc('Exclude dir when syncing, relative path to vault, split by ",", like blog/dir1')
.addText(text => text.setPlaceholder("blog/dir1").setValue(this.plugin.settings.exclude_dir).onChange(async (value) => {
new Setting(containerEl).setName("exclude dir").setDesc('Exclude dir when syncing, relative path to vault, split by ","')
.addText(text => text.setPlaceholder("templates,dir2,tmp/dir3").setValue(this.plugin.settings.exclude_dir).onChange(async (value) => {
this.plugin.settings.exclude_dir = value;
await this.plugin.saveSettings();
}))
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"1.0.4": "0.15.0",
"1.0.5": "0.15.0",
"1.0.6": "0.15.0",
"1.0.7": "0.15.0"
"1.0.7": "0.15.0",
"1.0.8": "0.15.0"
}

0 comments on commit 017aa23

Please sign in to comment.