Skip to content

Commit

Permalink
HXL-CPLP/forum#58, hapi-t9n-alpha (#13), mvp-l10n-schemas (#7): Hapi:…
Browse files Browse the repository at this point in the history
…:HSD.api_gid_xdefallo? rascunho; Hapi::HSD.referens_gid? ok
  • Loading branch information
fititnt committed Jun 7, 2021
1 parent b789831 commit 7a60f8c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _data/referens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,28 @@ schema_gid:

gid:
UN:
gid: UN
namen: "🇺🇳 UN 🇺🇳"
hashtag:
api: "api-UN"
schema: "schema-UN"
api_xdefallo: [] # _data/api.yml / _data/l10n/api.l10n.json

XZ:
gid: XZ
namen: "🌐 XZ 🌐"
hashtag:
api: "api-XZ"
schema: "schema-XZ"
api_xdefallo: [] # _data/api.yml / _data/l10n/api.l10n.json

BR:
gid: BR
namen: "🇧🇷 BR 🇧🇷"
hashtag:
api: "api-BR"
schema: "schema-BR"
api_xdefallo: [] # _data/api.yml / _data/l10n/api.l10n.json

hxl:
linguam:
Expand Down
24 changes: 24 additions & 0 deletions _plugins/hapi/hic_sunt_dracones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,22 @@ def api!(api)
Jekyll.sites[idx].data['api'] = api
end

def api_gid_xdefallo?(api_collectionem = nil, referens_gid = nil)
apis = api_collectionem || api?
referens_gid ||= referens_gid?
# resultatum = {}
resultatum = []

apis&.each do |api|
resultatum.append(api) if api.xdefallo_est?
# resultatum[clavem] = valendum
end

# TODO: order by UN, XZ, then others

resultatum
end

def api_xdefallo?(api_collectionem = nil)
apis = api_collectionem || api?
# resultatum = {}
Expand Down Expand Up @@ -136,6 +152,14 @@ def pages!(pages)
Jekyll.sites[idx].pages = pages
end

def referens_gid? # rubocop:disable Metrics/AbcSize
return [] unless Jekyll.sites.last.data['l10n'] && \
Jekyll.sites.last.data['l10n']['apil10n']['gid'] && \
Jekyll.sites.last.data['l10n']['apil10n']['gid']

Jekyll.sites.last.data['l10n']['apil10n']['gid']
end

def testum
# puts 'okay'
# puts 'Hapi.HSD.site?.inspect'
Expand Down

0 comments on commit 7a60f8c

Please sign in to comment.