sv/en toggle

This commit is contained in:
gws 2024-11-07 10:16:24 +01:00
parent 20d21d09a4
commit d5c1fe2d60
9 changed files with 168 additions and 41 deletions

View file

@ -0,0 +1,6 @@
+++
title = "Blog"
sort_by = "date"
weight = 5
+++

41
content/contact.sv.md Normal file
View file

@ -0,0 +1,41 @@
+++
title = "Contact"
description = "How to get in contact"
weight = 10
template = "contact.html"
[extra]
disable_toc = true
+++
<div class="contact-form">
<div class="first-container">
<div class="info-container">
<div><img class="icon" />
<h3>Address</h3>
<p>Mada Center 8th floor, 379 Hudson St, New York, NY 10018 US</p>
</div>
<div> <img class="icon" />
<h3>Lets Talk</h3>
<p>+1 800 1236879</p>
</div>
<div><img class="icon" />
<h3>General Support</h3>
<p>contact@example.com</p>
</div>
</div>
</div>
<div class="second-container">
<h2>Send Us A Message</h2>
<form>
<div class="form-group"><label for="name-input">Tell us your name*</label><input id="name-input" type="text"
placeholder="First name" required="required" /><input type="text" placeholder="Last name"
required="required" /></div>
<div class="form-group"><label for="email-input">Enter your email*</label><input id="email-input" type="text"
placeholder="Eg. example@email.com" required="required" /></div>
<div class="form-group"><label for="phone-input">Enter phone number*</label><input id="phone-input" type="text"
placeholder="Eg. +1 800 000000" required="required" /></div>
<div class="form-group"><label for="message-textarea">Message</label><textarea id="message-textarea"
placeholder="Write us a message"></textarea></div><button>Send message</button>
</form>
</div>
</div>

14
content/it.sv.md Normal file
View file

@ -0,0 +1,14 @@
+++
title = "IT"
description = "IT Services and Consulting"
weight = 3
+++
## TODO
```rust
fn main() {
println!("Hello, World!");
}
```

14
content/software.sv.md Normal file
View file

@ -0,0 +1,14 @@
+++
title = "Software"
description = "Software Development Consulting"
weight = 1
+++
## TODO
```rust
fn main() {
println!("Hello, World!");
}
```

View file

@ -1,6 +1,6 @@
{% macro render_header() %}
{% set section = get_section(path="_index.md") %}
<a href="{{ section.permalink | safe }}">
{% macro render_header(path) %}
{% set root = get_section(path="_index.md") %}
<a href="{{ root.permalink | safe }}">
<div class="logo">
<img src="{{ get_url(path=config.extra.juice_logo_path) }}" alt="logo">
{{ config.extra.juice_logo_name }}
@ -15,14 +15,29 @@
{% endif %}
{% for page in section.pages %}
{% for page in root.pages %}
{% if lang == "en" %}
<a class="nav-item subtitle-text" href="{{ page.permalink | safe }}">{{ page.title }}</a>
{% else %}
<a class="nav-item subtitle-text" href="/{{lang}}{{ page.path }}">{{ page.title }}</a>
{% endif %}
{% endfor %}
{% for path in section.subsections %}
{% for path in root.subsections %}
{% set child = get_section(path=path) %}
<a class="nav-item subtitle-text" href="{{ child.permalink }}">{{ child.title }}</a>
{% if lang == "en"%}
<a class="nav-item subtitle-text" href="{{ child.permalink | safe }}">{{ child.title }}</a>
{% else %}
<a class="nav-item subtitle-text" href="/{{lang}}{{ child.path }}">{{ child.title }}</a>
{% endif %}
{% endfor %}
{% if lang == "en"%}
<a class="nav-item subtitle-text" href="/sv{{ path }}">sv</a>
{% else %}
<a class="nav-item subtitle-text" href="{{ path }}">en</a>
{% endif %}
</nav>

View file

@ -29,7 +29,7 @@
{% block header %}
<header class="box-shadow">
{{ macros::render_header() }}
{{ macros::render_header(path=page.path) }}
</header>
{% endblock header %}

View file

@ -23,6 +23,12 @@
{% endblock head %}
<body>
{% block header %}
<header class="pos-absolute" style="background-color: transparent">
{{ macros::render_header(path = section.path ) }}
</header>
<div class="hero">
@ -67,6 +73,9 @@
{% endblock hero %}
</div>
{% endblock header %}

22
templates/page.html Normal file
View file

@ -0,0 +1,22 @@
{% import "_macros.html" as macros %}
{% extends "index.html" %}
{% block title %}{{ page.title }} | {{ super() }} {% endblock title %}
{% block header %}
<header class="box-shadow">
{% if lang =="en" %}
{% set path = [""] | concat(with=page.components) | join(sep="/") %}
{% else %}
{% set path = [""] | concat(with=page.components | slice(start=1)) | join(sep="/") %}
{% endif %}
{{ macros::render_header(path=path) }}
</header>
{% endblock header %}
{% block content %}
<div class="heading-text">{{ page.description }}</div>
{{ page.content | safe }}
{% endblock content %}

View file

@ -5,7 +5,13 @@
{% block header %}
<header class="box-shadow">
{{ macros::render_header() }}
{% if lang =="en" %}
{% set path = [""] | concat(with=section.components) | join(sep="/") %}
{% else %}
{% set path = [""] | concat(with=section.components | slice(start=1)) | join(sep="/") %}
{% endif %}
{{ macros::render_header(path=path) }}
</header>
{% endblock header %}