-
Notifications
You must be signed in to change notification settings - Fork 170
Localize images from Markdown metadata #525
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| # Copyright (c) 2017 - Mate Lakat | ||
| # Copyright (c) 2018 - Edwin Steele | ||
| # Copyright (c) 2021 - Tim AtLee | ||
| # Copyright (c) 2024 - Stasinos Konstantopoulos | ||
|
|
||
| # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| # of this software and associated documentation files (the "Software"), to | ||
|
|
@@ -217,7 +218,7 @@ def markdown_metadata_filepath(self): | |
|
|
||
| def _get_markdown_metadata(self): | ||
| """Get metadata from filename.md.""" | ||
| meta = {"title": "", "description": "", "meta": {}} | ||
| meta = {"title": "", "description": "", "lat": "", "lon": "", "meta": {}} | ||
| if isfile(self.markdown_metadata_filepath): | ||
| meta.update(read_markdown(self.markdown_metadata_filepath)) | ||
| return meta | ||
|
|
@@ -286,6 +287,15 @@ def _get_markdown_metadata(self): | |
|
|
||
| return meta | ||
|
|
||
| @cached_property | ||
| def lat(self): | ||
| return self.markdown_metadata.get("lat", {}) | ||
stasinos marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| @cached_property | ||
| def lon(self): | ||
| """Other metadata extracted from the Markdown index.md file.""" | ||
| return self.markdown_metadata.get("lon", {}) | ||
stasinos marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| @cached_property | ||
| def raw_exif(self): | ||
| """If not `None`, contains the raw EXIF tags.""" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.