From 569830853a41b6a3442025ae8a06a564f89cfb21 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Sat, 21 Aug 2021 22:11:13 +0800 Subject: [PATCH 1/3] chore: add initial hugo docs config --- docs/config.toml | 204 +++++++++++++++++++++++++++++++++ docs/content/en/_index.html | 17 +++ docs/content/en/docs/_index.md | 12 ++ 3 files changed, 233 insertions(+) create mode 100644 docs/config.toml create mode 100644 docs/content/en/_index.html create mode 100644 docs/content/en/docs/_index.md diff --git a/docs/config.toml b/docs/config.toml new file mode 100644 index 0000000..4b1a212 --- /dev/null +++ b/docs/config.toml @@ -0,0 +1,204 @@ +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" +defaultContentLanguageInSubdir = false +# Useful when translating. +enableMissingTranslationPlaceholders = 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" + +# Configure how URLs look like per section. +[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" + +[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 + +# Comment out if you don't want the "print entire section" link enabled. +[outputs] +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"] + +# 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.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/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" + +# Specify a value here if your content directory is not in your repo's root directory +github_subdir = "docs" + +# Uncomment this if you have a newer GitHub repo with "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 + +# Enable Lunr.js offline search +offlineSearch = true + +# 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 = 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 +navbar_logo = true +# Set to true to disable the About link in the site footer +footer_about_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 +# 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.' + +# 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 = "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" +# diff --git a/docs/content/en/_index.html b/docs/content/en/_index.html new file mode 100644 index 0000000..ae24d5f --- /dev/null +++ b/docs/content/en/_index.html @@ -0,0 +1,17 @@ ++++ +title = "PIV Agent" +linkTitle = "PIV Agent" + ++++ + +{{< blocks/cover title="PIV Agent" image_anchor="top" height="full" color="orange" >}} +
+ }}"> + Documentation + + + Download + +

Simple integration of a security token (e.g. Yubikey) with existing SSH and GPG workflows.

+
+{{< /blocks/cover >}} diff --git a/docs/content/en/docs/_index.md b/docs/content/en/docs/_index.md new file mode 100644 index 0000000..3ef7d0b --- /dev/null +++ b/docs/content/en/docs/_index.md @@ -0,0 +1,12 @@ +--- +title: "Documentation" +linkTitle: "Documentation" +weight: 20 +menu: + main: + weight: 20 +--- + +{{% pageinfo %}} +TODO +{{% /pageinfo %}} From 9af1867785745219b24e2b7ac76eabc4a71e3729 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Sat, 21 Aug 2021 22:23:03 +0800 Subject: [PATCH 2/3] chore: add workflow for gh-pages --- .github/workflows/github-pages.yaml | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/github-pages.yaml diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml new file mode 100644 index 0000000..4e0b782 --- /dev/null +++ b/.github/workflows/github-pages.yaml @@ -0,0 +1,45 @@ +name: github pages + +on: + push: + branches: + - main # Set a branch to deploy + pull_request: + +jobs: + deploy: + runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + + - uses: actions/checkout@v2 + with: + repository: google/docsy + path: docs/themes/docsy + submodules: true + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.87.0' + extended: true + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + + - run: cd docs && npm install postcss postcss-cli autoprefixer + + - run: cd docs && hugo --minify + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/public From be8f2738d4f5d36f4b2a3d6f8a85d81e80282612 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Sun, 22 Aug 2021 01:07:15 +0800 Subject: [PATCH 3/3] chore: add Makefile for running hugo serve locally --- docs/.gitignore | 4 ++++ docs/Makefile | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 docs/.gitignore create mode 100644 docs/Makefile diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..0c2c7c7 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,4 @@ +themes +node_modules +package-lock.json +resources diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..67050b3 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,9 @@ +.PHONY: serve +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' + +themes/docsy: + git clone --recurse-submodules http://github.com/google/docsy themes/docsy