Make unlisted gists not SEO crawlable (#78)
هذا الالتزام موجود في:
@@ -80,6 +80,10 @@ func gistInit(next echo.HandlerFunc) echo.HandlerFunc {
|
|||||||
setData(ctx, "hasLiked", hasLiked)
|
setData(ctx, "hasLiked", hasLiked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if gist.Private {
|
||||||
|
setData(ctx, "NoIndex", true)
|
||||||
|
}
|
||||||
|
|
||||||
return next(ctx)
|
return next(ctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
<html lang="en" class="h-full">
|
<html lang="en" class="h-full">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
{{ if .NoIndex }}
|
||||||
|
<meta name="robots" content="noindex, follow">
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const checkTheme = () => {
|
const checkTheme = () => {
|
||||||
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم