File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ format:
1313 html :
1414 css : styles/styles.css
1515 include-in-header : styles/goatcounter.html
16+ include-after-body : styles/goatcounter.js
1617 theme :
1718 light : flatly
1819 dark : darkly
@@ -35,7 +36,9 @@ website:
3536 site-url : " https://benson1231.github.io/tools/"
3637 favicon : assets/logo.svg
3738 back-to-top-navigation : true
38- page-footer : " Copyright 2026, benson1231"
39+ page-footer : |
40+ Copyright 2026, benson1231
41+ 👀 Total Views: <span id="gc-total">Loading...</span>
3942 navbar :
4043 pinned : true
4144 left :
Original file line number Diff line number Diff line change 1+ fetch ( "https://benson1231.goatcounter.com/counter//.json" )
2+ . then ( res => res . json ( ) )
3+ . then ( data => {
4+ const el = document . getElementById ( "gc-total" ) ;
5+ if ( el ) {
6+ el . innerText = data . count ;
7+ }
8+ } )
9+ . catch ( ( ) => {
10+ console . log ( "GoatCounter fetch failed" ) ;
11+ } ) ;
You can’t perform that action at this time.
0 commit comments