Skip to content

Commit

Permalink
HXL-CPLP/forum#58, hapi-t9n-alpha (#13), mvp-l10n-schemas (#7): rascu…
Browse files Browse the repository at this point in the history
…nho de pagina de desambiguação
  • Loading branch information
fititnt committed Jun 9, 2021
1 parent f1ac8ee commit 095cc2b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 27 deletions.
28 changes: 12 additions & 16 deletions _data/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@

## -----------------------------------------------------------------------------
- xdefallo: /mul-Zyyy/api/UN/HDX/
# uid: /mul/api/UN/HDX/
xdefallo_est: 1
linguam: mul-Zyyy # mul-Zyyy
typum: api
gid: UN
lid: HDX
lid: HDX # _[por] xdefallo_est: 1, logo lid é forçado manualmente [por]_
title: "Index: {% _🗣️ 📝eng-Latn📝 Hapi_api_UN_HDX_titulum 📝eng-Latn📝 🗣️_ %}"
noindex: true
# HAPI_api_UN_HDX
Expand Down Expand Up @@ -81,11 +81,11 @@

## -----------------------------------------------------------------------------
- xdefallo: /mul-Zyyy/api/UN/reliefweb/
# uid: /mul/api/UN/reliefweb/
xdefallo_est: 1
linguam: mul-Zyyy # mul-Zyyy
typum: api
gid: UN
lid: '{% _🗣️ 📝eng-Latn📝 Hapi_api_UN_reliefweb_slug 📝eng-Latn📝 🗣️_ %}'
lid: reliefweb # _[por] xdefallo_est: 1, logo lid é forçado manualmente [por]_
title: "Index: {% _🗣️ 📝eng-Latn📝 Hapi_api_UN_reliefweb_titulum 📝eng-Latn📝 🗣️_ %}"
noindex: true

Expand All @@ -111,11 +111,11 @@

## -----------------------------------------------------------------------------
- xdefallo: /mul-Zyyy/api/UN/CODV2API/
# uid: /mul/api/UN/CODV2API/
xdefallo_est: 1
linguam: mul-Zyyy # mul-Zyyy
typum: api
gid: UN
lid: '{% _🗣️ 📝eng-Latn📝 Hapi_api_UN_HDX_slug 📝eng-Latn📝 🗣️_ %}'
lid: CODV2API # _[por] xdefallo_est: 1, logo lid é forçado manualmente [por]_
title: "Index: {% _🗣️ 📝eng-Latn📝 Hapi_api_UN_CODV2API_titulum 📝eng-Latn📝 🗣️_ %}"
noindex: true

Expand Down Expand Up @@ -145,11 +145,11 @@

## -----------------------------------------------------------------------------
- xdefallo: /mul-Zyyy/api/XZ/HXL-Proxy/
# uid: /mul/api/XZ/HXL-Proxy/
xdefallo_est: 1
linguam: mul-Zyyy # mul-Zyyy
typum: api
gid: XZ
lid: '{% _🗣️ 📝eng-Latn📝 Hapi_api_XZ_HXL-Proxy_slug 📝eng-Latn📝 🗣️_ %}'
lid: HXL-Proxy # _[por] xdefallo_est: 1, logo lid é forçado manualmente [por]_
title: "Index: {% _🗣️ 📝eng-Latn📝 Hapi_api_XZ_HXL-Proxy_titulum 📝eng-Latn📝 🗣️_ %}"
noindex: true

Expand Down Expand Up @@ -177,16 +177,15 @@

## -----------------------------------------------------------------------------
- xdefallo: /mul-Zyyy/api/BR/portais-ckan-brasil/
# uid: /mul/api/BR/portais-ckan-brasil/
xdefallo_est: 1
linguam: mul-Zyyy # mul-Zyyy
typum: api
gid: BR
lid: '{% _🗣️ 📝por-Latn📝 Hapi_api_BR_portais-ckan-brasil_slug 📝por-Latn📝 🗣️_ %}'
lid: portais-ckan-brasil # _[por] xdefallo_est: 1, logo lid é forçado manualmente [por]_
title: "Index: {% _🗣️ 📝eng-Latn📝 Hapi_api_BR_portais-ckan-brasil_titulum 📝eng-Latn📝 🗣️_ %}"
noindex: true

- xdefallo: /mul-Zyyy/api/BR/portais-ckan-brasil/
# uid: /eng/api/BR/brazilian-ckan-portals/
linguam: eng-Latn
typum: api
gid: BR
Expand All @@ -199,7 +198,6 @@
noindex: true

- xdefallo: /mul-Zyyy/api/BR/portais-ckan-brasil/
# uid: /por/api/BR/dados-abertos-ckan-brasil/
linguam: por-Latn
typum: api
gid: BR
Expand All @@ -213,16 +211,15 @@

## -----------------------------------------------------------------------------
- xdefallo: /mul-Zyyy/api/BR/portais-arcgis-brasil/
# uid: /mul/api/BR/portais-arcgis-brasil/
xdefallo_est: 1
linguam: mul-Zyyy # mul-Zyyy
typum: api
gid: BR
lid: '{% _🗣️ 📝por-Latn📝 Hapi_api_BR_portais-arcgis-brasil_slug 📝por-Latn📝 🗣️_ %}'
lid: portais-arcgis-brasil # _[por] xdefallo_est: 1, logo lid é forçado manualmente [por]_
title: "Index: {% _🗣️ 📝por-Latn📝 Hapi_api_BR_portais-arcgis-brasil_titulum 📝por-Latn📝 🗣️_ %}"
noindex: true

- xdefallo: /mul-Zyyy/api/BR/portais-arcgis-brasil/
# uid: /por/api/BR/portais-arcgis-brasil/
linguam: eng-Latn
typum: api
gid: BR
Expand All @@ -233,7 +230,6 @@
noindex: true

- xdefallo: /mul-Zyyy/api/BR/portais-arcgis-brasil/
# uid: /por/api/BR/portais-arcgis-brasil/
linguam: por-Latn
typum: api
gid: BR
Expand Down
5 changes: 5 additions & 0 deletions _layouts/xapi.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: defallo
---

(xapi draft)
10 changes: 5 additions & 5 deletions _plugins/hapi/hic_sunt_dracones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ def api_gid_xdefallo?(api_collectionem = nil) # rubocop:disable Metrics/AbcSize,
resultatum = []

referens_gid.each do |clavem_gid, valendum|
puts "api_gid_xdefallo [#{clavem_gid}] [#{valendum}]"
puts ''
# puts "api_gid_xdefallo [#{clavem_gid}] [#{valendum}]"
# puts ''
res = valendum
res['collectionem_api'] = []
apis.each do |api|
res['collectionem_api'].append(api) if api.xdefallo_est? && api.gid_est?(clavem_gid)
res['collectionem_api'].append(api) if api.xdefallo_est && api.gid_est?(clavem_gid)
# resultatum[clavem] = valendum
end
# resultatum.append(res)
Expand All @@ -137,7 +137,7 @@ def api_xdefallo?(api_collectionem = nil)
resultatum = []

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

Expand Down Expand Up @@ -214,7 +214,7 @@ def globum?(api_collectionem = nil, _schemam_collectionem = nil) # rubocop:disab
res['collectionem_xapi'] = []
apis.each do |api|
res['collectionem_api'].append(api) if api.gid_est?(clavem_gid)
res['collectionem_xapi'].append(api) if api.xdefallo_est? && api.gid_est?(clavem_gid)
res['collectionem_xapi'].append(api) if api.xdefallo_est && api.gid_est?(clavem_gid)
# resultatum[clavem] = valendum
end
# resultatum.append(res)
Expand Down
10 changes: 7 additions & 3 deletions _plugins/hapi/utilitatem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ def expandendum_api_datum_jekyll_page(api, referens)
'tags' => tags_de_api(api),
'openapi_filum2' => openapi_filum_de_api(api),
'template' => 'api',
'layout' => 'api',
'layout' => api['xdefallo_est'] ? 'xapi' : 'api',
'trivium' => digitum_premendum(api['xdefallo'])
}

# puts api['jekyll-page']

api
end

Expand Down Expand Up @@ -208,7 +210,8 @@ def nomen_purissimum(name)
# _[por] Tags Jekyll de item de API [por]_
def openapi_filum_de_api(api)
if api['openapi_filum'].nil?
@filum = "#{api['xdefallo'].gsub('/mul/', '/')}/#{api['linguam']}/openapi.yaml"
# @filum = "#{api['xdefallo'].gsub('/mul/', '/')}/#{api['linguam']}/openapi.yaml"
@filum = "#{api['xdefallo'].gsub('/mul-Zyyyy/', '/')}/#{api['linguam']}/openapi.yaml"
@filum
else
api['openapi_filum']
Expand Down Expand Up @@ -299,7 +302,8 @@ def praeiudico_iso15924_de_iso6393(iso6393, referens_praeiudico)
# _[eng] Is this an xdefallo API? [eng]_
# _[por] Esta é uma API xdefallo? [por]_
def xdefault_est(api)
api['linguam'] == 'mul' || api['linguam'] == 'mul-Zyyy'
# api['linguam'] == 'mul' || api['linguam'] == 'mul-Zyyy'
!!api['xdefallo_est']
end

# _[eng] Return list of hreflang alternate of an API [eng]_
Expand Down
9 changes: 6 additions & 3 deletions _plugins/jekyll_hapi_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def generate(site) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
# _[eng] Subclass of `Jekyll::Page` with custom method definitions. [eng]_
# _[eng] Subclasse de `Jekyll::Page` com customizações nos métodos [eng]_
class ApiPaginam < Jekyll::Page
attr_accessor :datum, :gid, :uid, :xdefallo, :alternativum
attr_accessor :datum, :gid, :uid, :xdefallo, :xdefallo_est, :alternativum

# Attributes for Liquid templates
ATTRIBUTES_FOR_LIQUID = %w[
Expand All @@ -60,6 +60,7 @@ class ApiPaginam < Jekyll::Page
titulum
namen
xdefallo
xdefallo_est
content
dir
path
Expand Down Expand Up @@ -98,6 +99,7 @@ def initialize(site, api_datum, _debug) # rubocop:disable Metrics/AbcSize,Metric
@gid = api_datum['gid']
@uid = api_datum['uid']
@xdefallo = api_datum['xdefallo']
@xdefallo_est = !!api_datum['xdefallo_est']
# puts ' api_datum'
# puts api_datum
# @trivum = 'teste'
Expand Down Expand Up @@ -219,12 +221,13 @@ def to_s
# - https://en.wiktionary.org/wiki/trivium#Latin
# - 'xdefallo'
# - https://developers.google.com/search/blog/2013/04/x-default-hreflang-for-international-pages
def xdefallo_est?
def xdefallo_est
# @datum['linguam'] == 'mul' || @datum['linguam'] == 'mul-Zyyy'
# puts "#{@uid} == #{@xdefallo}"
# puts @uid == @xdefallo
# puts ''
@uid == @xdefallo
# @uid == @xdefallo
@xdefallo_est
end
end
end
Expand Down

0 comments on commit 095cc2b

Please sign in to comment.