Skip to content

Commit e76207e

Browse files
committed
fix(interlinks): do not error if no config found
1 parent 55909c4 commit e76207e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

_extensions/interlinks/interlinks.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,14 @@ return {
232232
Meta = function(meta)
233233
local json
234234
local prefix
235-
for k, v in pairs(meta.interlinks.sources) do
236-
local base_name = quarto.project.offset .. "/_inv/" .. k .. "_objects"
237-
json = read_inv_text_or_json(base_name)
238-
prefix = pandoc.utils.stringify(v.url)
239-
if json ~= nil then
240-
fixup_json(json, prefix)
235+
if meta.interlinks and meta.interlinks.sources then
236+
for k, v in pairs(meta.interlinks.sources) do
237+
local base_name = quarto.project.offset .. "/_inv/" .. k .. "_objects"
238+
json = read_inv_text_or_json(base_name)
239+
prefix = pandoc.utils.stringify(v.url)
240+
if json ~= nil then
241+
fixup_json(json, prefix)
242+
end
241243
end
242244
end
243245
json = read_inv_text_or_json(quarto.project.offset .. "/objects")

0 commit comments

Comments
 (0)