Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docusaurus.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ const config = {
title: 't1 Docs',
tagline: 'Documentation for t1, the permissionless credit protocol for DeFi.',
url: 'https://docs.t1protocol.com',
// PostHog project "t1" (shared with t1protocol.com, told apart by $host), sent
// through this site's own /relay proxy (netlify.toml) so ad blockers don't drop it.
headTags: [
{
tagName: 'script',
attributes: {},
innerHTML: 'if(!/^(localhost|127\\.0\\.0\\.1)$/.test(location.hostname)){!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.crossOrigin="anonymous",p.async=!0,p.src=s.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="init capture register identify reset get_distinct_id captureException".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);posthog.init("phc_ncQxnKfh4f3u4NFQW8GVC9sxKsNsR7WBqbFEjg6zdrtS",{api_host:location.origin+"/relay",ui_host:"https://us.posthog.com",capture_pageview:"history_change",capture_exceptions:true});}',
},
],
baseUrl: '/',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
Expand Down
14 changes: 14 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Same-origin proxy for PostHog (the headTags script in docusaurus.config.mjs),
# also used by t1protocol.com, which Firebase Hosting cannot proxy itself.
[[redirects]]
from = "/relay/static/*"
to = "https://us-assets.i.posthog.com/static/:splat"
status = 200
force = true

[[redirects]]
from = "/relay/*"
to = "https://us.i.posthog.com/:splat"
status = 200
force = true

[[redirects]]
from = "/concepts/*"
to = "/intro/:splat"
Expand Down
Loading