Browse Source

Add multi-languages support

master
albakham 1 year ago
parent
commit
78c6a3c44c
8 changed files with 109 additions and 9 deletions
  1. +3
    -3
      default.hbs
  2. +1
    -1
      locales/en.json
  3. +1
    -1
      locales/fr.json
  4. +1
    -0
      partials/icons/git.hbs
  5. +9
    -0
      partials/pagination.hbs
  6. +3
    -4
      partials/site-nav.hbs
  7. +15
    -0
      partials/subscribe_form.hbs
  8. +76
    -0
      subscribe.hbs

+ 3
- 3
default.hbs View File

@@ -29,7 +29,7 @@
{{!-- The footer at the very bottom of the screen --}}
<footer class="site-footer outer">
<div class="site-footer-content inner">
<section>Unless otherwise stated, the content of this site is available under the CC-BY-SA </a href="https://creativecommons.org/licenses/by-sa/4.0/"></section>license
<section>{{t Unless otherwise stated, the content of this site is available under the CC-BY-SA </a href='https://creativecommons.org/licenses/by-sa/4.0/'>license</section>}}
<nav class="site-footer-nav">
<a href="{{@site.url}}/about/">About</a>
</nav>
@@ -46,8 +46,8 @@
{{#if @site.logo}}
<img class="subscribe-overlay-logo" src="{{@site.logo}}" alt="{{@site.title}}" />
{{/if}}
<h1 class="subscribe-overlay-title">Subscribe to {{@site.title}}</h1>
<p class="subscribe-overlay-description">Stay up to date! Get all the latest &amp; greatest posts delivered straight to your inbox</p>
<h1 class="subscribe-overlay-title">{{t Subscribe to {{@site.title}}}}</h1>
<p class="subscribe-overlay-description">{{t Stay up to date! Get all the latest &amp; greatest posts delivered straight to your inbox}}</p>
{{subscribe_form placeholder="youremail@example.com"}}
</div>
</div>


+ 1
- 1
locales/en.json View File

@@ -28,6 +28,6 @@
"% posts": "% posts",
"1 min read": "1 min read",
"% min read": "% min read",
"": "",
"Unless otherwise stated, the content of this site is available under the CC-BY-SA </a href='https://creativecommons.org/licenses/by-sa/4.0/''>license</section>": "Unless otherwise stated, the content of this site is available under the CC-BY-SA </a href='https://creativecommons.org/licenses/by-sa/4.0/'>license</section>",
"": "",
}

+ 1
- 1
locales/fr.json View File

@@ -28,6 +28,6 @@
"% posts": "% publications",
"1 min read": "1 min de lecture",
"% min read": "% min de lecture",
"": "",
"Unless otherwise stated, the content of this site is available under the CC-BY-SA </a href='https://creativecommons.org/licenses/by-sa/4.0/''>license</section>": "Sauf indication contraire, le contenu de ce site est disponible sous licence CC-BY-SA</a href='https://creativecommons.org/licenses/by-sa/4.0/'></section>",
"": "",
}

+ 1
- 0
partials/icons/git.hbs View File

@@ -0,0 +1 @@
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="git" class="svg-inline--fa fa-git fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M18.8 221.7c0 25.3 16.2 60 41.5 68.5v1c-18.8 8.3-24 50.6 1 65.8v1C34 367 16 384.3 16 414.2c0 51.5 48.8 65.8 91.5 65.8 52 0 90.7-18.7 90.7-76 0-70.5-101-44.5-101-82.8 0-13.5 7.2-18.7 19.7-21.3 41.5-7.7 67.5-40 67.5-82.2 0-7.3-1.5-14.2-4-21 6.7-1.5 13.2-3.3 19.7-5.5v-50.5c-17.2 6.8-35.7 11.8-54.5 11.8-53.8-31-126.8 1.3-126.8 69.2zm87.7 163.8c17 0 41.2 3 41.2 25 0 21.8-19.5 26.3-37.7 26.3-17.3 0-43.3-2.7-43.3-25.2.1-22.3 22.1-26.1 39.8-26.1zM103.3 256c-22 0-31.3-13-31.3-33.8 0-49.3 61-48.8 61-.5 0 20.3-8 34.3-29.7 34.3zM432 305.5v49c-13.3 7.3-30.5 9.8-45.5 9.8-53.5 0-59.8-42.2-59.8-85.7v-87.7h.5v-1c-7 0-7.3-1.6-24 1v-47.5h24c0-22.3.3-31-1.5-41.2h56.7c-2 13.8-1.5 27.5-1.5 41.2h51v47.5s-19.3-1-51-1V281c0 14.8 3.3 32.8 21.8 32.8 9.8 0 21.3-2.8 29.3-8.3zM286 68.7c0 18.7-14.5 36.2-33.8 36.2-19.8 0-34.5-17.2-34.5-36.2 0-19.3 14.5-36.7 34.5-36.7C272 32 286 50 286 68.7zm-6.2 74.5c-1.8 14.6-1.6 199.8 0 217.8h-55.5c1.6-18.1 1.8-203 0-217.8h55.5z"></path></svg>

+ 9
- 0
partials/pagination.hbs View File

@@ -0,0 +1,9 @@
<nav class="pagination" role="navigation">
{{#if prev}}
<a class="newer-posts" href="{{page_url prev}}"><span aria-hidden="true">&larr;</span> Newer Posts</a>
{{/if}}
<span class="page-number">Page {{page}} of {{pages}}</span>
{{#if next}}
<a class="older-posts" href="{{page_url next}}">Older Posts <span aria-hidden="true">&rarr;</span></a>
{{/if}}
</nav>

+ 3
- 4
partials/site-nav.hbs View File

@@ -16,15 +16,14 @@
{{#if @site.twitter}}
<a class="social-link social-link-tw" href="{{twitter_url @site.twitter}}" title="Twitter" target="_blank" rel="noopener">{{> "icons/twitter"}}</a>
{{/if}}
<a rel="me" class="social-link social-link-ms" href="https://mstdn.io/@angristan" target="_blank" rel="noopener">{{> "icons/mastodon"}}</a>
<a class="social-link social-link-gh" href="https://github.com/Angristan" target="_blank" rel="noopener">{{> "icons/github"}}</a>
<a class="social-link social-link-sh" href="https://links.angristan.xyz" target="_blank" rel="noopener">{{> "icons/shaarli"}}</a>
<a rel="me" class="social-link social-link-ms" href="https://miaou.drycat.fr/@albakham" target="_blank" rel="noopener">{{> "icons/mastodon"}}</a>
<a class="social-link social-link-sh" href="https://git.drycat.fr" target="_blank" rel="noopener">{{> "icons/git"}}</a>
{{#if @site.facebook}}
<a class="social-link social-link-fb" href="{{facebook_url @site.facebook}}" target="_blank" rel="noopener">{{> "icons/facebook"}}</a>
{{/if}}
</div>
{{#if @labs.subscribers}}
<a class="subscribe-button" href="#subscribe">Subscribe</a>
<a class="subscribe-button" href="#subscribe">{{t Subscribe}</a>
{{else}}
<a class="rss-button" href="{{@site.url}}/rss/" title="RSS" target="_blank" rel="noopener">{{> "icons/rss"}}</a>
{{/if}}


+ 15
- 0
partials/subscribe_form.hbs View File

@@ -0,0 +1,15 @@
<form method="post" action="{{action}}" id="{{form_id}}" class="{{form_class}}">
{{! This is required for the form to work correctly }}
{{hidden}}

<div class="form-group{{#if error}} error{{/if}}">
{{input_email id=input_id class=input_class placeholder=placeholder value=email autofocus=autofocus}}
</div>
<button id="{{button_id}}" class="{{button_class}}" type="submit"><span>Subscribe</span></button>
{{! This is used to get extra info about where this subscriber came from }}
{{script}}
</form>

{{#if error}}
<p class="main-error">{{error.message}}</p>
{{/if}}

+ 76
- 0
subscribe.hbs View File

@@ -0,0 +1,76 @@
<!doctype html>
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
<!--[if (gte IE 9)| IEMobile |!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

<title>{{@site.title}} - Subscribe</title>

<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />

<link rel="shortcut icon" href="{{asset "favicon.ico"}}">
<meta http-equiv="cleartype" content="on">

<link rel="stylesheet" href="{{asset "public/ghost.css" hasMinFile="true"}}"/>
</head>
<body>
<div class="gh-app">
<div class="gh-viewport">
<main class="gh-main" role="main">
<div class="gh-flow">
<header class="gh-flow-head">
<nav class="gh-flow-nav">
<a href="{{#if subscribed_url}}{{subscribed_url}}{{else}}{{@site.url}}{{/if}}" class="gh-flow-back">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="17px" height="27px" viewBox="0 0 17 27" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 39.1 (31720) - http://www.bohemiancoding.com/sketch -->
<title>arrow-left3</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="Stroke-42" transform="translate(2.000000, 2.000000)" stroke-width="3" stroke="#0B0B0A">
<polyline points="13.5401 0.4256 0.3971 11.9256 13.5401 23.4256"></polyline>
</g>
</g>
</svg>
Back
</a>
</nav>
</header>

<div class="gh-flow-content-wrap">
<section class="gh-flow-content">
{{^if success}}
<header>
<h1>{{t Subscribe to {{@site.title}}}}</h1>
</header>

{{subscribe_form
form_class="gh-signin"
input_class="gh-input"
button_class="gh-btn gh-btn-blue gh-btn-block"
placeholder="Your email address"
autofocus="true"
}}
{{else}}
<header>
<h1>Subscribed!</h1>
</header>

<p>
{{t You've successfully subscribed to <em>{{@site.title}}</em>
with the email address <em>{{email}}</em>.}}
</p>
{{/if}}
</section>
</div>
</div>
</main>
</div>
</div>
</body>
</html>

Loading…
Cancel
Save