diff options
| author | Anoduck <9925396+anoduck@users.noreply.github.com> | 2024-09-08 14:54:54 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-08 14:54:54 +0000 |
| commit | d2a0fd14e05ef6b0b9fca454f8996faf86f94204 (patch) | |
| tree | 242f822be67c179618f1e2aabcea60c172f4f6e0 /config | |
Initial commit
Diffstat (limited to 'config')
| -rw-r--r-- | config/_default/hugo.toml | 114 | ||||
| -rw-r--r-- | config/_default/languages.toml | 11 | ||||
| -rw-r--r-- | config/_default/markup.toml | 41 | ||||
| -rw-r--r-- | config/_default/menus/menus.en.toml | 51 | ||||
| -rw-r--r-- | config/_default/params.toml | 154 | ||||
| -rw-r--r-- | config/_default/server.toml | 40 | ||||
| -rw-r--r-- | config/ci/hugo.toml | 23 | ||||
| -rw-r--r-- | config/postcss.config.js | 47 | ||||
| -rw-r--r-- | config/production/deployment.toml | 31 |
9 files changed, 512 insertions, 0 deletions
diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml new file mode 100644 index 0000000..77feef0 --- /dev/null +++ b/config/_default/hugo.toml @@ -0,0 +1,114 @@ +title = "Hinode" +copyright = "Copyright © 2024 Mark Dumay." +enableGitInfo = true + +# additional settings +baseURL = "https://example.com/" +canonifyURLs = false +enableEmoji = true +enableRobotsTXT = true +enableInlineShortcodes = true +summaryLength = 20 + +# prevent build failures when using Hugo's Instagram shortcode due to deprecated Instagram API. +# See https://github.com/gohugoio/hugo/issues/7228#issuecomment-714490456 +ignoreErrors = ["error-remote-getjson"] + +timeout = "180s" + +languageCode = "en-us" +defaultContentLanguage = "en" +defaultContentLanguageInSubdir = false + +[outputFormats.REDIR] +mediaType = "text/netlify" +baseName = "_redirects" +isPlainText = true +notAlternative = true + +[mediaTypes."text/netlify"] +delimiter = "" + +[outputs] +home = ["HTML", "RSS", "REDIR"] + +[build] + writeStats = true + +[taxonomies] + tag = 'tags' + +[pagination] + pagerSize = 9 + +[privacy] + [privacy.vimeo] + disabled = false + simple = true + + [privacy.twitter] + disabled = false + enableDNT = true + simple = true + + [privacy.instagram] + disabled = false + simple = true + + [privacy.youtube] + disabled = false + privacyEnhanced = true + +[services] + [services.instagram] + disableInlineCSS = true + [services.twitter] + disableInlineCSS = true + [services.googleAnalytics] + # ID = "G-xxxxxxxxxx" + +[outputFormats] + [outputFormats.XML] + isPlainText = false + mediaType = "application/xml" + isHtml = false + noUgly = true + permalinkable = false + name = "xml" + +[minify] + [minify.tdewolff.js] + keepVarNames = true + precision = 0 + version = 2022 + [minify.tdewolff.html] + keepWhitespace = true + +[module] + [module.hugoVersion] + extended = true + min = "0.134.0" + max = "" + [[module.mounts]] + source = "archetypes" + target = "archetypes" + [[module.mounts]] + source = "assets" + target = "assets" + [[module.mounts]] + source = "content" + target = "content" + [[module.mounts]] + source = "i18n" + target = "i18n" + [[module.mounts]] + source = "layouts" + target = "layouts" + [[module.mounts]] + source = "static" + target = "static" + [[module.mounts]] + source = "netlify.toml" + target = "assets/config/netlify.toml" + [[module.imports]] + path = "github.com/gethinode/hinode" diff --git a/config/_default/languages.toml b/config/_default/languages.toml new file mode 100644 index 0000000..5be582e --- /dev/null +++ b/config/_default/languages.toml @@ -0,0 +1,11 @@ +[en] + languageName = "English" + contentDir = "content" + weight = 1 + [en.params.head] + tagline = "A Hugo Theme" + [en.params.social] + title = "Follow me" + caption = "I work on everything coding and tweet developer memes" + [en.params.footer] + # license = "Licensed under Creative Commons (<a href='https://creativecommons.org/licenses/by-nc-sa/4.0/' class='link-secondary' target='_blank' rel='noopener noreferrer'>CC BY-NC-SA 4.0</a>)." diff --git a/config/_default/markup.toml b/config/_default/markup.toml new file mode 100644 index 0000000..aa15cb0 --- /dev/null +++ b/config/_default/markup.toml @@ -0,0 +1,41 @@ +defaultMarkdownHandler = "goldmark" + +[highlight] + anchorLineNos = false + codeFences = true + guessSyntax = true + hl_Lines = "" + lineAnchors = "" + lineNoStart = 1 + lineNos = false + lineNumbersInTable = false + noClasses = false + tabWidth = 2 + ## Update the 'create:syntax' command in package.json to modify the style + ## The first two lines have been modified to remove the background color + # style = "monokailight" + +[goldmark] + [goldmark.extensions] + definitionList = true + footnote = true + linkify = true + strikethrough = true + table = true + taskList = true + typographer = true + [goldmark.extensions.passthrough] + enable = true + [goldmark.extensions.passthrough.delimiters] + block = [['\[', '\]'], ['$$', '$$']] + inline = [['\(', '\)'], ['$', '$']] + [goldmark.parser] + autoHeadingID = true + autoHeadingIDType = 'github' + wrapStandAloneImageWithinParagraph = false + [goldmark.parser.attribute] + block = true + [goldmark.renderer] + hardWraps = false + unsafe = false + xhtml = false
\ No newline at end of file diff --git a/config/_default/menus/menus.en.toml b/config/_default/menus/menus.en.toml new file mode 100644 index 0000000..896d78a --- /dev/null +++ b/config/_default/menus/menus.en.toml @@ -0,0 +1,51 @@ +[[main]] + name = "Home" + pageRef = "/" + weight = 10 + +[[main]] + name = "Tags" + pageRef = "/tags" + weight = 20 + +[[social]] + name = "LinkedIn" + pre = "fab linkedin" + url = "https://linkedin.com/" + weight = 10 + +[[social]] + name = "GitHub" + pre = "fab fa-github" + url = "https://github.com/" + weight = 20 + +[[social]] + name = "Medium" + pre = "fab medium" + url = "https://medium.com/" + weight = 30 + +# toml-docs-start sample-navigation +[[sample]] + name = "Blog" + pageRef = "/blog/" + weight = 10 + +[[sample]] + name = "Projects" + pageRef = "/projects/" + weight = 20 + +[[sample]] + name = "Sample project" + pageRef = "/projects/sample-project/" + parent = "Projects" + weight = 1 + +[[sample]] + name = "Another project" + pageRef = "/projects/another-project/" + parent = "Projects" + weight = 2 +# toml-docs-end sample-navigation
\ No newline at end of file diff --git a/config/_default/params.toml b/config/_default/params.toml new file mode 100644 index 0000000..5ee0350 --- /dev/null +++ b/config/_default/params.toml @@ -0,0 +1,154 @@ +[main] + separator = "-" + description = "Hinode is a clean documentation and blog theme for your Hugo site based on Bootstrap 5." + enableDarkMode = true + enableLanguageSelectionStorage = false + modes = ["light", "dark"] + canonifyAssetsURLs = false + endorse = true + footerBelowFold = false + loading = "lazy" + breakpoint = "md" + [main.externalLinks] + cue = false + tab = false + [main.build] + transpiler = "libsass" + +[debugging] + showJS = false + showSCSS = false + purgeHTMLComments = false + +[docs] + github = "https://github.com/gethinode/hinode" + release = "https://github.com/gethinode/hinode/releases/tag/" + checkVersion = false + +[home] + # sections = ["posts"] + fullCover = false + centerHeadline = false + style = "" + +[navigation] + anchor = true + logo = "/img/logo_icon.svg" + color = "body" + fixed = true + offset = "5.5rem" + search = true + searchModal = false + breadcrumb = true + toc = true + sidebar = true + size = "md" + +[messages] + placement = "bottom-right" + +[sharing] + enabled = true + sort = "weight" + reverse = false + webshare = true + +[[sharing.providers]] + name = "LinkedIn" + url = "https://www.linkedin.com/sharing/share-offsite/?url={url}" + icon = "fab linkedin" + weight = 10 + +[[sharing.providers]] + name = "Twitter" + url = "https://twitter.com/home?status={url}" + icon = "fab x-twitter" + weight = 20 + +[[sharing.providers]] + name = "Facebook" + url = "https://www.facebook.com/sharer.php?u={url}" + icon = "fab facebook" + weight = 30 + +[[sharing.providers]] + name = "WhatsApp" + url = "whatsapp://send?text={title}%20{url}" + icon = "fab whatsapp" + weight = 40 + +[[sharing.providers]] + name = "email" + url = "{url}" + icon = "fas link" + weight = 50 + clipboard = true + +# toml-docs-start sections +# [sections] +# [sections.posts] +# title = "Posts" +# sort = "date" +# reverse = true +# nested = true +# cols = 3 +# color = "" +# padding = "0" +# header = "full" +# footer = "none" +# orientation = "stacked" +# style = "border-0 card-zoom" +# homepage = 3 +# separator = true +# toml-docs-end sections + +[favicon] + logo = "img/favicon.png" + sizes = [16, 32, 48] + +[style] + primary = "#d43900" + secondary = "#6c757d" + success = "#198754" + info = "#0dcaf0" + warning = "#ffc107" + danger = "#dc3545" + light = "#f8f9fa" + dark = "#212529" + themeOpacity = "10" + darkModeShade = "20%" + darkModeTint = "40%" + themeFont = "Inter" + # themeFontPath = "https://fonts.googleapis.com/css2?family=Inter:wght@200;300;600&display=swap" # external path + themeFontPath = "/fonts" # local path + fontSizeBase = "1rem" + purge = false + +[schema] + type = "Organization" + name = "Hinode" + locale = "en-US" + # twitter = "https://twitter.com/gethinode" + # linkedIn = "" + github = "https://github.com/gethinode/hinode" + section = "blog" + [schema.author] + name = "Mark Dumay" + # twitter = "https://twitter.com/markdumay" + linkedin = "https://www.linkedin.com/in/markdumay/" + github = "https://github.com/markdumay" + [schema.logo] + url = "img/logo512x512.png" + width = 512 + height = 512 + [schema.image] + url = "img/logo1280x640.png" + width = 1280 + height = 640 + +[opengraph] + images = ["logo.png"] + locale = "en_US" + +[links] + hinode = "https://gethinode.com" diff --git a/config/_default/server.toml b/config/_default/server.toml new file mode 100644 index 0000000..c80d88d --- /dev/null +++ b/config/_default/server.toml @@ -0,0 +1,40 @@ +[[headers]] +for = '/**' +[headers.values] + Strict-Transport-Security = "max-age=31536000; includeSubDomains; preload" + X-Content-Type-Options = "nosniff" + X-XSS-Protection = "1; mode=block" + Content-Security-Policy = """\ + default-src 'self'; \ + script-src 'self' https://*.google-analytics.com https://*.googletagmanager.com; \ + style-src 'self' https://fonts.googleapis.com https://www.youtube.com; \ + object-src 'none'; \ + base-uri 'self'; \ + connect-src 'self' + https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com; \ + font-src 'self' https://fonts.gstatic.com; \ + frame-src 'self' https://www.youtube-nocookie.com https://www.youtube.com; \ + img-src 'self' data: https://i.vimeocdn.com https://i.ytimg.com https://*.google-analytics.com https://*.googletagmanager.com https://tile.openstreetmap.org; \ + manifest-src 'self'; \ + media-src 'self' \ + """ + X-Frame-Options = "SAMEORIGIN" + Referrer-Policy = "strict-origin" + Permissions-Policy = """\ + geolocation=(), \ + midi=(), \ + sync-xhr=(), \ + microphone=(), \ + camera=(), \ + magnetometer=(), \ + gyroscope=(), \ + fullscreen=(), \ + payment=() \ + """ + cache-control = """\ + max-age=0, \ + no-cache, \ + no-store, \ + must-revalidate \ + """ + Access-Control-Allow-Origin = "*" diff --git a/config/ci/hugo.toml b/config/ci/hugo.toml new file mode 100644 index 0000000..395e78a --- /dev/null +++ b/config/ci/hugo.toml @@ -0,0 +1,23 @@ +# cachedir default on POSIX: '/tmp/hugo_cache_runner' +# cachedir default on Windows: '~\AppData\Local\hugo_cache' +# cachedir default on macOS: '/Users/runner/Library/Caches/hugo_cache' + +[caches] + [caches.assets] + dir = ':cacheDir/resources/_gen' # map to cacheDir instead of resourceDir to utilize GitHub action/cache + maxAge = -1 + [caches.getcsv] + dir = ':cacheDir/:project' + maxAge = -1 + [caches.getjson] + dir = ':cacheDir/:project' + maxAge = -1 + [caches.getresource] + dir = ':cacheDir/:project' + maxAge = -1 + [caches.images] + dir = ':cacheDir/resources/_gen' # map to cacheDir instead of resourceDir to utilize GitHub action/cache + maxAge = -1 + [caches.modules] + dir = ':cacheDir/modules' + maxAge = -1
\ No newline at end of file diff --git a/config/postcss.config.js b/config/postcss.config.js new file mode 100644 index 0000000..036241e --- /dev/null +++ b/config/postcss.config.js @@ -0,0 +1,47 @@ +const autoprefixer = require('autoprefixer')({}) +const cssnano = require('cssnano')({ + preset: 'advanced' +}) +const whitelister = require('purgecss-whitelister') +const purgecss = require('@fullhuman/postcss-purgecss')({ + content: ['./hugo_stats.json'], + defaultExtractor: (content) => { + const els = JSON.parse(content).htmlElements + return [...(els.tags || []), ...(els.classes || []), ...(els.ids || [])] + }, + dynamicAttributes: ['data-bs-theme'], + safelist: [ + ...whitelister([ + './assets/scss/theme/fonts.scss', + './assets/scss/theme/theme.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_clipboard.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_command.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_nav.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_navbar.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_search.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_syntax.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_syntax-dark.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_syntax-light.scss', + './_vendor/github.com/gethinode/hinode/assets/scss/components/_table.scss', + './_vendor/github.com/gethinode/mod-flexsearch/v2/assets/scss/modules/flexsearch/flexsearch.scss', + './_vendor/github.com/gethinode/mod-katex/dist/katex.scss', + './_vendor/github.com/gethinode/mod-leaflet/dist/leaflet.scss', + './_vendor/github.com/gethinode/mod-simple-datatables/dist/simple-datatables.scss', + './_vendor/github.com/twbs/bootstrap/scss/_carousel.scss', + './_vendor/github.com/twbs/bootstrap/scss/_dropdown.scss', + './_vendor/github.com/twbs/bootstrap/scss/_modal.scss', + './_vendor/github.com/twbs/bootstrap/scss/_reboot.scss', + './_vendor/github.com/twbs/bootstrap/scss/_tooltip.scss', + './_vendor/github.com/twbs/bootstrap/scss/_transitions.scss', + './_vendor/github.com/twbs/bootstrap/scss/_utilities.scss' + ]) + ] +}) + +module.exports = { + plugins: [ + autoprefixer, + cssnano, + purgecss + ] +} diff --git a/config/production/deployment.toml b/config/production/deployment.toml new file mode 100644 index 0000000..a12e23e --- /dev/null +++ b/config/production/deployment.toml @@ -0,0 +1,31 @@ +# toml-docs-start az-blob +# By default, files are uploaded in an arbitrary order. +# Files that match the regular expressions in the "Order" list +# will be uploaded first, in the listed order. +order = [".webp$", ".jpg$", ".gif$"] + +[targets] +name = "hinode" +URL = "azblob://$web" + +[[matchers]] +# Cache static assets for 1 year. +pattern = "^.+\\.(js|css|svg|ttf)$" +cacheControl = "max-age=31536000, no-transform, public" +gzip = true + +[[matchers]] +pattern = "^.+\\.(png|jpg|webp)$" +cacheControl = "max-age=31536000, no-transform, public" +gzip = false + +[[matchers]] +# Set custom content type for /sitemap.xml +pattern = "^sitemap\\.xml$" +contentType = "application/xml" +gzip = true + +[[matchers]] +pattern = "^.+\\.(html|xml|json)$" +gzip = true +# toml-docs-end az-blob |
