Figure out the relative path situation #2

Closed
opened 2024-12-07 20:51:04 -07:00 by sashakoshka · 0 comments
Owner

Currently, all file paths are given as just paths relative to the current working directory, which is also the site root. This is useful and fine, because fs.FS works nicely with this and its easy to reference a file anywhere on the system.

However, there needs to be a way to reference files relative to the current document. This should probably be ., because it sort of mirrors the template dot and is also similar to how include directives work in C.

There would be some function of Document that would transform a path given to a template function and turn it into either an absolute file path or one relative to the current working directory. All functions to do with files should run the input path through this.

Currently, all file paths are given as just paths relative to the current working directory, which is also the site root. This is useful and fine, because fs.FS works nicely with this and its easy to reference a file anywhere on the system. However, there needs to be a way to reference files relative to the current document. This should probably be `.`, because it sort of mirrors the template dot and is also similar to how include directives work in C. There would be some function of Document that would transform a path given to a template function and turn it into either an absolute file path or one relative to the current working directory. All functions to do with files should run the input path through this.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sashakoshka/step#2
No description provided.