Add language selector and make the homepage translatable

parent 81e6e4d2
......@@ -30,10 +30,19 @@ enableRobotsTXT = true
[languages]
[languages.en]
weight = 1
# [languages.fr]
# weight = 2
# [languages.de]
# weight = 2
languageName = "English"
[languages.uk]
weight = 2
languageName = "українська"
[languages.ca]
weight = 2
languageName = "Català"
[languages.pt]
weight = 2
languageName = "Português"
[languages.nl]
weight = 2
languageName = "Nederlands"
# default author
[Author]
......
---
# Don't translated this string
layout: index
---
Kate is a multi-document editor part of [KDE](https://kde.org) since release 2.2. Being a [KDE applications](https://kde.org/applications), Kate ships with network transparency, as well as integration with the outstanding features of KDE. Choose it for viewing HTML sources from konqueror, editing configuration files, writing new applications or any other text editing task. You still need just one running instance of Kate. [Learn more...](/about/)
![Screenshot of Kate showing multiple documents and the building terminal emulator](/images/kate-window.png)
<div class="text-center">
<a class="btn btn-success" href="/get-it"><i class="fa fa-download"></i>&nbsp;Get it</a>
</div>
{{ define "main" }}
<div class="container" role="main">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<article role="main" class="blog-post">
{{ partial "i18nlist.html" . }}
{{ .Content }}
{{ if .Params.tags }}
<div class="blog-tags">
{{ range .Params.tags }}
<a href="{{ $.Site.LanguagePrefix | absURL }}/tags/{{ . | urlize }}/">{{ . }}</a>&nbsp;
{{ end }}
</div>
{{ end }}
{{ if $.Param "socialShare" }}
<hr/>
<section id="social-share">
<div class="list-inline footer-links">
{{ partial "share-links" . }}
</div>
</section>
{{ end }}
{{ if .Site.Params.showRelatedPosts }}
{{ $related := .Site.RegularPages.Related . | first 3 }}
{{ with $related }}
<h4 class="see-also">{{ i18n "seeAlso" }}</h4>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</article>
{{ if ne .Type "page" }}
<ul class="pager blog-pager">
{{ if .PrevInSection }}
<li class="previous">
<a href="{{ .PrevInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .PrevInSection.Title }}">&larr; {{ i18n "previousPost" }}</a>
</li>
{{ end }}
{{ if .NextInSection }}
<li class="next">
<a href="{{ .NextInSection.Permalink }}" data-toggle="tooltip" data-placement="top" title="{{ .NextInSection.Title }}">{{ i18n "nextPost" }} &rarr;</a>
</li>
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
{{ end }}
......@@ -2,13 +2,8 @@
<div role="main" class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<p>Kate is a multi-document editor part of <a href="https://kde.org">KDE</a> since release 2.2. Being a <a href="https://kde.org/applications">KDE application</a>, Kate ships with network transparency, as well as integration with the outstanding features of KDE. Choose it for viewing HTML sources from konqueror, editing configuration files, writing new applications or any other text editing task. You still need just one running instance of Kate. <a href="/about/">Learn more...</a></p>
<img class="img-fluid" alt="Screenshot of kate showing multiple documents and the building terminal emulator"
src="/images/kate-window.png" />
<div class="text-center">
<a class="btn btn-success" href="/get-it"><i class="fa fa-download"></i>&nbsp;Get&nbsp;it</a>
</div>
{{ partial "i18nlist.html" . }}
{{ .Content }}
<div class="posts-list">
{{ $pag := .Paginate (where .Data.Pages "Type" "post") }}
......
{{ if (and (.IsTranslated) (gt (index .Translations 0).WordCount 0)) }}
<div class="well">
<p>Also available in:</p>
{{ range .Translations }}
<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
{{ end }}
</div>
{{ end }}
<nav class="navbar navbar-default navbar-fixed-top navbar-custom">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
<span class="sr-only">{{ i18n "toggleNavigation" }}</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ "" | absLangURL }}">{{ .Site.Title }}</a>
</div>
<div class="collapse navbar-collapse" id="main-navbar">
<ul class="nav navbar-nav navbar-right">
{{ range .Site.Menus.main.ByWeight }}
{{ if .HasChildren }}
<li class="navlinks-container">
<a class="navlinks-parent">{{ .Name }}</a>
<div class="navlinks-children">
{{ range .Children }}
<a href="{{ .URL | relLangURL }}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li>
<a title="{{ .Name }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
{{ if isset .Site.Params "gcse" }}
<li>
<a href="#modalSearch" data-toggle="modal" data-target="#modalSearch" style="outline: none;">
<span class="hidden-sm hidden-md hidden-lg">{{ i18n "gcseLabelShort" }}</span> <span id="searchGlyph" class="glyphicon glyphicon-search"></span>
</a>
</li>
{{ end }}
</ul>
</div>
{{ if isset .Site.Params "logo" }}
<div class="avatar-container">
<div class="avatar-img-border">
<a title="{{ .Site.Title }}" href="{{ "" | absLangURL }}">
<img class="avatar-img" src="{{ .Site.Params.logo | absURL }}" alt="{{ .Site.Title }}" />
</a>
</div>
</div>
{{ end }}
</div>
</nav>
<!-- Search Modal -->
{{ if isset .Site.Params "gcse" }}
<div id="modalSearch" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">{{ i18n "gcseLabelLong" . }}</h4>
</div>
<div class="modal-body">
<gcse:search></gcse:search>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ i18n "gcseClose" }}</button>
</div>
</div>
</div>
</div>
{{ end }}
......@@ -7,7 +7,7 @@ def webpage_list():
"""
Generate a list of webpage that need to be translated
"""
return ['content/about-kate.md']
return ['content/about-kate.md', 'content/_index.md']
def extract(args):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment