Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortlinks update #287

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ collections:
events:
output: true
permalink: /events/:year/:month/:title
shortlinks:
output: true
permalink: /s/:slug

defaults:
- scope:
Expand All @@ -49,6 +52,13 @@ defaults:
type: "events"
values:
layout: "event"
- scope:
path: ""
type: "shortlinks"
values:
layout: "redirect"
sitemap: false
robots: block

# Exclude from processing.
# The following items will not be processed, by default.
Expand Down
1 change: 1 addition & 0 deletions _i18n/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ titles:
media-kit: "Media Kit"
license: "License"
privacy: "Privacy Policy"
shortlinks: "Short links"

## Generic strings
generic:
Expand Down
126 changes: 64 additions & 62 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,69 +1,71 @@
{% if page.layout == "blog" or page.layout == "event" %}
{% capture title %}{{ page.title }} – {{ site.title }}{% endcapture %}
{% elsif page.title %}
{% capture title %}{% t page.title %} – {{ site.title }}{% endcapture %}
{% else %}
{% capture title %}{{ site.title }} – {% t homepage.header %}{% endcapture %}
{% endif %}
{% if page.layout == "blog" or page.layout == "event" %}
{%- capture title %}{{ page.title }} – {{ site.title }}{% endcapture %}
{%- elsif page.title %}
{%- capture title %}{% t page.title %} – {{ site.title }}{% endcapture %}
{%- else %}
{%- capture title %}{{ site.title }} – {% t homepage.header %}{% endcapture %}
{%- endif %}

{% if page.layout == "blog" or page.layout == "doc" or page.layout == "event" %}
{% capture descrlong %}{{ page.excerpt }}{% endcapture %}
{% elsif page.excerpt %}
{% capture descrlong %}{% t page.excerpt %}{% endcapture %}
{% else %}
{% capture descrlong %}{% t homepage.description %}{% endcapture %}
{% endif %}
{% capture description %}{{ descrlong | strip | strip_html | strip_newlines | truncate: 180 }}{% endcapture %}
{%- if page.layout == "blog" or page.layout == "doc" or page.layout == "event" %}
{%- capture descrlong %}{{ page.excerpt }}{% endcapture %}
{%- elsif page.excerpt %}
{%- capture descrlong %}{% t page.excerpt %}{% endcapture %}
{%- else %}
{%- capture descrlong %}{% t homepage.description %}{% endcapture %}
{%- endif %}
{%- capture description %}{{ descrlong | strip | strip_html | strip_newlines | truncate: 180 }}{% endcapture %}

{% capture image %}
{% if page.layout == 'blog' %}
/assets/images/blog/{{ page.image }}
{% elsif page.image %}
/assets/images/{{ page.image }}
{% else %}
/assets/branding/covers/cover_001.png
{% endif %}
{% endcapture %}
{% assign image = image | strip | prepend: site.url %}
{%- capture image %}
{%- if page.layout == 'blog' %}
/assets/images/blog/{{ page.image }}
{%- elsif page.image %}
/assets/images/{{ page.image }}
{%- else %}
/assets/branding/covers/cover_001.png
{%- endif %}
{%- endcapture %}
{%- assign image = image | strip | prepend: site.url -%}

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ title }}</title>
<meta name="description" content="{{ description }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="Blog posts" href="/rss.xml">
{%- if page.robots == "block" %}
<meta name="robots" content="noindex, nofollow" />
{%- endif %}

<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="Blog posts" href="/rss.xml">
<!-- Social: Twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="{{ title }}">
<meta name="twitter:description" content="{{ description }}">
<meta name="twitter:image" content="{{ image }}">

<!-- Social: Twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="{{ title }}">
<meta name="twitter:description" content="{{ description }}">
<meta name="twitter:image" content="{{ image }}">
<!-- Social: Facebook / Open Graph -->
<meta property="og:url" content="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<meta property="og:title" content="{{ title }}">
<meta property="og:image" content="{{ image }}">
<meta property="og:description" content="{{ description }}">
<meta property="og:site_name" content="{{ site.title }}">

<!-- Social: Facebook / Open Graph -->
<meta property="og:url" content="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<meta property="og:title" content="{{ title }}">
<meta property="og:image" content="{{ image }}">
<meta property="og:description" content="{{ description }}">
<meta property="og:site_name" content="{{ site.title }}">
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="/assets/branding/favicons/apple-touch-icon.png?v=2">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/branding/favicons/favicon-32x32.png?v=2">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/branding/favicons/favicon-16x16.png?v=2">
<link rel="manifest" href="/assets/branding/favicons/site.webmanifest?v=2">
<link rel="mask-icon" href="/assets/branding/favicons/safari-pinned-tab.svg?v=2" color="#364ff3">
<link rel="shortcut icon" href="/assets/branding/favicons/favicon.ico?v=2">
<meta name="msapplication-TileColor" content="#364ff3">
<meta name="msapplication-config" content="/assets/branding/favicons/browserconfig.xml?v=2">
<meta name="theme-color" content="#ffffff">

<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="/assets/branding/favicons/apple-touch-icon.png?v=2">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/branding/favicons/favicon-32x32.png?v=2">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/branding/favicons/favicon-16x16.png?v=2">
<link rel="manifest" href="/assets/branding/favicons/site.webmanifest?v=2">
<link rel="mask-icon" href="/assets/branding/favicons/safari-pinned-tab.svg?v=2" color="#364ff3">
<link rel="shortcut icon" href="/assets/branding/favicons/favicon.ico?v=2">
<meta name="msapplication-TileColor" content="#364ff3">
<meta name="msapplication-config" content="/assets/branding/favicons/browserconfig.xml?v=2">
<meta name="theme-color" content="#ffffff">

<!-- Resources -->
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="stylesheet" href="/assets/fontawesome/css/all.min.css">
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/bootstrap.bundle.min.js"></script>
<script defer src="/assets/js/search.min.js"></script>
<script defer src="/assets/js/tooltip.js"></script>
<script defer src="/assets/js/copy-url.js"></script>
<script defer src="/assets/js/mastodon-share.js"></script>
<!-- Resources -->
<link rel="stylesheet" href="/assets/css/main.css">
<link rel="stylesheet" href="/assets/fontawesome/css/all.min.css">
<script src="/assets/js/jquery.min.js"></script>
<script src="/assets/js/bootstrap.bundle.min.js"></script>
<script defer src="/assets/js/search.min.js"></script>
<script defer src="/assets/js/tooltip.js"></script>
<script defer src="/assets/js/copy-url.js"></script>
<script defer src="/assets/js/mastodon-share.js"></script>
4 changes: 2 additions & 2 deletions _layouts/redirect.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="{{ site.lang }}">
<head>
{% include head.html %}
{% capture redirect_to %}{% if site.lang != 'en' %}/{{ site.lang }}{% endif %}{{ page.redirect_to }}{% endcapture %}
{%- capture redirect_to %}{% if site.lang != 'en' %}/{{ site.lang }}{% endif %}{{ page.redirect_to }}{% endcapture %}
<meta http-equiv="refresh" content="0; URL={{ redirect_to }}">
{% include head.html %}
</head>
<body>
<div class="content">
Expand Down
4 changes: 4 additions & 0 deletions _shortlinks/ads.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
redirect_to: /documentation/general/ads
title: documentation.categories.general.ads
---
3 changes: 1 addition & 2 deletions s/subs-gone.md → _shortlinks/subs-gone.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: redirect
sitemap: false
redirect_to: /documentation/bugs-first-aid/database-error
title: documentation.categories.bugs-first-aid.database-error
---
3 changes: 1 addition & 2 deletions s/sync-help.md → _shortlinks/sync-help.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
layout: redirect
sitemap: false
redirect_to: /documentation/general/synchronization
title: documentation.categories.general.synchronization
---
28 changes: 28 additions & 0 deletions s/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: internal
title: titles.shortlinks
robots: block
---

<div class="container-fluid background-gray-100 py-4">
<div class="container">
<h1 class="color-gray-800 weight-700">{% t titles.shortlinks %}</h1>
</div>
</div>

<div class="container-fluid">
<div class="container py-5">
<div class="row">
{%- for link in site.shortlinks %}
<div class="col-12 col-md-4 mb-4 d-flex">
<div class="card shadow-sm project-card">
<a class="stretched-link" href="{{ link.url }}"></a>
<p class="mb-2">{{ link.url }}</p>
<h3 class="mb-2">{% t link.title %}</h3>
<p class="mb-0">{{ site.baseurl }}{{ link.redirect_to }}</p>
</div>
</div>
{%- endfor %}
</div>
</div>
</div>
Loading