Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jun 24, 2021

Conversation

person-al
Copy link

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
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.

@notkmhn
Copy link
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.

None yet

2 participants