From c23340d49e0cb4fe2096fe8eee8d6f61b2dab6be Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 18 Aug 2022 06:28:41 -0400 Subject: [PATCH] Config as YAML for Docsy and UG (#1184) --- config.toml | 64 ------------ config.yaml | 46 +++++++++ userguide/config.toml | 223 ------------------------------------------ userguide/config.yaml | 135 +++++++++++++++++++++++++ 4 files changed, 181 insertions(+), 287 deletions(-) delete mode 100644 config.toml create mode 100644 config.yaml delete mode 100644 userguide/config.toml create mode 100644 userguide/config.yaml diff --git a/config.toml b/config.toml deleted file mode 100644 index 874e57fcf1..0000000000 --- a/config.toml +++ /dev/null @@ -1,64 +0,0 @@ -# This the theme configuration for Docsy. -# Allowed configuration in a theme is (currently): -# params (global and per language) -# menu (global and per language) -# outputformats and mediatypes - -[params] -time_format_blog = "Monday, January 02, 2006" -time_format_default = "January 2, 2006" -# Sections to publish in the main RSS feed. -rss_sections = ["blog"] - -[params.drawio] -enable = true -#drawio_server = "https://example.com/" - -# For a full list of parameters used in Docsy sites, see: -# https://github.com/google/docsy-example/blob/master/config.toml - - -[outputFormats] -[outputFormats.PRINT] -baseName = "index" -isHTML = true -mediaType = "text/html" -path = "_print" -permalinkable = false - -[module] -[module.hugoVersion] -extended = true -min = "0.73.0" - [[module.mounts]] - source = 'assets' - target = 'assets' - [[module.mounts]] - source = 'node_modules/bootstrap' - target = 'assets/vendor/bootstrap' - [[module.mounts]] - source = 'node_modules/@fortawesome/fontawesome-free' - target = 'assets/vendor/Font-Awesome' - [[module.mounts]] - source = "i18n" - target = "i18n" - [[module.mounts]] - source = 'layouts' - target = 'layouts' - [[module.mounts]] - source = 'static' - target = 'static' - [[module.mounts]] - source = 'node_modules/@fortawesome/fontawesome-free/webfonts' - target = 'static/webfonts' - # Mounts for projects using Docsy as an NPM package. The source path prefix - # "../.." moves out of themes/docsy so that Docsy can find its dependencies. - [[module.mounts]] - source = '../../node_modules/bootstrap' - target = 'assets/vendor/bootstrap' - [[module.mounts]] - source = '../../node_modules/@fortawesome/fontawesome-free' - target = 'assets/vendor/Font-Awesome' - [[module.mounts]] - source = '../../node_modules/@fortawesome/fontawesome-free/webfonts' - target = 'static/webfonts' diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000000..8a4d145dc3 --- /dev/null +++ b/config.yaml @@ -0,0 +1,46 @@ +# Docsy config +# +# cSpell:ignore docsy fortawesome fontawesome webfonts + +params: + time_format_blog: Monday, January 02, 2006 + time_format_default: January 2, 2006 + rss_sections: [blog] + drawio: + enable: true + +outputFormats: + PRINT: + baseName: index + isHTML: true + mediaType: text/html + path: _print + permalinkable: false + +module: + hugoVersion: + extended: true + min: 0.73.0 + mounts: + - source: assets + target: assets + - source: node_modules/bootstrap + target: assets/vendor/bootstrap + - source: node_modules/@fortawesome/fontawesome-free + target: assets/vendor/Font-Awesome + - source: i18n + target: i18n + - source: layouts + target: layouts + - source: static + target: static + - source: node_modules/@fortawesome/fontawesome-free/webfonts + target: static/webfonts + # Mounts for projects using Docsy as an NPM package. The source path prefix + # "../.." moves out of themes/docsy so that Docsy can find its dependencies. + - source: ../../node_modules/bootstrap + target: assets/vendor/bootstrap + - source: ../../node_modules/@fortawesome/fontawesome-free + target: assets/vendor/Font-Awesome + - source: ../../node_modules/@fortawesome/fontawesome-free/webfonts + target: static/webfonts diff --git a/userguide/config.toml b/userguide/config.toml deleted file mode 100644 index ed8d083581..0000000000 --- a/userguide/config.toml +++ /dev/null @@ -1,223 +0,0 @@ -baseURL = "/" -title = "Docsy Example" - -enableRobotsTXT = true - -# Hugo allows theme composition (and inheritance). The precedence is from left to right. -theme = ["docsy"] - -# Will give values to .Lastmod etc. -enableGitInfo = true - -# disableKinds = ["taxonomy", "taxonomyTerm"] - -# Highlighting config -pygmentsCodeFences = true -pygmentsUseClasses = false -# Use the new Chroma Go highlighter in Hugo. -pygmentsUseClassic = false -#pygmentsOptions = "linenos=table" -# 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"] - -[outputs] -home = [ "HTML" ] -page = [ "HTML" ] -section = [ "HTML", "RSS", "print"] - -# Image processing configuration. -[imaging] -resampleFilter = "CatmullRom" -quality = 75 -anchor = "smart" - -# Additional menu items - -[[menu.main]] - name = "Example Site" - weight = 40 - url = "https://example.docsy.dev" - post = '' - -[services] -[services.googleAnalytics] -id = "UA-00000000-0" # FIXME: https://github.com/google/docsy/issues/1097 - -# Language configuration - -[languages] -[languages.en] -title = "Docsy" -description = "Docsy does docs" -languageName ="English" -# Weight used for sorting. -weight = 1 - -[markup] - [markup.goldmark] - [markup.goldmark.renderer] - unsafe = true - [markup.highlight] - # See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html - style = "tango" - # Uncomment if you want your chosen highlight style used for code blocks without a specified language - # guessSyntax = "true" - -# Everything below this are Site Params - -[params] -copyright = "The Docsy Authors" -privacy_policy = "https://policies.google.com/privacy" - -# Menu title if your navbar has a versions selector to access old versions of your site. -# This menu appears only if you have at least one [params.versions] set. -version_menu = "Releases" - -# Flag used in the "version-banner" partial to decide whether to display a -# banner on every page indicating that this is an archived version of the docs. -# Set this flag to "true" if you want to display the banner. -archived_version = false - -# The version number for the version of the docs represented in this doc set. -# Used in the "version-banner" partial to display a version number for the -# current doc set. -version = "0.4.0" - -# A link to latest version of the docs. Used in the "version-banner" partial to -# point people to the main doc site. -url_latest_version = "https://example.com" - -# Repository configuration (URLs for in-page links to opening issues and suggesting changes) -github_repo = "https://github.com/google/docsy" -# An optional link to a related project repo. For example, the sibling repository where your product code lives. -github_project_repo = "https://github.com/google/docsy" - -# Specify a value here if your content directory is not in your repo's root directory -github_subdir = "userguide" - -time_format_blog = "Monday, January 02, 2006" -time_format_default = "January 2, 2006" -# Sections to publish in the main RSS feed. -rss_sections = ["blog"] - -# Google Custom Search Engine ID. Remove or comment out to disable search. -gcs_engine_id = "011217106833237091527:la2vtv2emlw" - -# Enable Algolia DocSearch -algolia_docsearch = false - -#Enable offline search with Lunr.js -offlineSearch = false -offlineSearchSummaryLength = 70 -offlineSearchMaxResults = 10 - -# Enable syntax highlighting and copy buttons on code blocks with Prism -prism_syntax_highlighting = false - -# User interface configuration -[params.ui] -# Enable to show the side bar menu in its compact state. -sidebar_menu_compact = true -sidebar_menu_foldable = false -sidebar_cache_limit = 10 -# 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) -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 -navbar_logo = true - -# For details concerning the page feedback widget, see -# https://www.docsy.dev/docs/adding-content/feedback/#user-feedback -[params.ui.feedback] -enable = true -# The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful). -# Update with your own repository and response text. -yes = 'Glad to hear it! Please tell us how we can improve.' -no = 'Sorry to hear that. Please tell us how we can improve.' - -# Adds a reading time to the top of each doc. -# If you want this feature, but occasionally need to remove the Reading time from a single page, -# add "hide_readingtime: true" to the page's front matter -[params.ui.readingtime] -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 = "fa-brands 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-solid fa-envelope" - desc = "Sign up for Docsy announcements" -[[params.links.user]] - name ="Twitter" - url = "https://twitter.com/docsydocs" - icon = "fa-brands 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 = "fa-brands 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 = "fa-brands fa-github" - desc = "Development takes place here!" -# [[params.links.developer]] - # name = "Slack" - # url = "https://example.org/slack" - # icon = "fa-brands fa-slack" - # desc = "Chat with other project developers" -# [[params.links.developer]] - # name = "Developer mailing list" - # url = "https://example.org/mail" - # icon = "fa-solid fa-envelope" - # desc = "Discuss development issues around the project" - -[params.mermaid] -enable = true -theme = "default" - -[params.plantuml] -enable = true -theme = "default" -svg_image_url = "https://www.plantuml.com/plantuml/svg/" -svg = false - -[params.katex] -enable = true -html_dom_element = "document.body" - -# enable display of chemical equations and physical units via mhchem extension -[params.katex.mhchem] -enable = true - -[params.print] -disable_toc = false - -[params.markmap] -enable = true - -# [params.taxonomy] -# taxonomyCloud = ["tags", "categories"] # set taxonomyCloud = [] to hide taxonomy clouds -# taxonomyCloudTitle = ["Tag Cloud", "Cloud of Categories"] # if used, must have same length as taxonomyCloud -# taxonomyPageHeader = ["tags", "categories"] # set taxonomyPageHeader = [] to hide taxonomies on the page headers - -[taxonomies] -tag = "tags" -category = "categories" - -[module] -[[module.mounts]] - source = 'content/en' - target = 'content' diff --git a/userguide/config.yaml b/userguide/config.yaml new file mode 100644 index 0000000000..db4d85f7a5 --- /dev/null +++ b/userguide/config.yaml @@ -0,0 +1,135 @@ +baseURL: / +title: Docsy Example +enableRobotsTXT: true +theme: [docsy] +enableGitInfo: true + +pygmentsCodeFences: true +pygmentsUseClasses: false +pygmentsUseClassic: false +pygmentsStyle: tango + +outputs: + home: [HTML] + page: [HTML] + section: [HTML, RSS, print] + +imaging: + resampleFilter: CatmullRom + quality: 75 + anchor: smart + +menu: + main: + - name: Example Site + weight: 40 + url: https://example.docsy.dev + post: + +services: + googleAnalytics: + id: UA-00000000-0 + +languages: + en: + title: Docsy + description: Docsy does docs + languageName: English + weight: 1 + +markup: + goldmark: + renderer: + unsafe: true + highlight: + style: tango + +params: + copyright: The Docsy Authors + privacy_policy: https://policies.google.com/privacy + version_menu: Releases + archived_version: false + version: 0.4.0 + url_latest_version: https://example.com + github_repo: https://github.com/google/docsy + github_project_repo: https://github.com/google/docsy + github_subdir: userguide + time_format_blog: Monday, January 02, 2006 + time_format_default: January 2, 2006 + rss_sections: [blog] # TODO: drop since this is the default + gcs_engine_id: 011217106833237091527:la2vtv2emlw + algolia_docsearch: false + offlineSearch: false + offlineSearchSummaryLength: 70 + offlineSearchMaxResults: 10 + prism_syntax_highlighting: false + ui: + sidebar_menu_compact: true + sidebar_menu_foldable: false + sidebar_cache_limit: 10 + breadcrumb_disable: false + sidebar_search_disable: false + navbar_logo: true + feedback: + enable: true + 'yes': >- + Glad to hear it! Please tell us how we can + improve. + 'no': >- + Sorry to hear that. Please tell us how we can + improve. + readingtime: + enable: false + links: + user: + - name: GitHub Discussions + url: https://github.com/google/docsy/discussions + icon: fa-brands fa-github + desc: Discussion and help from your fellow users + - name: User mailing list + url: https://groups.google.com/forum/#!forum/docsy-users + icon: fa-solid fa-envelope + desc: Sign up for Docsy announcements + - name: Twitter + url: https://twitter.com/docsydocs + icon: fa-brands fa-twitter + desc: Follow us on Twitter to get the latest news! + - name: Stack Overflow + url: https://stackoverflow.com/questions/tagged/docsy + icon: fa-brands fa-stack-overflow + desc: Practical questions and curated answers + developer: + - name: GitHub + url: https://github.com/google/docsy + icon: fa-brands fa-github + desc: Development takes place here! + + mermaid: + enable: true + theme: default + plantuml: + enable: true + theme: default + svg_image_url: https://www.plantuml.com/plantuml/svg/ + svg: false + katex: + enable: true + html_dom_element: document.body + mhchem: + enable: true + print: + disable_toc: false + markmap: + enable: true + +taxonomies: + tag: tags + category: categories + +module: + mounts: + - source: content/en + target: content