From 49b98d7bbe6511c8f52cc2bb1e2120008ea03a0d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Sep 09 2023 12:43:10 +0000 Subject: [PATCH 1/4] move from asciidoctor to markdown hugo does not interact so well with asciidoctor, making everything slower. with f37 content, asciidoctor takes about 90 seconds while markdown does this in 10 seconds. --- diff --git a/templates/_index.language.adoc b/templates/_index.language.adoc deleted file mode 100644 index 75291bc..0000000 --- a/templates/_index.language.adoc +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "Languages for {{ release }}" -date: {{ now }} -layout: "list_languages" ---- \ No newline at end of file diff --git a/templates/_index.language.md b/templates/_index.language.md new file mode 100644 index 0000000..75291bc --- /dev/null +++ b/templates/_index.language.md @@ -0,0 +1,5 @@ +--- +title: "Languages for {{ release }}" +date: {{ now }} +layout: "list_languages" +--- \ No newline at end of file diff --git a/templates/_index.package.adoc b/templates/_index.package.adoc deleted file mode 100644 index 0c1f25b..0000000 --- a/templates/_index.package.adoc +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Packages for {{ distribution }}" -date: {{ now }} -layout: "list_packages" ---- - -This listing aims at making it easy to find packages with files for which no languages could be deducted. \ No newline at end of file diff --git a/templates/_index.package.md b/templates/_index.package.md new file mode 100644 index 0000000..0c1f25b --- /dev/null +++ b/templates/_index.package.md @@ -0,0 +1,7 @@ +--- +title: "Packages for {{ distribution }}" +date: {{ now }} +layout: "list_packages" +--- + +This listing aims at making it easy to find packages with files for which no languages could be deducted. \ No newline at end of file diff --git a/templates/_index.release.adoc b/templates/_index.release.adoc deleted file mode 100644 index 60d0de3..0000000 --- a/templates/_index.release.adoc +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Statistics for {{ release }}" -date: {{ now }} -layout: "release" ---- - -Fedora {{ release }}:: -* contains {{ packages_count }} packages, -* we identified {{ packages_detected_count }} packages with translations files, -* it represents {{ files_detected_count }} translations files (po). - -What we were able to process:: -* {{ packages_processed_count }} packages, -* {{ files_processed_count }} translation files containing {{ totalsourcewords }} words to translate, -* {{ languages_processed_count }} languages. - -Why such gaps?:: -. File reading was not possible (encoding or format issue), -. Language detection failed (missing information). \ No newline at end of file diff --git a/templates/_index.release.md b/templates/_index.release.md new file mode 100644 index 0000000..d083669 --- /dev/null +++ b/templates/_index.release.md @@ -0,0 +1,19 @@ +--- +title: "Statistics for {{ release }}" +date: {{ now }} +layout: "release" +--- + +Fedora {{ release }}: +* contains {{ packages_count }} packages, +* we identified {{ packages_detected_count }} packages with translations files, +* it represents {{ files_detected_count }} translations files (po). + +What we were able to process: +* {{ packages_processed_count }} packages, +* {{ files_processed_count }} translation files containing {{ totalsourcewords }} words to translate, +* {{ languages_processed_count }} languages. + +Why such gaps? +* File reading was not possible (encoding or format issue), +* Language detection failed (missing information). \ No newline at end of file diff --git a/templates/_index.territory.adoc b/templates/_index.territory.adoc deleted file mode 100644 index ad6e959..0000000 --- a/templates/_index.territory.adoc +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "{{ code }} {{ name }}" ---- -Data coming from Unicode consortium (CLDR {{ cldr_version }}): - -* Population: {{ _population }} -* Literacy percent: {{_literacyPercent}} - -{%- if languagePopulation %} -{% for lang, value in languagePopulation.items() %} -* {{ lang }} -{%- if value._officialStatus %} *{{ value._officialStatus }}*{%- endif %} -{%- if value._populationPercent %} ({{ value._populationPercent }} %){%- endif %} -{%- endfor %} - -{%- endif %} \ No newline at end of file diff --git a/templates/_index.territory.md b/templates/_index.territory.md new file mode 100644 index 0000000..ad6e959 --- /dev/null +++ b/templates/_index.territory.md @@ -0,0 +1,16 @@ +--- +title: "{{ code }} {{ name }}" +--- +Data coming from Unicode consortium (CLDR {{ cldr_version }}): + +* Population: {{ _population }} +* Literacy percent: {{_literacyPercent}} + +{%- if languagePopulation %} +{% for lang, value in languagePopulation.items() %} +* {{ lang }} +{%- if value._officialStatus %} *{{ value._officialStatus }}*{%- endif %} +{%- if value._populationPercent %} ({{ value._populationPercent }} %){%- endif %} +{%- endfor %} + +{%- endif %} \ No newline at end of file diff --git a/templates/language.adoc b/templates/language.adoc deleted file mode 100644 index 55e6b33..0000000 --- a/templates/language.adoc +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: "{{ lang_code }}-{{ lang_name_en }} ({{ lang_name_local }})" -date: {{ now }} -code: {{ lang_code }} -name_english: {{ lang_name_en }} -name_local: {{ lang_name_local }} -progress: {{ '{:.2f}'.format(progress) }} -progress_d: {{ '{:.2f}'.format(progress_d) }} -release: {{ results }} -{%- if territories %} -territories: -{%- for territory in territories %} - - {{ territory }} -{%- endfor %} -{%- endif %} ---- - -Language progress for {{ lang_name_en }} ({{ lang_code }}) in Fedora {{ results }} is: - -* {{ '{:.2f}'.format(progress) }}% when we only look on started packages for this language. -* {{ '{:.2f}'.format(progress_d) }}% when we compare to every single translatable string in Fedora {{ results }}. - -Possible scripts are: {% for script in scripts -%}{{ script }} {%- endfor %} - -* Total translatable string in Fedora {{ results }}: {{ totalsourcewords_d }} -* Source words to translate in started packages: {{ totalsourcewordssum }} -* Translated words: {{ translatedsourcewords }} - -Download: - -* link:{{ "{{% resource url=" }}"{{ files["compendium"]["url"] }}" {{ "%}}" }}[{{ lang_code }} compendium ({{ files["compendium"]["size"]|filesizeformat() }})] (aggregation of all strings found in po files) -* link:{{ "{{% resource url=" }}"{{ files["terminology"]["url"] }}" {{ "%}}" }}[{{ lang_code }} terminology ({{ files["terminology"]["size"]|filesizeformat() }})] see https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/poterminology.html[poterminology] -* link:{{ "{{% resource url=" }}"{{ files["tmx"]["url"] }}" {{ "%}}" }}[{{ lang_code }} translation memory ({{ files["tmx"]["size"]|filesizeformat() }})] see https://en.wikipedia.org/wiki/Translation_Memory_eXchange[tmx] -* link:{{ "{{% resource url=" }}"{{ files["csv"]["url"] }}" {{ "%}}" }}[{{ lang_code }} generated stats ({{ files["csv"]["size"]|filesizeformat() }})] - -Packages: - -[cols="1a,1,1,1,3", options="header"] -|=== -| Name -| Translated words -| Total source words -| Progress (%) -| Language teams - -{% for package in packages -%} -| link:{{ '{{' }}< ref "/{{ results }}/package/{{ package }}.adoc" >{{ '}}' }}[{{ package }}] ->| {{ packages[package].translatedsourcewords }} ->| {{ packages[package].totalsourcewordssum }} ->| {{ '{:.1f}'.format(packages[package].progress) }} -| {{ packages[package].team }} -{% endfor %} -|=== \ No newline at end of file diff --git a/templates/language.md b/templates/language.md new file mode 100644 index 0000000..ed449ec --- /dev/null +++ b/templates/language.md @@ -0,0 +1,47 @@ +--- +title: "{{ lang_code }}-{{ lang_name_en }} ({{ lang_name_local }})" +date: {{ now }} +code: {{ lang_code }} +name_english: {{ lang_name_en }} +name_local: {{ lang_name_local }} +progress: {{ '{:.2f}'.format(progress) }} +progress_d: {{ '{:.2f}'.format(progress_d) }} +release: {{ results }} +{%- if territories %} +territories: +{%- for territory in territories %} + - {{ territory }} +{%- endfor %} +{%- endif %} +--- + +Language progress for {{ lang_name_en }} ({{ lang_code }}) in Fedora {{ results }} is: + +* {{ '{:.2f}'.format(progress) }}% when we only look on started packages for this language. +* {{ '{:.2f}'.format(progress_d) }}% when we compare to every single translatable string in Fedora {{ results }}. + +Possible scripts are: {% for script in scripts -%}{{ script }} {%- endfor %} + +* Total translatable string in Fedora {{ results }}: {{ totalsourcewords_d }} +* Source words to translate in started packages: {{ totalsourcewordssum }} +* Translated words: {{ translatedsourcewords }} + +Download: +* [{{ lang_code }} compendium ({{ files["compendium"]["size"]|filesizeformat() }})]({{ "{{% resource url=" }}"{{ files["compendium"]["url"] }}" {{ "%}}" }}) (aggregation of all strings found in po files) +* [{{ lang_code }} terminology ({{ files["terminology"]["size"]|filesizeformat() }})]({{ "{{% resource url=" }}"{{ files["terminology"]["url"] }}" {{ "%}}" }}) see [poterminology](https://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/poterminology.html) +* [{{ lang_code }} translation memory ({{ files["tmx"]["size"]|filesizeformat() }})]({{ "{{% resource url=" }}"{{ files["tmx"]["url"] }}" {{ "%}}" }}) see [tmx](https://en.wikipedia.org/wiki/Translation_Memory_eXchange) +* [{{ lang_code }} generated stats ({{ files["csv"]["size"]|filesizeformat() }})]({{ "{{% resource url=" }}"{{ files["csv"]["url"] }}" {{ "%}}" }}) + +Packages: + +| Name | Translated words | Total source words | Progress (%) | Language teams | +|------|------------------:|-------------------:|-------------:|----------------| +{% for package in packages %} +{%- set output = " | [" ~ package ~ "]({{< ref \"/" ~ results ~ "/package/" ~ package ~ ".md\" >}})" -%} +{%- set output = output ~ " | " ~ packages[package].translatedsourcewords -%} +{%- set output = output ~ " | " ~ packages[package].totalsourcewordssum -%} +{%- set output = output ~ " | " ~ '{:.1f}'.format(packages[package].progress) -%} +{%- set output = output ~ " | " ~ packages[package].team -%} +{%- set output = output ~ " | " -%} +{{ output }} +{% endfor -%} \ No newline at end of file diff --git a/templates/package.adoc b/templates/package.adoc deleted file mode 100644 index 06d6da6..0000000 --- a/templates/package.adoc +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "{{ package }}" -date: {{ now }} -started_languages: {{ started_languages }} -no_languages: {{ no_languages }} ---- -The package {{ package }}: - -* represents {{ totalsourcewords }} source words to be translated, -* is translated into {{ stats.languages|length }} languages in Fedora {{ results }}, -* contains {{ no_languages }} files for which no languages could be deducted. - -[cols="1a,1,1,1,3", options="header"] -|=== -| Language -| Translated words -| Total source words -| Progress (%) -| Files - -{% for stat in stats.languages|sort -%} -| link:{{ '{{' }}< ref "/{{ results }}/language/{{ stat }}.adoc" >{{ '}}' }}[{{ stat }}] ->| {{ stats.languages[stat].translatedsourcewords }} ->| {{ stats.languages[stat].totalsourcewordssum }} ->| {{ '{:.1f}'.format(stats.languages[stat].progress) }} -| {{ stats.languages[stat].filename }} - -{% endfor %} - -|=== diff --git a/templates/package.md b/templates/package.md new file mode 100644 index 0000000..e589cc3 --- /dev/null +++ b/templates/package.md @@ -0,0 +1,23 @@ +--- +title: "{{ package }}" +date: {{ now }} +started_languages: {{ started_languages }} +no_languages: {{ no_languages }} +--- +The package {{ package }}: + +* represents {{ totalsourcewords }} source words to be translated, +* is translated into {{ stats.languages|length }} languages in Fedora {{ results }}, +* contains {{ no_languages }} files for which no languages could be deducted. + +| Language | Translated words | Total source words | Progress (%) | Files | +|----------|-----------------:|-------------------:|-------------:|-------| +{% for stat in stats.languages|sort -%} +{%- set output = " | [" ~ stat ~ "]({{< ref \"/" ~ results ~ "/language/" ~ stat ~ ".md\" >}})" -%} +{%- set output = output ~ " | " ~ stats.languages[stat].translatedsourcewords -%} +{%- set output = output ~ " | " ~ stats.languages[stat].totalsourcewordssum -%} +{%- set output = output ~ " | " ~ '{:.1f}'.format(stats.languages[stat].progress) -%} +{%- set output = output ~ " | " ~ stats.languages[stat].filename -%} +{%- set output = output ~ " | " -%} +{{ output }} +{% endfor -%} \ No newline at end of file diff --git a/website/config.toml b/website/config.toml index 278ae5e..812f0ea 100644 --- a/website/config.toml +++ b/website/config.toml @@ -11,15 +11,4 @@ unsafe= true since = "2021" [taxonomies] -countries = "territories" - -[security] - enableInlineShortcodes = false - [security.exec] - allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$', '^asciidoctor$'] - osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$'] - [security.funcs] - getenv = ['^HUGO_'] - [security.http] - methods = ['(?i)GET|POST'] - urls = ['.*'] +countries = "territories" \ No newline at end of file From ce7133e034ce85fd38af2f58755c4afc87d67cba Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Sep 09 2023 12:45:53 +0000 Subject: [PATCH 2/4] move from asciidoctor to markdown --- diff --git a/build_website.py b/build_website.py index 362d914..ab00ca0 100755 --- a/build_website.py +++ b/build_website.py @@ -115,7 +115,7 @@ def main(): for language_file in sorted(languages): language = language_file[: -len(".json")] stats_file = os.path.join(langs_stats, language_file) - destination_file = os.path.join(static_langs_folder, f"{language}.adoc") + destination_file = os.path.join(static_langs_folder, f"{language}.md") with open(stats_file, "r") as read_file: content = json.load(read_file) @@ -135,7 +135,7 @@ def main(): ] for package in sorted(packages): stats_file = os.path.join(packages_stats, package, "stats.json") - destination_file = os.path.join(static_pkgs_folder, f"{package}.adoc") + destination_file = os.path.join(static_pkgs_folder, f"{package}.md") with open(stats_file, "r") as read_file: content = json.load(read_file) @@ -143,23 +143,23 @@ def main(): generate_static_pages_packages(args.results, package, content, destination_file) log.info("Generating indexes") - package_statistics_file = os.path.join(static_folder, "_index.adoc") + package_statistics_file = os.path.join(static_folder, "_index.md") generate_release_index(args.results, package_statistics_file, distribution_stats) - package_statistics_file = os.path.join(static_langs_folder, "_index.adoc") + package_statistics_file = os.path.join(static_langs_folder, "_index.md") generate_language_index(args.results, package_statistics_file) - package_statistics_file = os.path.join(static_pkgs_folder, "_index.adoc") + package_statistics_file = os.path.join(static_pkgs_folder, "_index.md") generate_package_index(args.results, package_statistics_file) for code in cldr_territories.keys(): # prevent containers and alternative names to be included if code in cldr_territories_info.keys(): - package_statistics_file = os.path.join(static_territories_folder, code, "_index.adoc") + package_statistics_file = os.path.join(static_territories_folder, code, "_index.md") generate_territory_index(package_statistics_file, cldr_territories[code], code, cldr_territories_info.get(code, {}), cldr_version) log.info("Copy translation memories") - languages = [ + """languages = [ f for f in os.listdir(tm_folder) if os.path.isfile(os.path.join(tm_folder, f)) ] for lang in languages: @@ -167,7 +167,7 @@ def main(): shutil.copyfile( os.path.join(tm_folder, lang), os.path.join(static_tm_folder, lang) ) - +""" log.info("done") @@ -195,7 +195,7 @@ def generate_static_pages_langs(results: str, code: str, content: dict, destinat if len(territories) > 0: data["territories"] = territories - apply_jinja_template(data, destination_file, "language.adoc") + apply_jinja_template(data, destination_file, "language.md") def generate_static_pages_packages(release: str, package: str, statistics: dict, destination_file: str) -> None: @@ -223,7 +223,7 @@ def generate_static_pages_packages(release: str, package: str, statistics: dict, path = f"./results/{release}/packages/{package}/" data["stats"]["languages"][lang]["filename"] = data["stats"]["languages"][lang]["filename"].replace(path, " ") - apply_jinja_template(data, destination_file, "package.adoc") + apply_jinja_template(data, destination_file, "package.md") def generate_release_index(release: str, destination_file: str, data: dict) -> None: @@ -232,7 +232,7 @@ def generate_release_index(release: str, destination_file: str, data: dict) -> N data["release"] = release data["now"] = datetime.datetime.utcnow() - apply_jinja_template(data, destination_file, "_index.release.adoc") + apply_jinja_template(data, destination_file, "_index.release.md") def generate_language_index(release: str, destination_file: str) -> None: @@ -242,7 +242,7 @@ def generate_language_index(release: str, destination_file: str) -> None: data["release"] = release data["now"] = datetime.datetime.utcnow() - apply_jinja_template(data, destination_file, "_index.language.adoc") + apply_jinja_template(data, destination_file, "_index.language.md") def generate_package_index(distribution: str, destination_file: str) -> None: @@ -252,7 +252,7 @@ def generate_package_index(distribution: str, destination_file: str) -> None: data["distribution"] = distribution data["now"] = datetime.datetime.utcnow() - apply_jinja_template(data, destination_file, "_index.package.adoc") + apply_jinja_template(data, destination_file, "_index.package.md") def generate_territory_index(destination_file: str, name: list[str], code: str, data: dict, cldr_version: str) -> None: @@ -262,7 +262,7 @@ def generate_territory_index(destination_file: str, name: list[str], code: str, data["code"] = code data["cldr_version"] = cldr_version - apply_jinja_template(data, destination_file, "_index.territory.adoc") + apply_jinja_template(data, destination_file, "_index.territory.md") def store_json_file(content: dict, destination_file: str) -> None: From 6a19d3cf49d02a8c357b5e3833874abad6439def Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Sep 09 2023 12:46:41 +0000 Subject: [PATCH 3/4] add favicon --- diff --git a/website/config.toml b/website/config.toml index 812f0ea..7f37113 100644 --- a/website/config.toml +++ b/website/config.toml @@ -9,6 +9,7 @@ unsafe= true [Params] since = "2021" +favicon = "img/favicon.ico" [taxonomies] countries = "territories" \ No newline at end of file diff --git a/website/themes/beautifulhugo/static/img/favicon.ico b/website/themes/beautifulhugo/static/img/favicon.ico index 523bc99..204a34a 100644 Binary files a/website/themes/beautifulhugo/static/img/favicon.ico and b/website/themes/beautifulhugo/static/img/favicon.ico differ From 31a8dae733dc39fafd54528d1a020ac19c91cf02 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Sep 09 2023 12:49:58 +0000 Subject: [PATCH 4/4] simplify templating remove a lot of complex stuff we do not use and makes it hard to know where to change something in our website. adding a little bit of cache too, the impact is really low, but still, no reason not to use it --- diff --git a/website/themes/beautifulhugo/layouts/_default/baseof.html b/website/themes/beautifulhugo/layouts/_default/baseof.html index a67d0c4..bbe3512 100644 --- a/website/themes/beautifulhugo/layouts/_default/baseof.html +++ b/website/themes/beautifulhugo/layouts/_default/baseof.html @@ -1,13 +1,13 @@ - {{ partial "head.html" . }} + {{ partialCached "head.html" . (.Title | default .Site.Title) }} - {{ partial "nav.html" . }} - {{ block "header" . }}{{ partial "header.html" . }}{{ end }} + {{ partialCached "nav.html" . }} + {{ block "header" . }}{{ partialCached "header.html" . (.Title | default .Site.Title) }}{{ end }} {{ block "main" . }}{{ end }} - {{ partial "footer.html" . }} + {{ partialCached "footer.html" . }} {{ block "footer" . }}{{ end }} diff --git a/website/themes/beautifulhugo/layouts/partials/footer.html b/website/themes/beautifulhugo/layouts/partials/footer.html index 7ddef70..41ad5f3 100644 --- a/website/themes/beautifulhugo/layouts/partials/footer.html +++ b/website/themes/beautifulhugo/layouts/partials/footer.html @@ -1,53 +1,16 @@ - {{ if eq .Type "page" }} - {{ partial "page_meta.html" . }} - {{ end }}
- - -

- {{ i18n "poweredBy" . | safeHTML }} -

- -{{- partial "footer_custom.html" . }} +{{- partialCached "footer_custom.html" . }} diff --git a/website/themes/beautifulhugo/layouts/partials/head.html b/website/themes/beautifulhugo/layouts/partials/head.html index 7f8d4bb..29c0f3b 100644 --- a/website/themes/beautifulhugo/layouts/partials/head.html +++ b/website/themes/beautifulhugo/layouts/partials/head.html @@ -1,41 +1,11 @@ -{{- if eq .Kind "taxonomyTerm" }} - {{- range $key, $value := .Data.Terms.ByCount }} - {{- $.Scratch.Add "most_used" (slice $value.Name) }} - {{- end }} - {{- if not ($.Scratch.Get "most_used") }} - {{- $description := printf "A full overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular | truncate 180 }} - {{- $.Scratch.Set "Description" $description }} - {{- else }} - {{- $description := printf "A full overview of all pages with %s, ordered by %s, such as: %s" .Data.Plural .Data.Singular ( delimit ( $.Scratch.Get "most_used" ) ", " ", and " ) | truncate 180 }} - {{- $.Scratch.Set "Description" $description }} - {{- end }} - - {{- $title := printf "Overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular }} - {{- $.Scratch.Set "Title" $title }} -{{- else if eq .Kind "taxonomy" }} - {{- $description := printf "Overview of all pages with the %s #%s, such as: %s" .Data.Singular $.Title ( index .Pages 0).Title | truncate 160 }} - {{- $.Scratch.Set "Description" $description }} - - {{- $title := printf "Overview of all pages with the %s #%s" .Data.Singular $.Title }} - {{- $.Scratch.Set "Title" $title }} -{{- else }} - {{- $.Scratch.Set "Description" ( .Description | default .Params.subtitle | default .Summary ) }} - {{- $.Scratch.Set "Title" ( .Title | default .Site.Title ) }} -{{- end }} - - -{{- with ($.Scratch.Get "Title") }} - {{ . }} - {{ $.Site.Title }} -{{- end }} -{{- with ($.Scratch.Get "Description") }} + + {{ .Title | default .Site.Title }} - {{ $.Site.Title }} +{{- with .Description }} {{- end }} -{{- with .Site.Author.name }} - -{{- end }} {{- with .Site.Params.favicon }} {{- end -}} @@ -48,4 +18,4 @@ -{{- partial "head_custom.html" . }} \ No newline at end of file +{{- partialCached "head_custom.html" . }} \ No newline at end of file diff --git a/website/themes/beautifulhugo/layouts/partials/header.html b/website/themes/beautifulhugo/layouts/partials/header.html index a841f79..8264234 100644 --- a/website/themes/beautifulhugo/layouts/partials/header.html +++ b/website/themes/beautifulhugo/layouts/partials/header.html @@ -1,85 +1,12 @@ -{{ if .IsHome }} - {{ if .Site.Params.homeTitle }}{{ $.Scratch.Set "title" .Site.Params.homeTitle }}{{ else }}{{ $.Scratch.Set "title" .Site.Title }}{{ end }} - {{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }} - {{ if .Site.Params.bigimg }}{{ $.Scratch.Set "bigimg" .Site.Params.bigimg }}{{ end }} -{{ else }} - {{ $.Scratch.Set "title" .Title }} - {{ if .Params.subtitle }}{{ $.Scratch.Set "subtitle" .Params.subtitle }}{{ end }} - {{ if .Params.bigimg }}{{ $.Scratch.Set "bigimg" .Params.bigimg }}{{ end }} -{{ end }} -{{ $bigimg := $.Scratch.Get "bigimg" }} -{{ $title := $.Scratch.Get "title" }} -{{ $subtitle := $.Scratch.Get "subtitle" }} - -{{ if or $bigimg $title }} - {{ if $bigimg }} -
- {{ end }} - -
- {{ if $bigimg }} -
- {{ $subtitle := $.Scratch.Get "subtitle" }} -
-
-
-
-

{{ with $.Scratch.Get "title" }}{{.}}{{ else }}
{{ end }}

- {{ if $subtitle }} - {{ if eq .Type "page" }} -
- {{ $subtitle }} - {{ else }} -

{{ $subtitle }}

- {{ end }} - {{ end }} - {{ if eq .Type "post" }} - {{ partial "post_meta.html" . }} - {{ end }} -
-
-
-
- -
- {{end}} -
-
-
-
-
- {{ if eq .Type "list" }} -

{{ if .Data.Singular }}#{{ end }}{{ .Title }}

- {{ else }} -

{{ with $title }}{{.}}{{ else }}
{{ end }}

- {{ end }} - {{ if ne .Type "post" }} -
- {{ end }} - {{ if $subtitle }} - {{ if eq .Type "page" }} - {{ $subtitle }} - {{ else }} -

{{ $subtitle }}

- {{ end }} - {{ end }} - {{ if eq .Type "post" }} - {{ partial "post_meta.html" . }} - {{ end }} -
-
+
+
+
+
+
+

{{ .Title | default .Site.Title }}

+
-
-{{ else }} -
-{{ end }} +
+
\ No newline at end of file diff --git a/website/themes/beautifulhugo/layouts/partials/page_meta.html b/website/themes/beautifulhugo/layouts/partials/page_meta.html deleted file mode 100644 index ac9661b..0000000 --- a/website/themes/beautifulhugo/layouts/partials/page_meta.html +++ /dev/null @@ -1,8 +0,0 @@ -
- {{ $lastmodstr := default (i18n "dateFormat") .Site.Params.dateformat | .Lastmod.Format }} - {{ $datestr := default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format }} - {{ if ne $datestr $lastmodstr }} - {{ $lastmodstr | i18n "lastModified" }} - {{ end }} -
- diff --git a/website/themes/beautifulhugo/layouts/partials/post_meta.html b/website/themes/beautifulhugo/layouts/partials/post_meta.html deleted file mode 100644 index a43e844..0000000 --- a/website/themes/beautifulhugo/layouts/partials/post_meta.html +++ /dev/null @@ -1,29 +0,0 @@ - - diff --git a/website/themes/beautifulhugo/layouts/partials/post_preview.html b/website/themes/beautifulhugo/layouts/partials/post_preview.html index 0411585..9df51ef 100644 --- a/website/themes/beautifulhugo/layouts/partials/post_preview.html +++ b/website/themes/beautifulhugo/layouts/partials/post_preview.html @@ -1,24 +1,8 @@