Resolve #66 : Add noindex to 404.html

Signed-off-by: GitHub Action <action@github.com>
This commit is contained in:
GitHub Action
2024-04-15 14:40:47 +00:00
parent b1e128d15b
commit 91fef8025c
2 changed files with 11 additions and 2 deletions

View File

@ -90,7 +90,12 @@ Use [RealFaviconGenerator](https://realfavicongenerator.net/) to generate these
* safari-pinned-tab.svg * safari-pinned-tab.svg
* site.webmanifest * site.webmanifest
If your favicon source is in the svg format, save it as `assets/images/favicon.svg` to enable svg favicon for supported browsers. #### SVG Favicons
If your favicon is in SVG format, there are two ways to implement the same in this theme.
* If you are looking for a clean directory structure, place your favicon as `favicon.svg` in `static` directory. **In this mode, favicon will not be minified by Hugo**
* If you want your generated site to be as light as possible, place your favicon as `favicon.svg` in `assets/images`. **In this mode, favicon will be minified by Hugo**
### Social icons ### Social icons

View File

@ -2,12 +2,16 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
{{- if (not (in .Page.RelPermalink "404")) -}}
<meta name="robots" content="index, follow"> <meta name="robots" content="index, follow">
<meta name="revisit-after" content="15 days"> <meta name="revisit-after" content="15 days">
{{- else -}}
<meta name="robots" content="noindex, nofollow, noarchive">
{{- end -}}
<link rel="author" href="{{"humans.txt" | relURL}}"> <link rel="author" href="{{"humans.txt" | relURL}}">
<link rel="apple-touch-icon" sizes="180x180" href="{{"apple-touch-icon.png" | relURL}}"> <link rel="apple-touch-icon" sizes="180x180" href="{{"apple-touch-icon.png" | relURL}}">
{{- if (fileExists "static/favicon.ico") -}} {{- if (fileExists "static/favicon.ico") -}}
<link rel="icon" href="{{"favicon.ico" | relURL}}" type="image/x-icon" sizes="48x48"> <link rel="icon" href="{{"favicon.ico" | relURL}}" type="image/x-icon">
{{- end -}} {{- end -}}
{{ $favicon := "images/favicon.svg" }} {{ $favicon := "images/favicon.svg" }}
{{- if (fileExists (printf "assets/%s" $favicon)) -}} {{- if (fileExists (printf "assets/%s" $favicon)) -}}