From 7a60f8c53eb7f3fa44ce79597610f246be3b590d Mon Sep 17 00:00:00 2001 From: Emerson Rocha Date: Mon, 7 Jun 2021 20:00:30 -0300 Subject: [PATCH] HXL-CPLP/forum#58, hapi-t9n-alpha (#13), mvp-l10n-schemas (#7): Hapi::HSD.api_gid_xdefallo? rascunho; Hapi::HSD.referens_gid? ok --- _data/referens.yml | 8 ++++++++ _plugins/hapi/hic_sunt_dracones.rb | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/_data/referens.yml b/_data/referens.yml index 0c4e43b..80607d0 100644 --- a/_data/referens.yml +++ b/_data/referens.yml @@ -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: diff --git a/_plugins/hapi/hic_sunt_dracones.rb b/_plugins/hapi/hic_sunt_dracones.rb index fab1491..3aec470 100644 --- a/_plugins/hapi/hic_sunt_dracones.rb +++ b/_plugins/hapi/hic_sunt_dracones.rb @@ -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 = {} @@ -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'