Go to file
2022-04-12 15:34:53 +07:00
.github/ISSUE_TEMPLATE first commit 2022-04-10 15:20:41 +07:00
archetypes first commit 2022-04-10 15:20:41 +07:00
assets removed unecessary font fetch 2022-04-10 20:36:00 +07:00
data first commit 2022-04-10 15:20:41 +07:00
exampleSite first commit 2022-04-10 15:20:41 +07:00
i18n first commit 2022-04-10 15:20:41 +07:00
images first commit 2022-04-10 15:20:41 +07:00
layouts Added event for plausible, and bypass adblock filter 2022-04-11 22:07:09 +07:00
static redirect js fetch on shortcode 2022-04-10 16:58:44 +07:00
.gitignore first commit 2022-04-10 15:20:41 +07:00
LICENSE first commit 2022-04-10 15:20:41 +07:00
local_git_config.sh first commit 2022-04-10 15:20:41 +07:00
netlify.toml first commit 2022-04-10 15:20:41 +07:00
README.md Readme Update 2022-04-12 15:34:53 +07:00
task_regen_toc.sh first commit 2022-04-10 15:20:41 +07:00
task_serve.sh first commit 2022-04-10 15:20:41 +07:00
theme.toml first commit 2022-04-10 15:20:41 +07:00

Infidel Cupper

Maintenance

This is infidel's fork version of hugo Cupper theme. I use this theme for my own site nnag.me.

Added Feature

Plausible integration

Shortcode

    {{ if and (.Site.Params.plsDomain) (.Site.Params.plsUrl) }}
        <script defer data-domain="{{.Site.Params.plsDomain}}" src="{{.Site.Params.plsUrl | relURL}}"></script>
    {{ end }}

Hugo Conf

    ...
    params:
        plsDomain : <Your Domain>
        plsUrl    : <Your Plausible script url>
    ...

Plausible Bypass Adblock

Adblocker easyfilter has some filter on “plausible.js” string, especially if its routed towards external source . To bypass this you can setup a proxy rule on nginx to redirect this plausible api into the currently accessed site.

nginx conf

   
	server {
	    ...
	    location = /js/script.js {
	        # Change this if you use a different variant of the script
	        proxy_pass https://plausible.io/js/script.js;
	
	        # Tiny, negligible performance improvement. Very optional.
	        proxy_buffering on;
	
	        # Cache the script for 6 hours, as long as plausible.io returns a valid response
	        proxy_cache jscache;
	        proxy_cache_valid 200 6h;
	        proxy_cache_use_stale updating error timeout invalid_header http_500;
	
	        # Optional. Adds a header to tell if you got a cache hit or miss
	        add_header X-Cache $upstream_cache_status;
	    }
	
	    location = /api/event {
	        proxy_pass https://plausible.io/api/event;
	        proxy_buffering on;
	        proxy_http_version 1.1;
	
	        proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
	        proxy_set_header X-Forwarded-Proto $scheme;
	        proxy_set_header X-Forwarded-Host  $host;
	    }
	} 

Hugo Conf

    ...
    params:
        plsDomain : <Your Domain>
        plsUrl    : /js/script.js
    ...

PDF.js

shortcode

  • layout/shortcodes/embed-pdf.html

scripts

  • static/js/pdf.js
  • static/js/pdf.worker.js