Skip to content

Commit

Permalink
schemam-un-htcds (#15): Hapi::ArchivumSimplex agora em arquivo dedicado
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Jun 24, 2021
1 parent ec50dab commit 8e2451c
Show file tree
Hide file tree
Showing 17 changed files with 206 additions and 75 deletions.
4 changes: 4 additions & 0 deletions _config_dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# _config_dev.yml
url: ""

# This will use Linux temp dir instead of _site folder.
# Can speed rebuild times. Not really necessary.
destination: /tmp/jekyll_site/

# @see https://jekyllrb.com/docs/configuration/liquid/
liquid:
# error_mode: warn
Expand Down
24 changes: 18 additions & 6 deletions _data/expandendum/schemam.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"gid": "UN",
"lid": "HTCDS",
"nomen": "{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_nomen 🗣️_ %}",
"titulum": "{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_nomen 🗣️_ %}",
"titulum": "{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_titulum 🗣️_ %}",
"summarius": "{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_summarius 🗣️_ %}",
"situs_interretialis": {
"referens_officinale": [
Expand All @@ -20,9 +20,11 @@
"archivum": {
"referens_officinale": [
{
"nomen": "HTCDS Excel Spreadsheet.xlsm",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm"
},
{
"nomen": "htcds_xlsform.xlsx",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx"
}
]
Expand All @@ -40,7 +42,7 @@
"slug_permanens": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_slug 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"slug_situs_interretialis": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_slug 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"nomen": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_nomen 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_nomen 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝por-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_titulum 🔎🔕🔍 📝por-Latn📝 🗣️_ %}",
"summarius": "{% _🗣️ 📝por-Latn📝 UN_codicem_anglicum_IOM_HTCDS_summarius 📝por-Latn📝 🗣️_ %}",
"situs_interretialis": {
"referens_officinale": [
Expand All @@ -52,9 +54,11 @@
"archivum": {
"referens_officinale": [
{
"nomen": "HTCDS Excel Spreadsheet.xlsm",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm"
},
{
"nomen": "htcds_xlsform.xlsx",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx"
}
],
Expand Down Expand Up @@ -108,7 +112,7 @@
"slug_permanens": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_slug 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"slug_situs_interretialis": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_slug 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"nomen": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_nomen 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_nomen 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝eng-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_titulum 🔎🔕🔍 📝eng-Latn📝 🗣️_ %}",
"summarius": "{% _🗣️ 📝eng-Latn📝 UN_codicem_anglicum_IOM_HTCDS_summarius 📝eng-Latn📝 🗣️_ %}",
"situs_interretialis": {
"referens_officinale": [
Expand All @@ -120,9 +124,11 @@
"archivum": {
"referens_officinale": [
{
"nomen": "HTCDS Excel Spreadsheet.xlsm",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm"
},
{
"nomen": "htcds_xlsform.xlsx",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx"
}
],
Expand Down Expand Up @@ -176,7 +182,7 @@
"slug_permanens": "{% _🗣️ 📝spa-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_slug 🔎🔕🔍 📝spa-Latn📝 🗣️_ %}",
"slug_situs_interretialis": "{% _🗣️ 📝spa-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_slug 🔎🔕🔍 📝spa-Latn📝 🗣️_ %}",
"nomen": "{% _🗣️ 📝spa-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_nomen 🔎🔕🔍 📝spa-Latn📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝spa-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_nomen 🔎🔕🔍 📝spa-Latn📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝spa-Latn📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_titulum 🔎🔕🔍 📝spa-Latn📝 🗣️_ %}",
"summarius": "{% _🗣️ 📝spa-Latn📝 UN_codicem_anglicum_IOM_HTCDS_summarius 📝spa-Latn📝 🗣️_ %}",
"situs_interretialis": {
"referens_officinale": [
Expand All @@ -188,9 +194,11 @@
"archivum": {
"referens_officinale": [
{
"nomen": "HTCDS Excel Spreadsheet.xlsm",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm"
},
{
"nomen": "htcds_xlsform.xlsx",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx"
}
],
Expand Down Expand Up @@ -244,7 +252,7 @@
"slug_permanens": "{% _🗣️ 📝arb-Arab📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_slug 🔎🔕🔍 📝arb-Arab📝 🗣️_ %}",
"slug_situs_interretialis": "{% _🗣️ 📝arb-Arab📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_slug 🔎🔕🔍 📝arb-Arab📝 🗣️_ %}",
"nomen": "{% _🗣️ 📝arb-Arab📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_nomen 🔎🔕🔍 📝arb-Arab📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝arb-Arab📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_nomen 🔎🔕🔍 📝arb-Arab📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝arb-Arab📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_titulum 🔎🔕🔍 📝arb-Arab📝 🗣️_ %}",
"summarius": "{% _🗣️ 📝arb-Arab📝 UN_codicem_anglicum_IOM_HTCDS_summarius 📝arb-Arab📝 🗣️_ %}",
"situs_interretialis": {
"referens_officinale": [
Expand All @@ -256,9 +264,11 @@
"archivum": {
"referens_officinale": [
{
"nomen": "HTCDS Excel Spreadsheet.xlsm",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm"
},
{
"nomen": "htcds_xlsform.xlsx",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx"
}
],
Expand Down Expand Up @@ -312,7 +322,7 @@
"slug_permanens": "{% _🗣️ 📝hin-Deva📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_slug 🔎🔕🔍 📝hin-Deva📝 🗣️_ %}",
"slug_situs_interretialis": "{% _🗣️ 📝hin-Deva📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_slug 🔎🔕🔍 📝hin-Deva📝 🗣️_ %}",
"nomen": "{% _🗣️ 📝hin-Deva📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_nomen 🔎🔕🔍 📝hin-Deva📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝hin-Deva📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_nomen 🔎🔕🔍 📝hin-Deva📝 🗣️_ %}",
"titulum": "{% _🗣️ 📝hin-Deva📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_titulum 🔎🔕🔍 📝hin-Deva📝 🗣️_ %}",
"summarius": "{% _🗣️ 📝hin-Deva📝 UN_codicem_anglicum_IOM_HTCDS_summarius 📝hin-Deva📝 🗣️_ %}",
"situs_interretialis": {
"referens_officinale": [
Expand All @@ -324,9 +334,11 @@
"archivum": {
"referens_officinale": [
{
"nomen": "HTCDS Excel Spreadsheet.xlsm",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm"
},
{
"nomen": "htcds_xlsform.xlsx",
"iri": "https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx"
}
],
Expand Down
3 changes: 0 additions & 3 deletions _data/navigationem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ principale:
- nomen: <span lang="en" dir="ltr">UN P</span>
debile: true

- nomen: <span lang="en" dir="ltr">UN HTCDS</span>
debile: true

- nomen: '{% _🗣️ Hapi_locum_001_nomen_emoji 🗣️_ %}'
iri: "#"
descendens:
Expand Down
21 changes: 15 additions & 6 deletions _data/schemam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
# - https://github.com/cldf/csvw
# - https://datacommons.org/

# TODO: _[por-Latn] O slug_situs_interretialis não está 100% implementado para
# gerar as URLs, porém as memórias de tradução já contém
# as referencias
# [por-Latn]_

- uid: /mul-Zyyy/schemam/UN/HTCDS/
xdefallo: /mul-Zyyy/schemam/UN/HTCDS/
xdefallo_est: true
Expand All @@ -17,7 +22,7 @@
gid: UN
lid: HTCDS
nomen: "{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_nomen 🗣️_ %}"
titulum: "{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_nomen 🗣️_ %}"
titulum: "{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_titulum 🗣️_ %}"
summarius: "{% _🗣️ UN_codicem_anglicum_IOM_HTCDS_summarius 🗣️_ %}"
situs_interretialis:
referens_officinale:
Expand All @@ -28,8 +33,10 @@
# - codicem: (...)
archivum:
referens_officinale:
- iri: https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm
- iri: https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx
- nomen: "HTCDS Excel Spreadsheet.xlsm"
iri: https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm
- nomen: htcds_xlsform.xlsx
iri: https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx
# referens_alternativum_nomen
opus_in_progressu: true # deprecated, Use experimentum_est
experimentum_est: true
Expand Down Expand Up @@ -59,7 +66,7 @@
# Exemplum: The Human Trafficking Case Data Standard
nomen: "{% _🗣️ 📝und-Zyyy📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_nomen 🔎🔕🔍 📝und-Zyyy📝 🗣️_ %}"
# Exemplum: The Human Trafficking Case Data Standard (HTCDS)
titulum: "{% _🗣️ 📝und-Zyyy📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_nomen 🔎🔕🔍 📝und-Zyyy📝 🗣️_ %}"
titulum: "{% _🗣️ 📝und-Zyyy📝 🔎🔕🔍 UN_codicem_anglicum_IOM_HTCDS_titulum 🔎🔕🔍 📝und-Zyyy📝 🗣️_ %}"
summarius: "{% _🗣️ 📝und-Zyyy📝 UN_codicem_anglicum_IOM_HTCDS_summarius 📝und-Zyyy📝 🗣️_ %}"
situs_interretialis:
referens_officinale:
Expand All @@ -72,8 +79,10 @@
# - codicem: Q16866
archivum:
referens_officinale:
- iri: https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm
- iri: https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx
- nomen: "HTCDS Excel Spreadsheet.xlsm"
iri: https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Excel/HTCDS%20Excel%20Spreadsheet.xlsm
- nomen: htcds_xlsform.xlsx
iri: https://github.com/UNMigration/HTCDS/blob/master/Toolkit/Survey/htcds_xlsform.xlsx
# referens_alternativum_nomen
schemam:
csv+hxl:
Expand Down
2 changes: 1 addition & 1 deletion _data/tm/schemam-un-htcds.tm.hxl.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ UN_codicem_anglicum_IOM_HTCDS_abbreviationem,Q1065,1,UN,UN,codicem_anglicum,IOM,
UN_codicem_anglicum_IOM_HTCDS_slug,,1,UN,UN,codicem_anglicum,IOM,HTCDS,,,slug,,,∅,PDCTH,∅,HTCDS,∅,HTCDS,∅,HTCDS,∅,HTCDS,∅
UN_codicem_anglicum_IOM_HTCDS_situs_interretialis_slug,,1,UN,UN,codicem_anglicum,IOM,HTCDS,,situs_interretialis,slug,,,∅,pdcth-padrao-de-dados-de-casos-de-trafico-humano,∅,htcds-human-trafficking-case-data-standard,∅,HTCDS,∅,HTCDS,∅,HTCDS,∅
UN_codicem_anglicum_IOM_HTCDS_nomen,,1,UN,UN,codicem_anglicum,IOM,HTCDS,,,nomen,,,∅,Padrão de Dados de Casos de Tráfico Humano,∅,Human Trafficking Case Data Standard,∅,,∅,,∅,,∅
UN_codicem_anglicum_IOM_HTCDS_titulum,,1,UN,UN,codicem_anglicum,IOM,HTCDS,,,titulum,,,∅,O Padrão de Dados de Casos de Tráfico Humano (PDCTH),∅,The Human Trafficking Case Data Standard (HTCDS),∅,,∅,,∅,,∅
UN_codicem_anglicum_IOM_HTCDS_titulum,,1,UN,UN,codicem_anglicum,IOM,HTCDS,,,titulum,,,∅,PDCTH: O Padrão de Dados de Casos de Tráfico Humano,∅,HTCDS: The Human Trafficking Case Data Standard,∅,,∅,,∅,,∅
UN_codicem_anglicum_IOM_HTCDS_summarius,,1,UN,UN,codicem_anglicum,IOM,HTCDS,,,summarius,,,∅,"O Padrão de Dados de Casos de Tráfico Humano (PDCTH) é um formato global e uma abordagem comum para coletar e registrar dados de casos relacionados ao tráfico de pessoas. O padrão permitirá que organizações em todo o mundo coletem e potencialmente compartilhem informações relacionadas a casos de tráfico humano de maneira consistente. O PDCTH pretende ser uma referência para organizações que lidam com casos relacionados ao tráfico humano, provedores de serviços de tecnologia e fornecedores independentes de software (FIDs).",∅,"The Human Trafficking Case Data Standard (HTCDS) is a global format and common approach to collecting and recording case data related to human trafficking. The standard will enable organizations around the world to collect and potentially share information related to human trafficking cases in a consistent way. The HTCDS is intended to be a reference for organizations handling cases related to human trafficking, technology service providers and independent software vendors (ISVs).",∅,,∅,,∅,,∅
UN_codicem_anglicum_IOM_HTCDS_prs_Salutation_nomen,,1,UN,UN,codicem_anglicum,IOM,HTCDS,prs,Salutation,nomen,,,∅,,∅,Salutation,∅,,∅,,∅,,∅
UN_codicem_anglicum_IOM_HTCDS_prs_Salutation_summarius,,1,UN,UN,codicem_anglicum,IOM,HTCDS,prs,Salutation,summarius,,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅,∅
Expand Down
4 changes: 2 additions & 2 deletions _includes/schemam/item.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

<{{ h1 }} class="card-title" id="{{ schemam.url | slugify }}" >
{% if multiplum_linguam %}
{{ schemam.linguam }} - {{ schemam.nomen }}
{{ schemam.linguam }} - {{ schemam.titulum }}
{% else -%}
{{ schemam.nomen }}
{{ schemam.titulum }}
{%- endif -%}
</{{ h1 }}>

Expand Down
3 changes: 3 additions & 0 deletions _plugins/hapi/paginam/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ class ApiPaginam < Hapi::HapiPaginamCommune
html_body_class
nomen
summarius
slug
slug_permanens
slug_situs_interretialis
opus_in_progressu
xdefallo
xdefallo_est
Expand Down
82 changes: 82 additions & 0 deletions _plugins/hapi/paginam/archivum.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# @ARCHĪVUM _plugins/hapi/paginam/archivum.rb
#
# rubocop:disable RubocopIsRacistAndIcanProveIt/AsciiComments
# @see https://github.com/rubocop/ruby-style-guide/issues/301
# @see https://github.com/rubocop/ruby-style-guide/issues/137

# require 'json'

#
# Trivia:
# - 'Hapi'
# - https://hapi.etica.ai/
# - 'schēmam'
# - https://en.wiktionary.org/wiki/schema#Latin
# - 'datum'
# - https://en.wiktionary.org/wiki/datum#Latin
# - 'pāginam'
# - https://en.wiktionary.org/wiki/pagina#Latin
# - ūtilitātem
# - https://en.wiktionary.org/wiki/utilitas#Latin
# - 'expandendum'
# - https://en.wiktionary.org/wiki/expando#Latin
# frozen_string_literal: true
module Hapi
# Subclass of `Jekyll::Page` with custom method definitions.
class ArchivumSimplex < Jekyll::Page
attr_accessor :archivum_extensionem

# Attributes for Liquid templates
ATTRIBUTES_FOR_LIQUID = %w[
archivum_extensionem
content
dir
excerpt
name
path
url
].freeze

def initialize(site, archivum, schemam) # rubocop:disable Metrics/MethodLength,Lint/MissingSuper,Metrics/AbcSize
template = 'archivum-simplex'
template_ext = '.html'

@site = site # the current site instance.
@base = site.source # path to the source directory.
@dir = File.dirname(archivum['objectivum']) # the directory the page will reside in.
@ext = File.extname(archivum['objectivum']) # the extension.
@basename = File.basename(archivum['objectivum'], '.*') # filename without the extension.
@name = File.basename(archivum['objectivum']) # basically @basename + @ext.

@archivum_extensionem = @ext
# puts @ext

template_textum = File.read(Jekyll::PathManager.join(@base, archivum['fontem']))

base_path = @site.layouts[template].path
base_path.slice! @site.layouts[template].name

read_yaml(base_path, "#{template}#{template_ext}")

# _[por] Não estamos usando Jekyll defaults [por]_
data.default_proc = proc do |_, key|
site.frontmatter_defaults.find(relative_path, type, key)
end

# @archivum_fundationem = template_textum
@content = template_textum
# @linguam = schemam['linguam']
data['linguam'] = schemam['linguam']

# data['archivum_fundationem'] = template_textum

process(@name)

Jekyll::Hooks.trigger :pages, :post_init, self
end
end
end

# _[por] rubocop é tão racista que obriga re-habilitar
# AsciiComments [por]_
# rubocop:enable RubocopIsRacistAndIcanProveIt/AsciiComments
10 changes: 10 additions & 0 deletions _plugins/hapi/paginam/commune.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class HapiPaginamCommune < Jekyll::Page # rubocop:disable Metrics/ClassLength
opus_in_progressu
path
slug
slug_permanens
slug_situs_interretialis
summarius
tags
titulum
Expand Down Expand Up @@ -253,6 +255,14 @@ def slug
@datum['lid']
end

def slug_permanens
@datum['slug_permanens'] || @datum['lid']
end

def slug_situs_interretialis
@datum['slug_situs_interretialis'] || @datum['slug_permanens'] || @datum['lid']
end

# _[eng] Returns the object as a debug String [eng]_
# @see https://github.com/jekyll/jekyll/blob/master/lib/jekyll/collection.rb
# @see https://github.com/jekyll/jekyll/blob/master/lib/jekyll/page.rb
Expand Down
Loading

0 comments on commit 8e2451c

Please sign in to comment.