clone url: git://git.m455.casa/m455.casa
html/posts/redirecting-your-github-pages-website-to-a-dat-url.html
1 | <!DOCTYPE html> |
2 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> |
3 | <head> |
4 | <meta charset="utf-8" /> |
5 | <meta name="generator" content="pandoc" /> |
6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> |
7 | <title>Redirecting your GitHub Pages website to a Dat URL</title> |
8 | <style> |
9 | code{white-space: pre-wrap;} |
10 | span.smallcaps{font-variant: small-caps;} |
11 | span.underline{text-decoration: underline;} |
12 | div.column{display: inline-block; vertical-align: top; width: 50%;} |
13 | div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} |
14 | ul.task-list{list-style: none;} |
15 | </style> |
16 | <link rel="stylesheet" href="/assets/archive.css"> |
17 | </head> |
18 | <body> |
19 | <main> |
20 | <h2 id="redirecting-your-github-pages-website-to-a-dat-url">Redirecting your GitHub Pages website to a Dat URL</h2> |
21 | <p>2019-12-07 00:00</p> |
22 | <p>This guide will teach you how to automatically redirect users from your <a href="https://pages.github.com/">GitHub Pages website</a> to a <a href="https://dat.foundation/">Dat</a> website (a <code>dat://</code> link) when they are accessing your GitHub Pages website using <a href="https://beakerbrowser.com">Beaker Browser</a>.</p> |
23 | <p>This guide is intended for users who dabble, or want to dabble, with the Dat protocol or decentralized/distributed technology.</p> |
24 | <p>This guide consists of the following sections:</p> |
25 | <ul> |
26 | <li><a href="#requirements">Requirements</a></li> |
27 | <li><a href="#conventions-used-in-this-guide">Conventions used in this guide</a></li> |
28 | <li><a href="#enabling-dat">Enabling Dat</a></li> |
29 | </ul> |
30 | <h3 id="conventions-used-in-this-guide">Conventions used in this guide</h3> |
31 | <ul> |
32 | <li><strong>Note</strong>: Signifies additional information</li> |
33 | <li><strong>Tip</strong>: Signifies an alternative procedure for completing a step</li> |
34 | <li><strong>Warning</strong>: Signifies that damage, such as data loss, may occur</li> |
35 | <li><strong>Example</strong>: Shows how a procedure would be performed in a real scenario</li> |
36 | <li><code>Inline code and code blocks</code>: Signify package names, filenames, file contents, or commands</li> |
37 | <li><code><variable></code> Signifies that the text between the <code><</code> and <code>></code> should be replaced, and the <code><</code> and <code>></code> should be removed</li> |
38 | <li><strong>Bold font</strong> Signifies user interface items</li> |
39 | </ul> |
40 | <h3 id="requirements">Requirements</h3> |
41 | <p>For this guide, ensure you have:</p> |
42 | <ul> |
43 | <li>A GitHub account</li> |
44 | <li>A <a href="https://pages.github.com/#user-site">GitHub Pages website repository</a></li> |
45 | <li><a href="https://docs.datproject.org/docs/install">Installed Dat</a></li> |
46 | </ul> |
47 | <h3 id="enabling-dat">Enabling Dat</h3> |
48 | <ol type="1"> |
49 | <li><p>Add a <code>.well-known/dat</code> file to the root folder of your GitHub Pages repository.</p></li> |
50 | <li><p>Inside the <code>.well-known/dat</code> file, add the following:</p> |
51 | <pre><code> dat://your-dat-url/ |
52 | TTL=3600</code></pre> |
53 | <aside class="border"> |
54 | <p> |
55 | <p><strong>Note</strong>: Make sure you include the <code>/</code> at the end of the <code>your-dat-url</code>. This seemed to be a make-or-break for me when trying to get this to work.</p> |
56 | </p> |
57 | </aside></li> |
58 | <li><p>Add a <code>_config.yml</code> file to the root folder of your GitHub Pages repository.</p></li> |
59 | <li><p>Inside the <code>_config.yml</code> file, add the following:</p> |
60 | <pre><code> include: [".well-known"]</code></pre></li> |
61 | </ol> |
62 | </main> |
63 | </body> |
64 | </html> |