mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
wip: 🔕 temporary commit
This commit is contained in:
@ -317,13 +317,18 @@ func (cmd *command) Run(ctx context.Context, log *logger.Logger, cfg *config.Con
|
|||||||
// url=https%3A%2F%2Ferror-pages.goatcounter.com%2Fcounter%2F%2Fuse-template%2Flost-in-space.json
|
// url=https%3A%2F%2Ferror-pages.goatcounter.com%2Fcounter%2F%2Fuse-template%2Flost-in-space.json
|
||||||
// &query=%24.count&label=Used%20times)
|
// &query=%24.count&label=Used%20times)
|
||||||
go func() {
|
go func() {
|
||||||
|
var tpl = url.QueryEscape(cfg.TemplateName)
|
||||||
|
|
||||||
req, reqErr := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(
|
req, reqErr := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(
|
||||||
"https://error-pages.goatcounter.com/count?event=true&p=/use-template/%s", url.QueryEscape(cfg.TemplateName),
|
// https://www.goatcounter.com/help/pixel
|
||||||
|
"https://error-pages.goatcounter.com/count?e=true&p=/use-template/%s&t=%s", tpl, tpl,
|
||||||
), http.NoBody)
|
), http.NoBody)
|
||||||
if reqErr != nil {
|
if reqErr != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.Header.Set("User-Agent", "error-pages") // by default, the User-Agent is "Go-http-client/x.x"
|
||||||
|
|
||||||
resp, respErr := (&http.Client{Timeout: 10 * time.Second}).Do(req) //nolint:mnd // don't care about the response
|
resp, respErr := (&http.Client{Timeout: 10 * time.Second}).Do(req) //nolint:mnd // don't care about the response
|
||||||
if respErr != nil {
|
if respErr != nil {
|
||||||
log.Debug("Cannot send a request to increment the template usage counter", logger.Error(respErr))
|
log.Debug("Cannot send a request to increment the template usage counter", logger.Error(respErr))
|
||||||
|
@ -500,7 +500,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- {{- if l10n_enabled -}} -->
|
<!-- {{- if l10n_enabled -}} -->
|
||||||
<script> // {{ l10nScript }}</script>
|
<script>// {{ l10nScript }}</script>
|
||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -157,7 +157,7 @@
|
|||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
|
|
||||||
<!-- {{- if l10n_enabled -}} -->
|
<!-- {{- if l10n_enabled -}} -->
|
||||||
<script> // {{ l10nScript }}</script>
|
<script>// {{ l10nScript }}</script>
|
||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -456,7 +456,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- {{- if l10n_enabled -}} -->
|
<!-- {{- if l10n_enabled -}} -->
|
||||||
<script> // {{ l10nScript }}</script>
|
<script>// {{ l10nScript }}</script>
|
||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -243,7 +243,7 @@
|
|||||||
</article>
|
</article>
|
||||||
|
|
||||||
<!-- {{- if l10n_enabled -}} -->
|
<!-- {{- if l10n_enabled -}} -->
|
||||||
<script> // {{ l10nScript }}</script>
|
<script>// {{ l10nScript }}</script>
|
||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -180,7 +180,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- {{- if l10n_enabled -}} -->
|
<!-- {{- if l10n_enabled -}} -->
|
||||||
<script> // {{ l10nScript }}</script>
|
<script>// {{ l10nScript }}</script>
|
||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -165,7 +165,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- {{- if l10n_enabled -}} -->
|
<!-- {{- if l10n_enabled -}} -->
|
||||||
<script> // {{ l10nScript }}</script>
|
<script>// {{ l10nScript }}</script>
|
||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -449,7 +449,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<!-- {{- if l10n_enabled -}} -->
|
<!-- {{- if l10n_enabled -}} -->
|
||||||
<script> // {{ l10nScript }}</script>
|
<script>// {{ l10nScript }}</script>
|
||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
273
templates/orient.html
Normal file
273
templates/orient.html
Normal file
File diff suppressed because one or more lines are too long
@ -261,7 +261,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- {{- if l10n_enabled -}} -->
|
<!-- {{- if l10n_enabled -}} -->
|
||||||
<script> // {{ l10nScript }}</script>
|
<script>// {{ l10nScript }}</script>
|
||||||
<!-- {{- end -}} -->
|
<!-- {{- end -}} -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user