Skip to content

Commit

Permalink
remove jquery, add contributors mention and lang dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Holywell authored and Simon Holywell committed Feb 27, 2018
1 parent ad249d1 commit faf6137
Show file tree
Hide file tree
Showing 25 changed files with 250 additions and 111 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Gemfile.lock

_site
_gh_pages
.jekyll-metadata
27 changes: 26 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,32 @@ kramdown:
input: GFM
hard_wrap: false
toc_levels: "2,3"
auto_ids: true
transliterated_header_ids: true
auto_id_stripping: true

gems:
plugins:
- jekyll-redirect-from
- jekyll-sitemap

langs:
de:
de: Deutsch
en: German
en:
en: English
ja:
ja: 日本語
en: Japanese
pt-BR:
pt-BR: Português (BR)
en: Portuguese - Brazil
ru:
ru: Русский
en: Russian
zh:
zh: 简体中文
en: Simplified Chinese
zh-TW:
zh-TW: 正體中文
en: Traditional Chinese
47 changes: 0 additions & 47 deletions _includes/head.html

This file was deleted.

28 changes: 1 addition & 27 deletions _includes/foot.html → _includes/layout_partials/foot.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,7 @@
<hr/>
<nav class="translation-nav">
<span>Translations:</span>
<a href="{{ site.url }}/de/" itemprop="availableLanguage" itemscope itemtype="http://schema.org/Language">
<span itemprop="name" alternateName="de" title="Deutsch (German)" lang="de">Deutsch</span>
</a>
·
<a href="{{ site.url }}" itemprop="availableLanguage" itemscope itemtype="http://schema.org/Language">
<span itemprop="name" alternateName="en" title="English">English</span>
</a>
·
<a href="{{ site.url }}/ja" itemprop="availableLanguage" itemscope itemtype="http://schema.org/Language">
<span itemprop="name" alternateName="ja" title="日本語 (Japanese)" lang="ja">日本語</span>
</a>
·
<a href="{{ site.url }}/pt-br/" itemprop="availableLanguage" itemscope itemtype="http://schema.org/Language">
<span itemprop="name" alternateName="pt-BR" title="Português (BR) (Portuguese - Brazil)" lang="pt-BR">Português (BR)</span>
</a>
·
<a href="{{ site.url }}/ru/" itemprop="availableLanguage" itemscope itemtype="http://schema.org/Language">
<span itemprop="name" alternateName="ru" title="Русский (Russian)" lang="ru">Русский</span>
</a>
·
<a href="{{ site.url }}/zh" itemprop="availableLanguage" itemscope itemtype="http://schema.org/Language">
<span itemprop="name" alternateName="zh" title="简体中文 (Simplified Chinese)" lang="zh">简体中文</span>
</a>
·
<a href="{{ site.url }}/zh-tw" itemprop="availableLanguage" itemscope itemtype="http://schema.org/Language">
<span itemprop="name" alternateName="zh-TW" title="正體中文 (Traditional Chinese)" lang="zh-TW">正體中文</span>
</a>
{% include layout_partials/languages.html %}
</nav>
<p>
This guide is being discussed on Hacker News [
Expand Down
35 changes: 35 additions & 0 deletions _includes/layout_partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<nav id="page-nav">
<a href="#" id="to-top" class="toplink"></a>
</nav>
<div id="translation-bar">
<div class="wrap">
<select class="language-drop" id="language-drop">
{% include layout_partials/languages.html dropdown=true %}
</select>
<div class="language-ico">{% include static/language.svg %}</div>
</div>
</div>
<header class="top">
<div class="wrap">
<h1 itemprop="name">{% if page.lang_title %}{{ page.lang_title }} · {% endif %}SQL Style Guide</h1>
<p class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">by
<a href="https://www.simonholywell.com/?utm_source=sqlstyle.guide-{{ site.domain }}&amp;utm_medium=link&amp;utm_campaign=header" itemprop="url"><span itemprop="name">Simon Holywell</span></a> &middot;
<a href="https://twitter.com/treffynnon">@Treffynnon</a>
</p>
<p class="twitter">
<a href="https://twitter.com/share" class="twitter-share-button"
data-url="{{ site.url }}" data-text="SQL style guide by @treffynnon: {{ site.description }}"
data-size="large" data-dnt="true">Tweet</a>
</p>
{% if page.contributors -%}
<p class="translator">Translated by:
{% for user in page.contributors -%}
<a href="https://github.com/{{ user.user }}" title="{{ user.user }} - {{ user.type }}" rel="nofollow">
{{- user.user -}}
</a>
{%- if forloop.last != true %} · {% endif -%}
{%- endfor %}
</p>
{%- endif %}
</div>
</header>
4 changes: 4 additions & 0 deletions _includes/layout_partials/language_dropdown_option.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<option value="{{ iso }}"
{%- if page.lang == iso %} selected="selected"{% endif %}>
{{ full }}
</option>
7 changes: 7 additions & 0 deletions _includes/layout_partials/language_nav_links.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<a href="{{ url }}" itemprop="availableLanguage"
itemscope itemtype="http://schema.org/Language">
<span itemprop="name" alternateName="{{ iso }}"
title="{{ full }}"
lang="{{ iso }}">{{ local }}</span>
</a>
{%- if forloop.last != true %} · {% endif -%}
1 change: 1 addition & 0 deletions _includes/layout_partials/language_rel_alternate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="alternate" hreflang="{{ iso }}" href="{{ url }}">
21 changes: 21 additions & 0 deletions _includes/layout_partials/languages.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{%- assign lpages=site.pages | where_exp:"page", "page contains 'lang'" | sort: 'lang' -%}

{%- assign content_template="layout_partials/language_nav_links.html" -%}
{%- if include.dropdown == true -%}
{%- assign content_template="layout_partials/language_dropdown_option.html" -%}
{%- endif -%}
{%- if include.rel_alternate == true -%}
{%- assign content_template="layout_partials/language_rel_alternate.html" -%}
{%- endif -%}

{% for l in lpages %}
{%- assign local=site.langs[l.lang][l.lang] -%}
{%- assign english=site.langs[l.lang]['en'] -%}
{%- assign iso=l.lang -%}
{%- assign url=l.url | absolute_url -%}
{%- capture full -%}
{{ local }}{% if l.lang_title %} ({{ english }}){% endif %}
{%- endcapture -%}

{% include {{ content_template }} %}
{% endfor %}
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions _includes/static/language.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 8 additions & 15 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title property="og:title">{% if page.lang_title %}{{ page.lang_title }} · {% endif %}{{ site.name }}</title>
<link href="http://fonts.googleapis.com/css?family=PT+Sans|Roboto+Slab|Droid+Sans+Mono" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="{{ site.url }}/style.css">
<link rel="stylesheet" href="{{ site.url }}/static/style.css">

<link rel="icon" type="image/png" href="{{ site.url }}/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ site.url }}/favicon-16x16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="{{ site.url }}/static/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ site.url }}/static/favicon-16x16.png" sizes="16x16" />

<meta content="website" property="og:type">
<meta content="{{ site.url }}" property="og:url">
Expand All @@ -31,31 +31,24 @@

<link rel="canonical" href="{{ site.url }}{{ page.url | replace:'index.html',''}}">
<link rel="alternate" hreflang="x-default" href="{{ site.url }}/">
<link rel="alternate" hreflang="en" href="{{ site.url }}/">
<link rel="alternate" hreflang="ja" href="{{ site.url }}/ja/">
<link rel="alternate" hreflang="zh" href="{{ site.url }}/zh/">
<link rel="alternate" hreflang="zh-TW" href="{{ site.url }}/zh-tw/">
<link rel="alternate" hreflang="pt-BR" href="{{ site.url }}/pt-br/">
<link rel="alternate" hreflang="ru" href="{{ site.url }}/ru/">
<link rel="alternate" hreflang="de" href="{{ site.url }}/de/">
{% include layout_partials/languages.html rel_alternate=true %}
</head>
<body itemscope itemtype="http://schema.org/TechArticle">
<meta itemprop="wordCount" content="{{ content | number_of_words }}">
<meta itemprop="about" content="{{ site.description }}">
<meta itemprop="audience" content="SQL programmers">
<meta itemprop="license" content="http://creativecommons.org/licenses/by-sa/4.0/">
<meta itemprop="version" content="1.0.0">
<meta itemprop="version" content="1.0.1">
<meta itemprop="proficiencyLevel" content="Beginner">
<meta itemprop="dependencies" content="SQL knowledge">
<meta itemprop="copyrightHolder" content="Simon Holywell">
{% include head.html %}
{% include layout_partials/head.html %}
<main class="article-body wrap" id="content" itemprop="articleBody" lang="{{ page.lang }}">
{{ content }}
</main>
{% include foot.html %}
{% include layout_partials/foot.html %}
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="{{ site.url }}/scripts.js"></script>
<script src="{{ site.url }}/static/scripts.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
Expand Down
3 changes: 3 additions & 0 deletions de/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
layout: default
lang: de
lang_title: SQL-Styleguide
contributors:
- user: AStasyK
type: translator
---

* TOC
Expand Down
3 changes: 3 additions & 0 deletions ja/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ layout: default
redirect_from: "/jp"
lang: ja
lang_title: SQLスタイルガイド
contributors:
- user: nkurigit
type: translator
---

* TOC
Expand Down
3 changes: 3 additions & 0 deletions pt-br/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
layout: default
lang: pt-BR
lang_title: Guia de Estilo SQL
contributors:
- user: pmarcus93
type: translator
---

* TOC
Expand Down
3 changes: 3 additions & 0 deletions ru/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
layout: default
lang: ru
lang_title: Руководство по стилю SQL
contributors:
- user: denpatin
type: translator
---

* TOC
Expand Down
File renamed without changes
File renamed without changes
48 changes: 48 additions & 0 deletions static/language.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit faf6137

Please sign in to comment.