1
0
mirror of https://github.com/danbee/danbarber.me.hugo.git synced 2025-03-04 08:59:18 +00:00

Improve create_photo script for photos without title

This commit is contained in:
Daniel Barber 2024-05-12 14:13:15 -05:00
parent c1d707a48d
commit cfb66e79c0
5 changed files with 69 additions and 1 deletions

1
Brewfile Normal file
View File

@ -0,0 +1 @@
brew "exiftool"

62
Brewfile.lock.json Normal file
View File

@ -0,0 +1,62 @@
{
"entries": {
"brew": {
"exiftool": {
"version": "12.76",
"bottle": {
"rebuild": 0,
"root_url": "https://ghcr.io/v2/homebrew/core",
"files": {
"arm64_sonoma": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/exiftool/blobs/sha256:eaefac7e07b3e99c42d2aa0a99c8e78355c6d6a874245445de60d45c846febd7",
"sha256": "eaefac7e07b3e99c42d2aa0a99c8e78355c6d6a874245445de60d45c846febd7"
},
"arm64_ventura": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/exiftool/blobs/sha256:c98ed3b14a4d1c66cdb7c19b21fab826ce4c53df12e7a02a51f093f342e7c3b3",
"sha256": "c98ed3b14a4d1c66cdb7c19b21fab826ce4c53df12e7a02a51f093f342e7c3b3"
},
"arm64_monterey": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/exiftool/blobs/sha256:c98ed3b14a4d1c66cdb7c19b21fab826ce4c53df12e7a02a51f093f342e7c3b3",
"sha256": "c98ed3b14a4d1c66cdb7c19b21fab826ce4c53df12e7a02a51f093f342e7c3b3"
},
"sonoma": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/exiftool/blobs/sha256:d7518674545b5024eb61598e5597c0a42a3eec16bebe249c5ac00de773a45169",
"sha256": "d7518674545b5024eb61598e5597c0a42a3eec16bebe249c5ac00de773a45169"
},
"ventura": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/exiftool/blobs/sha256:3a9703e2864c0e897286d4bb8d77d63612ca50fcec2c61e809c19838acb60474",
"sha256": "3a9703e2864c0e897286d4bb8d77d63612ca50fcec2c61e809c19838acb60474"
},
"monterey": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/exiftool/blobs/sha256:3a9703e2864c0e897286d4bb8d77d63612ca50fcec2c61e809c19838acb60474",
"sha256": "3a9703e2864c0e897286d4bb8d77d63612ca50fcec2c61e809c19838acb60474"
},
"x86_64_linux": {
"cellar": ":any_skip_relocation",
"url": "https://ghcr.io/v2/homebrew/core/exiftool/blobs/sha256:01ef54fe0dfd9c6b794a61a269cd1599b58a79851f74c4369fbb33f1737f813c",
"sha256": "01ef54fe0dfd9c6b794a61a269cd1599b58a79851f74c4369fbb33f1737f813c"
}
}
}
}
}
},
"system": {
"macos": {
"sonoma": {
"HOMEBREW_VERSION": "4.2.21",
"HOMEBREW_PREFIX": "/opt/homebrew",
"Homebrew/homebrew-core": "api",
"CLT": "15.3.0.0.1.1708646388",
"Xcode": "15.3",
"macOS": "14.4.1"
}
}
}
}

View File

@ -2,4 +2,5 @@ source "https://rubygems.org"
gem "erb" gem "erb"
gem "exiftool" gem "exiftool"
gem "i18n"
gem "pry" gem "pry"

View File

@ -3,10 +3,13 @@ GEM
specs: specs:
cgi (0.4.1) cgi (0.4.1)
coderay (1.1.3) coderay (1.1.3)
concurrent-ruby (1.2.3)
erb (4.0.4) erb (4.0.4)
cgi (>= 0.3.3) cgi (>= 0.3.3)
exiftool (1.2.5) exiftool (1.2.5)
json json
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.7.2) json (2.7.2)
method_source (1.1.0) method_source (1.1.0)
pry (0.14.2) pry (0.14.2)
@ -20,6 +23,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
erb erb
exiftool exiftool
i18n
pry pry
BUNDLED WITH BUNDLED WITH

View File

@ -19,7 +19,7 @@ date = Date.today.iso8601
template = ERB.new(File.read("archetypes/photos/index.md.erb")) template = ERB.new(File.read("archetypes/photos/index.md.erb"))
post_dir = "content/photos/#{date}-#{parameterize(photo[:title])}" post_dir = "content/photos/#{date}-#{parameterize(photo[:title] || photo[:file_name])}"
if !Dir.exist?(post_dir) if !Dir.exist?(post_dir)
Dir.mkdir(post_dir) Dir.mkdir(post_dir)