From 8dbefdd21a4725a5260a29b31bb1ef3d835f51b5 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 24 Jan 2022 21:16:35 +0100 Subject: [PATCH 1/7] Turn docsy and userguide into hugo modules --- config.toml | 5 +++++ go.mod | 8 ++++++++ go.sum | 4 ++++ userguide/config.toml | 14 ++++++++++++-- userguide/go.mod | 5 +++++ userguide/go.sum | 2 ++ 6 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 userguide/go.mod create mode 100644 userguide/go.sum diff --git a/config.toml b/config.toml index 4f56aa5179..406ed0f762 100644 --- a/config.toml +++ b/config.toml @@ -25,3 +25,8 @@ isHTML = true mediaType = "text/html" path = "_print" permalinkable = false + +[module] +[module.hugoVersion] +extended = true +min = "0.73.0" \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000000..f77c91b666 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/google/docsy + +go 1.12 + +require ( + github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac // indirect + github.com/twbs/bootstrap v4.6.1+incompatible // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000000..7b9a0c9cc6 --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac h1:AjwgwoaDsNEA1Wtc8pgw/BqG7SEk9bKxXPjEPQQ42vY= +github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/twbs/bootstrap v4.6.1+incompatible h1:75PsBfPU1SS65ag0Z3Cq6JNXVAfUNfB0oCLHh9k9Fu8= +github.com/twbs/bootstrap v4.6.1+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/userguide/config.toml b/userguide/config.toml index 7661151b77..397397005e 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -3,8 +3,18 @@ title = "Docsy Example" enableRobotsTXT = true -# Hugo allows theme composition (and inheritance). The precedence is from left to right. -theme = ["docsy"] +# set docsy as theme, either locally or as module +[module] + # uncomment line below for temporary local development of module + # replacements = "github.com/google/docsy -> ../../docsy" + [module.hugoVersion] + extended = true + min = "0.73.0" + [[module.imports]] + # either get theme from local themes folder + path = "docsy" + # or pull it in as hugo module + # path = "github.com/google/docsy" # Will give values to .Lastmod etc. enableGitInfo = true diff --git a/userguide/go.mod b/userguide/go.mod new file mode 100644 index 0000000000..3205870c19 --- /dev/null +++ b/userguide/go.mod @@ -0,0 +1,5 @@ +module github.com/google/docsy/userguide + +go 1.12 + +require github.com/google/docsy v0.1.1-0.20220124145409-3e2cfeba3ad1 // indirect diff --git a/userguide/go.sum b/userguide/go.sum new file mode 100644 index 0000000000..220b3abbd2 --- /dev/null +++ b/userguide/go.sum @@ -0,0 +1,2 @@ +github.com/google/docsy v0.1.1-0.20220124145409-3e2cfeba3ad1 h1:GFZN0DfvT05pu5t799Mv0NO/XE4iW2h0fX8VxukM8Kg= +github.com/google/docsy v0.1.1-0.20220124145409-3e2cfeba3ad1/go.mod h1:alhAPKceHP14eqO+nJEhYehHeNcPKV8QnduoauTBZhs= From efbeb33c1867e5cf729ba61563e8d265af798532 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 24 Jan 2022 21:27:04 +0100 Subject: [PATCH 2/7] User guide, config.toml: remove tabs, use whitepace only --- userguide/config.toml | 66 +++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/userguide/config.toml b/userguide/config.toml index 397397005e..9747e63838 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -37,8 +37,8 @@ pygmentsUseClassic = false # See https://help.farbox.com/pygments.html pygmentsStyle = "tango" - # First one is picked as the Twitter card image if not set on page. - #images = ["images/project-illustration.png"] +# First one is picked as the Twitter card image if not set on page. +#images = ["images/project-illustration.png"] # Configure how URLs look like per section. [permalinks] @@ -158,11 +158,11 @@ prism_syntax_highlighting = false sidebar_menu_compact = false sidebar_menu_foldable = false sidebar_cache_limit = 10 -# Set to true to disable breadcrumb navigation. +# Set to true to disable breadcrumb navigation. breadcrumb_disable = false -# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled) +# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled) sidebar_search_disable = false -# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top nav bar +# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top nav bar navbar_logo = true # Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events. @@ -185,41 +185,41 @@ enable = false [params.links] # End user relevant links. These will show up on left side of footer and in the community page if you have one. [[params.links.user]] - name ="GitHub Discussions" - url = "https://github.com/google/docsy/discussions" - icon = "fab fa-github" - desc = "Discussion and help from your fellow users" + name ="GitHub Discussions" + url = "https://github.com/google/docsy/discussions" + icon = "fab fa-github" + desc = "Discussion and help from your fellow users" [[params.links.user]] - name = "User mailing list" - url = "https://groups.google.com/forum/#!forum/docsy-users" - icon = "fa fa-envelope" - desc = "Sign up for Docsy announcements" + name = "User mailing list" + url = "https://groups.google.com/forum/#!forum/docsy-users" + icon = "fa fa-envelope" + desc = "Sign up for Docsy announcements" [[params.links.user]] - name ="Twitter" - url = "https://twitter.com/docsydocs" - icon = "fab fa-twitter" - desc = "Follow us on Twitter to get the latest news!" + name ="Twitter" + url = "https://twitter.com/docsydocs" + icon = "fab fa-twitter" + desc = "Follow us on Twitter to get the latest news!" [[params.links.user]] - name = "Stack Overflow" - url = "https://stackoverflow.com/questions/tagged/docsy" - icon = "fab fa-stack-overflow" - desc = "Practical questions and curated answers" + name = "Stack Overflow" + url = "https://stackoverflow.com/questions/tagged/docsy" + icon = "fab fa-stack-overflow" + desc = "Practical questions and curated answers" # Developer relevant links. These will show up on right side of footer and in the community page if you have one. [[params.links.developer]] - name = "GitHub" - url = "https://github.com/google/docsy" - icon = "fab fa-github" - desc = "Development takes place here!" + name = "GitHub" + url = "https://github.com/google/docsy" + icon = "fab fa-github" + desc = "Development takes place here!" # [[params.links.developer]] - # name = "Slack" - # url = "https://example.org/slack" - # icon = "fab fa-slack" - # desc = "Chat with other project developers" + # name = "Slack" + # url = "https://example.org/slack" + # icon = "fab fa-slack" + # desc = "Chat with other project developers" # [[params.links.developer]] - # name = "Developer mailing list" - # url = "https://example.org/mail" - # icon = "fa fa-envelope" - # desc = "Discuss development issues around the project" + # name = "Developer mailing list" + # url = "https://example.org/mail" + # icon = "fa fa-envelope" + # desc = "Discuss development issues around the project" [params.mermaid] enable = true From 0c27c23f490bd475b36d944d8bba339fa9639920 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 24 Jan 2022 21:36:07 +0100 Subject: [PATCH 3/7] =?UTF-8?q?Work=20around=20a=20known=20bug=20in=20Go?= =?UTF-8?q?=E2=80=99s=20module=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/bootstrap/README.txt | 2 + assets/bootstrap/scss/_vendor/README.txt | 3 + assets/bootstrap/scss/_vendor/_rfs.scss | 228 +++++++++++++++++++++++ 3 files changed, 233 insertions(+) create mode 100644 assets/bootstrap/README.txt create mode 100644 assets/bootstrap/scss/_vendor/README.txt create mode 100644 assets/bootstrap/scss/_vendor/_rfs.scss diff --git a/assets/bootstrap/README.txt b/assets/bootstrap/README.txt new file mode 100644 index 0000000000..eb9a64e177 --- /dev/null +++ b/assets/bootstrap/README.txt @@ -0,0 +1,2 @@ +This folder was added in order to work around a known bug in Go’s module management. +For details, please refer to: https://github.com/golang/go/issues/37397 diff --git a/assets/bootstrap/scss/_vendor/README.txt b/assets/bootstrap/scss/_vendor/README.txt new file mode 100644 index 0000000000..bbc3d024e1 --- /dev/null +++ b/assets/bootstrap/scss/_vendor/README.txt @@ -0,0 +1,3 @@ +This file belongs to bootstrap framework: + +https://raw.githubusercontent.com/twbs/bootstrap/v4.6.1/scss/vendor/_rfs.scss \ No newline at end of file diff --git a/assets/bootstrap/scss/_vendor/_rfs.scss b/assets/bootstrap/scss/_vendor/_rfs.scss new file mode 100644 index 0000000000..e453f441ee --- /dev/null +++ b/assets/bootstrap/scss/_vendor/_rfs.scss @@ -0,0 +1,228 @@ +// stylelint-disable property-blacklist, scss/dollar-variable-default + +// SCSS RFS mixin +// +// Automated responsive font sizes +// +// Licensed under MIT (https://github.com/twbs/rfs/blob/v8.x/LICENSE) + +// Configuration + +// Base font size +$rfs-base-font-size: 1.25rem !default; +$rfs-font-size-unit: rem !default; + +@if $rfs-font-size-unit != rem and $rfs-font-size-unit != px { + @error "`#{$rfs-font-size-unit}` is not a valid unit for $rfs-font-size-unit. Use `px` or `rem`."; +} + +// Breakpoint at where font-size starts decreasing if screen width is smaller +$rfs-breakpoint: 1200px !default; +$rfs-breakpoint-unit: px !default; + +@if $rfs-breakpoint-unit != px and $rfs-breakpoint-unit != em and $rfs-breakpoint-unit != rem { + @error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`."; +} + +// Resize font size based on screen height and width +$rfs-two-dimensional: false !default; + +// Factor of decrease +$rfs-factor: 10 !default; + +@if type-of($rfs-factor) != "number" or $rfs-factor <= 1 { + @error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1."; +} + +// Generate enable or disable classes. Possibilities: false, "enable" or "disable" +$rfs-class: false !default; + +// 1 rem = $rfs-rem-value px +$rfs-rem-value: 16 !default; + +// Safari iframe resize bug: https://github.com/twbs/rfs/issues/14 +$rfs-safari-iframe-resize-bug-fix: false !default; + +// Disable RFS by setting $enable-responsive-font-sizes to false +$enable-responsive-font-sizes: true !default; + +// Cache $rfs-base-font-size unit +$rfs-base-font-size-unit: unit($rfs-base-font-size); + +@function divide($dividend, $divisor, $precision: 10) { + $sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1); + $dividend: abs($dividend); + $divisor: abs($divisor); + @if $dividend == 0 { + @return 0; + } + @if $divisor == 0 { + @error "Cannot divide by 0"; + } + $remainder: $dividend; + $result: 0; + $factor: 10; + @while ($remainder > 0 and $precision >= 0) { + $quotient: 0; + @while ($remainder >= $divisor) { + $remainder: $remainder - $divisor; + $quotient: $quotient + 1; + } + $result: $result * 10 + $quotient; + $factor: $factor * .1; + $remainder: $remainder * 10; + $precision: $precision - 1; + @if ($precision < 0 and $remainder >= $divisor * 5) { + $result: $result + 1; + } + } + $result: $result * $factor * $sign; + $dividend-unit: unit($dividend); + $divisor-unit: unit($divisor); + $unit-map: ( + "px": 1px, + "rem": 1rem, + "em": 1em, + "%": 1% + ); + @if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) { + $result: $result * map-get($unit-map, $dividend-unit); + } + @return $result; +} + +// Remove px-unit from $rfs-base-font-size for calculations +@if $rfs-base-font-size-unit == "px" { + $rfs-base-font-size: divide($rfs-base-font-size, $rfs-base-font-size * 0 + 1); +} +@else if $rfs-base-font-size-unit == "rem" { + $rfs-base-font-size: divide($rfs-base-font-size, divide($rfs-base-font-size * 0 + 1, $rfs-rem-value)); +} + +// Cache $rfs-breakpoint unit to prevent multiple calls +$rfs-breakpoint-unit-cache: unit($rfs-breakpoint); + +// Remove unit from $rfs-breakpoint for calculations +@if $rfs-breakpoint-unit-cache == "px" { + $rfs-breakpoint: divide($rfs-breakpoint, $rfs-breakpoint * 0 + 1); +} +@else if $rfs-breakpoint-unit-cache == "rem" or $rfs-breakpoint-unit-cache == "em" { + $rfs-breakpoint: divide($rfs-breakpoint, divide($rfs-breakpoint * 0 + 1, $rfs-rem-value)); +} + +// Internal mixin that adds disable classes to the selector if needed. +@mixin _rfs-disable-class { + @if $rfs-class == "disable" { + // Adding an extra class increases specificity, which prevents the media query to override the font size + &, + .disable-responsive-font-size &, + &.disable-responsive-font-size { + @content; + } + } + @else { + @content; + } +} + +// Internal mixin that adds enable classes to the selector if needed. +@mixin _rfs-enable-class { + @if $rfs-class == "enable" { + .enable-responsive-font-size &, + &.enable-responsive-font-size { + @content; + } + } + @else { + @content; + } +} + +// Internal mixin used to determine which media query needs to be used +@mixin _rfs-media-query($mq-value) { + @if $rfs-two-dimensional { + @media (max-width: #{$mq-value}), (max-height: #{$mq-value}) { + @content; + } + } + @else { + @media (max-width: #{$mq-value}) { + @content; + } + } +} + +// Responsive font size mixin +@mixin rfs($fs, $important: false) { + // Cache $fs unit + $fs-unit: if(type-of($fs) == "number", unit($fs), false); + + // Add !important suffix if needed + $rfs-suffix: if($important, " !important", ""); + + // If $fs isn't a number (like inherit) or $fs has a unit (not px or rem, like 1.5em) or $ is 0, just print the value + @if not $fs-unit or $fs-unit != "" and $fs-unit != "px" and $fs-unit != "rem" or $fs == 0 { + font-size: #{$fs}#{$rfs-suffix}; + } + @else { + // Remove unit from $fs for calculations + @if $fs-unit == "px" { + $fs: divide($fs, $fs * 0 + 1); + } + @else if $fs-unit == "rem" { + $fs: divide($fs, divide($fs * 0 + 1, $rfs-rem-value)); + } + + // Set default font size + $rfs-static: if($rfs-font-size-unit == rem, #{divide($fs, $rfs-rem-value)}rem, #{$fs}px); + + // Only add the media query if the font size is bigger than the minimum font size + @if $fs <= $rfs-base-font-size or not $enable-responsive-font-sizes { + font-size: #{$rfs-static}#{$rfs-suffix}; + } + @else { + // Calculate the minimum font size for $fs + $fs-min: $rfs-base-font-size + divide($fs - $rfs-base-font-size, $rfs-factor); + + // Calculate difference between $fs and the minimum font size + $fs-diff: $fs - $fs-min; + + // Base font-size formatting + $min-width: if($rfs-font-size-unit == rem, #{divide($fs-min, $rfs-rem-value)}rem, #{$fs-min}px); + + // Use `vmin` if two-dimensional is enabled + $variable-unit: if($rfs-two-dimensional, vmin, vw); + + // Calculate the variable width between 0 and $rfs-breakpoint + $variable-width: #{divide($fs-diff * 100, $rfs-breakpoint)}#{$variable-unit}; + + // Set the calculated font-size + $rfs-fluid: calc(#{$min-width} + #{$variable-width}) #{$rfs-suffix}; + + // Breakpoint formatting + $mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{divide($rfs-breakpoint, $rfs-rem-value)}#{$rfs-breakpoint-unit}); + + @include _rfs-disable-class { + font-size: #{$rfs-static}#{$rfs-suffix}; + } + + @include _rfs-media-query($mq-value) { + @include _rfs-enable-class { + font-size: $rfs-fluid; + } + + // Include safari iframe resize fix if needed + min-width: if($rfs-safari-iframe-resize-bug-fix, (0 * 1vw), null); + } + } + } +} + +// The font-size & responsive-font-size mixins use RFS to rescale the font size +@mixin font-size($fs, $important: false) { + @include rfs($fs, $important); +} + +@mixin responsive-font-size($fs, $important: false) { + @include rfs($fs, $important); +} From 26fac4aec3fc6f8b198b46a2e4346e8ba37503da Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 24 Jan 2022 21:54:29 +0100 Subject: [PATCH 4/7] Adding module github.com/google/docsy/module, enabling use of theme as module --- config.toml | 1 + go.mod | 3 +++ module/config.toml | 40 ++++++++++++++++++++++++++++++++++++++++ module/go.mod | 3 +++ 4 files changed, 47 insertions(+) create mode 100644 module/config.toml create mode 100644 module/go.mod diff --git a/config.toml b/config.toml index 406ed0f762..3795f450a2 100644 --- a/config.toml +++ b/config.toml @@ -27,6 +27,7 @@ path = "_print" permalinkable = false [module] +_merge = "deep" [module.hugoVersion] extended = true min = "0.73.0" \ No newline at end of file diff --git a/go.mod b/go.mod index f77c91b666..80be01a0ba 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,10 @@ module github.com/google/docsy go 1.12 +replace github.com/google/docsy/module v0.1.1-0.20220124145409-3e2cfeba3ad1e => 03eede2c51f62 + require ( + github.com/google/docsy/module v0.1.1-0.20220124145409-3e2cfeba3ad1 // indirect github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac // indirect github.com/twbs/bootstrap v4.6.1+incompatible // indirect ) diff --git a/module/config.toml b/module/config.toml new file mode 100644 index 0000000000..17abfaf9f7 --- /dev/null +++ b/module/config.toml @@ -0,0 +1,40 @@ +[module] +_merge = "deep" +# work around https://github.com/golang/go/issues/37397 +[[module.mounts]] + source = "assets/bootstrap/scss/_vendor" + target = "assets/vendor/bootstrap/scss/vendor" +# mount user guide so that we can copy it to skeleton site +[[module.mounts]] + source = "userguide" + target = "assets/userguide" +# mount asserts directory +[[module.mounts]] + source = "assets" + target = "assets" +# mount i18n directory +[[module.mounts]] + source = "i18n" + target = "i18n" +# mount layouts directory +[[module.mounts]] + source = "layouts" + target = "layouts" +# mount static directory +[[module.mounts]] + source = "static" + target = "static" +# Dependencies are brought in as modules +# and mount points are declared +[[module.imports]] + path = "github.com/twbs/bootstrap" + disable = false +[[module.imports.mounts]] + source = "scss" + target = "assets/vendor/bootstrap/scss" +[[module.imports]] + path = "github.com/FortAwesome/Font-Awesome" + disable = false +[[module.imports.mounts]] + source = "scss" + target = "assets/vendor/Font-Awesome/scss" \ No newline at end of file diff --git a/module/go.mod b/module/go.mod new file mode 100644 index 0000000000..5f3160bdcc --- /dev/null +++ b/module/go.mod @@ -0,0 +1,3 @@ +module github.com/google/docsy/module + +go 1.12 From db3ca1bd4fc9af8ad9b7720632fcbf3c75b511f3 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Sat, 29 Jan 2022 20:04:28 +0100 Subject: [PATCH 5/7] Correcting github.com/google/docsy/module, userguide: correcting config.toml --- go.mod | 4 +-- go.sum | 2 ++ .../assets}/bootstrap/README.txt | 0 .../assets}/bootstrap/scss/_vendor/README.txt | 0 .../assets}/bootstrap/scss/_vendor/_rfs.scss | 0 module/config.toml | 2 +- module/module.go | 1 + userguide/config.toml | 30 ++++++++++++------- userguide/go.mod | 4 +-- userguide/go.sum | 2 -- 10 files changed, 26 insertions(+), 19 deletions(-) rename {assets => module/assets}/bootstrap/README.txt (100%) rename {assets => module/assets}/bootstrap/scss/_vendor/README.txt (100%) rename {assets => module/assets}/bootstrap/scss/_vendor/_rfs.scss (100%) create mode 100644 module/module.go delete mode 100644 userguide/go.sum diff --git a/go.mod b/go.mod index 80be01a0ba..63544fe35c 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,10 @@ module github.com/google/docsy go 1.12 -replace github.com/google/docsy/module v0.1.1-0.20220124145409-3e2cfeba3ad1e => 03eede2c51f62 +//replace github.com/google/docsy/module v0.0.0-20220129185551-e4b42eecdf1d => e4b42eecdf1d require ( - github.com/google/docsy/module v0.1.1-0.20220124145409-3e2cfeba3ad1 // indirect github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac // indirect + github.com/google/docsy/module v0.2.0-pre // indirect github.com/twbs/bootstrap v4.6.1+incompatible // indirect ) diff --git a/go.sum b/go.sum index 7b9a0c9cc6..54d7ffa3e7 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac h1:AjwgwoaDsNEA1Wtc8pgw/BqG7SEk9bKxXPjEPQQ42vY= github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/google/docsy/module v0.0.0-20220129185551-e4b42eecdf1d h1:5f3AMLwAG2RrZrafxbbv1NE6EpGQkJCiSvJUkJVLYWc= +github.com/google/docsy/module v0.0.0-20220129185551-e4b42eecdf1d/go.mod h1:XSdPwCDtX3JK1d+wwDwQTSYQ2ZEHzghf/uhGIPoeDjw= github.com/twbs/bootstrap v4.6.1+incompatible h1:75PsBfPU1SS65ag0Z3Cq6JNXVAfUNfB0oCLHh9k9Fu8= github.com/twbs/bootstrap v4.6.1+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/assets/bootstrap/README.txt b/module/assets/bootstrap/README.txt similarity index 100% rename from assets/bootstrap/README.txt rename to module/assets/bootstrap/README.txt diff --git a/assets/bootstrap/scss/_vendor/README.txt b/module/assets/bootstrap/scss/_vendor/README.txt similarity index 100% rename from assets/bootstrap/scss/_vendor/README.txt rename to module/assets/bootstrap/scss/_vendor/README.txt diff --git a/assets/bootstrap/scss/_vendor/_rfs.scss b/module/assets/bootstrap/scss/_vendor/_rfs.scss similarity index 100% rename from assets/bootstrap/scss/_vendor/_rfs.scss rename to module/assets/bootstrap/scss/_vendor/_rfs.scss diff --git a/module/config.toml b/module/config.toml index 17abfaf9f7..3aa828a12c 100644 --- a/module/config.toml +++ b/module/config.toml @@ -37,4 +37,4 @@ _merge = "deep" disable = false [[module.imports.mounts]] source = "scss" - target = "assets/vendor/Font-Awesome/scss" \ No newline at end of file + target = "assets/vendor/Font-Awesome/scss" diff --git a/module/module.go b/module/module.go new file mode 100644 index 0000000000..d0c47a6fc0 --- /dev/null +++ b/module/module.go @@ -0,0 +1 @@ +package module diff --git a/userguide/config.toml b/userguide/config.toml index 9747e63838..828f264d64 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -4,17 +4,25 @@ title = "Docsy Example" enableRobotsTXT = true # set docsy as theme, either locally or as module -[module] - # uncomment line below for temporary local development of module - # replacements = "github.com/google/docsy -> ../../docsy" - [module.hugoVersion] - extended = true - min = "0.73.0" - [[module.imports]] - # either get theme from local themes folder - path = "docsy" - # or pull it in as hugo module - # path = "github.com/google/docsy" +theme = ["docsy"] +# theme = ["github.com/google/docsy", "github.com/google/docsy/module"] + +# when using docsy as module, instead of using +# theme = ["github.com/google/docsy", "github.com/google/docsy/module"] +# you may alternatively use the declaration given below: +#[module] +# # uncomment lines below for temporary local development of module +# # replacements = "github.com/google/docsy -> ../../docsy" +# # replacements = "github.com/google/docsy/module -> ../../docsy" +# [module.hugoVersion] +# extended = true +# min = "0.73.0" +# [[module.imports]] +# # pull in docsy as hugo module +# path = "github.com/google/docsy" +# [[module.imports]] +# # pull in workaround and dependencies +# path = "github.com/google/docsy/module" # Will give values to .Lastmod etc. enableGitInfo = true diff --git a/userguide/go.mod b/userguide/go.mod index 3205870c19..f796dadc38 100644 --- a/userguide/go.mod +++ b/userguide/go.mod @@ -1,5 +1,3 @@ -module github.com/google/docsy/userguide +module github.com/google/docsy go 1.12 - -require github.com/google/docsy v0.1.1-0.20220124145409-3e2cfeba3ad1 // indirect diff --git a/userguide/go.sum b/userguide/go.sum deleted file mode 100644 index 220b3abbd2..0000000000 --- a/userguide/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/google/docsy v0.1.1-0.20220124145409-3e2cfeba3ad1 h1:GFZN0DfvT05pu5t799Mv0NO/XE4iW2h0fX8VxukM8Kg= -github.com/google/docsy v0.1.1-0.20220124145409-3e2cfeba3ad1/go.mod h1:alhAPKceHP14eqO+nJEhYehHeNcPKV8QnduoauTBZhs= From 25b954a46903c3e8917666eb6c0960bbc418b811 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Sun, 6 Feb 2022 17:10:55 +0100 Subject: [PATCH 6/7] Changes as requested per review from Patrice Chalin (#871) --- .../assets/bootstrap/README.txt | 0 .../assets/bootstrap/scss/_vendor/README.txt | 0 .../assets/bootstrap/scss/_vendor/_rfs.scss | 0 {module => dependencies}/config.toml | 4 --- dependencies/go.mod | 3 ++ go.mod | 4 +-- go.sum | 2 -- module/go.mod | 3 -- module/module.go | 1 - userguide/config.toml | 35 +++++-------------- 10 files changed, 13 insertions(+), 39 deletions(-) rename {module => dependencies}/assets/bootstrap/README.txt (100%) rename {module => dependencies}/assets/bootstrap/scss/_vendor/README.txt (100%) rename {module => dependencies}/assets/bootstrap/scss/_vendor/_rfs.scss (100%) rename {module => dependencies}/config.toml (84%) create mode 100644 dependencies/go.mod delete mode 100644 module/go.mod delete mode 100644 module/module.go diff --git a/module/assets/bootstrap/README.txt b/dependencies/assets/bootstrap/README.txt similarity index 100% rename from module/assets/bootstrap/README.txt rename to dependencies/assets/bootstrap/README.txt diff --git a/module/assets/bootstrap/scss/_vendor/README.txt b/dependencies/assets/bootstrap/scss/_vendor/README.txt similarity index 100% rename from module/assets/bootstrap/scss/_vendor/README.txt rename to dependencies/assets/bootstrap/scss/_vendor/README.txt diff --git a/module/assets/bootstrap/scss/_vendor/_rfs.scss b/dependencies/assets/bootstrap/scss/_vendor/_rfs.scss similarity index 100% rename from module/assets/bootstrap/scss/_vendor/_rfs.scss rename to dependencies/assets/bootstrap/scss/_vendor/_rfs.scss diff --git a/module/config.toml b/dependencies/config.toml similarity index 84% rename from module/config.toml rename to dependencies/config.toml index 3aa828a12c..fced225788 100644 --- a/module/config.toml +++ b/dependencies/config.toml @@ -4,10 +4,6 @@ _merge = "deep" [[module.mounts]] source = "assets/bootstrap/scss/_vendor" target = "assets/vendor/bootstrap/scss/vendor" -# mount user guide so that we can copy it to skeleton site -[[module.mounts]] - source = "userguide" - target = "assets/userguide" # mount asserts directory [[module.mounts]] source = "assets" diff --git a/dependencies/go.mod b/dependencies/go.mod new file mode 100644 index 0000000000..f151fcb953 --- /dev/null +++ b/dependencies/go.mod @@ -0,0 +1,3 @@ +module github.com/google/docsy/dependencies + +go 1.12 diff --git a/go.mod b/go.mod index 63544fe35c..72a37f6811 100644 --- a/go.mod +++ b/go.mod @@ -2,10 +2,8 @@ module github.com/google/docsy go 1.12 -//replace github.com/google/docsy/module v0.0.0-20220129185551-e4b42eecdf1d => e4b42eecdf1d - require ( github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac // indirect - github.com/google/docsy/module v0.2.0-pre // indirect + github.com/google/docsy/dependencies v0.2.0-pre // indirect github.com/twbs/bootstrap v4.6.1+incompatible // indirect ) diff --git a/go.sum b/go.sum index 54d7ffa3e7..7b9a0c9cc6 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,4 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac h1:AjwgwoaDsNEA1Wtc8pgw/BqG7SEk9bKxXPjEPQQ42vY= github.com/FortAwesome/Font-Awesome v0.0.0-20210804190922-7d3d774145ac/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= -github.com/google/docsy/module v0.0.0-20220129185551-e4b42eecdf1d h1:5f3AMLwAG2RrZrafxbbv1NE6EpGQkJCiSvJUkJVLYWc= -github.com/google/docsy/module v0.0.0-20220129185551-e4b42eecdf1d/go.mod h1:XSdPwCDtX3JK1d+wwDwQTSYQ2ZEHzghf/uhGIPoeDjw= github.com/twbs/bootstrap v4.6.1+incompatible h1:75PsBfPU1SS65ag0Z3Cq6JNXVAfUNfB0oCLHh9k9Fu8= github.com/twbs/bootstrap v4.6.1+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/module/go.mod b/module/go.mod deleted file mode 100644 index 5f3160bdcc..0000000000 --- a/module/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/google/docsy/module - -go 1.12 diff --git a/module/module.go b/module/module.go deleted file mode 100644 index d0c47a6fc0..0000000000 --- a/module/module.go +++ /dev/null @@ -1 +0,0 @@ -package module diff --git a/userguide/config.toml b/userguide/config.toml index 828f264d64..08e9f99617 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -1,32 +1,6 @@ baseURL = "/" title = "Docsy Example" -enableRobotsTXT = true - -# set docsy as theme, either locally or as module -theme = ["docsy"] -# theme = ["github.com/google/docsy", "github.com/google/docsy/module"] - -# when using docsy as module, instead of using -# theme = ["github.com/google/docsy", "github.com/google/docsy/module"] -# you may alternatively use the declaration given below: -#[module] -# # uncomment lines below for temporary local development of module -# # replacements = "github.com/google/docsy -> ../../docsy" -# # replacements = "github.com/google/docsy/module -> ../../docsy" -# [module.hugoVersion] -# extended = true -# min = "0.73.0" -# [[module.imports]] -# # pull in docsy as hugo module -# path = "github.com/google/docsy" -# [[module.imports]] -# # pull in workaround and dependencies -# path = "github.com/google/docsy/module" - -# Will give values to .Lastmod etc. -enableGitInfo = true - # Language settings contentDir = "content/en" defaultContentLanguage = "en" @@ -34,6 +8,15 @@ defaultContentLanguageInSubdir = false # Useful when translating. enableMissingTranslationPlaceholders = true +enableRobotsTXT = true + +# set docsy as theme, either locally or as hugo module +theme = ["docsy"] +# theme = ["github.com/google/docsy", "github.com/google/docsy/dependencies"] + +# Will give values to .Lastmod etc. +enableGitInfo = true + # disableKinds = ["taxonomy", "taxonomyTerm"] # Highlighting config From dcf58ac14cd77bf72ab40eede1d6f455554efcfb Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Mon, 14 Feb 2022 20:15:18 +0100 Subject: [PATCH 7/7] User guide: changes to as requested per review (#871) --- config.toml | 1 - netlify.toml | 2 +- userguide/config.toml | 3 +-- userguide/go.mod | 3 --- 4 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 userguide/go.mod diff --git a/config.toml b/config.toml index 3795f450a2..406ed0f762 100644 --- a/config.toml +++ b/config.toml @@ -27,7 +27,6 @@ path = "_print" permalinkable = false [module] -_merge = "deep" [module.hugoVersion] extended = true min = "0.73.0" \ No newline at end of file diff --git a/netlify.toml b/netlify.toml index 85fb54e521..e7d2541e1e 100644 --- a/netlify.toml +++ b/netlify.toml @@ -6,7 +6,7 @@ publish = "userguide/public" command = "npm install && npm run build:preview" [build.environment] -GO_VERSION = "1.17.6" +GO_VERSION = "1.17.7" HUGO_THEME = "repo" [context.production] diff --git a/userguide/config.toml b/userguide/config.toml index 08e9f99617..56ffffc4d9 100644 --- a/userguide/config.toml +++ b/userguide/config.toml @@ -10,9 +10,8 @@ enableMissingTranslationPlaceholders = true enableRobotsTXT = true -# set docsy as theme, either locally or as hugo module +# Hugo allows theme composition (and inheritance). The precedence is from left to right. theme = ["docsy"] -# theme = ["github.com/google/docsy", "github.com/google/docsy/dependencies"] # Will give values to .Lastmod etc. enableGitInfo = true diff --git a/userguide/go.mod b/userguide/go.mod deleted file mode 100644 index f796dadc38..0000000000 --- a/userguide/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/google/docsy - -go 1.12