mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-31 15:22:39 +00:00
Make unlisted gists not SEO crawlable (#78)
This commit is contained in:
parent
038d81df2d
commit
5bb5886770
2 changed files with 8 additions and 0 deletions
|
@ -80,6 +80,10 @@ func gistInit(next echo.HandlerFunc) echo.HandlerFunc {
|
|||
setData(ctx, "hasLiked", hasLiked)
|
||||
}
|
||||
|
||||
if gist.Private {
|
||||
setData(ctx, "NoIndex", true)
|
||||
}
|
||||
|
||||
return next(ctx)
|
||||
}
|
||||
}
|
||||
|
|
4
templates/base/base_header.html
vendored
4
templates/base/base_header.html
vendored
|
@ -3,6 +3,10 @@
|
|||
<html lang="en" class="h-full">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
{{ if .NoIndex }}
|
||||
<meta name="robots" content="noindex, follow">
|
||||
{{ end }}
|
||||
|
||||
<script>
|
||||
const checkTheme = () => {
|
||||
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
|
|
Loading…
Reference in a new issue