diff options
author | thingsym <thingsym@gmail.com> | 2021-10-18 11:59:36 +0300 |
---|---|---|
committer | thingsym <thingsym@gmail.com> | 2021-10-18 11:59:36 +0300 |
commit | 0a79aafad0405b0822b72e3501952a644bcd6d40 (patch) | |
tree | c7da0914016fb36f6fb94cde81891532fd05cc17 | |
parent | 0677e27e76f1e217129b1f6404744ab6c192724a (diff) |
docs: add workflows for publishing demo site to gh-pages
-rw-r--r-- | .github/demo_config.toml | 118 | ||||
-rw-r--r-- | .github/workflows/gh-pages.yml | 33 |
2 files changed, 151 insertions, 0 deletions
diff --git a/.github/demo_config.toml b/.github/demo_config.toml new file mode 100644 index 0000000..00f4c40 --- /dev/null +++ b/.github/demo_config.toml @@ -0,0 +1,118 @@ +baseURL = "https://thingsym.github.io/hugo-theme-techdoc" + +languageCode = "en-us" +DefaultContentLanguage = "en" +title = "Hugo Techdoc Theme" +theme = "hugo-theme-techdoc" + +hasCJKLanguage = true +metaDataFormat = "yaml" + +defaultContentLanguage = "en" +defaultContentLanguageInSubdir= false +enableMissingTranslationPlaceholders = false + +[params] + + # Source Code repository section + description = "put your description" + github_repository = "https://github.com/thingsym/hugo-theme-techdoc" + version = "0.9.7" + + # Documentation repository section + # documentation repository (set edit link to documentation repository) + github_doc_repository = "https://github.com/thingsym/hugo-theme-techdoc" + + # Analytic section + google_analytics_id = "" # Your Google Analytics tracking id + tag_manager_container_id = "" # Your Google Tag Manager container id + google_site_verification = "" # Your Google Site Verification for Search Console + + # Open Graph and Twitter Cards settings section + # Open Graph settings for each page are set on the front matter. + # See https://gohugo.io/templates/internal/#open-graph + # See https://gohugo.io/templates/internal/#twitter-cards + title = "Hugo Techdoc Theme" + images = ["images/og-image.png"] # Open graph images are placed in `static/images` + + # Theme settings section + # Theme color + # See color value reference https://developer.mozilla.org/en-US/docs/Web/CSS/color + custom_font_color = "" + custom_background_color = "" + + # Documentation Menu section + # Menu style settings + menu_style = "open-menu" # "open-menu" or "slide-menu" or "" blank is as no sidebar + + # Date format + dateformat = "" # default "2 Jan 2006" + # See the format reference https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference + + # path name excluded from documentation menu + menu_exclusion = [ + "archives", + "archive", + "blog", + "entry", + "post", + "posts", + ] + + # Algolia site search section + # See https://www.algolia.com/doc/ + algolia_search_enable = true + algolia_indexName = "hugo-demo-techdoc" + algolia_appId = "7W4SAN4PLK" + algolia_apiKey = "cbf12a63ff72d9c5dc0c10c195cf9128" # Search-Only API Key + +# Global menu section +# See https://gohugo.io/content-management/menus/ +[menu] + [[menu.main]] + name = "Home" + url = "/" + weight = 1 + + [[menu.main]] + name = "Twitter" + url = "https://twitter.com/thingsym" + weight = 2 + +# Markup configure section +# See https://gohugo.io/getting-started/configuration-markup/ +[markup] + defaultMarkdownHandler = "goldmark" + [markup.goldmark.renderer] + unsafe= true + [markup.tableOfContents] + startLevel = 2 + endLevel = 6 + ordered = false + +[outputs] + home = ["HTML", "RSS", "Algolia"] + +# Algolia Search configure section +[outputFormats.Algolia] + baseName = "algolia" + mediaType = "application/json" + isPlainText = true + notAlternative = true + +[params.algolia] + vars = [ + "title", + "summary", + "content", + "date", + "publishdate", + "description", + "permalink", + "keywords", + "lastmod", + ] + params = [ + "tags", + "categories", + ] diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..d1a9544 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,33 @@ +name: Publish demo site to Github Pages + +on: + push: + tags: + - 'v*.*.*' + +jobs: + publish: + runs-on: ubuntu-18.04 + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v2 + + - name: Install Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.88.1' + extended: true + + - name: Build demo website to public directory + run: | + cd ./exampleSite + hugo --config ../.github/demo_config.toml --themesDir ../.. --minify + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + personal_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: ./exampleSite/public + commit_message: 'deploy to GitHub Pages via GitHub Actions' |