Following is the index.html generated for https://termux.dev and will be roughly same for other redirected pages. Note that this includes the head.html and footer.html which will then trigger further requests for main.css and minima-social-icons.svg, but they should be cached, so further page loads should not be affected, assuming redirection is for a normal site page, since otherwise there will be a performance hit.
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"><!-- Begin Jekyll SEO tag v2.8.0 -->
<title>Termux | The main termux site and help pages.</title>
<meta name="generator" content="Jekyll v3.9.3" />
<meta property="og:title" content="Termux" />
<meta property="og:locale" content="en" />
<meta name="description" content="The main termux site and help pages." />
<meta property="og:description" content="The main termux site and help pages." />
<link rel="canonical" href="http://localhost:4000/" />
<meta property="og:url" content="http://localhost:4000/" />
<meta property="og:site_name" content="Termux" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Termux" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"WebSite","description":"The main termux site and help pages.","headline":"Termux","name":"Termux","url":"http://localhost:4000/"}</script>
<!-- End Jekyll SEO tag -->
<link rel="stylesheet" href="/assets/main.css"><link type="application/atom+xml" rel="alternate" href="http://localhost:4000/feed.xml" title="Termux" /></head>
<body><header class="site-header" role="banner">
<div class="wrapper"><a class="site-title" rel="author" href="/">Termux</a><nav class="site-nav">
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger">
<span class="menu-icon">
<svg viewBox="0 0 18 15" width="18px" height="15px">
<path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
</svg>
</span>
</label>
<div class="trigger"><a class="page-link" href="/en/docs/index.html">Docs</a><a class="page-link" href="/en/posts/index.html">Posts</a><a class="page-link" href="https://packages.termux.dev">Packages</a><a class="page-link" href="/en/donate">Donate</a><a class="page-link" href="/en/privacy-policy">Privacy Policy</a></div>
</nav></div>
</header>
<main class="page-content" aria-label="Content">
<link rel="canonical" href="http://localhost:4000/en/">
<script>location="http://localhost:4000/en/"</script>
<meta http-equiv="refresh" content="0; url=http://localhost:4000/en/">
<meta name="robots" content="noindex">
<h1>Redirecting…</h1>
<a href="http://localhost:4000/en/">Click here if you are not redirected.</a>
</main><footer class="site-footer h-card">
<data class="u-url" href="/"></data>
<div class="wrapper">
<h2 class="footer-heading">Termux</h2>
<div class="footer-col-wrapper">
<div class="footer-col footer-col-1">
<ul class="contact-list">
<li class="p-name"><li><a href="https://github.com/termux/termux.github.io">Site Source</a></li></li></ul>
</div>
<div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/termux"><svg class="svg-icon"><use xlink:href="/assets/minima-social-icons.svg#github"></use></svg> <span class="username">termux</span></a></li><li><a href="https://www.twitter.com/termuxdevs"><svg class="svg-icon"><use xlink:href="/assets/minima-social-icons.svg#twitter"></use></svg> <span class="username">termuxdevs</span></a></li></ul>
</div>
<div class="footer-col footer-col-3">
<p>Terminal emulator and Linux environment for Android.</p>
</div>
</div>
</div>
</footer>
</body>
</html>
<!DOCTYPE html>
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting…</title>
<link rel="canonical" href="https://termux.dev/en/">
<script>location="https://termux.dev/en/"</script>
<meta http-equiv="refresh" content="0; url=https://termux.dev/en/">
<meta name="robots" content="noindex">
<h1>Redirecting…</h1>
<a href="https://termux.dev/en/">Click here if you are not redirected.</a>
</html>
Now let's look at the real issues.
Commit message Changed: added redirect template is not following correct uppercase for first letter of description (and also tense) as per current git history. The added needs to be Add. And you are using a layout, not a template. Moreover, if you were "adding" something, the proper commit message type would be Added, not Changed, but you are technically changing something that already exists. A more appropriate message would be Changed: Use custom redirect layout that loads default site layout instead of the one by jekyll-redirect-from. But this still doesn't cover, "why" you made this change. The description should mention your mastodon verification issue, so that anyone who intends to make changes to the file can know that why this was necessary and not to break verification. Check https://github.com/termux/termux-app#for-maintainers-and-contributors for info on conventional commit format that is used by repos I manage.
There needs to be empty line after front matter in redirect.html as per other files.
When you use a layout value in front matter it pulls the current content of the file, and provides it to the specified layout as {{ content }}. So when you use default layout in the redirect.html that contains html content, instead of text content, you are providing it as the body. That's what I meant when I said duplicate html, both redirect.html and default.html have html tags cause they are expected to be standalone pages. What that has done is that
http-equiv duplicated, one in <head> as meta http-equiv="X-UA-Compatible" content="IE=edge"> (from head.html) and one in <body> as <meta http-equiv="refresh" content="0; url=http://localhost:4000/en/"> (from redirect.html). The other <meta> values like robots are also pulled into <body> basically creating an invalid document as <meta> tags should be in <head>, even if some browser forgives it.
https://stackoverflow.com/questions/1447842/what-happens-if-the-meta-tags-are-present-in-the-document-body
Either fix all the above issues if you want to show header and footer for redirect pages or use following as redirect.html and under if page.redirect.from == "/" add your required mastodon tag.
Following is the
index.html
generated for https://termux.dev and will be roughly same for other redirected pages. Note that this includes thehead.html
andfooter.html
which will then trigger further requests formain.css
andminima-social-icons.svg
, but they should be cached, so further page loads should not be affected, assuming redirection is for a normal site page, since otherwise there will be a performance hit.Following is the current one as per https://github.com/jekyll/jekyll-redirect-from/blob/master/lib/jekyll-redirect-from/redirect.html
Now let's look at the real issues.
Commit message
Changed: added redirect template
is not following correct uppercase for first letter of description (and also tense) as per current git history. Theadded
needs to beAdd
. And you are using alayout
, not a template. Moreover, if you were "adding" something, the proper commit message type would beAdded
, notChanged
, but you are technically changing something that already exists. A more appropriate message would beChanged: Use custom redirect layout that loads default site layout instead of the one by jekyll-redirect-from
. But this still doesn't cover, "why" you made this change. The description should mention your mastodon verification issue, so that anyone who intends to make changes to the file can know that why this was necessary and not to break verification. Check https://github.com/termux/termux-app#for-maintainers-and-contributors for info on conventional commit format that is used by repos I manage.There needs to be empty line after front matter in
redirect.html
as per other files.When you use a
layout
value in front matter it pulls the current content of the file, and provides it to the specified layout as{{ content }}
. So when you usedefault
layout in theredirect.html
that containshtml
content, instead of text content, you are providing it as the body. That's what I meant when I said duplicatehtml
, bothredirect.html
anddefault.html
havehtml
tags cause they are expected to be standalone pages. What that has done is thathttp-equiv
duplicated, one in<head>
asmeta http-equiv="X-UA-Compatible" content="IE=edge">
(fromhead.html
) and one in<body>
as<meta http-equiv="refresh" content="0; url=http://localhost:4000/en/">
(fromredirect.html
). The other<meta>
values likerobots
are also pulled into<body>
basically creating an invalid document as<meta>
tags should be in<head>
, even if some browser forgives it. https://stackoverflow.com/questions/1447842/what-happens-if-the-meta-tags-are-present-in-the-document-body<link rel="canonical" href="http://localhost:4000/" />
is added to<head>
and<link rel="canonical" href="http://localhost:4000/en/">
to<body>
, when only<link rel="canonical" href="https://termux.dev/en/">
must exist in<head>
instead. https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls#rel-canonical-link-method<script>location="http://localhost:4000/en/"</script>
has also been moved to<body>
, which would also cause problems. https://github.com/jekyll/jekyll-redirect-from/commit/97c2841d4b971c8e5b5b4f7d219891cd229c6636 https://stackoverflow.com/questions/436411/where-should-i-put-script-tags-in-html-markupEither fix all the above issues if you want to show header and footer for redirect pages or use following as
redirect.html
and underif page.redirect.from == "/"
add your required mastodon tag.