diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7d41c5cc66ee0c94f565391ce5742d99247a7637..e136f838faf953a82541d92baf68014650995334 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,26 +1,42 @@ -default: - image: node:lts - cache: - paths: - - node_modules/ +variables: + DART_SASS_VERSION: 1.64.1 + HUGO_VERSION: 0.115.4 + NODE_VERSION: 20.x + GIT_DEPTH: 0 + GIT_STRATEGY: clone + GIT_SUBMODULE_STRATEGY: recursive + TZ: America/Los_Angeles + +image: + name: golang:1.20.6-bookworm pages: script: - - export NODE_OPTIONS=--openssl-legacy-provider # Install brotli - apt-get update - apt-get install -y brotli # Install Dart Sass - - curl -LJO https://github.com/sass/dart-sass/releases/download/1.64.1/dart-sass-1.64.1-linux-x64.tar.gz - - tar -xf dart-sass-1.64.1-linux-x64.tar.gz + - curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz + - tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz - cp -r dart-sass/ /usr/local/bin - rm -rf dart-sass* - export PATH=/usr/local/bin/dart-sass:$PATH - - npm ci - #- npm test - - npm run build - + # Install Hugo + - curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb + - apt-get install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb + - rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb + # Install Node.js + - curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - + - apt-get install -y nodejs + # Install Node.js dependencies + - "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" + # Build + - hugo --gc --minify + # Compress + - find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec gzip -f -k {} \; + - find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec brotli -f -k {} \; artifacts: paths: - public + diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml index 7d7b18d4fc82e3451aa9090052597a91be29df91..83ffac511d55c6c5c004fa8abb1b68aa802ac4b7 100644 --- a/config/_default/hugo.toml +++ b/config/_default/hugo.toml @@ -1,41 +1,57 @@ -title = "Tetras Doks" -baseurl = "http://doks-test-antoine-perso-99736c269ce0ed108f0bd1283c834482b315ddd.pages.tetras-libre.fr/" -canonifyURLs = true +baseurl = "https://epogrebnyak.gitlab.io/doks-howto" disableAliases = true disableHugoGeneratorInject = true -# disableKinds = ["taxonomy", "term"] enableEmoji = true enableGitInfo = false enableRobotsTXT = true -languageCode = "fr-FR " -paginate = 10 +#languageCode = "en-US" +paginate = 7 rssLimit = 10 -summarylength = 20 # 70 (default) -# Multilingual defaultContentLanguage = "en" -disableLanguages = ["de", "nl"] -defaultContentLanguageInSubdir = false -copyRight = "Copyright (c) 2023 Hyas" +[languages] +[languages.ru] +## Homepage +title = "Это суперсайт" +titleSeparator = "-" +titleAddition = "Modern Documentation Theme" +description = "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default." +weight = 2 +[languages.en] +## Homepage +title = "Doks in Several Languages" +titleSeparator = "-" +titleAddition = "Modern Documentation Theme" +description = "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default." +weight = 1 -[build.buildStats] - enable = true - -[social] - twitter = "getdoks" +# add redirects/headers [outputs] - home = ["HTML", "RSS", "searchIndex"] - section = ["HTML", "RSS", "SITEMAP"] +home = ["HTML", "RSS", "REDIRECTS", "HEADERS"] +section = ["HTML", "RSS", "SITEMAP"] + +# remove .{ext} from text/netlify +[mediaTypes."text/netlify"] +suffixes = [""] +delimiter = "" -[outputFormats.searchIndex] - mediaType = "application/json" - baseName = "search-index" - isPlainText = true - notAlternative = true +# add output format for netlify _redirects +[outputFormats.REDIRECTS] +mediaType = "text/netlify" +baseName = "_redirects" +isPlainText = true +notAlternative = true + +# add output format for netlify _headers +[outputFormats.HEADERS] +mediaType = "text/netlify" +baseName = "_headers" +isPlainText = true +notAlternative = true -# Add output format for section sitemap.xml +# add output format for section sitemap.xml [outputFormats.SITEMAP] mediaType = "application/xml" baseName = "sitemap" @@ -44,46 +60,53 @@ isPlainText = true noUgly = true rel = "sitemap" -[sitemap] - changefreq = "monthly" - filename = "sitemap.xml" - priority = 0.5 +[markup] +[markup.goldmark] +[markup.goldmark.extensions] +linkify = false +[markup.goldmark.renderer] +unsafe = true +[markup.highlight] +codeFences = true +guessSyntax = false +hl_Lines = "" +lineNoStart = 1 +lineNos = false +lineNumbersInTable = true +noClasses = false +style = "dracula" +tabWidth = 4 -[caches] - [caches.getjson] - dir = ":cacheDir/:project" - maxAge = "30m" +[sitemap] +changefreq = "weekly" +filename = "sitemap.xml" +priority = 0.5 [taxonomies] - contributor = "contributors" - category = "categories" - tag = "tags" +contributor = "contributors" [permalinks] - blog = "/blog/:slug/" - docs = "/docs/:sections[1:]/:slug/" -# docs = "/docs/1.0/:sections[1:]/:slug/" - -[minify.tdewolff.html] - keepWhitespace = false - -[related] - threshold = 80 - includeNewer = true - toLower = false - [[related.indices]] - name = "categories" - weight = 100 - [[related.indices]] - name = "tags" - weight = 80 - [[related.indices]] - name = "date" - weight = 10 +blog = "/blog/:title/" -[imaging] - anchor = "Smart" - bgColor = "#ffffff" - hint = "photo" - quality = 75 - resampleFilter = "Box" +[module] +[[module.mounts]] +source = "assets" +target = "assets" +[[module.mounts]] +source = "static" +target = "static" +[[module.mounts]] +source = "node_modules/lazysizes" +target = "assets/js/vendor/lazysizes" +[[module.mounts]] +source = "node_modules/instant.page" +target = "assets/js/vendor/instant.page" +[[module.mounts]] +source = "node_modules/lazysizes" +target = "assets/js/vendor/lazysizes" +[[module.mounts]] +source = "node_modules/flexsearch" +target = "assets/js/vendor/flexsearch" +[[module.mounts]] +source = "node_modules/clipboard" +target = "assets/js/vendor/clipboard"