mirror of
https://github.com/danbee/danbarber.me.hugo.git
synced 2025-03-04 08:59:18 +00:00
Compare commits
2 Commits
67281a6be0
...
2b00bc0a01
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b00bc0a01 | |||
| e941f99229 |
@ -1 +1,2 @@
|
||||
hugo extended_0.120.4
|
||||
ruby 3.2.2
|
||||
|
||||
5
Gemfile
Normal file
5
Gemfile
Normal file
@ -0,0 +1,5 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "erb"
|
||||
gem "exiftool"
|
||||
gem "pry"
|
||||
26
Gemfile.lock
Normal file
26
Gemfile.lock
Normal file
@ -0,0 +1,26 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
cgi (0.4.1)
|
||||
coderay (1.1.3)
|
||||
erb (4.0.4)
|
||||
cgi (>= 0.3.3)
|
||||
exiftool (1.2.5)
|
||||
json
|
||||
json (2.7.2)
|
||||
method_source (1.1.0)
|
||||
pry (0.14.2)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
|
||||
PLATFORMS
|
||||
arm64-darwin-23
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
erb
|
||||
exiftool
|
||||
pry
|
||||
|
||||
BUNDLED WITH
|
||||
2.5.9
|
||||
20
archetypes/photos/index.md.erb
Normal file
20
archetypes/photos/index.md.erb
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "<%= photo[:title] %>"
|
||||
date: <%= date %>
|
||||
categories:
|
||||
tags:
|
||||
layout: post
|
||||
image: <%= photo[:file_name] %>
|
||||
---
|
||||
|
||||
<figure class="photo photo--wide">
|
||||
<img src="<%= photo[:file_name] %>" alt="<%= photo[:image_description] %>">
|
||||
|
||||
<figcaption>
|
||||
<%= photo[:model] %>,
|
||||
<%= (photo[:focal_length35efl] || photo[:focal_length]).gsub(" mm", "mm") %>,
|
||||
ISO <%= photo[:iso] %>,
|
||||
<%= photo[:shutter_speed] %>
|
||||
at ƒ/<%= photo[:f_number] %>
|
||||
</figcaption>
|
||||
</figure>
|
||||
30
bin/create_photo
Executable file
30
bin/create_photo
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env ruby
|
||||
require "erb"
|
||||
require "exiftool"
|
||||
require "i18n"
|
||||
require "pry"
|
||||
|
||||
I18n.config.available_locales = :en
|
||||
|
||||
def parameterize(string)
|
||||
I18n.transliterate(string)
|
||||
.downcase
|
||||
.gsub(/[^a-z]+/, "-")
|
||||
end
|
||||
|
||||
photo_path = ARGV.first
|
||||
|
||||
photo = Exiftool.new(photo_path)
|
||||
date = Date.today.iso8601
|
||||
|
||||
template = ERB.new(File.read("archetypes/photos/index.md.erb"))
|
||||
|
||||
post_dir = "content/photos/#{date}-#{parameterize(photo[:title])}"
|
||||
|
||||
if !Dir.exist?(post_dir)
|
||||
Dir.mkdir(post_dir)
|
||||
end
|
||||
|
||||
FileUtils.cp(photo_path, "#{post_dir}/#{photo[:file_name]}")
|
||||
|
||||
File.write("#{post_dir}/index.md", template.result)
|
||||
BIN
content/photos/2024-04-21-i-destroy-silence/IMG_6362.jpeg
Normal file
BIN
content/photos/2024-04-21-i-destroy-silence/IMG_6362.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 MiB |
20
content/photos/2024-04-21-i-destroy-silence/index.md
Normal file
20
content/photos/2024-04-21-i-destroy-silence/index.md
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
title: "I Destroy Silence"
|
||||
date: 2024-04-21
|
||||
categories:
|
||||
tags:
|
||||
layout: post
|
||||
image: IMG_6362.jpeg
|
||||
---
|
||||
|
||||
<figure class="photo photo--wide">
|
||||
<img src="IMG_6362.jpeg" alt="Sofía and I at my SMC gig on Saturday">
|
||||
|
||||
<figcaption>
|
||||
iPhone 15 Pro Max,
|
||||
6.8mm (35mm equivalent: 24.0mm),
|
||||
ISO 3200,
|
||||
1/15
|
||||
at ƒ/1.8
|
||||
</figcaption>
|
||||
</figure>
|
||||
Loading…
Reference in New Issue
Block a user