From 7316238f16655bd127b04476bbf7864b27f940f9 Mon Sep 17 00:00:00 2001 From: Sivaldo Date: Sat, 13 Jun 2026 19:20:23 -0300 Subject: Commit inicial --- layouts/_default/baseof.html | 46 ++++ layouts/_default/list.html | 146 ++++++++++++ layouts/partials/disc-extras.html | 72 ++++++ layouts/partials/quiz-runtime.html | 447 +++++++++++++++++++++++++++++++++++++ layouts/quizzes/list.html | 57 +++++ layouts/quizzes/single.html | 60 +++++ layouts/txts/single.html | 224 +++++++++++++++++++ 7 files changed, 1052 insertions(+) create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/partials/disc-extras.html create mode 100644 layouts/partials/quiz-runtime.html create mode 100644 layouts/quizzes/list.html create mode 100644 layouts/quizzes/single.html create mode 100644 layouts/txts/single.html (limited to 'layouts') diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..4fca1f9 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + {{ block "title" . }}{{ .Site.Title }}{{ end }} + + +
+ {{ block "header" . }} + direito + {{ end }} +
+
+ {{ block "main" . }}{{ end }} +
+ + + + + + + + + + + + {{ block "scripts" . }}{{ end }} + + + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..09804c9 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,146 @@ +{{ define "title" }} + {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }} +{{ end }} + +{{ define "header" }} + direito + {{ if not .IsHome }} + / + {{ .Title }} + {{ end }} +{{ end }} + +{{ define "main" }} +{{ if .IsHome }} + + {{/* Mapas por slug de disciplina */}} + {{ $simMap := dict }} + {{ $quizMap := dict }} + {{ $discsQz := slice }} + {{ range .Site.RegularPages }} + {{ if eq .Section "quizzes" }} + {{ $slug := .File.Dir | strings.TrimSuffix "/" | path.Base }} + {{ if not (in $discsQz $slug) }}{{ $discsQz = $discsQz | append $slug }}{{ end }} + {{ $isSim := or (.Params.simulado) (in (.File.BaseFileName | lower) "simulado") }} + {{ if $isSim }} + {{ $simMap = merge $simMap (dict $slug (add (index $simMap $slug | default 0) 1)) }} + {{ else }} + {{ $quizMap = merge $quizMap (dict $slug (add (index $quizMap $slug | default 0) 1)) }} + {{ end }} + {{ end }} + {{ end }} + +
+ {{ $txtsSlugs := slice }} + {{ range .Site.Sections }} + {{ if eq .Section "txts" }} + {{ range .Sections }} + {{ $slug := .RelPermalink | strings.TrimSuffix "/" | path.Base }} + {{ $txtsSlugs = $txtsSlugs | append $slug }} + {{ $sims := index $simMap $slug | default 0 }} + {{ $qz := index $quizMap $slug | default 0 }} + +
{{ .Title }}
+
+ {{ $n := len .RegularPages }} + {{ if $n }}{{ $n }} assunto{{ if gt $n 1 }}s{{ end }}{{ else }}sem textos{{ end }} + {{ if $sims }} · simulado{{ end }} + {{ if $qz }} · {{ $qz }} exercício{{ if gt $qz 1 }}s{{ end }}{{ end }} +
+
+ {{ end }} + {{ end }} + {{ end }} + + {{/* Disciplinas que só existem em quizzes (sem txts) */}} + {{ range $slug := $discsQz }} + {{ if not (in $txtsSlugs $slug) }} + {{ $sims := index $simMap $slug | default 0 }} + {{ $qz := index $quizMap $slug | default 0 }} + +
{{ humanize (replace $slug "-" " ") }}
+
+ {{ if $sims }}simulado · {{ end }}{{ $qz }} exercício{{ if gt $qz 1 }}s{{ end }} +
+
+ {{ end }} + {{ end }} +
+ +{{ else }} + {{/* Página de disciplina */}} + {{ $discSlug := .RelPermalink | strings.TrimSuffix "/" | path.Base }} +
+ +
{{ .Title }}
+ + {{ if .Content }} +
+
{{ .Content }}
+
+ {{ end }} + +
+ {{ partial "disc-extras.html" . }} +
+ + {{/* Simulados desta disciplina */}} + {{ $simulados := slice }} + {{ range $.Site.RegularPages }} + {{ if eq .Section "quizzes" }} + {{ $parent := .File.Dir | strings.TrimSuffix "/" | path.Base }} + {{ if eq $parent $discSlug }} + {{ if or (.Params.simulado) (in (.File.BaseFileName | lower) "simulado") }} + {{ $simulados = $simulados | append . }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} + {{ with $simulados }} +
+
simulados
+
+ {{ range . }} + + {{ .Title }} + simulado + + {{ end }} +
+
+ {{ end }} + + {{/* Assuntos com vínculo aos exercícios */}} + {{ $exercises := slice }} + {{ range $.Site.RegularPages }} + {{ if eq .Section "quizzes" }} + {{ $parent := .File.Dir | strings.TrimSuffix "/" | path.Base }} + {{ if eq $parent $discSlug }} + {{ if not (or (.Params.simulado) (in (.File.BaseFileName | lower) "simulado")) }} + {{ $exercises = $exercises | append . }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} + +
+ {{ range .RegularPages }} + {{ $assuntoSlug := .File.BaseFileName }} + {{ $linkedQuiz := false }} + {{ range $exercises }} + {{ if eq .File.BaseFileName $assuntoSlug }} + {{ $linkedQuiz = . }} + {{ end }} + {{ end }} + + {{ .Title }} + + texto{{ if $linkedQuiz }} · exercícios{{ end }} + + + {{ end }} + {{ if not .RegularPages }}

sem assuntos ainda

{{ end }} +
+
+{{ end }} +{{ end }} diff --git a/layouts/partials/disc-extras.html b/layouts/partials/disc-extras.html new file mode 100644 index 0000000..adff907 --- /dev/null +++ b/layouts/partials/disc-extras.html @@ -0,0 +1,72 @@ +{{/* disc-extras.html — recebe . (a página, seja _index ou single) + Renderiza colapsáveis: Guia de Estudo, Materiais (com subdivisões: Textos, Vídeos, Áudios) */}} + +{{/* ── Guia de estudo (guide) ── */}} +{{ with .Params.guide }} +
+ + guia de estudo + + +
+ {{ . | markdownify }} +
+
+{{ end }} + +{{/* ── Materiais unificados (files, videos, audios) ── */}} +{{ $files := .Params.files }} +{{ $videos := .Params.videos }} +{{ $audios := .Params.audios }} +{{ if or $files (or $videos $audios) }} +
+ + materiais + + {{ $n := 0 }} + {{ with $files }}{{ $n = add $n (len .) }}{{ end }} + {{ with $videos }}{{ $n = add $n (len .) }}{{ end }} + {{ with $audios }}{{ $n = add $n (len .) }}{{ end }} + {{ $n }} item{{ if gt $n 1 }}s{{ end }} + + + +
+ {{/* Textos (arquivos/links) */}} + {{ with $files }} +
textos
+ {{ range . }} + + + {{ .name }} + link + + {{ end }} + {{ end }} + + {{/* Vídeos */}} + {{ with $videos }} +
vídeos
+ {{ range . }} + + + {{ .name }} + youtube + + {{ end }} + {{ end }} + + {{/* Áudios */}} + {{ with $audios }} +
áudios
+ {{ range . }} + + + {{ .name }} + youtube + + {{ end }} + {{ end }} +
+
+{{ end }} diff --git a/layouts/partials/quiz-runtime.html b/layouts/partials/quiz-runtime.html new file mode 100644 index 0000000..9ce5aab --- /dev/null +++ b/layouts/partials/quiz-runtime.html @@ -0,0 +1,447 @@ + diff --git a/layouts/quizzes/list.html b/layouts/quizzes/list.html new file mode 100644 index 0000000..c37a486 --- /dev/null +++ b/layouts/quizzes/list.html @@ -0,0 +1,57 @@ +{{ define "title" }}{{ .Title }} · {{ .Site.Title }}{{ end }} + +{{ define "header" }} + direito + / + {{ .Title }} +{{ end }} + +{{ define "main" }} +{{ $discSlug := .RelPermalink | strings.TrimSuffix "/" | path.Base }} +
+ +
{{ .Title }}
+ + {{/* Separa simulados (frontmatter `simulado: true` OU nome contendo "simulado") dos quizzes + desta disciplina, usando .File.Dir já que as subpastas de quizzes/ não são sections. */}} + {{ $simulados := slice }} + {{ $quizzes := slice }} + {{ range .RegularPages }} + {{ if or (.Params.simulado) (in (.File.BaseFileName | lower) "simulado") }} + {{ $simulados = $simulados | append . }} + {{ else }} + {{ $quizzes = $quizzes | append . }} + {{ end }} + {{ end }} + + {{ with $simulados }} +
+
simulados
+
+ {{ range . }} + + {{ .Title }} + simulado + + {{ end }} +
+
+ {{ end }} + + {{ with $quizzes }} +
+
exercícios
+ {{ range . }} + + {{ .Title }} + quiz + + {{ end }} +
+ {{ end }} + + {{ if and (not $simulados) (not $quizzes) }} +

sem conteúdo ainda

+ {{ end }} +
+{{ end }} diff --git a/layouts/quizzes/single.html b/layouts/quizzes/single.html new file mode 100644 index 0000000..0a51a9c --- /dev/null +++ b/layouts/quizzes/single.html @@ -0,0 +1,60 @@ +{{ define "title" }}{{ .Title }} · {{ .Site.Title }}{{ end }} +{{ define "header" }} + {{ $discSlug := .File.Dir | path.Dir | path.Base }} + direito + / + {{ $discPage := $.Site.GetPage (printf "/txts/%s" $discSlug) }} + {{ if $discPage }} + {{ $discPage.Title }} + / + {{ end }} + {{ .Title }} +{{ end }} +{{ define "main" }} +{{ $discSlug := .File.Dir | path.Dir | path.Base }} +{{ $discPage := $.Site.GetPage (printf "/txts/%s" $discSlug) }} +
+ {{ if $discPage }} + + {{ else }} + + {{ end }} +
{{ .Title }}
+
+
+
+
+
+ +
+
+ +
+ + +{{ end }} diff --git a/layouts/txts/single.html b/layouts/txts/single.html new file mode 100644 index 0000000..d8f7eb1 --- /dev/null +++ b/layouts/txts/single.html @@ -0,0 +1,224 @@ +{{ define "title" }}{{ .Title }} · {{ .Site.Title }}{{ end }} + +{{ define "header" }} + {{ $discSlug := .RelPermalink | strings.TrimSuffix "/" | path.Dir | path.Base }} + direito + {{ range $.Site.Sections }} + {{ if and (eq .Section "txts") (eq (.RelPermalink | strings.TrimSuffix "/" | path.Base) $discSlug) }} + / + {{ .Title }} + {{ end }} + {{ end }} + / + {{ .Title }} +{{ end }} + +{{ define "main" }} +{{ $slug := .File.BaseFileName }} +{{ $discSlug := .RelPermalink | strings.TrimSuffix "/" | path.Dir | path.Base }} + +{{/* Encontra quiz do assunto (exercício, não simulado) */}} +{{ $quizPage := false }} +{{ range $.Site.RegularPages }} + {{ if eq .Section "quizzes" }} + {{ $parent := .File.Dir | strings.TrimSuffix "/" | path.Base }} + {{ if and (eq $parent $discSlug) (eq .File.BaseFileName $slug) }} + {{ if not (or (.Params.simulado) (in (.File.BaseFileName | lower) "simulado")) }} + {{ $quizPage = . }} + {{ end }} + {{ end }} + {{ end }} +{{ end }} + +
+
+ {{ range $.Site.Sections }} + {{ if and (eq .Section "txts") (eq (.RelPermalink | strings.TrimSuffix "/" | path.Base) $discSlug) }} + {{ .Title }} + {{ end }} + {{ end }} + assunto +
+

{{ .Title }}

+ + {{/* Colapsáveis: guia de estudo e materiais do assunto */}} + {{ $hasExtras := or .Params.guide (or .Params.files (or .Params.videos .Params.audios)) }} + {{ if $hasExtras }} +
+ {{ partial "disc-extras.html" . }} +
+ {{ end }} + + + +
{{ .Content }}
+ + {{/* Notas de rodapé — renderizadas pelo Hugo automaticamente no .Content; + o floater (footnotes.js) intercepta os links #fn: e mostra tooltip */}} + + {{/* Questões do assunto — quiz inline embutido */}} + {{ if $quizPage }} +
+
+ exercícios deste assunto + modo completo → +
+
+ +
+ + +
+ + {{ end }} + + {{ if .Params.references }} +
+
referências
+
+ {{ range .Params.references }}

{{ . }}

{{ end }} +
+
+ {{ end }} +
+ +{{ end }} -- cgit v1.2.3