add goatcounter

This commit is contained in:
Rik Berkelder 2021-05-05 10:19:41 +02:00
parent 0b4ddff65b
commit f70729c774
2 changed files with 95 additions and 90 deletions

View File

@ -6,94 +6,95 @@
module.exports = { module.exports = {
/* Your site config here */ /* Your site config here */
plugins: [ plugins: [
'gatsby-plugin-react-helmet', 'gatsby-plugin-graphql-codegen',
{ 'gatsby-plugin-react-helmet',
resolve: `gatsby-plugin-sass`, {
options: { resolve: `gatsby-plugin-sass`,
postCssPlugins: [ options: {
require("tailwindcss"), postCssPlugins: [
] require("tailwindcss"),
} ]
}, }
{ },
resolve: 'gatsby-source-filesystem', {
options: { resolve: 'gatsby-source-filesystem',
name: 'markdown-pages', options: {
path: `${__dirname}/src/markdown-pages` name: 'markdown-pages',
} path: `${__dirname}/src/markdown-pages`
}, }
{ },
resolve: `gatsby-transformer-remark`, {
options: { resolve: `gatsby-transformer-remark`,
plugins: [ options: {
{ plugins: [
resolve: `gatsby-remark-prismjs`, {
options: { resolve: `gatsby-remark-prismjs`,
// Class prefix for <pre> tags containing syntax highlighting; options: {
// defaults to 'language-' (e.g. <pre class="language-js">). // Class prefix for <pre> tags containing syntax highlighting;
// If your site loads Prism into the browser at runtime, // defaults to 'language-' (e.g. <pre class="language-js">).
// (e.g. for use with libraries like react-live), // If your site loads Prism into the browser at runtime,
// you may use this to prevent Prism from re-processing syntax. // (e.g. for use with libraries like react-live),
// This is an uncommon use-case though; // you may use this to prevent Prism from re-processing syntax.
// If you're unsure, it's best to use the default value. // This is an uncommon use-case though;
classPrefix: "language-", // If you're unsure, it's best to use the default value.
// This is used to allow setting a language for inline code classPrefix: "language-",
// (i.e. single backticks) by creating a separator. // This is used to allow setting a language for inline code
// This separator is a string and will do no white-space // (i.e. single backticks) by creating a separator.
// stripping. // This separator is a string and will do no white-space
// A suggested value for English speakers is the non-ascii // stripping.
// character ''. // A suggested value for English speakers is the non-ascii
inlineCodeMarker: null, // character ''.
// This lets you set up language aliases. For example, inlineCodeMarker: null,
// setting this to '{ sh: "bash" }' will let you use // This lets you set up language aliases. For example,
// the language "sh" which will highlight using the // setting this to '{ sh: "bash" }' will let you use
// bash highlighter. // the language "sh" which will highlight using the
aliases: {}, // bash highlighter.
// This toggles the display of line numbers globally alongside the code. aliases: {},
// To use it, add the following line in gatsby-browser.js // This toggles the display of line numbers globally alongside the code.
// right after importing the prism color scheme: // To use it, add the following line in gatsby-browser.js
// require("prismjs/plugins/line-numbers/prism-line-numbers.css") // right after importing the prism color scheme:
// Defaults to false. // require("prismjs/plugins/line-numbers/prism-line-numbers.css")
// If you wish to only show line numbers on certain code blocks, // Defaults to false.
// leave false and use the {numberLines: true} syntax below // If you wish to only show line numbers on certain code blocks,
showLineNumbers: false, // leave false and use the {numberLines: true} syntax below
// If setting this to true, the parser won't handle and highlight inline showLineNumbers: false,
// code used in markdown i.e. single backtick code like `this`. // If setting this to true, the parser won't handle and highlight inline
noInlineHighlight: false, // code used in markdown i.e. single backtick code like `this`.
// This adds a new language definition to Prism or extend an already noInlineHighlight: false,
// existing language definition. More details on this option can be // This adds a new language definition to Prism or extend an already
// found under the header "Add new language definition or extend an // existing language definition. More details on this option can be
// existing language" below. // found under the header "Add new language definition or extend an
languageExtensions: [ // existing language" below.
{ languageExtensions: [
language: "superscript", {
extend: "javascript", language: "superscript",
definition: { extend: "javascript",
superscript_types: /(SuperType)/, definition: {
}, superscript_types: /(SuperType)/,
insertBefore: { },
function: { insertBefore: {
superscript_keywords: /(superif|superelse)/, function: {
}, superscript_keywords: /(superif|superelse)/,
}, },
}, },
], },
// Customize the prompt used in shell output ],
// Values below are default // Customize the prompt used in shell output
prompt: { // Values below are default
user: "root", prompt: {
host: "localhost", user: "root",
global: false, host: "localhost",
}, global: false,
// By default the HTML entities <>&'" are escaped. },
// Add additional HTML escapes by providing a mapping // By default the HTML entities <>&'" are escaped.
// of HTML entities and their escape value IE: { '}': '&#123;' } // Add additional HTML escapes by providing a mapping
escapeEntities: {}, // of HTML entities and their escape value IE: { '}': '&#123;' }
}, escapeEntities: {},
}, },
], },
],
}, },
}, },
], ],
} }

View File

@ -15,6 +15,10 @@ const Layout: React.FC<{}> = (props) => {
{props.children} {props.children}
</main> </main>
</div> </div>
{process.env.NODE_ENV === "production" ? (
<script data-goatcounter="https://riksolo-com.stats.riksolo.com/count"
async src="//riksolo-com.stats.riksolo.com/count.js"></script>
) : null}
</div> </div>
) )
}; };