diff --git a/CHANGELOG.md b/CHANGELOG.md index 9833219f549a6f9201061799056a701be3551ba2..c10e99427e99350f2c2012e0972ec4ab4abf502f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ * Fixed style for gitlab-heatmap partial to match overall theme. * Fixed `Uncaught ReferenceError: ga is not defined` error in web console. * Added W3C specification styling for writing W3C recomendations directly. +* Added used-by shortcode for displaying brands you've worked with. +* Fixed bug where using the tabbed shortcode across different pages may cause + a nonexistant tab to be selected. +* Added project type with layouts for rendering projects in a more visually + appealing way. ## 2.1.0 diff --git a/layouts/partials/body_project_list.html b/layouts/partials/body_project_list.html new file mode 100644 index 0000000000000000000000000000000000000000..f571d726c4f0de4f14a20e0acd857a34d59faf74 --- /dev/null +++ b/layouts/partials/body_project_list.html @@ -0,0 +1,16 @@ +<section class="section-lg"> + <div class="container"> + <div class="row center"> + <div class="col center-text"> + <h2>{{ .Params.heading }}</h2> + <p>{{ .Params.subheading }}</p> + </div> + </div> + <div id="cal-heatmap-container"> + <div id="cal-heatmap" class="cal-heatmap"></div> + <div id="cal-heatmap-legend" class="cal-heatmap-legend"></div> + </div> + + {{ partial "projects_for_section.html" . }} + </div> +</section> diff --git a/layouts/partials/projects_for_section.html b/layouts/partials/projects_for_section.html new file mode 100644 index 0000000000000000000000000000000000000000..a21a41ac08ddfe74b2d7f3f361f23b50bbcb5001 --- /dev/null +++ b/layouts/partials/projects_for_section.html @@ -0,0 +1,19 @@ +{{ range $index, $element := .Data.Pages }} + {{- if math.ModBool $index 3 }}{{- if ne $index 0 }}</div>{{ end }}<div class="row">{{ end }} + <div class="col"> + <a class="card" {{ if .Content }}href="{{ .Permalink }}"{{ else if .Params.repoUrl }}href="{{ .Params.repoUrl }}"{{ end }}> + <div class="card__body"> + <h4 style="margin:0;text-transform:capitalize">{{ .Title}}</h4> + <small>{{- if .Params.description }}{{ .Params.description }}{{ else }}{{.Content }} {{ end }}</small> + </div> + {{- if (or (.Params.repoPath) (.Params.projLang) )}} + <hr style="margin:15px 0 10px 0"> + <div style="display:flex;flex-direction:row;justify-content:space-between;padding:0 15px 10px 15px;font-size:0.8em"> + <div>{{ .Params.repoPath }}</div> + <div>{{ .Params.projLang }}</div> + </div> + {{- end }} + </a> + </div> +{{ end }} +</div> diff --git a/layouts/project/list.html b/layouts/project/list.html new file mode 100644 index 0000000000000000000000000000000000000000..b250d3f9d0c8f73c8c55e5307b278b8481688498 --- /dev/null +++ b/layouts/project/list.html @@ -0,0 +1,3 @@ +{{ partial "top_list_generic.html" . }} +{{ partial "body_project_list.html" . }} +{{ partial "bottom_list.html" . }} diff --git a/layouts/project/single.html b/layouts/project/single.html new file mode 100644 index 0000000000000000000000000000000000000000..6ba1fb76d9e3a5129f3965378d5e4a34454d044f --- /dev/null +++ b/layouts/project/single.html @@ -0,0 +1,3 @@ +{{ partial "top_home.html" . }} +{{ .Content }} +{{ partial "bottom_home.html" . }} diff --git a/layouts/shortcodes/example-tab.html b/layouts/shortcodes/example-tab.html new file mode 100644 index 0000000000000000000000000000000000000000..b8871a75af3c6d458d9a03f2b40b290f7dea1b98 --- /dev/null +++ b/layouts/shortcodes/example-tab.html @@ -0,0 +1,9 @@ +<div class="code-with-header tab-pane" title={{ with .Get "title" }}{{ . }}{{ end }}> + {{ with .Get "title" }}<div class="code-header">{{ . }}</div>{{ end }} + <div class="scrollbar-container"> + <div class="codeBlockWrapper_2QGZ"> + {{ .Inner }} + {{ with .Get "add_copy" }}<button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button>{{ end }} + </div> + </div> +</div> diff --git a/layouts/shortcodes/example.html b/layouts/shortcodes/example.html deleted file mode 100644 index 1f34155ddfec98c2f14f99da72aee5bafc47c78b..0000000000000000000000000000000000000000 --- a/layouts/shortcodes/example.html +++ /dev/null @@ -1,9 +0,0 @@ -<div class="code-with-header"> - <div class="code-header">{{ .Get 0 }}</div> - <div class="scrollbar-container"> - <div class="codeBlockWrapper_2QGZ"> - {{ .Inner }} - {{ if .Get 1 }}<button type="button" aria-label="Copy code to clipboard" class="copyButton_1BYj">Copy</button>{{ end }} - </div> - </div> -</div> diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index 6a2cd5c579c62fbe457315cbd13392ca44a4bf4e..595e3a598f8e75a39c7b5415b399b2ad49e4f1d0 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -1,5 +1,5 @@ <figure> - {{- if .Get "src" }}<a href="{{ .Get "src" }}">{{ end }} + {{- if .Get "link" }}<a href="{{ .Get "link" }}">{{ end }} <img {{ with .Get "src" }}src="{{ . }}"{{ end }} {{ with .Get "alt" }}alt="{{ range (split . " ") }}{{ . }} {{ end }}"{{ end }} @@ -10,6 +10,6 @@ {{ with .Get "width" }}width="{{ . }}"{{ end }} {{ with .Get "height" }}height="{{ . }}"{{ end }} {{ with .Get "layout" }}layout="{{ . }}"{{ end }} /> - {{- if .Get "src" }}</a>{{ end }} + {{- if .Get "link" }}</a>{{ end }} {{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }} </figure> diff --git a/layouts/shortcodes/text-box.html b/layouts/shortcodes/text-box.html new file mode 100644 index 0000000000000000000000000000000000000000..9648df06815300947f32cbe65787e0280dd9e0ce --- /dev/null +++ b/layouts/shortcodes/text-box.html @@ -0,0 +1,6 @@ +<div class="text-box"> + <blockquote> + {{ .Inner }} + </blockquote> + {{ if .Get "source" }}<cite>{{ .Get "source" }}</cite>{{ end }} +</div> diff --git a/layouts/shortcodes/titled-side.html b/layouts/shortcodes/titled-side.html index 77b92dab9d5ccc3d48f86fc3b7deffae1f00ff8c..6bcd33d54213c183024daab1ec5eeb4bb2434c20 100644 --- a/layouts/shortcodes/titled-side.html +++ b/layouts/shortcodes/titled-side.html @@ -1,7 +1,7 @@ <header class="titled-side"> <div class="container"> <div class="row titled-side__inner"> - <div class="col col--5 titled-side--title center-text"> + <div class="col col--6 titled-side--title center-text"> <h2>{{ .Get 0 }}</h2> <p >{{ .Get 1 }}</p> <div> @@ -9,7 +9,7 @@ <a class="button button-primary titled-side-content" to="{{ .Get 5 }}" href="{{ .Get 5 }}">{{ .Get 4 }}</a> </div> </div> - <div class="col col--7 titled-side--content"> + <div class="col col--6 titled-side--content"> {{ .Inner }} </div> </div> diff --git a/layouts/shortcodes/used-by-entry.html b/layouts/shortcodes/used-by-entry.html new file mode 100644 index 0000000000000000000000000000000000000000..e603973b70bf20d26852d92434ee55b641a9f710 --- /dev/null +++ b/layouts/shortcodes/used-by-entry.html @@ -0,0 +1,10 @@ +<img class="brand-logo" + {{ with .Get "src" }}src="{{ . }}"{{ end }} + {{ with .Get "alt" }}alt="{{ range (split . " ") }}{{ . }} {{ end }}"{{ end }} + {{ with .Get "attribution" }}attribution="{{ range (split . " ") }}{{ . }} {{ end }}"{{ end }} + {{ with .Get "srcset" }}srcset="{{ range (split . " ") }}{{ . }} {{ end }}"{{ end }} + {{ with .Get "tabindex" }}tabindex="{{ . }}"{{ end }} + {{ with .Get "role" }}role="{{ . }}"{{ end }} + {{ with .Get "width" }}width="{{ . }}"{{ end }} + {{ with .Get "height" }}height="{{ . }}"{{ end }} + {{ with .Get "layout" }}layout="{{ . }}"{{ end }} /> \ No newline at end of file diff --git a/layouts/shortcodes/used-by.html b/layouts/shortcodes/used-by.html new file mode 100644 index 0000000000000000000000000000000000000000..8a571c044a72bf5a209e4864c44e234095d4566a --- /dev/null +++ b/layouts/shortcodes/used-by.html @@ -0,0 +1,8 @@ +<section class="separator brands-box"> + <div class="container"> + <span class="brand-logos"> + {{ .Inner }} + </span> + <div class="brand-text">{{- if .Get "caption" }}{{ .Get "caption" }}{{ else }}Brands that have used our technology{{ end }}</div> + </div> +</section> diff --git a/static/css/main.css b/static/css/main.css index b7504718a45716fe0aa9bbb01b28da107aff86b2..3b95df699291842c81f99efaa9d9740f5d7e9087 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -5,20 +5,20 @@ --ifm-light-value:15%; --ifm-lighter-value:30%; --ifm-lightest-value:50%; - --ifm-color-primary:#3578e5; - --ifm-color-primary-dark:#306cce; - --ifm-color-primary-darker:#2d66c3; - --ifm-color-primary-darkest:#2554a0; - --ifm-color-primary-light:#538ce9; - --ifm-color-primary-lighter:#72a1ed; - --ifm-color-primary-lightest:#9abcf2; - --ifm-color-secondary:#ebedf0; - --ifm-color-secondary-dark:#d4d5d8; - --ifm-color-secondary-darker:#c8c9cc; - --ifm-color-secondary-darkest:#a4a6a8; - --ifm-color-secondary-light:#eef0f2; - --ifm-color-secondary-lighter:#f1f2f5; - --ifm-color-secondary-lightest:#f5f6f8; + --ifm-color-primary:#37D4B4; + --ifm-color-primary-dark:#29A78D; + --ifm-color-primary-darker:#1F8570; + --ifm-color-primary-darkest:#1F846F; + --ifm-color-primary-light:#37D4B4; + --ifm-color-primary-lighter:#37D4B4; + --ifm-color-primary-lightest:#37D4B4; + --ifm-color-secondary:#D4AF37; + --ifm-color-secondary-dark:#8D7421; + --ifm-color-secondary-darker:#8D7421; + --ifm-color-secondary-darkest:#8D7421; + --ifm-color-secondary-light:#D4AF37; + --ifm-color-secondary-lighter:#D4AF37; + --ifm-color-secondary-lightest:#f5D4AF37f6f8; --ifm-color-success:#00a400; --ifm-color-success-dark:#009400; --ifm-color-success-darker:#008b00; @@ -973,7 +973,7 @@ section { .separator { background-color: var(--custom-background-color-diff); - padding: 50px 0; + padding: 35px 0; } /******************************************************************************* @@ -1178,6 +1178,26 @@ section { margin-bottom: 0.25em; } +/******************************************************************************* +** Brands Section +*******************************************************************************/ + +.brands-box { + text-align: center; +} + +.brand-logos { + display: inline-block; + height: 100%; + vertical-align: middle; +} + +.brand-logo { + vertical-align: middle; + max-height: 50px; + padding: 10px; +} + /******************************************************************************* ** Cards Section *******************************************************************************/ @@ -2238,6 +2258,67 @@ div#ch-tooltip { display: flex; } +/* Adding pretty text boxes */ + +.text-box { + text-align: left; + color: #3f3f5a; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding-left: 5em; +} + +.text-box > blockquote { + font-size: 1.5rem; + max-width: 600px; + line-height: 1.4; + position: relative; + padding: .5rem; + border-left: none; + font-style: normal; + margin: auto; + text-align: start; +} + +.text-box > blockquote:before, +.text-box > blockquote:after { + position: absolute; + color: #ccc; + font-size: 8rem; + width: 4rem; + height: 4rem; +} + +.text-box > blockquote:before { + /* content: '“'; */ + left: -5rem; + top: -2rem; +} + +.text-box > blockquote:after { + /* content: 'â€'; */ + right: 0; + bottom: 1rem; +} + +.text-box > cite { + line-height: 3; + text-align: right; + font-size: 2rem; + margin: auto; +} + +.text-box > cite:before { + content: '- '; + font-size: 2rem; +} + +.text-box-highlight { + color: var(--ifm-color-secondary); +} + /* Adding pretty quote boxes */ .quote-box { @@ -2472,6 +2553,14 @@ li.navbar-menu-item > .button { display: none; } + /***************************************************************************** + ** Titled-side section + *****************************************************************************/ + + .titled-side--content img { + width: 20em; + } + /******************************************************************************* ******************************************************************************** ** Media specific css (max-width) @@ -2881,6 +2970,7 @@ li.navbar-menu-item > .button { text-rendering: optimizeLegibility; } } + } @media (min-width: 992px) { diff --git a/static/javascripts/head.js b/static/javascripts/head.js index 55f824995ac7dc28ba0604cfb56b057f093f979a..ecef51325c1d5b66541ecac06dfcf9f513e9ec84 100644 --- a/static/javascripts/head.js +++ b/static/javascripts/head.js @@ -87,6 +87,10 @@ null !== a ? t(a) : n.matches && t("dark") $(document).ready(function () { + if(window.localStorage) { + window.localStorage.setItem("configLangPref", 1) + } + $('.tab-content').find('.tab-pane').each(function (idx, item) { var navTabs = $(this).closest('.code-tabs').find('.nav-tabs'), title = $(this).attr('title');