Skip to content

Commit

Permalink
Merge pull request #15 from geolexica/fixing_glossary_concept_sources…
Browse files Browse the repository at this point in the history
…_structure

fix: glossary source structure
  • Loading branch information
HassanAkbar authored Aug 8, 2023
2 parents 47e3472 + 66e5ebc commit 6af2d98
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/jekyll/geolexica/glossary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ def normalize_sources(concept)
concept['sources'] ||= []

authoritative_sources.each do |authoritative_source|
concept['sources'] << authoritative_source.merge({ 'type' => 'authoritative' })
concept['sources'] << {
"origin" => {
'ref' => authoritative_source['ref'],
'clause' => authoritative_source['clause'],
'link' => authoritative_source['link'],
}.compact,
'type' => 'authoritative'
}
end
end

Expand Down
5 changes: 4 additions & 1 deletion spec/unit/jekyll/geolexica/glossary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@
"notes" => [],
"examples" => [],
"sources" => [
{ "type" => "authoritative", "ref" => "MSF" }
{
"origin" => { "ref" => "MSF" },
"type" => "authoritative"
}
]
}
}
Expand Down

0 comments on commit 6af2d98

Please sign in to comment.