3

我喜欢遵循此处描述的简码约定:https ://laurakalbag.com/processing-responsive-images-with-hugo/ 并在 config.toml 中设置 exif 参数,如下所示

[imaging.exif]
 # Regexp matching the fields you want to Exclude from the (massive) set of Exif info
# available. As we cache this info to disk, this is for performance and
# disk space reasons more than anything.
# If you want it all, put ".*" in this config setting.
# Note that if neither this or ExcludeFields is set, Hugo will return a small
# default set.
includeFields = ""

# Regexp matching the Exif fields you want to exclude. This may be easier to use
# than IncludeFields above, depending on what you want.
excludeFields = ".*"

# Hugo extracts the "photo taken" date/time into .Date by default.
# Set this to true to turn it off.
disableDate = true

# Hugo extracts the "photo taken where" (GPS latitude and longitude) into
# .Long and .Lat. Set this to true to turn it off.
disableLatLong = true

但是,我注意到虽然 hugo 从生成的缩放图像中正确剥离了 exif,但 hugo 还将具有完整 EXIF 的原始图像放在公共目录中,这会带来安全问题。

我对不发布原始图像的解决方案或确实发布原始图像但使用剥离的 EXIF 的解决方案感到满意。

感谢您的任何指点,我确定我误解了一些基本的东西!

4

0 回答 0