-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
155 lines (149 loc) · 6.89 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<meta name=viewport content="width=device-width, initial-scale=1">
<title>How to remove HTML extension from GitHub Pages in 0 easy steps - by Rafał Pocztarski</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<link rel=stylesheet href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel=stylesheet href="https://fonts.googleapis.com/css?family=Roboto:400,100,300&subset=latin,latin-ext">
<style>
body {
font-size: 18px;
font-family: Roboto,'Helvetica Neue',Helvetica,Arial,sans-serif;
}
a,img {
-webkit-transition: all ease-in-out 0.5s;
-moz-transition: all ease-in-out 0.5s;
-ms-transition: all ease-in-out 0.5s;
-o-transition: all ease-in-out 0.5s;
transition: all ease-in-out 0.5s;
}
h1, h2 {
text-align: center;
}
#avatar {
border-radius: 50%;
display: block;
margin: 0 auto;
width: 40px;
height: 40px;
}
#favatar {
border-radius: 50%;
width: 20px;
height: 20px;
margin-top: -4px;
}
.foot {
margin-top: 20px;
text-align: center;
font-weight: bold;
background: #eee;
}
.share {
font-style: italic;
color: #e74c3c;
font-size: 1.6em;
text-align: center;
}
.share .fa {
/*padding: 0.25em;*/
/*border-radius: 100%;*/
color: #fff;
width: 1.6em;
text-align: center;
line-height: 1.6em;
border-radius: 0.8em;
}
.share .fa-twitter {
background: #55acee;
}
.share .fa-facebook {
background: #3b5999;
}
.share .fa-google-plus {
background: #dd4b39;
}
.share .fa-github {
background: transparent;
color: #000;
font-size: 1.7em;
position: relative;
top: 0.15em;
width: 0;
}
.warn .fa {
color: #e74c3c;
}
</style>
</head>
<body>
<div class="jumbotron">
<div class="container">
<h1>How to remove HTML extension from GitHub Pages in 0 easy steps</h1>
<h2>by <a href="https://pocztarski.com/">Rafał Pocztarski</a></h2>
<a href="https://pocztarski.com/"><img id=avatar src="https://s.gravatar.com/avatar/c0a8a4fb43f9c19b3391a7b1066d491f?s=80"></a>
</div>
</div>
<div class="share">
Share it on
<a href="http://twitter.com/share?url=https://rsp.github.io/gh-pages-no-extension/&text=How to remove %23HTML extension from %23GitHubPages in 0 easy steps%0D%0A%23github %23staticsites %23ghpages&via=pocztarski" target="_blank"><i class="fa fa-twitter"></i></a>
<a href="https://www.facebook.com/sharer/sharer.php?u=https://rsp.github.io/gh-pages-no-extension/" target="_blank"><i class="fa fa-facebook"></i></a>
<a href="https://plus.google.com/share?url=https%3A%2F%2Frsp.github.io%2Fgh-pages-no-extension%2F" target="_blank"><i class="fa fa-google-plus"></i></a>
and star it on
<a href="https://github.com/rsp/gh-pages-no-extension" target="_blank"><i class="fa fa-github"></i></a>
</div>
<h2>Step 0: It already works and you don't have to do anything</h2>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<p>I'm not sure if you are already aware of that or not but to remove .html extension from GitHub Pages all you have to do is remove .html extension from your links.</p>
<h2 class="warn"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> See <a href="test1.html">the tests</a> to see which links are insecure!</h2>
<p>In other words it already works and you don't have to do anything. You don't have to use subdirectories, CNAME, redirects, Jekyll _config.yml, YAML front-matter or any other hack suggested all over the web.</p>
<p>For example this file is named <a href="index.html">index.html</a>
but you can access is as those URLs:</p>
<ul>
<li><a href="https://rsp.github.io/gh-pages-no-extension">https://rsp.github.io/gh-pages-no-extension</a></li>
<li><a href="https://rsp.github.io/gh-pages-no-extension/">https://rsp.github.io/gh-pages-no-extension/</a></li>
<li><a href="https://rsp.github.io/gh-pages-no-extension/index">https://rsp.github.io/gh-pages-no-extension/index</a></li>
<li><a href="https://rsp.github.io/gh-pages-no-extension/index.html">https://rsp.github.io/gh-pages-no-extension/index.html</a></li>
</ul>
<p>
some of which may be insecure in some cases (see <a href="https://stackoverflow.com/questions/21244910/remove-html-extension-from-github-pages/29200325#29200325" target="_blank">details</a>).
</p>
<p>See <a href="test1.html">the tests</a> to experiment yourself how it works
and see how those files are named in <a href="https://github.com/rsp/gh-pages-no-extension">the GitHub repository</a>.</p>
<p>
This is based on the information originally posted as an answer to:
<a href="https://stackoverflow.com/questions/21244910/remove-html-extension-from-github-pages/29200325#29200325" target="_blank">Remove html extension from GitHub Pages</a>
quwstion on Stack Overflow. See <a href="https://stackoverflow.com/questions/21244910/remove-html-extension-from-github-pages/29200325#29200325" target="_blank">the full answer</a> for more details.
</p>
</div>
</div>
</div>
<div class="foot">
<a href="https://pocztarski.com/">Rafał Pocztarski <img id=favatar src="https://s.gravatar.com/avatar/c0a8a4fb43f9c19b3391a7b1066d491f?s=80"></a>
<a href="https://twitter.com/pocztarski" target="_blank"><i class="fa fa-twitter"></i></a>
<a href="https://medium.com/@pocztarski" target="_blank"><i class="fa fa-medium"></i></a>
<a href="https://www.facebook.com/pocztarski" target="_blank"><i class="fa fa-facebook"></i></a>
<a href="https://plus.google.com/106457556668508404492" target="_blank"><i class="fa fa-google-plus"></i></a>
<a href="https://www.linkedin.com/in/pocztarski" target="_blank"><i class="fa fa-linkedin"></i></a>
<a href="https://angel.co/pocztarski" target="_blank"><i class="fa fa-angellist"></i></a>
<a href="https://www.flickr.com/photos/pocztarski/" target="_blank"><i class="fa fa-flickr"></i></a>
<a href="https://codepen.io/rsp/" target="_blank"><i class="fa fa-codepen"></i></a>
<a href="https://github.com/rsp" target="_blank"><i class="fa fa-github"></i></a>
<a href="https://stackexchange.com/users/303952/rsp" target="_blank"><i class="fa fa-stack-exchange"></i></a>
<a href="https://stackoverflow.com/users/613198/rsp" target="_blank"><i class="fa fa-stack-overflow"></i></a>
</div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-35668915-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>