diff --git a/.github/workflows/user-documentation.yaml b/.github/workflows/user-documentation.yaml index 1555bdb..7ca85a0 100644 --- a/.github/workflows/user-documentation.yaml +++ b/.github/workflows/user-documentation.yaml @@ -1,6 +1,7 @@ name: User Documentation on: + pull_request: push: branches: - main # Set a branch to deploy @@ -15,27 +16,18 @@ jobs: with: fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod - - uses: actions/checkout@v4 - with: - repository: google/docsy - path: docs/themes/docsy - submodules: true - - name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: + hugo-version: '0.123.8' extended: true - name: Setup Node uses: actions/setup-node@v4 with: - node-version: '16' - - - run: cd docs && npm install postcss postcss-cli autoprefixer - - - run: cd docs/themes/docsy && npm install + node-version: 20 - - run: cd docs && hugo --minify + - run: cd docs && npm install postcss-cli autoprefixer && hugo --minify - name: Deploy uses: peaceiris/actions-gh-pages@v3 diff --git a/docs/.gitignore b/docs/.gitignore index e5020f2..fb10aa1 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -2,5 +2,6 @@ /node_modules /package-lock.json /package.json +/public /resources /themes diff --git a/docs/Makefile b/docs/Makefile index e3b77a1..03d0631 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,9 +1,13 @@ .PHONY: serve -serve: themes/docsy +serve: cd .. && \ - docker run --rm -it -v $$(pwd):/src -u $$(id -u) -p 1313:1313 \ - --entrypoint sh klakegg/hugo:ext-alpine -c \ - 'cd docs && npm install postcss postcss-cli autoprefixer && hugo --baseURL=/ --bind=0.0.0.0 serve' + docker run --rm -it -v $$(pwd):/src -v $$HOME/.cache/hugo_cache:/home/node/.cache/hugo_cache -u $$(id -u) -p 1313:1313 \ + --entrypoint sh hugomods/hugo:latest -c \ + "cd docs && hugo server --baseURL=/ --bind 0.0.0.0" -themes/docsy: - git clone --recurse-submodules http://github.com/google/docsy themes/docsy +.PHONY: minify +minify: + cd .. && \ + docker run --rm -it -v $$(pwd):/src -v $$HOME/.cache/hugo_cache:/home/node/.cache/hugo_cache -u $$(id -u)\ + --entrypoint sh hugomods/hugo:latest -c \ + "cd docs && npm install postcss-cli autoprefixer && hugo --minify" diff --git a/docs/assets/scss/_variables_project.scss b/docs/assets/scss/_variables_project.scss new file mode 100644 index 0000000..2569027 --- /dev/null +++ b/docs/assets/scss/_variables_project.scss @@ -0,0 +1,6 @@ +/* + +Add styles or override variables from the theme here. + +*/ + diff --git a/docs/go.mod b/docs/go.mod new file mode 100644 index 0000000..37ec744 --- /dev/null +++ b/docs/go.mod @@ -0,0 +1,5 @@ +module github.com/google/docsy-example + +go 1.12 + +require github.com/google/docsy v0.9.1 // indirect diff --git a/docs/go.sum b/docs/go.sum new file mode 100644 index 0000000..c11d56b --- /dev/null +++ b/docs/go.sum @@ -0,0 +1,5 @@ +github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/google/docsy v0.9.1 h1:+jqges1YCd+yHeuZ1BUvD8V8mEGVtPxULg5j/vaJ984= +github.com/google/docsy v0.9.1/go.mod h1:saOqKEUOn07Bc0orM/JdIF3VkOanHta9LU5Y53bwN2U= +github.com/twbs/bootstrap v5.2.3+incompatible h1:lOmsJx587qfF7/gE7Vv4FxEofegyJlEACeVV+Mt7cgc= +github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/docs/config.toml b/docs/hugo.toml similarity index 56% rename from docs/config.toml rename to docs/hugo.toml index 4b1a212..a26e770 100644 --- a/docs/config.toml +++ b/docs/hugo.toml @@ -1,14 +1,6 @@ baseURL = "/piv-agent/" title = "PIV Agent" -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 - # Language settings contentDir = "content/en" defaultContentLanguage = "en" @@ -16,7 +8,13 @@ defaultContentLanguageInSubdir = false # Useful when translating. enableMissingTranslationPlaceholders = true -disableKinds = ["taxonomy", "taxonomyTerm"] +enableRobotsTXT = true + +# Will give values to .Lastmod etc. +enableGitInfo = true + +# Comment out to enable taxonomies in Docsy +disableKinds = ["taxonomy"] # Highlighting config pygmentsCodeFences = true @@ -31,58 +29,35 @@ pygmentsStyle = "tango" [permalinks] blog = "/:section/:year/:month/:day/:slug/" -## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday -[blackfriday] -plainIDAnchors = true -hrefTargetBlank = true -angledQuotes = false -latexDashes = true - # Image processing configuration. [imaging] resampleFilter = "CatmullRom" quality = 75 anchor = "smart" -[services] -[services.googleAnalytics] -# Comment out the next line to disable GA tracking. Also disables the feature described in [params.ui.feedback]. -# id = "UA-00000000-0" - # Language configuration [languages] [languages.en] -title = "PIV Agent" -description = "PIV Agent replaces ssh-agent and gpg-agent, and allows you to use your PIV security token with SSH or GPG" languageName ="English" # Weight used for sorting. weight = 1 -# [languages.no] -# title = "Goldydocs" -# description = "Docsy er operativsystem for skyen" -# languageName ="Norsk" -# contentDir = "content/no" -# time_format_default = "02.01.2006" -# time_format_blog = "02.01.2006" -# -# [languages.fa] -# title = "اسناد گلدی" -# description = "یک نمونه برای پوسته داکسی" -# languageName ="فارسی" -# contentDir = "content/fa" -# time_format_default = "2006.01.02" -# time_format_blog = "2006.01.02" +[languages.en.params] +title = "PIV Agent" +description = "PIV Agent replaces ssh-agent and gpg-agent, and allows you to use your PIV security token with SSH or GPG" + [markup] [markup.goldmark] + [markup.goldmark.parser.attribute] + block = true [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" + # 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 @@ -91,9 +66,6 @@ weight = 1 section = ["HTML", "print"] [params] -copyright = "PIV Agent Contributors" -# privacy_policy = "https://github.com/smlx/piv-agent" - # First one is picked as the Twitter card image if not set on page. # images = ["images/project-illustration.png"] @@ -101,13 +73,13 @@ copyright = "PIV Agent Contributors" # 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 +# 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 +# Used in the "version-banner" partial to display a version number for the # current doc set. version = "0.0" @@ -118,20 +90,17 @@ url_latest_version = "https://example.com" # Repository configuration (URLs for in-page links to opening issues and suggesting changes) github_repo = "https://github.com/smlx/piv-agent" # An optional link to a related project repo. For example, the sibling repository where your product code lives. -# github_project_repo = "https://github.com/smlx/piv-agent" +# 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 = "docs" +# github_subdir = "" -# Uncomment this if you have a newer GitHub repo with "main" as the default branch, +# Uncomment this if your GitHub repo does not have "main" as the default branch, # or specify a new value if you want to reference another branch in your GitHub links github_branch= "main" # Google Custom Search Engine ID. Remove or comment out to disable search. -#gcs_engine_id = "d72aa9b2712488cc3" - -# Enable Algolia DocSearch -algolia_docsearch = false +# gcs_engine_id = "d72aa9b2712488cc3" # Enable Lunr.js offline search offlineSearch = true @@ -139,66 +108,56 @@ offlineSearch = true # Enable syntax highlighting and copy buttons on code blocks with Prism prism_syntax_highlighting = false +[params.copyright] + authors = "PIV Agent Contributors | [CC BY SA 4.0](https://creativecommons.org/licenses/by-sa/4.0)" + from_year = 2020 + # User interface configuration [params.ui] -# Enable to show the side bar menu in its compact state. -sidebar_menu_compact = false # 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 +# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top navbar navbar_logo = true -# Set to true to disable the About link in the site footer -footer_about_disable = false +# Set to true if you don't want the top navbar to be translucent when over a `block/cover`, like on the homepage. +navbar_translucent_over_cover_disable = false +# Enable to show the side bar menu in its compact state. +sidebar_menu_compact = 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 # Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events. # This feature depends on [services.googleAnalytics] and will be disabled if "services.googleAnalytics.id" is not set. # If you want this feature, but occasionally need to remove the "Feedback" section from a single page, # add "hide_feedback: true" to the page's front matter. [params.ui.feedback] -enable = true +enable = false # The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful). -yes = 'Glad to hear it! Please tell us how we can improve.' -no = 'Sorry to hear that. Please tell us how we can improve.' +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, +# 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 = "User mailing list" -# url = "https://example.org/mail" -# icon = "fa fa-envelope" -# desc = "Discussion and help from your fellow users" -# [[params.links.user]] -# name ="Twitter" -# url = "https://example.org/twitter" -# icon = "fab fa-twitter" -# desc = "Follow us on Twitter to get the latest news!" -# [[params.links.user]] -# name = "Stack Overflow" -# url = "https://example.org/stack" -# 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/smlx/piv-agent" - 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" -# [[params.links.developer]] -# name = "Developer mailing list" -# url = "https://example.org/mail" -# icon = "fa fa-envelope" -# desc = "Discuss development issues around the project" -# + name = "GitHub" + url = "https://github.com/smlx/piv-agent" + icon = "fab fa-github" + desc = "Development takes place here!" + +# hugo module configuration + +[module] + # Uncomment the next line to build and serve using local docsy clone declared in the named Hugo workspace: + # workspace = "docsy.work" + [module.hugoVersion] + extended = true + min = "0.110.0" + [[module.imports]] + path = "github.com/google/docsy" + disable = false diff --git a/docs/layouts/404.html b/docs/layouts/404.html new file mode 100644 index 0000000..1a9bd70 --- /dev/null +++ b/docs/layouts/404.html @@ -0,0 +1,7 @@ +{{ define "main" -}} +
+

Not found

+

Oops! This page doesn't exist. Try going back to the home page.

+

You can learn how to make a 404 page like this in Custom 404 Pages.

+
+{{- end }} diff --git a/docs/layouts/_default/_markup/render-heading.html b/docs/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..7f8e974 --- /dev/null +++ b/docs/layouts/_default/_markup/render-heading.html @@ -0,0 +1 @@ +{{ template "_default/_markup/td-render-heading.html" . }}