clone url: git://git.m455.casa/m455.casa
html/archive/2019/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 | <style> |
17 | body { |
18 | line-height: 1.5; |
19 | font-family: sans-serif; |
20 | font-size: 18px; |
21 | margin: 20px auto; |
22 | max-width: 630px; |
23 | } |
24 |
|
25 | a { |
26 | color: blue; |
27 | } |
28 |
|
29 | code, pre { |
30 | background-color: #fddee3; |
31 | font-size: 14px; |
32 | } |
33 |
|
34 | pre { |
35 | padding: 25px 25px; |
36 | overflow: auto; |
37 | } |
38 |
|
39 | pre code { |
40 | white-space: pre; |
41 | } |
42 |
|
43 | img { |
44 | max-width: 100%; |
45 | } |
46 |
|
47 | table { |
48 | border-collapse: collapse; |
49 | } |
50 |
|
51 | table caption { |
52 | font-weight: bold; |
53 | margin: 10px 0px; |
54 | text-align: left; |
55 | } |
56 |
|
57 | th, td { |
58 | border: 1px solid #000; |
59 | padding: 4px; |
60 | } |
61 |
|
62 | blockquote { |
63 | border-left: 3px solid #000; |
64 | padding-left: 10px; |
65 | } |
66 |
|
67 | .border { |
68 | border: 1px solid #000; |
69 | margin: 25px 0px; |
70 | padding: 5px 25px; |
71 | } |
72 |
|
73 | @media only screen and (max-width: 700px) { |
74 | body { |
75 | margin: 10px; |
76 | } |
77 | } |
78 |
|
79 | @media (prefers-color-scheme: dark) { |
80 | body { |
81 | background-color: #111; |
82 | color: #eee; |
83 | } |
84 | a { |
85 | color: #009fff; |
86 | } |
87 | code, pre { |
88 | background-color: #111; |
89 | color: #fd6363; |
90 | } |
91 | pre { |
92 | padding: 15px 25px; |
93 | } |
94 | blockquote { |
95 | border-left: 3px solid #666; |
96 | } |
97 | .border, th, td { |
98 | border: 1px solid #666; |
99 | } |
100 | } |
101 | </style> |
102 | </head> |
103 | <body> |
104 | <main> |
105 | <h2 id="redirecting-your-github-pages-website-to-a-dat-url">Redirecting your GitHub Pages website to a Dat URL</h2> |
106 | <p>2019-12-07 00:00</p> |
107 | <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> |
108 | <p>This guide is intended for users who dabble, or want to dabble, with the Dat protocol or decentralized/distributed technology.</p> |
109 | <p>This guide consists of the following sections:</p> |
110 | <ul> |
111 | <li><a href="#requirements">Requirements</a></li> |
112 | <li><a href="#conventions-used-in-this-guide">Conventions used in this guide</a></li> |
113 | <li><a href="#enabling-dat">Enabling Dat</a></li> |
114 | </ul> |
115 | <h3 id="conventions-used-in-this-guide">Conventions used in this guide</h3> |
116 | <ul> |
117 | <li><strong>Note</strong>: Signifies additional information</li> |
118 | <li><strong>Tip</strong>: Signifies an alternative procedure for completing a step</li> |
119 | <li><strong>Warning</strong>: Signifies that damage, such as data loss, may occur</li> |
120 | <li><strong>Example</strong>: Shows how a procedure would be performed in a real scenario</li> |
121 | <li><code>Inline code and code blocks</code>: Signify package names, filenames, file contents, or commands</li> |
122 | <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> |
123 | <li><strong>Bold font</strong> Signifies user interface items</li> |
124 | </ul> |
125 | <h3 id="requirements">Requirements</h3> |
126 | <p>For this guide, ensure you have:</p> |
127 | <ul> |
128 | <li>A GitHub account</li> |
129 | <li>A <a href="https://pages.github.com/#user-site">GitHub Pages website repository</a></li> |
130 | <li><a href="https://docs.datproject.org/docs/install">Installed Dat</a></li> |
131 | </ul> |
132 | <h3 id="enabling-dat">Enabling Dat</h3> |
133 | <ol type="1"> |
134 | <li><p>Add a <code>.well-known/dat</code> file to the root folder of your GitHub Pages repository.</p></li> |
135 | <li><p>Inside the <code>.well-known/dat</code> file, add the following:</p> |
136 | <pre><code> dat://your-dat-url/ |
137 | TTL=3600</code></pre> |
138 | <aside class="border"> |
139 | <p> |
140 | <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> |
141 | </p> |
142 | </aside></li> |
143 | <li><p>Add a <code>_config.yml</code> file to the root folder of your GitHub Pages repository.</p></li> |
144 | <li><p>Inside the <code>_config.yml</code> file, add the following:</p> |
145 | <pre><code> include: [".well-known"]</code></pre></li> |
146 | </ol> |
147 | </main> |
148 | </body> |
149 | </html> |