Skip to content

Allow find and replace metadata and do not error when file not found.#1

Merged
notkmhn merged 1 commit intonotkmhn:mainfrom
person-al:person/find-replace
Jun 24, 2021
Merged

Allow find and replace metadata and do not error when file not found.#1
notkmhn merged 1 commit intonotkmhn:mainfrom
person-al:person/find-replace

Conversation

@person-al
Copy link
Copy Markdown

Allow find and replace metadata so you can modify files systematically before publishing them. This is helpful when removing extra status information from files before publishing. Additionally, do not error out if you cannot find a file for a given Obsidian link

dated_name, _, _ = dated_file_index[link_name_slug]
rewritten = rewritten.replace(
link, f'[{link_text}]({generate_post_link(dated_name, post_link_mode)})')
dated_name, _, _ = dated_file_index.get(link_name_slug, (None, None, None))
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, if a file has a [[ link to a file that doesn't exist yet, obdye errors out. This change makes it skip replacing the link instead.

@person-al person-al force-pushed the person/find-replace branch from f2a7b0d to 6410c16 Compare June 24, 2021 00:09
@person-al person-al force-pushed the person/find-replace branch from 6410c16 to ea306c4 Compare June 24, 2021 00:10
@notkmhn
Copy link
Copy Markdown
Owner

notkmhn commented Jun 24, 2021

Nice addition, thanks for the PR!

@notkmhn notkmhn merged commit f182a83 into notkmhn:main Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants