Indeed.
ok, so after you disable the plugin, if you edit the note, does it clear the error?
which version of the plugin are you using?
Actually yes it did somehow clear the error. Iām merely changing the markdown though . Do you have any clue what may be going on between the āUpdate time on editā and Publish? Right when I turned the plugin on, the ones that failed were in the āChangedā section and were ones that had there āupdatedā time changed.
As has been mentioned before, saving the file again from within a separate editor like VS code and having the āUpdate time on editā plugin disabled also fixes it which makes me think this is related to file metadata
Edit: The plugin doesnāt even have to be disabled. I just saved it in VS Code and it functions as a temporary workaround.
I decided not to publish for now. Iāll probably try again in a few months time, hopefully by then the issue will have been resolved.
I moved to the Linter plugin for the time being. There are issues with using Linter when it comes to moving the vault or something along those lines, but Iād rather not have to autosave everything in an external IDE everytime I want to publish
I have the same problem. I canāt publish notes. Same error. I also had the āUpdate time on editā plugin. Even after disabling it, the publish still doesnāt work and Iāve got same error.
However, after I remove ācreatedā and āupdatedā fields from frontmatter, the error is gone and publish works. So, I assume that the Publish and this plugin uses internally the same fields.
...few moments later...
My assumption seems to be correct. When changed the name of these fields in āUpdate time on editā plugin settings, the publish works fine even with enabled plugin.
...few moments later...
Nahā¦ this doesnāt help for some reason and next tryā¦Iāve got the same error again, even with changed field names. However, deleting fields seem to help a bit.
You can save the pages in a separate editor like VS Code and the error-giving pages should Publish. I decided to go with the Linter plugin for the time being till the issue is resolved for the plugin
I use a python script to delete all the Updated and Created property. Please use it with caution and make a backup
import os
def add_properties(file_path, name_property, value_property):
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
# Check if file has a YAML header.
if content.startswith('---'):
# Split content into header, delimiter and the rest of the file.
_, header, rest = content.split('---', 2)
# Split header into lines.
lines = header.split('\n')
# Add the new property line at the end of the header, before the delimiter.
lines.append(f"{name_property}: {value_property}")
# Join the lines, the delimiter, and the rest of the file.
content = '---'.join(['', '\n'.join(lines), rest])
else:
# No YAML header exists, so we create one with the given property and value.
yaml_header = f"---\n{name_property}: {value_property}\n---\n"
content = yaml_header + content
with open(file_path, 'w', encoding='utf-8') as file:
file.write(content)
def clean_file(file_path, delete_properties):
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
# Check if file has a YAML header.
if content.startswith('---'):
# Split content into header, delimiter and the rest of the file.
_, header, rest = content.split('---', 2)
# Split header into lines.
lines = header.split('\n')
# Remove line with the specified property.
lines = [line for line in lines if not line.startswith(delete_properties + ':')]
# Join the lines, the delimiter, and the rest of the file.
content = '---'.join(['', '\n'.join(lines), rest])
with open(file_path, 'w', encoding='utf-8') as file:
file.write(content)
def list_md_files(directory):
"""Recursively list all .md files in a directory and call clean_file for each."""
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith('.md'):
file_path = os.path.join(root, file)
clean_file(file_path, delete_properties)
# Starting directory
start_dir = './' # You can change this to any directory path you want
delete_properties = "Updated" # Or any other property you want to delete.
list_md_files(start_dir)
And change the delete_properties to Createdā¦
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.