跳转至

添加404页面

首先在mkdocs.yml文件中添加custom_dir:

1
2
3
theme:
  name: material
  custom_dir: docs/overrides #覆写路径

docs/overrides文件下新建404.html

树状结构如下:

$ tree -a
.
├── .github
│   ├── .DS_Store
│   └── workflows
│       └── PublishMySite.yml
├── docs
│   └── index.md
│   └──overrides
│       └──assets
│       └──404.html
│       └──main.html
│       └──partials
│          └──comments.html
└── mkdocs.yml

404公益页面

点击展开
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>404 - 页面不存在</title>```
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8" />
    <meta name="description" content="公益404页面是由腾讯公司员工志愿者自主发起的互联网公益活动。" />
    <link rel="icon" href="data:image/gif;base64,R0lGODdhIAAgANUAAAAAAAgFBgYICAwMDBAPDxAQDxQTFBUYFxcaGRwcHCQkJCQoJykqKTQ0ND09PUJCQktMTFZWVltcXF1hYGNjY2doaGpqanNzc3d5eHp6eoODg4uLi5eXl5mamqOjo62tra+wr7S0tLe5uLu7u7/AwMPEw83NzdbX1tfa2dra2uTk5Ovr6+/w7/T09Pj39/f4+P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAADEALAAAAAAgACAAAAb/QJhwOGyZOpIGQ6FgNCQcU4tIrcJaIwlgy+1uJaOplZqydBOSzGaTkSS6lNN4ONoOAJRQajV0rVAgFF0jcyEAbw9hc1cjD4cAIVZ1DAAXKotEKxkAlIREJ48bYphFGwAKAHJCLWaVo6RFF1sWYnUDDpewVSoOd4QtWgCeMCmXLaqfUyopdF9GWxRiKQAVKh3CRHUdKhQEzFeCAEdbH6uOh28A3ypbCQhbEGIfWx2CCd8wJhB2CpFDIQvuAIBgYkiKN0kASOAzRJYjBwyFrGgAwNGFTFqUAMjwYogpA1woMFwRDgDIDUQ2LQGAcoiGLRr2QRgp8yUADURMMWFJRYMH3BglJOQSwq0EDA84c56ilOGVLisqKUaISKVFihIjRJRI4XTIiggAGggygKxICAoguSDI0/UEyAnXAJTLJMtLlwxUYcwD0MEEtIgtBKGi0OHDh3qn8IwKvEVKuGHXGAwI8apFCAOUOvxzBqNOAVzgthi1UgKasl7YrtS9MMXI6DEjpKieNWoaSA1dF7V4+QafkNKoLOlSIQsVCUkmATgYwWIRCxEOAByANKc0AAEAJnzYI6bFihQfBAUQjSlF3S0GIqjZgCFC2i0XfM/BUtJuSEVPjdRTwsQJYdljBAEAOw==" />
    <title>404 您访问的页面搞丢了</title>
    <script src="https://volunteer.cdn-go.cn/404/latest/404.js" rendertarget="404DlV"></script>
    <style>
        body {
            overflow-x: hidden;
            max-width: 100vw;
            margin: 0;
            padding: 0;
            background-color: rgba(0, 0, 0, 0);
            color: white;
            text-align: center;
        }
        .container {
            position: relative;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 1600px;
            height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }
        .background-img {
            width: 100%;
            max-width: 1600px;
            filter: brightness(75%);
        }
        .content {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 98vw;
            max-width: 1600px;
            text-align: center;
        }
        .content h1 {
            font-size: 128px;
            font-weight: 800;
            margin: 0;
        }
        .content p {
            font-size: 28px;
            margin: 0;
        }
        .content i {
            font-size: 1.2em;
        }
        .footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 98vw;
            max-width: 1600px;
            font-size: 0.75em;
            margin-top: 20px;
        }
        .footer img {
            width: 160px;
        }
        .footer div {
            text-align: right;
        }
        .footer a {
            /* color: lightgray; */
            font-size: 0.8em;
        }
    </style>
</head>
<body>
    <div class="container">
        <img class="background-img" alt="404!您要访问的页面走丢了!" src="https://volunteer.cdn-go.cn/404/latest/img/dream4school.jpg" />
        <div class="content">
            <h1>404 NOT Found</h1>
            <p>您访问的页面走丢在寻找梦想的路上了</p>
            <p>不过您还可以和腾讯志愿者一起</p>
            <i><b>为孩子们点亮一个梦想</b></i>
        </div>
        <div class="footer">
            <a href="https://volunteer.cdn-go.cn/404/latest/img/dream4schoolQR.png">
                <img src="https://volunteer.cdn-go.cn/404/latest/img/dream4schoolQR.png" alt="点击进入支持页面" />
                <br />扫码点亮一个梦想
            </a>
            <div>
                <p>照片拍摄于湖南省岳阳市平江县三市镇新村完小</p>
                <p>拍摄时间:二零二三年七月十一日</p>
                <p>(感恩基金会供稿)</p>
                <a href="https://support.qq.com/products/378306">我要反馈</a>
            </div>
        </div>
    </div>
</body>
</html>

404骰子页面

目前更换了新的404页面:

点击展开
  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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>404</title>
    <style>
      body {
        background: #000;
        height: 100vh;
        overflow: hidden;
        display: flex;
        font-family: Anton, sans-serif;
        justify-content: center;
        align-items: center;
        -webkit-perspective: 1000px;
        perspective: 1000px;
      }

      div {
        -webkit-transform-style: preserve-3d;
        transform-style: preserve-3d;
      }

      .rail {
        position: absolute;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        -webkit-transform: rotateX(-30deg) rotateY(-30deg);
        transform: rotateX(-30deg) rotateY(-30deg);
      }

      .rail .stamp {
        position: absolute;
        width: 200px;
        height: 200px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #141414;
        color: #fff;
        font-size: 7rem;
      }

      .rail .stamp:nth-child(1) {
        -webkit-animation: stampSlide 40s -2.3s linear infinite;
        animation: stampSlide 40s -2.3s linear infinite;
      }

      .rail .stamp:nth-child(2) {
        -webkit-animation: stampSlide 40s -4.3s linear infinite;
        animation: stampSlide 40s -4.3s linear infinite;
      }

      .rail .stamp:nth-child(3) {
        -webkit-animation: stampSlide 40s -6.3s linear infinite;
        animation: stampSlide 40s -6.3s linear infinite;
      }

      .rail .stamp:nth-child(4) {
        -webkit-animation: stampSlide 40s -8.3s linear infinite;
        animation: stampSlide 40s -8.3s linear infinite;
      }

      .rail .stamp:nth-child(5) {
        -webkit-animation: stampSlide 40s -10.3s linear infinite;
        animation: stampSlide 40s -10.3s linear infinite;
      }

      .rail .stamp:nth-child(6) {
        -webkit-animation: stampSlide 40s -12.3s linear infinite;
        animation: stampSlide 40s -12.3s linear infinite;
      }

      .rail .stamp:nth-child(7) {
        -webkit-animation: stampSlide 40s -14.3s linear infinite;
        animation: stampSlide 40s -14.3s linear infinite;
      }

      .rail .stamp:nth-child(8) {
        -webkit-animation: stampSlide 40s -16.3s linear infinite;
        animation: stampSlide 40s -16.3s linear infinite;
      }

      .rail .stamp:nth-child(9) {
        -webkit-animation: stampSlide 40s -18.3s linear infinite;
        animation: stampSlide 40s -18.3s linear infinite;
      }

      .rail .stamp:nth-child(10) {
        -webkit-animation: stampSlide 40s -20.3s linear infinite;
        animation: stampSlide 40s -20.3s linear infinite;
      }

      .rail .stamp:nth-child(11) {
        -webkit-animation: stampSlide 40s -22.3s linear infinite;
        animation: stampSlide 40s -22.3s linear infinite;
      }

      .rail .stamp:nth-child(12) {
        -webkit-animation: stampSlide 40s -24.3s linear infinite;
        animation: stampSlide 40s -24.3s linear infinite;
      }

      .rail .stamp:nth-child(13) {
        -webkit-animation: stampSlide 40s -26.3s linear infinite;
        animation: stampSlide 40s -26.3s linear infinite;
      }

      .rail .stamp:nth-child(14) {
        -webkit-animation: stampSlide 40s -28.3s linear infinite;
        animation: stampSlide 40s -28.3s linear infinite;
      }

      .rail .stamp:nth-child(15) {
        -webkit-animation: stampSlide 40s -30.3s linear infinite;
        animation: stampSlide 40s -30.3s linear infinite;
      }

      .rail .stamp:nth-child(16) {
        -webkit-animation: stampSlide 40s -32.3s linear infinite;
        animation: stampSlide 40s -32.3s linear infinite;
      }

      .rail .stamp:nth-child(17) {
        -webkit-animation: stampSlide 40s -34.3s linear infinite;
        animation: stampSlide 40s -34.3s linear infinite;
      }

      .rail .stamp:nth-child(18) {
        -webkit-animation: stampSlide 40s -36.3s linear infinite;
        animation: stampSlide 40s -36.3s linear infinite;
      }

      .rail .stamp:nth-child(19) {
        -webkit-animation: stampSlide 40s -38.3s linear infinite;
        animation: stampSlide 40s -38.3s linear infinite;
      }

      .rail .stamp:nth-child(20) {
        -webkit-animation: stampSlide 40s -40.3s linear infinite;
        animation: stampSlide 40s -40.3s linear infinite;
      }

      @-webkit-keyframes stampSlide {
        0% {
          -webkit-transform: rotateX(90deg) rotateZ(-90deg) translateZ(-200px)
            translateY(130px);
          transform: rotateX(90deg) rotateZ(-90deg) translateZ(-200px)
            translateY(130px);
        }

        100% {
          -webkit-transform: rotateX(90deg) rotateZ(-90deg) translateZ(-200px)
            translateY(-3870px);
          transform: rotateX(90deg) rotateZ(-90deg) translateZ(-200px)
            translateY(-3870px);
        }
      }

      @keyframes stampSlide {
        0% {
          -webkit-transform: rotateX(90deg) rotateZ(-90deg) translateZ(-200px)
            translateY(130px);
          transform: rotateX(90deg) rotateZ(-90deg) translateZ(-200px)
            translateY(130px);
        }

        100% {
          -webkit-transform: rotateX(90deg) rotateZ(-90deg) translateZ(-200px)
            translateY(-3870px);
          transform: rotateX(90deg) rotateZ(-90deg) translateZ(-200px)
            translateY(-3870px);
        }
      }

      .world {
        -webkit-transform: rotateX(-30deg) rotateY(-30deg);
        transform: rotateX(-30deg) rotateY(-30deg);
      }

      .world .forward {
        position: absolute;
        -webkit-animation: slide 2s linear infinite;
        animation: slide 2s linear infinite;
      }

      .world .box {
        width: 200px;
        height: 200px;
        -webkit-transform-origin: 100% 100%;
        transform-origin: 100% 100%;
        -webkit-animation: roll 2s cubic-bezier(1, 0.01, 1, 1) infinite;
        animation: roll 2s cubic-bezier(1, 0.01, 1, 1) infinite;
      }

      .world .box .wall {
        position: absolute;
        width: 200px;
        height: 200px;
        background: rgba(10, 10, 10, 0.8);
        border: 1px solid #fafafa;
        box-sizing: border-box;
      }

      .world .box .wall::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        color: #fff;
        font-size: 7rem;
      }

      .world .box .wall:nth-child(1) {
        -webkit-transform: translateZ(100px);
        transform: translateZ(100px);
      }

      .world .box .wall:nth-child(2) {
        -webkit-transform: rotateX(180deg) translateZ(100px);
        transform: rotateX(180deg) translateZ(100px);
      }

      .world .box .wall:nth-child(3) {
        -webkit-transform: rotateX(90deg) translateZ(100px);
        transform: rotateX(90deg) translateZ(100px);
      }

      .world .box .wall:nth-child(3)::before {
        -webkit-transform: rotateX(180deg) rotateZ(90deg) translateZ(-1px);
        transform: rotateX(180deg) rotateZ(90deg) translateZ(-1px);
        -webkit-animation: zeroFour 4s -2s linear infinite;
        animation: zeroFour 4s -2s linear infinite;
      }

      .world .box .wall:nth-child(4) {
        -webkit-transform: rotateX(-90deg) translateZ(100px);
        transform: rotateX(-90deg) translateZ(100px);
      }

      .world .box .wall:nth-child(4)::before {
        -webkit-transform: rotateX(180deg) rotateZ(-90deg) translateZ(-1px);
        transform: rotateX(180deg) rotateZ(-90deg) translateZ(-1px);
        -webkit-animation: zeroFour 4s -2s linear infinite;
        animation: zeroFour 4s -2s linear infinite;
      }

      .world .box .wall:nth-child(5) {
        -webkit-transform: rotateY(90deg) translateZ(100px);
        transform: rotateY(90deg) translateZ(100px);
      }

      .world .box .wall:nth-child(5)::before {
        -webkit-transform: rotateX(180deg) translateZ(-1px);
        transform: rotateX(180deg) translateZ(-1px);
        -webkit-animation: zeroFour 4s linear infinite;
        animation: zeroFour 4s linear infinite;
      }

      .world .box .wall:nth-child(6) {
        -webkit-transform: rotateY(-90deg) translateZ(100px);
        transform: rotateY(-90deg) translateZ(100px);
      }

      .world .box .wall:nth-child(6)::before {
        -webkit-transform: rotateX(180deg) rotateZ(180deg) translateZ(-1px);
        transform: rotateX(180deg) rotateZ(180deg) translateZ(-1px);
        -webkit-animation: zeroFour 4s linear infinite;
        animation: zeroFour 4s linear infinite;
      }

      @-webkit-keyframes zeroFour {
        0% {
          content: "4";
        }

        100% {
          content: "0";
        }
      }

      @keyframes zeroFour {
        0% {
          content: "4";
        }

        100% {
          content: "0";
        }
      }

      @-webkit-keyframes roll {
        0% {
          -webkit-transform: rotateZ(0);
          transform: rotateZ(0);
        }

        85% {
          -webkit-transform: rotateZ(90deg);
          transform: rotateZ(90deg);
        }

        87% {
          -webkit-transform: rotateZ(88deg);
          transform: rotateZ(88deg);
        }

        90% {
          -webkit-transform: rotateZ(90deg);
          transform: rotateZ(90deg);
        }

        100% {
          -webkit-transform: rotateZ(90deg);
          transform: rotateZ(90deg);
        }
      }

      @keyframes roll {
        0% {
          -webkit-transform: rotateZ(0);
          transform: rotateZ(0);
        }

        85% {
          -webkit-transform: rotateZ(90deg);
          transform: rotateZ(90deg);
        }

        87% {
          -webkit-transform: rotateZ(88deg);
          transform: rotateZ(88deg);
        }

        90% {
          -webkit-transform: rotateZ(90deg);
          transform: rotateZ(90deg);
        }

        100% {
          -webkit-transform: rotateZ(90deg);
          transform: rotateZ(90deg);
        }
      }

      @-webkit-keyframes slide {
        0% {
          -webkit-transform: translateX(0);
          transform: translateX(0);
        }

        100% {
          -webkit-transform: translateX(-200px);
          transform: translateX(-200px);
        }
      }

      @keyframes slide {
        0% {
          -webkit-transform: translateX(0);
          transform: translateX(0);
        }

        100% {
          -webkit-transform: translateX(-200px);
          transform: translateX(-200px);
        }
      }
    </style>
  </head>
  <body>
    <div class="rail">
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
      <div class="stamp four">4</div>
      <div class="stamp zero">0</div>
    </div>
    <div class="world">
      <div class="forward">
        <div class="box">
          <div class="wall"></div>
          <div class="wall"></div>
          <div class="wall"></div>
          <div class="wall"></div>
          <div class="wall"></div>
          <div class="wall"></div>
        </div>
      </div>
    </div>
  </body>
</html>