Skip to content

Commit

Permalink
mvp-tema-i18n (#9): _includes/tm/index-xdefallo.html, rascunho
Browse files Browse the repository at this point in the history
  • Loading branch information
fititnt committed Jun 18, 2021
1 parent b335634 commit acdba85
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 323 deletions.
18 changes: 18 additions & 0 deletions _includes/tm/index-xdefallo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- _includes/schemam/index-xdefallo.html -->

{% assign xtm = include.xtm %}
{% assign h_1sx = include.initiale_html_hN %}
{% assign h_2sx = h_1sx | plus: 1 %}
{% assign h_3sx = h_2sx | plus: 1 %}

{% assign h1sx = h_1sx | prepend: 'h' %}
{% assign h2sx = h_2sx | prepend: 'h' %}
{% assign h3sx = h_3sx | prepend: 'h' %}

{% _🗣️ opus_in_progressu_emoji_nomen 🗣_️ %}

{% for rem in xtm.alternativum %}
<article style="padding: 1em">
{% include tm/item.html tm=rem initiale_html_hN=h_3sx multiplum_linguam=true %}
</article>
{% endfor %}
58 changes: 58 additions & 0 deletions _includes/tm/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!-- _includes/schemam/index.html -->

{% assign h_1sx = include.initiale_html_hN %}
{% assign h_2sx = h_1sx | plus: 1 %}
{% assign h_3sx = h_2sx | plus: 1 %}

{% assign h1sx = h_1sx | prepend: 'h' %}
{% assign h2sx = h_2sx | prepend: 'h' %}
{% assign h3sx = h_3sx | prepend: 'h' %}

{% for xschemam_global in site.data.hapi.xschemam %}
{% if xschemam_global.collectionem_xschemam[0] %}
<section>
<{{ h1sx }} id="{% _🗣️ 🔎🔕🔍 Hapi_schemam_slug 🔎🔕🔍 🗣️_ %}--{{ xschemam_global.gid }}">
{{ xschemam_global.nomen }}
</{{ h1sx }}>

{% for xschemam in xschemam_global.collectionem_xschemam %}

{%- if xschemam.alternativum_linguam contains page.linguam and page.linguam != 'mul-Zyyy' -%}
{% assign rem = xschemam.alternativum | where: 'linguam', page.linguam | first %}
<article style="padding: 1em">
{% include schemam/item.html schemam=rem initiale_html_hN=h_2sx multiplum_linguam=false %}
</article>

{%- else -%}

<section style="padding-left: 1em; padding-right: 1em">
<{{ h2sx }} id="{% _🗣️ 🔎🔕🔍 Hapi_schemam_slug 🔎🔕🔍 🗣️_ %}--{{ xschemam.lid | slugify }}">
<a href="#{{ xschemam.url | slugify }}">🔗</a>
{{ xschemam.lid }}
</{{ h2sx }}>

{% unless page.linguam == 'mul-Zyyy' %}
<p>
<mark lang="pt">_[por] TODO: Sem idioma disponível. Apresentando todas as opções. [por]_</mark>
</p>
{% endunless %}

{% for rem in xschemam.alternativum %}
{% comment %} {% if api_alt.url == xapi.url %}
{% continue %}
{% endif %} {% endcomment %}

<article style="padding: 1em">
{% include schemam/item.html schemam=rem initiale_html_hN=h_3sx multiplum_linguam=true %}
</article>

{% endfor %}

</section>

{%- endif -%}

{% endfor %}
</section>
{% endif %}
{% endfor %}
76 changes: 76 additions & 0 deletions _includes/tm/item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!-- _includes/schemam/item.html -->
{% assign schemam = include.schemam %}
{% assign multiplum_linguam = include.multiplum_linguam %}

{% assign h_1 = include.initiale_html_hN %}
{% assign h_2 = h_1 | plus: 1 %}
{% assign h_3 = h_2 | plus: 1 %}
{% assign h_4 = h_3 | plus: 1 %}
{% assign h1 = h_1 | prepend: 'h' %}
{% assign h2 = h_2 | prepend: 'h' %}
{% assign h3 = h_3 | prepend: 'h' %}
{% assign h4 = h_4 | prepend: 'h' %}

<div class="card">
<div class="card-header">
<small>🗣{{ schemam.linguam }}🗣</small>
{% if schemam.opus_in_progressu %}
<small>{% _🗣️ opus_in_progressu_emoji_nomen 🗣️_ %}</small>
{% endif %}
</div>
<div class="card-body">

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

<p class="card-text">
{{ schemam.summarius }}
</p>

<a href="{{ schemam.url }}" hreflang="{{ schemam.hreflang }}"
class="btn btn-primary">
{% _🗣️ abbreviationem_XZ_URL_canonicum_nomen 🗣️_ %}
</a>

{%- if schemam.datum.archivum %}

{%- if schemam.datum.archivum.schemam.graphql %}
{% for rem in schemam.datum.archivum.schemam.graphql %}
<a href="{{ rem.iri }}" class="btn btn-secondary">
{% _🗣️ graphql_schemam_nomen 🗣️_ %}
</a>
{%- endfor %}
{% endif %}

{%- if schemam.datum.archivum.schemam.json %}
{% for rem in schemam.datum.archivum.schemam.json %}
<a href="{{ rem.iri }}" class="btn btn-secondary">
{% _🗣️ json_schemam_nomen 🗣️_ %}
</a>
{%- endfor %}
{% endif %}

{%- if schemam.datum.archivum.schemam.sql %}
{% for rem in schemam.datum.archivum.schemam.sql %}
<a href="{{ rem.iri }}" class="btn btn-secondary">
{% _🗣️ SQL_abbreviationem_nomen 🗣️_ %}
</a>
{%- endfor %}
{% endif %}

{% endif %}

</div>
<div class="card-footer">
<small class="text-muted">
{% _🗣️ commune_agnitionem_et_gratiam_nomen 🗣️_ %}: <br>
<mark>_[por] TODO: adicionar lista de colaboradores [por]_</mark>
</small>
</div>
</div>

2 changes: 1 addition & 1 deletion _layouts/xtm.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

{% include xdefallo-linguam-notitia.html %}

{% include schemam/index-xdefallo.html xschemam=page initiale_html_hN=2 %}
{% include tm/index-xdefallo.html xtm=page initiale_html_hN=2 %}

15 changes: 1 addition & 14 deletions _plugins/hapi/hic_sunt_dracones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,6 @@ module Hapi
module HSD # rubocop:disable Metrics/ModuleLength
module_function

# # _[eng] Global Anti-pattern of global variable without global variable [eng]_
# class Site
# include Singleton

# def jekyll_site
# Jekyll.sites.last
# end

# def jekyll_data
# Jekyll.sites.last.data
# end
# end

def initiale_after_reset(site)
schemam_fontem_path = File.join(site.source, '/_data/schemam.yml')
hapi_referens_path = File.join(site.source, '/_data/referens.yml')
Expand Down Expand Up @@ -210,7 +197,7 @@ def data?
Jekyll.sites.last.data
end

def l10n_simplex(codicem, linguam)
def l10n_simplex(codicem, _linguam)
# puts "TODO: l10n_simplex #{codicem} #{linguam}"

codicem
Expand Down
78 changes: 3 additions & 75 deletions _plugins/hapi/paginam/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# - 'expandendum'
# - https://en.wiktionary.org/wiki/expando#Latin
module Hapi
# HapiApiGenerator is (TODO: document)
class HapiApiGenerator < Jekyll::Generator
# ApiGenerator is (TODO: document)
class ApiGenerator < Jekyll::Generator
safe true

def generate(site) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
Expand Down Expand Up @@ -53,7 +53,7 @@ def generate(site) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
# _[eng] Subclasse de `Jekyll::Page` com customizações nos métodos [eng]_
# class ApiPaginam < Jekyll::Page
class ApiPaginam < Hapi::HapiPaginamCommune
attr_accessor :datum, :gid, :uid, :xdefallo, :xdefallo_est, :experimentum_est
attr_accessor :datum, :gid, :uid, :experimentum_est

# Attributes for Liquid templates
ATTRIBUTES_FOR_LIQUID = %w[
Expand Down Expand Up @@ -109,16 +109,6 @@ def initialize(site, api_datum, _debug) # rubocop:disable Metrics/AbcSize,Metric
@xdefallo_est = !!api_datum['xdefallo_est']
@opus_in_progressu = !!api_datum['opus_in_progressu'] # rubocop:disable Style/DoubleNegation
@experimentum_est = api_datum['experimentum_est'] ? true : false
# puts api_datum['opus_in_progressu']
# puts api_datum
# @trivum = 'teste'

# Hapi::HapiApiGenerator.quod_datum_api_liquify(site, '/data/api.json')
# HapiApiGenerator.quod_datum_api_liquify(site, '/data/api.json')

# site.pages.each do |paginam|
# puts JSON.parse(paginam.content) if paginam.url == '/data/api.json'
# end

process(name)
# read_yaml(PathManager.join(base, dir), name)
Expand Down Expand Up @@ -159,22 +149,6 @@ def alternativum
resultatum
end

# # Trivia
# # - 'digitum'
# # - https://en.wiktionary.org/wiki/digitus#Latin
# # - 'signātūrum'
# # - https://en.wiktionary.org/wiki/signaturus#Latin
# def digitum_signaturum
# Utilitatem.digitum_premendum(relative_path)
# end

# # Trivia
# # - 'gid'
# # - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
# def gid_est?(gid)
# @gid == gid
# end

def html_body_class
[
'paginam-typum-api',
Expand All @@ -191,20 +165,6 @@ def openapi_filum
@datum['jekyll-page']['openapi_filum2']
end

# # @deprecated use experimentum_est
# def opus_in_progressu
# !!@opus_in_progressu
# end

# # TODO: remove obsolete parts
# def summarius
# unless @datum['jekyll-page'].nil?
# @summarius || @datum['jekyll-page']['summarius'] || '<mark lang="la">Nulla summarius. Adiuva me 🥺</mark>'
# end

# @summarius || @datum['summarius']
# end

# TODO: remove obsolete parts
# TODO: Hapi::HapiCommunePaginam.titulum?
def titulum
Expand All @@ -216,27 +176,6 @@ def nomen
@titulum || @nomen || @title
end

# # Trivia
# # - 'trivium'
# # - https://en.wiktionary.org/wiki/trivium#Latin
# # - 'xdefallo'
# # - https://developers.google.com/search/blog/2013/04/x-default-hreflang-for-international-pages
# def trivium
# @datum
# 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
# # .
# def inspect
# # puts 'datum'
# # puts @datum

# # "#<#{self.class} @relative_path=#{relative_path.inspect} xdefallo=#{@trivum}>"
# "#<#{self.class} @uid=#{@uid} xdefallo=#{@xdefallo}>"
# 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 All @@ -248,17 +187,6 @@ def to_s
# "#<#{self.class} @relative_path=#{relative_path.inspect} xdefallo=#{@trivum}>"
"#<#{self.class} @uid=#{@uid} xdefallo=#{@xdefallo}>"
end

# attr_reader :xdefallo

# # _[eng] Is this an xdefallo API? [eng]_
# # _[por] Esta é uma API xdefallo? [por]_
# # Trivia
# # - 'trivium'
# # - https://en.wiktionary.org/wiki/trivium#Latin
# # - 'xdefallo'
# # - https://developers.google.com/search/blog/2013/04/x-default-hreflang-for-international-pages
# attr_reader :xdefallo_est
end
end

Expand Down
3 changes: 2 additions & 1 deletion _plugins/hapi/paginam/commune.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module Hapi
# _[eng] Subclass of `Jekyll::Page` with custom method definitions. [eng]_
# _[eng] Subclasse de `Jekyll::Page` com customizações nos métodos [eng]_
class HapiPaginamCommune < Jekyll::Page # rubocop:disable Metrics/ClassLength
attr_accessor :datum, :gid, :uid, :xdefallo, :xdefallo_est, :experimentum_est
# attr_accessor :datum, :gid, :uid, :xdefallo, :xdefallo_est, :experimentum_est
attr_accessor :datum, :gid, :uid, :experimentum_est

# Attributes for Liquid templates
ATTRIBUTES_FOR_LIQUID = %w[
Expand Down
Loading

0 comments on commit acdba85

Please sign in to comment.