updated created-at values
Used refactor-frontmatter-property-created-at.py to add created-at frontmatter property values with command python refactor-frontmatter-property-created-at.py > log.md 2>&1 in terminal from _import.
Backfilling created-at Frontmatter Property
What We Did
- Two-Pass Vault Scan: Iterated through every Markdown file in the vault (excluding hidden folders like
.obsidianand.trash, as well aslog.md) to build a complete index of files and embedded note references before making any edits. - Excluded Embedded Notes: Detected all embedded notes using both wikilink (
!Alias) and Markdown () syntax, skipping them so sub-notes/embeds do not receive standalonecreated-attimestamps. - Preserved Existing Values & Formatting: Only targeted notes where
created-atwas missing ornull, using a customObsidianYAMLHandlerto preserve double-quoted wikilinks ("[[...]]"), empty strings, and unescaped Unicode/emojis. - Handled
metadata_sourceAttachments & URLs:- When
metadata_sourcepointed to a local vault attachment (e.g.,.png,.pdf), resolved the file across the vault and pulled its timestamp instead of the wrapper.mdnote's timestamp. - When
metadata_sourcepointed to a web URL (http://orhttps://), defaulted cleanly to the.mdnote's own creation timestamp.
- When
- Recovered Earliest True Timestamp: To work around Windows/cloud sync timestamp resets and post-copy snowflake generation, calculated
created-at(YYYY-MM-DDTHH:MM:SS) by taking the earliest available timestamp among:- Custom snowflake ID in the filename (
(snowflake >> 22) + 991724400000) - Image EXIF metadata (
DateTimeOriginal,DateTimeDigitized,DateTimevia Pillow) - Filesystem creation time (
st_birthtime) - Filesystem last modified time (
st_mtime)
- Custom snowflake ID in the filename (
Limitations & Edge Cases
- Cloud/Zip Timestamp Resets: If a non-snowflake file without EXIF metadata was downloaded via a web
.zipfrom Google Drive or copied across drives that overwrite bothst_birthtimeandst_mtime, the earliest available timestamp reflects the copy/download time rather than the original creation date. - Name-Based Embed Matching: Embedded notes are matched by case-insensitive filename stem rather than full relative path. If two different folders contain notes with the exact same filename and one is embedded, both are skipped.
- URL-Encoded Markdown Embeds: Standard Markdown embeds containing
%20for spaces (e.g.,) are not URL-decoded before matching against filenames on disk. - Frontmatter-Only Embeds Ignored: Embed references are only scanned in the Markdown body content, not inside YAML frontmatter properties.
- YAML Re-Serialization: Notes modified by the script have their YAML frontmatter re-serialized by
PyYAML(sort_keys=True), which alphabetically sorts frontmatter keys and strips any inline YAML comments.