Add translations to the main site (+markdown transition) [DON'T MERGE] #621
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
languages:
|
||||
- de
|
||||
- it
|
||||
- en
|
|
@ -3,3 +3,4 @@ Gemfile
|
|||
Gemfile.lock
|
||||
.sass-cache/
|
||||
.DS_Store
|
||||
.vscode/
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
en: &base
|
||||
title: Global Mass Surveillance - The Fourteen Eyes
|
||||
description: >
|
||||
The UKUSA Agreement is an agreement between the United Kingdom, United States, Australia, Canada, and New Zealand to cooperatively collect, analyze, and share intelligence. Members of this group, known as the [Five Eyes](https://www.giswatch.org/en/communications-surveillance/unmasking-five-eyes-global-surveillance-practices), focus on gathering and analyzing intelligence from different parts of the world. While Five Eyes countries have agreed to [not spy on each other](https://www.pbs.org/newshour/world/an-exclusive-club-the-five-countries-that-dont-spy-on-each-other) as adversaries, leaks by Snowden have revealed that some Five Eyes members monitor each other’s citizens and [share intelligence](https://www.theguardian.com/uk/2013/jun/21/gchq-cables-secret-world-communications-nsa) to [avoid breaking domestic laws](https://www.theguardian.com/politics/2013/jun/10/nsa-offers-intelligence-british-counterparts-blunkett) that prohibit them from spying on their own citizens. The Five Eyes alliance also cooperates with groups of third-party countries to share intelligence (forming the Nine Eyes and Fourteen Eyes), however Five Eyes and third-party countries can and do spy on each other.
|
||||
five_eyes: Five Eyes
|
||||
nine_eyes: Nine Eyes
|
||||
fourteen_eyes: Fourteen Eyes
|
||||
|
||||
it:
|
||||
<<: *base
|
||||
---
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
en: &base
|
||||
site_subheading: >
|
||||
You are being watched. Private and state-sponsored organizations are monitoring and recording
|
||||
your online activities. privacytools.io provides knowledge and tools to protect your privacy
|
||||
against global mass surveillance.
|
||||
translations_disclaimer: Translations of privacytools.io were done by volunteers. They might be not up to date.
|
||||
read_also: Read also
|
||||
related_information: Related Information
|
||||
|
||||
it:
|
||||
<<: *base
|
||||
site_subheading: >
|
||||
You are being watched. Private and state-sponsored organizations are monitoring and recording
|
||||
your online activities. privacytools.io provides knowledge and tools to protect your privacy
|
||||
against global mass surveillance. (IT)
|
||||
read_also: Read also (IT)
|
||||
---
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
en: &base
|
||||
title: Key Disclosure Law
|
||||
subheading: Who is required to hand over the encryption keys to authorities?
|
||||
description: >
|
||||
Mandatory [key disclosure laws](https://en.wikipedia.org/wiki/Key_disclosure_law) require individuals to turn over encryption keys to law enforcement conducting a criminal investigation. How these laws are implemented (who may be legally compelled to assist) vary from nation to nation, but a warrant is generally required. Defenses against key disclosure laws include steganography and encrypting data in a way that provides plausible deniability.
|
||||
|
||||
[Steganography](https://en.wikipedia.org/wiki/Steganography) involves hiding sensitive information (which may be encrypted) inside of ordinary data (for example, encrypting an image file and then hiding it in an audio file). With plausible deniability, data is encrypted in a way that prevents an adversary from being able to prove that the information they are after exists (for example, one password may decrypt benign data and another password, used on the same file, could decrypt sensitive data).
|
||||
apply: Key disclosure laws apply
|
||||
may_apply: Key disclosure laws may apply
|
||||
dont_apply: Key disclosure laws don't apply
|
||||
footnote: people who know how to access a system may be ordered to share their knowledge, <strong>however, this doesn't apply to the suspect itself or family members.</strong>
|
||||
|
||||
it:
|
||||
<<: *base
|
||||
footnote: something italian
|
||||
|
||||
---
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
en: &base
|
||||
title: Privacy? I don't have anything to hide.
|
||||
quote: >
|
||||
Over the last 16 months, as I've debated this issue around the world,
|
||||
every single time somebody has said to me, "I don't really worry about
|
||||
invasions of privacy because I don't have anything to hide." I always
|
||||
say the same thing to them. I get out a pen, I write down my email address.
|
||||
I say, "Here's my email address. What I want you to do when you get home
|
||||
is email me the passwords to all of your email accounts, not just the
|
||||
nice, respectable work one in your name, but all of them, because I want
|
||||
to be able to just troll through what it is you're doing online, read
|
||||
what I want to read and publish whatever I find interesting. After all,
|
||||
if you're not a bad person, if you're doing nothing wrong, you should
|
||||
have nothing to hide." **Not a single person hsa taken me up on
|
||||
that offer**
|
||||
talk_name: Why privacy matters
|
||||
|
||||
it:
|
||||
<<: *base
|
||||
title: Italian title for nothing to hide
|
||||
quote: >
|
||||
Italian quote
|
||||
---
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
en: &base
|
||||
title: Why is it not recommended to choose a US-based service?
|
||||
description: >
|
||||
Services based in the United States are not recommended because of the country’s surveillance programs, use of [National Security Letters](https://www.eff.org/issues/national-security-letters/faq) (NSLs) and accompanying gag orders, which forbid the recipient from talking about the request. This combination allows the government to [secretly force](https://www.schneier.com/blog/archives/2013/08/more_on_the_nsa.html) companies to grant complete access to customer data and transform the service into a tool of mass surveillance.
|
||||
|
||||
An example of this is [Lavabit](https://en.wikipedia.org/wiki/Lavabit#Suspension_and_gag_order) – a discontinued secure email service created by Ladar Levison. The FBI [requested](https://motherboard.vice.com/en_us/article/nzz888/lavabit-founder-ladar-levison-discusses-his-federal-battle-for-privacy) Snowden’s records after finding out that he used the service. Since Lavabit did not keep logs and email content was stored encrypted, the FBI served a subpoena (with a gag order) for the service’s SSL keys. Having the SSL keys would allow them to access communications (both metadata and unencrypted content) in real time for all of Lavabit’s customers, not just Snowden's.
|
||||
|
||||
Ultimately, Levison turned over the SSL keys and [shut down](https://www.theguardian.com/commentisfree/2014/may/20/why-did-lavabit-shut-down-snowden-email) the service at the same time. The US government then [threatened Levison with arrest](http://www.cnbc.com/id/100962389),
|
||||
saying that shutting down the service was a violation of the court order.
|
||||
|
||||
it:
|
||||
<<: *base
|
||||
---
|
|
@ -37,7 +37,7 @@
|
|||
{% endif %}
|
||||
</a>
|
||||
{% if include.tor %}
|
||||
<a class="mb-1" data-toggle="tooltip" data-placement="bottom" data-original-title="{{include.tor}} Requires specific software to access: torproject.org" href="{{include.tor}}"><img alt="Tor" src="assets/img/layout/tor.png" width="35"></a>
|
||||
<a class="mb-1" data-toggle="tooltip" data-placement="bottom" data-original-title="{{include.tor}} Requires specific software to access: torproject.org" href="{{include.tor}}"><img alt="Tor" src="/assets/img/layout/tor.png" width="35"></a>
|
||||
{% endif %}
|
||||
|
||||
{% if include.extra_button %}
|
|
@ -5,10 +5,18 @@
|
|||
{% else %}
|
||||
<div class="card-header text-white bg-{{include.color}}">
|
||||
{% endif %}
|
||||
<h3 class="h5">{{include.title}}</h3>
|
||||
<h3 class="h5">{{ include.title }}</h3>
|
||||
</div>
|
||||
{% if include.list %}
|
||||
<div class="card-body">
|
||||
{{include.body}}
|
||||
<ol class="card-ol">
|
||||
{{ include.list | markdownify | replace:"<":"<" | replace:">":">" | remove:"<ul>" | remove:"</ul>" }}
|
||||
</ol>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card-body">
|
||||
{{ include.body }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,40 @@
|
|||
{% include language %}
|
||||
|
||||
<h1 id="ukusa" class="anchor"><a href="#ukusa"><i class="fas fa-link anchor-icon"></i></a> {{ lang.title }} </h1>
|
||||
<img src="/assets/img/layout/UKUSA.png" class="img-fluid float-right" alt="UKUSA Agreement" style="margin-left:10px;">
|
||||
{{ lang.description }}
|
||||
|
||||
<!-- chart -->
|
||||
<div class="row mb-3">
|
||||
{% include components/panel.html color="danger"
|
||||
title=lang.five_eyes
|
||||
list='
|
||||
- Australia <div class="float-right"><span class="flag-icon flag-icon-au"></span></div>
|
||||
- Canada <div class="float-right"><span class="flag-icon flag-icon-ca"></span></div>
|
||||
- New Zealand <div class="float-right"><span class="flag-icon flag-icon-nz"></span></div>
|
||||
- United Kingdom <div class="float-right"><span class="flag-icon flag-icon-gb"></span></div>
|
||||
- United States of America <div class="float-right"><span class="flag-icon flag-icon-us"></span></div>
|
||||
'
|
||||
%}
|
||||
|
||||
{% include components/panel.html color="warning"
|
||||
title=lang.nine_eyes
|
||||
list='
|
||||
- Denmark <div class="float-right"><span class="flag-icon flag-icon-dk"></span></div>
|
||||
- France <div class="float-right"><span class="flag-icon flag-icon-fr"></span></div>
|
||||
- Netherlands <div class="float-right"><span class="flag-icon flag-icon-nl"></span></div>
|
||||
- Norway <div class="float-right"><span class="flag-icon flag-icon-no"></span></div>
|
||||
'
|
||||
%}
|
||||
|
||||
{% include components/panel.html color="secondary"
|
||||
title=lang.fourteen_eyes
|
||||
list='
|
||||
- Belgium <div class="float-right"><span class="flag-icon flag-icon-be"></span></div>
|
||||
- Germany <div class="float-right"><span class="flag-icon flag-icon-de"></span></div>
|
||||
- Italy <div class="float-right"><span class="flag-icon flag-icon-it"></span></div>
|
||||
- Spain <div class="float-right"><span class="flag-icon flag-icon-es"></span></div>
|
||||
- Sweden <div class="float-right"><span class="flag-icon flag-icon-se"></span></div>
|
||||
'
|
||||
%}
|
||||
</div>
|
|
@ -0,0 +1,55 @@
|
|||
{% include language %}
|
||||
|
||||
<h1 id="kdl" class="anchor"><a href="#kdl"><i class="fas fa-link anchor-icon"></i></a> {{ lang.title }}</h1>
|
||||
### {{ lang.subheading }}
|
||||
|
||||
{{ lang.description }}
|
||||
|
||||
<!-- Chart of key disclosure law in some countries -->
|
||||
<div class="row mb-2">
|
||||
|
||||
{% include components/panel.html color="danger"
|
||||
title=lang.apply
|
||||
list='
|
||||
- [Antigua and Barbuda](https://en.wikipedia.org/wiki/Key_disclosure_law#Antigua_and_Barbuda) <div class="float-right"><span class="flag-icon flag-icon-ag"></span></div>
|
||||
- [Australia](https://en.wikipedia.org/wiki/Key_disclosure_law#Australia) <div class="float-right"><span class="flag-icon flag-icon-au"></span></div>
|
||||
- [Canada](https://en.wikipedia.org/wiki/Key_disclosure_law#Canada) <div class="float-right"><span class="flag-icon flag-icon-ca"></span></div>
|
||||
- [France](https://en.wikipedia.org/wiki/Key_disclosure_law#France) <div class="float-right"><span class="flag-icon flag-icon-fr"></span></div>
|
||||
- [India](https://en.wikipedia.org/wiki/Key_disclosure_law#India) <div class="float-right"><span class="flag-icon flag-icon-in"></span></div>
|
||||
- [Ireland](https://en.wikipedia.org/wiki/Key_disclosure_law#Ireland) <div class="float-right"><span class="flag-icon flag-icon-ie"></span></div>
|
||||
- [Norway](https://edri.org/norway-introduces-forced-biometric-authentication/) <div class="float-right"><span class="flag-icon flag-icon-no"></span></div>
|
||||
- [Russia](https://www.bloomberg.com/news/articles/2018-03-20/telegram-loses-bid-to-stop-russia-from-getting-encryption-keys) <div class="float-right"><span class="flag-icon flag-icon-ru"></span></div>
|
||||
- [South Africa](https://en.wikipedia.org/wiki/Key_disclosure_law#South_Africa) <div class="float-right"><span class="flag-icon flag-icon-za"></span></div>
|
||||
- [United Kingdom](https://en.wikipedia.org/wiki/Key_disclosure_law#United_Kingdom) <div class="float-right"><span class="flag-icon flag-icon-gb"></span></div>
|
||||
'
|
||||
%}
|
||||
|
||||
{% include components/panel.html color="warning"
|
||||
title=lang.may_apply
|
||||
list='
|
||||
- [Belgium *](https://en.wikipedia.org/wiki/Key_disclosure_law#Belgium) <div class="float-right"><span class="flag-icon flag-icon-be"></span></div>
|
||||
- [Finland *](https://en.wikipedia.org/wiki/Key_disclosure_law#Finland) <div class="float-right"><span class="flag-icon flag-icon-fi"></span></div>
|
||||
- [New Zealand](https://en.wikipedia.org/wiki/Key_disclosure_law#New_Zealand) (unclear) <div class="float-right"><span class="flag-icon flag-icon-nz"></span></div>
|
||||
- [The Netherlands *](https://en.wikipedia.org/wiki/Key_disclosure_law#The_Netherlands) <div class="float-right"><span class="flag-icon flag-icon-nl"></span></div>
|
||||
- [United States](https://en.wikipedia.org/wiki/Key_disclosure_law#United_States) (see related information) <div class="float-right"><span class="flag-icon flag-icon-us"></span></div>
|
||||
'
|
||||
%}
|
||||
|
||||
{% include components/panel.html color="success"
|
||||
title=lang.dont_apply
|
||||
list='
|
||||
- [Czech Republic](https://en.wikipedia.org/wiki/Key_disclosure_law#Czech_Republic) <div class="float-right"><span class="flag-icon flag-icon-cz"></span></div>
|
||||
- [Germany](https://en.wikipedia.org/wiki/Key_disclosure_law#Germany) <div class="float-right"><span class="flag-icon flag-icon-de"></span></div>
|
||||
- [Poland](https://en.wikipedia.org/wiki/Key_disclosure_law#Poland) <div class="float-right"><span class="flag-icon flag-icon-pl"></span></div>
|
||||
- [Sweden](https://en.wikipedia.org/wiki/Key_disclosure_law#Sweden) (proposed) <div class="float-right"><span class="flag-icon flag-icon-se"></span></div>
|
||||
'
|
||||
%}
|
||||
|
||||
</div>
|
||||
|
||||
\* ({{ lang.footnote }})
|
||||
|
||||
### {{ general.related_information }}
|
||||
- <a href="https://en.wikipedia.org/wiki/Key_disclosure_law">Wikipedia page on key disclosure law</a>
|
||||
- <a href="https://law.stackexchange.com/questions/1523/can-a-us-citizen-be-required-to-provide-the-authentication-key-for-encrypted-dat">law.stackexchange.com question about key disclosure law in US</a>
|
||||
- <a href="https://www.youtube.com/watch?v=Jt7D4AIfqlQ">DEFCON 20: Crypto and the Cops: the Law of Key Disclosure and Forced Decryption</a>
|
|
@ -0,0 +1,18 @@
|
|||
{% include language %}
|
||||
|
||||
<div class="page-header">
|
||||
<h1>{{ lang.title }}</h1>
|
||||
</div>
|
||||
<blockquote class="blockquote">
|
||||
<p>
|
||||
<a href="https://www.ted.com/talks/glenn_greenwald_why_privacy_matters" title="Glenn Greenwald - {{ lang.talk_name }} - TED Talk"><img src="/assets/img/layout/Glenn-Greenwald-Why-privacy-matters.jpg" class="img-fluid float-right ml-2" alt="Glenn Greenwald: {{ lang.talk_name }}"></a>
|
||||
{{ lang.quote }}
|
||||
</p>
|
||||
<footer class="blockquote-footer">Glenn Greenwald in <cite title="{{ lang.talk_name }} - TED Talk"><a href="https://www.ted.com/talks/glenn_greenwald_why_privacy_matters">{{ lang.talk_name }} - TED Talk</a></cite></footer>
|
||||
</blockquote>
|
||||
|
||||
#### {{ general.read_also }}:
|
||||
|
||||
- [Nothing to hide argument (Wikipedia)](https://en.wikipedia.org/wiki/Nothing_to_hide_argument)
|
||||
- [How do you counter the "I have nothing to hide?" argument? (reddit.com)](https://www.reddit.com/r/privacy/comments/3hynvp/how_do_you_counter_the_i_have_nothing_to_hide/)
|
||||
- ["I've Got Nothing to Hide" and Other Misunderstandings of Privacy (Daniel J. Solove - San Diego Law Review)](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=998565)
|
|
@ -0,0 +1,17 @@
|
|||
{% include language %}
|
||||
|
||||
<h3 id="usa" class="anchor">{{ lang.title }}</h3>
|
||||
|
||||
<img src="/assets/img/layout/USA.png" class="img-fluid float-right" alt="USA" style="margin-left:10px;">
|
||||
|
||||
{{ lang.description }}
|
||||
|
||||
### {{ general.related_information }}
|
||||
|
||||
- [Avoid all US and UK based services](https://www.bestvpn.com/the-ultimate-privacy-guide/#avoidus)
|
||||
- [Proof that warrant canaries work based on the surespot example.](https://en.wikipedia.org/wiki/Surespot#History)
|
||||
- [The United Kingdom – United States of America Agreement (UKUSA)](https://en.wikipedia.org/wiki/UKUSA_Agreement)
|
||||
- [Lavabit: Suspension and gag order](https://en.wikipedia.org/wiki/Lavabit#Suspension_and_gag_order)
|
||||
- [Key disclosure law](https://en.wikipedia.org/wiki/Key_disclosure_law)
|
||||
- [Wikipedia Portal: Mass_surveillance](https://en.wikipedia.org/wiki/Portal:Mass_surveillance)
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,2 @@
|
|||
{% assign lang = site.data.lang.[include.section].[page.lang] %}
|
||||
{% assign general = site.data.lang.general.[page.lang] %}
|
|
@ -0,0 +1,5 @@
|
|||
{% capture md %}
|
||||
{% include content/{{include.name}}.md lang=page.lang section=include.name %}
|
||||
{% endcapture %}
|
||||
|
||||
{{ md | markdownify }}
|
|
@ -23,28 +23,28 @@
|
|||
{% endif %}
|
||||
|
||||
<!-- icons -->
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="assets/img/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="assets/img/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="assets/img/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="assets/img/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="assets/img/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="assets/img/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="assets/img/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="assets/img/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="assets/img/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="assets/img/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="assets/img/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="assets/img/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="assets/img/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="assets/img/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="assets/img/favicons/favicon.ico">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="/assets/img/favicons/apple-touch-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="/assets/img/favicons/apple-touch-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="/assets/img/favicons/apple-touch-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="/assets/img/favicons/apple-touch-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="/assets/img/favicons/apple-touch-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/assets/img/favicons/apple-touch-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="/assets/img/favicons/apple-touch-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="/assets/img/favicons/apple-touch-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/assets/img/favicons/apple-touch-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" href="/assets/img/favicons/favicon-32x32.png" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="/assets/img/favicons/android-chrome-192x192.png" sizes="192x192">
|
||||
<link rel="icon" type="image/png" href="/assets/img/favicons/favicon-96x96.png" sizes="96x96">
|
||||
<link rel="icon" type="image/png" href="/assets/img/favicons/favicon-16x16.png" sizes="16x16">
|
||||
<link rel="manifest" href="/assets/img/favicons/manifest.json">
|
||||
<link rel="shortcut icon" href="/assets/img/favicons/favicon.ico">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="msapplication-TileImage" content="assets/img/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="assets/img/favicons/browserconfig.xml">
|
||||
<meta name="msapplication-TileImage" content="/assets/img/favicons/mstile-144x144.png">
|
||||
<meta name="msapplication-config" content="/assets/img/favicons/browserconfig.xml">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<!-- CSS stylesheets -->
|
||||
<link href="assets/css/style.css?v=5" rel="stylesheet">
|
||||
<link href="/assets/css/style.css?v=5" rel="stylesheet">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="js/html5shiv.min.js"></script>
|
||||
|
@ -190,10 +190,10 @@
|
|||
</div>
|
||||
|
||||
<!-- add jQuery, Popper, Bootstrap, Sortable, and tooltip libraries -->
|
||||
<script src="assets/js/jquery-3.3.1.min.js?v=4"></script>
|
||||
<script src="assets/js/popper.min.js?v=4"></script>
|
||||
<script src="assets/js/bootstrap.min.js?v=4"></script>
|
||||
<script src="assets/js/sortable.min.js?v=4"></script>
|
||||
<script src="/assets/js/jquery-3.3.1.min.js?v=4"></script>
|
||||
<script src="/assets/js/popper.min.js?v=4"></script>
|
||||
<script src="/assets/js/bootstrap.min.js?v=4"></script>
|
||||
<script src="/assets/js/sortable.min.js?v=4"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
$("[data-toggle='tooltip']").tooltip();
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
#!/usr/bin/env python3
|
||||
from sys import argv
|
||||
from yaml import safe_load as yaml_safe_load
|
||||
|
||||
"""
|
||||
A tool to make working with localized sections easier.
|
||||
|
||||
Inspired by Laravel's artisan.
|
||||
"""
|
||||
|
||||
class Activist:
|
||||
def help(self):
|
||||
print("""
|
||||
Available commands:
|
||||
make:section name Creates all files needed for a new section.
|
||||
""")
|
||||
|
||||
def handle(self, args):
|
||||
try:
|
||||
command, *arguments = args
|
||||
except:
|
||||
self.help()
|
||||
exit()
|
||||
|
||||
self.run(command, arguments)
|
||||
|
||||
def run(self, command, arguments):
|
||||
commands = {
|
||||
"make:section": self.make_section
|
||||
}
|
||||
|
||||
if command not in commands:
|
||||
self.help()
|
||||
exit("Wrong command.")
|
||||
|
||||
commands[command](arguments)
|
||||
|
||||
def make_section(self, arguments):
|
||||
try:
|
||||
name, *_ = arguments
|
||||
except:
|
||||
exit("Please supply a section name.")
|
||||
|
||||
# create files
|
||||
with open("_data/lang/%s.yml" % name, 'w') as f:
|
||||
f.write("---\n")
|
||||
f.write("en: &base\n title: Section Title\n\n")
|
||||
with open(".activist.yml", "r") as config:
|
||||
# get list of languages except "en"
|
||||
for language in filter(lambda lang: lang != "en", yaml_safe_load(config.read())['languages']):
|
||||
f.write("{0}:\n <<: *base\n # title: Section Title in {0}\n\n".format(language))
|
||||
f.write("---")
|
||||
with open("_includes/content/%s.md" % name, 'w') as f:
|
||||
f.write("{% include language %}\n\n")
|
||||
print("""Add this line to index.html:
|
||||
|
||||
{% include section name=\""""+ name + """\" %}""")
|
||||
print("\nAnd don't forge to add the section to the navbar in _layouts/default.html!")
|
||||
|
||||
|
||||
def main(args):
|
||||
activist = Activist()
|
||||
activist.handle(args)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(argv[1:])
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
layout: default
|
||||
permalink: /
|
||||
lang: "en"
|
||||
---
|
||||
|
||||
{% include index.html lang="en" %}
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
layout: default
|
||||
permalink: /it/
|
||||
lang: it
|
||||
---
|
||||
|
||||
{% include index.html lang="it" %}
|
Reference in New Issue