Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Internationalisation of Name #4

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# -----------------------------------------------------------------------------

title: blank # the website title (if blank, full name will be used instead)
first_name: You
middle_name: R.
last_name: Name
email: [email protected]
keywords: jekyll, jekyll-theme, academic-website, portfolio-website # add your own keywords or leave empty

Expand Down
3 changes: 3 additions & 0 deletions _i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ not_found:
message: You will be redirected to the main page within 3 seconds. If not redirected, please go back to the
main_page: home page
main:
first_name: You
middle_name: R.
last_name: Name
address: >
<p>555 your office number</p>
<p>123 your address street</p>
Expand Down
3 changes: 3 additions & 0 deletions _i18n/pt-br.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ not_found:
message: Você será redirecionado para a página principal em 3 segundos. Se não for redirecionado, por favor volte para a
main_page: página principal
main:
first_name: Se
middle_name: U.
last_name: Nome
address: >
<p>555 seu telefone do trabalho</p>
<p>123 seu endereço</p>
Expand Down
9 changes: 7 additions & 2 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{% capture name_components %}
{% if site.translations[site.lang].main.first_name %}{{ site.translations[site.lang].main.first_name }}{% endif %}
{% if site.translations[site.lang].main.middle_name %}{{ site.translations[site.lang].main.middle_name }}{% endif %}
{% if site.translations[site.lang].main.last_name %}{{ site.translations[site.lang].main.last_name }}{% endif %}
{% endcapture %}
{% if site.footer_fixed %}
<footer class="fixed-bottom">
<div class="container mt-0">
&copy; Copyright {{ site.time | date: '%Y' }} {{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}. {% t main.footer_text %}
&copy; Copyright {{ name_components | split:' ' | join:' ' }}. {% t main.footer_text %}
DavidKrassnig marked this conversation as resolved.
Show resolved Hide resolved
{%- if site.impressum_path -%}
<a href="{{ site.url }}{{ site.baseurl }}{{ site.impressum_path }}">Impressum</a>.
{%- endif -%}
Expand All @@ -13,7 +18,7 @@
{%- else -%}
<footer class="sticky-bottom mt-5">
<div class="container">
&copy; Copyright {{ site.time | date: '%Y' }} {{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}. {% t main.footer_text %}
&copy; Copyright {{ name_components | split:' ' | join:' ' }}. {% t main.footer_text %}
DavidKrassnig marked this conversation as resolved.
Show resolved Hide resolved
{%- if site.impressum_path -%}
<a href="{{ site.url }}{{ site.baseurl }}{{ site.impressum_path }}">Impressum</a>.
{%- endif -%}
Expand Down
12 changes: 6 additions & 6 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
{% if page.permalink != '/' -%}
<a class="navbar-brand title font-weight-lighter" href="{{ site.baseurl }}/">
{%- if site.title == "blank" -%}
{%- if site.first_name -%}
<span class="font-weight-bold">{{- site.first_name -}}&nbsp;</span>
{% if site.translations[site.lang].main.first_name %}
<span class="font-weight-bold">{{ site.translations[site.lang].main.first_name }}</span>
{%- endif -%}
{%- if site.middle_name -%}
{{- site.middle_name -}}&nbsp;
{% if site.translations[site.lang].main.middle_name %}
{{ site.translations[site.lang].main.middle_name }}
{%- endif -%}
{%- if site.last_name -%}
{{- site.last_name -}}
{% if site.translations[site.lang].main.last_name %}
{{ site.translations[site.lang].main.last_name }}
{%- endif -%}
{%- else -%}
{{- site.title -}}
Expand Down
14 changes: 9 additions & 5 deletions _includes/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
-->
<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
{%- endif %}

{% capture name_components %}
{% if site.translations[site.lang].main.first_name %}{{ site.translations[site.lang].main.first_name }}{% endif %}
{% if site.translations[site.lang].main.middle_name %}{{ site.translations[site.lang].main.middle_name }}{% endif %}
{% if site.translations[site.lang].main.last_name %}{{ site.translations[site.lang].main.last_name }}{% endif %}
{% endcapture %}
{%- if site.title == "blank" -%}
{%- capture title -%}{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}{%- endcapture -%}
{%- capture title -%}{{ name_components | split:' ' | join:' ' }}{%- endcapture -%}
{%- else -%}
{%- capture title -%}{{ site.title }}{%- endcapture -%}
{%- endif -%}
Expand Down Expand Up @@ -67,7 +71,7 @@
{{ title }}
{%- endif -%}
</title>
<meta name="author" content="{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}" />
<meta name="author" content="{{ name_components | split:' ' | join:' ' }}" />
<meta name="description" content="{%- if page.description -%}{{ page.description }}{%- else -%}{{ site.description }}{%- endif -%}" />
{%- if page.keywords or site.keywords %}
<meta name="keywords" content="{%- if page.keywords -%}{{ page.keywords }}{%- else -%}{{ site.keywords }}{%- endif -%}" />
Expand Down Expand Up @@ -255,7 +259,7 @@
"author":
{
"@type": "Person",
"name": "{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}"
"name": "{{ name_components | split:' ' | join:' ' }}"
},
"url": "{{ page.url | prepend: site.baseurl | prepend: site.url }}",
"@type": "{%- if is_blog_post -%}BlogPosting{%- else -%}WebSite{%- endif -%}",
Expand All @@ -264,7 +268,7 @@
{% if sameaslinks != blank -%}
"sameAs": {{ sameaslinks }},
{%- endif %}
"name": "{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}",
"name": "{{ name_components | split:' ' | join:' ' }}",
"@context": "https://schema.org"
}
</script>
Expand Down
14 changes: 13 additions & 1 deletion _layouts/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@
<div class="post">
<header class="post-header">
<h1 class="post-title">
{% if site.title == "blank" -%}<span class="font-weight-bold">{{ site.first_name }}</span> {{ site.middle_name }} {{ site.last_name }}{%- else -%}{{ site.title }}{%- endif %}
{%- if site.title == "blank" -%}
{% if site.translations[site.lang].main.first_name %}
<span class="font-weight-bold">{{ site.translations[site.lang].main.first_name }}</span>
{%- endif -%}
{% if site.translations[site.lang].main.middle_name %}
{{ site.translations[site.lang].main.middle_name }}
{%- endif -%}
{% if site.translations[site.lang].main.last_name %}
{{ site.translations[site.lang].main.last_name }}
{%- endif -%}
{%- else -%}
{{- site.title -}}
{%- endif -%}
</h1>
<p class="desc">{% t main.subtitle %}</p>
</header>
Expand Down