mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-15 07:56:11 +08:00
Note: Replace 'id' with 'fileName'
It all just makes far more since when each Note has a fileName. Though we don't save the fileName in the YAML header. It seems quite redundant to do that. Another advantage of this is that if we can read any file ending with a '.md' in a git repo. It doesn't need to be named exactly how we want it, and we will still save the details correctly.
This commit is contained in:
@ -48,13 +48,7 @@ class MarkdownYAMLSerializer implements NoteSerializer {
|
||||
|
||||
var metadata = note.toJson();
|
||||
metadata.remove('body');
|
||||
|
||||
// Do not save the 'id' if it is just the 'created' file like default
|
||||
if (metadata.containsKey('id') && metadata.containsKey('created')) {
|
||||
if (metadata['id'] == metadata['created']) {
|
||||
metadata.remove('id');
|
||||
}
|
||||
}
|
||||
metadata.remove('fileName');
|
||||
|
||||
str += toYAML(metadata);
|
||||
str += serparator;
|
||||
|
Reference in New Issue
Block a user