├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── pull-request_template.md └── workflows │ ├── agolia-update.yaml │ ├── aws-deploy.yaml │ └── cleanup.yaml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── assets ├── js │ ├── code.js │ ├── custom.js │ ├── functions.js │ ├── index.js │ ├── mode.js │ ├── search │ │ ├── algolia.js │ │ ├── fuse.js │ │ ├── index.js │ │ └── variables.js │ └── variables.js └── sass │ ├── _base.sass │ ├── _blog.sass │ ├── _chart.sass │ ├── _components.sass │ ├── _custom.sass │ ├── _fonts.sass │ ├── _mermaid.sass │ ├── _nav.sass │ ├── _syntax.sass │ ├── _utils.sass │ ├── _variables.sass │ └── main.sass ├── dist └── .gitkeep ├── exampleSite ├── .github │ └── workflows │ │ ├── agolia-update.yaml │ │ └── aws-deploy.yaml ├── LICENSE ├── README.md ├── config │ ├── .gitkeep │ └── _default │ │ ├── languages.toml │ │ ├── markup.toml │ │ ├── menus │ │ └── menu.en.toml │ │ └── params.toml ├── content │ ├── _index.md │ ├── blog │ │ ├── _index.md │ │ ├── creating-a-new-theme.md │ │ ├── emoji-support.md │ │ ├── goisforlovers.md │ │ ├── hugoisforlovers.md │ │ └── migrate-from-jekyll.md │ ├── docs │ │ ├── _index.md │ │ ├── clarity │ │ │ ├── _index.md │ │ │ ├── blogging.md │ │ │ ├── customize.md │ │ │ ├── features.md │ │ │ ├── getting-started.md │ │ │ ├── images.md │ │ │ ├── syntax-highlighting.md │ │ │ └── theme-overrides.md │ │ └── compose │ │ │ ├── _index.md │ │ │ ├── customize.md │ │ │ ├── github-actions.md │ │ │ ├── graphs-charts-tables.md │ │ │ ├── install-theme.md │ │ │ ├── mermaid.md │ │ │ ├── organize-content.md │ │ │ ├── search.md │ │ │ ├── shortcodes-example.md │ │ │ ├── shortcodes.md │ │ │ └── use-tina-cms.md │ ├── projects.csv │ ├── search.md │ ├── themes.csv │ └── tutorials │ │ ├── _index.md │ │ └── example │ │ ├── _index.md │ │ └── mermaid.md ├── dist │ └── .gitkeep ├── go.mod ├── go.sum ├── hugo.toml ├── netlify.toml ├── package.json ├── resources │ └── _gen │ │ └── assets │ │ └── sass │ │ ├── main.sass_ad0d8311f7d21d831066e97916b5dca2.content │ │ ├── main.sass_ad0d8311f7d21d831066e97916b5dca2.json │ │ ├── main.sass_ae9eb86df8175869edaecf50caadd93b.content │ │ ├── main.sass_ae9eb86df8175869edaecf50caadd93b.json │ │ └── sass │ │ ├── main.sass_ae9eb86df8175869edaecf50caadd93b.content │ │ ├── main.sass_ae9eb86df8175869edaecf50caadd93b.json │ │ ├── main.sass_ca26857cefa9076967ab300682271513.content │ │ └── main.sass_ca26857cefa9076967ab300682271513.json ├── static │ ├── admin │ │ └── .gitignore │ └── images │ │ ├── GitHubMarkDark.svg │ │ ├── GitHubMarkLight.svg │ │ ├── artist.jpg │ │ ├── boy.jpg │ │ ├── clarity │ │ ├── article-toc.png │ │ ├── image-figure.png │ │ ├── image-inline.png │ │ ├── screenshot-darkmode.png │ │ ├── screenshot-mobile-darkmode.png │ │ ├── screenshot-mobile.png │ │ ├── screenshot.png │ │ ├── syntax-block.gif │ │ ├── tags.png │ │ ├── tn-darkmode.png │ │ └── tn.png │ │ ├── compose-light.svg │ │ ├── compose.svg │ │ ├── frustrated.jpg │ │ ├── painting.jpg │ │ ├── scribble.jpg │ │ ├── speakers.jpg │ │ ├── street.jpg │ │ └── stuck.jpg └── tina │ ├── config.js │ └── tina-lock.json ├── go.mod ├── i18n ├── de.toml ├── en.toml ├── eo.toml ├── es.toml └── tr.toml ├── images ├── screenshot.png └── tn.png ├── layouts ├── 404.html ├── _default │ ├── _markup │ │ └── render-heading.html │ ├── baseof.html │ ├── index.json │ ├── list.html │ ├── single.html │ └── term.html ├── blog │ ├── list.html │ └── single.html ├── index.html ├── partials │ ├── document.html │ ├── footer.html │ ├── functions │ │ ├── getAlgoliaConfig.html │ │ ├── getCodeConfig.html │ │ ├── getIconPath.html │ │ ├── getScript.html │ │ └── getSearchConfig.html │ ├── head │ │ ├── index.html │ │ └── liteyoutube.html │ ├── hooks │ │ ├── head.html │ │ └── scripts.html │ ├── mode.html │ ├── nav.html │ ├── pager.html │ ├── scripts │ │ ├── bundle.html │ │ ├── getJsBundle.html │ │ ├── mermaid.html │ │ ├── search.html │ │ └── translations.html │ ├── search.html │ ├── share.html │ ├── sidebar.html │ ├── sprite.html │ └── sprites.html ├── search │ └── single.html └── shortcodes │ ├── block.html │ ├── button.html │ ├── chart.html │ ├── column.html │ ├── gallery.html │ ├── grid.html │ ├── icon.html │ ├── image.html │ ├── liteyoutube.html │ ├── mermaid.html │ ├── partial.html │ ├── picture.html │ ├── tab.html │ ├── tabs.html │ ├── tip.html │ └── youtube.html ├── static ├── css │ └── lite-yt-embed.css ├── favicons │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ └── site.webmanifest ├── fonts │ ├── Metropolis-Black.woff │ ├── Metropolis-Black.woff2 │ ├── Metropolis-BlackItalic.woff │ ├── Metropolis-BlackItalic.woff2 │ ├── Metropolis-Bold.woff │ ├── Metropolis-Bold.woff2 │ ├── Metropolis-BoldItalic.woff │ ├── Metropolis-BoldItalic.woff2 │ ├── Metropolis-ExtraBold.woff │ ├── Metropolis-ExtraBold.woff2 │ ├── Metropolis-ExtraBoldItalic.woff │ ├── Metropolis-ExtraBoldItalic.woff2 │ ├── Metropolis-ExtraLight.woff │ ├── Metropolis-ExtraLight.woff2 │ ├── Metropolis-ExtraLightItalic.woff │ ├── Metropolis-ExtraLightItalic.woff2 │ ├── Metropolis-Light.woff │ ├── Metropolis-Light.woff2 │ ├── Metropolis-LightItalic.woff │ ├── Metropolis-LightItalic.woff2 │ ├── Metropolis-Medium.woff │ ├── Metropolis-Medium.woff2 │ ├── Metropolis-MediumItalic.woff │ ├── Metropolis-MediumItalic.woff2 │ ├── Metropolis-Regular.woff │ ├── Metropolis-Regular.woff2 │ ├── Metropolis-RegularItalic.woff │ ├── Metropolis-RegularItalic.woff2 │ ├── Metropolis-SemiBold.woff │ ├── Metropolis-SemiBold.woff2 │ ├── Metropolis-SemiBoldItalic.woff │ ├── Metropolis-SemiBoldItalic.woff2 │ ├── Metropolis-Thin.woff │ ├── Metropolis-Thin.woff2 │ ├── Metropolis-ThinItalic.woff │ └── Metropolis-ThinItalic.woff2 ├── icons │ ├── carly.svg │ ├── check.svg │ ├── copy.svg │ ├── expand.svg │ ├── info.svg │ ├── link.svg │ ├── moon.svg │ ├── next.svg │ ├── order.svg │ └── sun.svg ├── images │ ├── github.svg │ ├── next.svg │ └── search.svg └── js │ ├── chart.min.js │ ├── lite-yt-embed.js │ └── w3.js └── theme.toml /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report an issue to help us improve the theme 4 | title: '[BUG]' 5 | labels: 'bug' 6 | assignees: '' 7 | --- 8 | 9 | **I have checked all the prerequisites below and I'm yet experiencing a problem** 10 | 11 | - [] Read the README.md 12 | - [] Have the extended version of Hugo installed 13 | - [] Used the exampleSite's hugo.toml as a reference 14 | - [] If and when requested, I'll link my repo to make it easier to debug. 15 | 16 | __⚠️ NOTE:__ If the issue isn't easy to reproduce and its author(s) decline to provide reasonable accommodation to debug, the issue will be closed. 17 | 18 | **Describe the bug** 19 | 20 | A clear and concise description of what the bug is. [REPLACE] 21 | 22 | **Desktop (please complete the following information):** 23 | - OS: [e.g. iOS 14, Windows 10] 24 | - Browser: [e.g. chrome 76, safari 13] 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Request a feature to Compose. 4 | title: '[FEATURE]' 5 | labels: 'enhancement' 6 | assignees: '' 7 | --- 8 | 9 | **I have checked all the prerequisites below and I don't see this is available** 10 | 11 | - [ ] Read the README.md 12 | - [ ] Have the extended version of Hugo installed 13 | - [ ] Used the exampleSite's hugo.toml as a reference 14 | 15 | **Describe the feature** 16 | 17 | A clear and concise description of what the feature is. [REPLACE] 18 | 19 | **Desktop (please complete the following information):** 20 | - OS: [e.g. iOS 14, Windows 10] 21 | - Browser: [e.g. chrome 76, safari 13] 22 | -------------------------------------------------------------------------------- /.github/pull-request_template.md: -------------------------------------------------------------------------------- 1 | This PR... 2 | 3 | ## Changes / fixes 4 | 5 | - 6 | 7 | ## Screenshots (if applicable) 8 | 9 | (prefer animated gif) 10 | 11 | ## Checklist 12 | 13 | _Ensure you have checked off the following before submitting your PR._ 14 | 15 | - [ ] tested locally with the [latest release of Hugo](https://github.com/gohugoio/hugo/releases). This requirement is [a standard](https://github.com/gohugoio/hugoThemes#theme-maintenance) 16 | - [ ] added new dependencies 17 | - [ ] updated the [docs]() ⚠️ 18 | -------------------------------------------------------------------------------- /.github/workflows/agolia-update.yaml: -------------------------------------------------------------------------------- 1 | name: UPDATE ALGOLIA INDEX 2 | 3 | on: 4 | workflow_dispatch: 5 | branches: 6 | - production 7 | push: 8 | paths: 9 | - content/**/* 10 | # - hugo.toml 11 | 12 | env: 13 | # Name of the branch in your repository which will store your generated site. 14 | SITE-BRANCH: master 15 | 16 | jobs: 17 | build: 18 | # In this phase, the code is pulled from main and the site rendered in Hugo. The built site is stored as an artifact for other stages. # deploy: 19 | runs-on: ubuntu-20.04 20 | concurrency: 21 | group: ${{ github.workflow }}-${{ github.ref }} 22 | steps: 23 | - uses: actions/checkout@v3 24 | with: 25 | submodules: true # Fetch Hugo themes (true OR recursive) 26 | fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod 27 | 28 | - name: Setup Hugo 29 | uses: peaceiris/actions-hugo@v2 30 | with: 31 | hugo-version: 'latest' 32 | extended: true 33 | 34 | - name: Build 35 | run: hugo -e "production" -s "exampleSite" -d "dist" --minify 36 | # If build succeeds, store the dist/ dir as an artifact to be used in subsequent phases. 37 | - name: Upload output dist dir as artifact 38 | uses: actions/upload-artifact@v1 39 | with: 40 | name: dist 41 | path: dist/ 42 | publish: 43 | # In the publish phase, the site is pushed up to a different branch which only stores the dist/ folder ("site" branch) and is also delta synchronized to the S3 bucket. CloudFront invalidation happens last. 44 | runs-on: ubuntu-20.04 45 | needs: build 46 | steps: 47 | # Check out the site branch this time since we have to ultimately commit those changes there. 48 | - name: Checkout site branch 49 | uses: actions/checkout@v3 50 | with: 51 | submodules: true 52 | fetch-depth: 0 53 | ref: ${{ env.SITE-BRANCH }} 54 | # Download the artifact containing the newly built site. This overwrites the dist/ dir from the check out above. 55 | - name: Download artifact from build stage 56 | uses: actions/download-artifact@v1 57 | with: 58 | name: dist 59 | # Add all the files/changes in dist/ that were pulled down from the build stage and then commit them. 60 | # The final line sets a GitHub Action output value that can be read by other steps. 61 | # This function cannot store mult-line values so newline chars must be stripped. 62 | - name: Commit files 63 | id: can_commit 64 | run: | 65 | git config --local user.email "action@github.com" 66 | git config --local user.name "GitHub Action" 67 | cp dist/index.json index.json 68 | git add -A index.json 69 | commit_message=$(git commit -m "Build search index." -a | tr -d '\n' || true) 70 | echo "commit_message=$commxit_message >> $GITHUB_OUTPUT" 71 | # Checks if previous stage had any valid commit. 72 | - name: Nothing to commit 73 | id: nothing_committed 74 | if: contains(steps.can_commit.outputs.commit_message, 'nothing to commit') 75 | run: echo "Saw that no changes were made to Hugo site." 76 | # Push those changes back to the site branch. 77 | - name: Push to site branch 78 | if: steps.nothing_committed.conclusion == 'skipped' 79 | uses: ad-m/github-push-action@master 80 | with: 81 | github_token: ${{ secrets.GITHUB_TOKEN }} 82 | branch: ${{ env.SITE-BRANCH }} 83 | index: 84 | runs-on: ubuntu-latest 85 | needs: publish 86 | name: Upload Algolia Index 87 | steps: 88 | - uses: algolia/setup-algolia-cli@master 89 | with: 90 | version: 91 | 1.2.0 92 | - name: clean index 93 | id: clean_up_index 94 | env: 95 | ALGOLIA_APPLICATION_ID: ${{ secrets.ALGOLIA_APP_ID }} 96 | ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }} 97 | run: | 98 | algolia index clear dimi_site --confirm 99 | - uses: actions/checkout@v2 100 | with: 101 | fetch-depth: 0 102 | - uses: wangchucheng/algolia-uploader@master 103 | with: 104 | # Such as `Z0U0ACGBN8` 105 | app_id: EG0M7UVCD9 106 | # Go to https://github.com/dimi365/website/settings/secrets/actions and set an ALGOLIA_ADMIN_KEY secret key 107 | admin_key: ${{ secrets.ALGOLIA_ADMIN_KEY }} 108 | # The index name. 109 | index_name: ${{ secrets.ALGOLIA_APP_NAME }} 110 | # The index file path relative to repo root. no leading forward slash 111 | index_file_path: index.json -------------------------------------------------------------------------------- /.github/workflows/aws-deploy.yaml: -------------------------------------------------------------------------------- 1 | # PREREQUISITES: 2 | # The following secrets must be stored in your repository where this Action runs: 3 | # AWS_ACCESS_KEY_ID 4 | # AWS_CLOUDFRONT_DISTRO_ID 5 | # AWS_S3_BUCKET_NAME 6 | # AWS_SECRET_ACCESS_KEY 7 | 8 | name: AWS DEPLOY CI 9 | on: # change to `on:` to turn on 10 | workflow_dispatch: 11 | branches: 12 | - production # change to 'main' to automate 13 | push: 14 | paths: 15 | # - exampleSite/content/**/* 16 | - exampleSite/hugo.toml 17 | # pull_request: 18 | # branches: 19 | # - production 20 | env: 21 | # Default AWS region where S3 pushes and CloudFront invalidations will occur. 22 | AWS-DEFAULT-REGION: us-east-2 23 | # Name of the branch in your repository which will store your generated site. 24 | SITE-BRANCH: site 25 | 26 | jobs: 27 | build: 28 | # In this phase, the code is pulled from main and the site rendered in Hugo. The built site is stored as an artifact for other stages. # deploy: 29 | runs-on: ubuntu-20.04 30 | concurrency: 31 | group: ${{ github.workflow }}-${{ github.ref }} 32 | steps: 33 | - uses: actions/checkout@v3 34 | with: 35 | submodules: true # Fetch Hugo themes (true OR recursive) 36 | fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod 37 | 38 | - name: Setup Hugo 39 | uses: peaceiris/actions-hugo@v2 40 | with: 41 | hugo-version: 'latest' 42 | extended: true 43 | 44 | - name: Build 45 | run: hugo -e "production" -d "dist" -s "exampleSite" --minify 46 | # If build succeeds, store the dist/ dir as an artifact to be used in subsequent phases. 47 | - name: Upload output public dir as artifact 48 | uses: actions/upload-artifact@v1 49 | with: 50 | name: public 51 | path: dist/ 52 | publish: 53 | # In the publish phase, the site is pushed up to a different branch which only stores the dist/ folder ("site" branch) and is also delta synchronized to the S3 bucket. CloudFront invalidation happens last. 54 | runs-on: ubuntu-20.04 55 | needs: build 56 | steps: 57 | # Check out the site branch this time since we have to ultimately commit those changes there. 58 | - name: Checkout site branch 59 | uses: actions/checkout@v3 60 | with: 61 | submodules: true 62 | fetch-depth: 0 63 | ref: ${{ env.SITE-BRANCH }} 64 | # Download the artifact containing the newly built site. This overwrites the dist/ dir from the check out above. 65 | - name: Download artifact from build stage 66 | uses: actions/download-artifact@v1 67 | with: 68 | name: public 69 | # Add all the files/changes in dist/ that were pulled down from the build stage and then commit them. 70 | # The final line sets a GitHub Action output value that can be read by other steps. 71 | # This function cannot store mult-line values so newline chars must be stripped. 72 | - name: Commit files 73 | id: can_commit 74 | run: | 75 | git config --local user.email "action@github.com" 76 | git config --local user.name "GitHub Action" 77 | git add -A dist/ 78 | commit_message=$(git commit -m "Publish generated Hugo site." -a | tr -d '\n' || true) 79 | echo "commit_message=$commit_message >> $GITHUB_OUTPUT" 80 | # Checks if previous stage had any valid commit. 81 | - name: Nothing to commit 82 | id: nothing_committed 83 | if: contains(steps.can_commit.outputs.commit_message, 'nothing to commit') 84 | run: echo "Saw that no changes were made to Hugo site." 85 | # Push those changes back to the site branch. 86 | - name: Push to site branch 87 | if: steps.nothing_committed.conclusion == 'skipped' 88 | uses: ad-m/github-push-action@master 89 | with: 90 | github_token: ${{ secrets.GITHUB_TOKEN }} 91 | branch: ${{ env.SITE-BRANCH }} 92 | # Store the AWS credentials on the runner. 93 | - name: Configure AWS credentials 94 | if: steps.nothing_committed.conclusion == 'skipped' 95 | uses: aws-actions/configure-aws-credentials@v1-node16 96 | with: 97 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 98 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 99 | aws-region: ${{ env.AWS-DEFAULT-REGION }} 100 | - name: Delta sync site to S3 with aws cli 101 | if: steps.nothing_committed.conclusion == 'skipped' 102 | run: aws s3 sync --size-only --delete --exclude "/authors/*/page/*" --cache-control max-age=2592000 dist/ s3://${{ secrets.AWS_S3_BUCKET_NAME }} 103 | # Use s5cmd to perform only a delta sync to the destination S3 bucket. This minimizes transfer traffic since it only uploads changed files. 104 | # - name: Delta sync site to S3 bucket 105 | # if: steps.nothing_committed.conclusion == 'skipped' 106 | # run: | 107 | # curl -sLO https://github.com/peak/s5cmd/releases/download/v1.0.0/s5cmd_1.0.0_Linux-64bit.tar.gz 108 | # tar -xzf s5cmd_1.0.0_Linux-64bit.tar.gz 109 | # chmod +x s5cmd 110 | # sudo mv s5cmd /usr/local/bin/ 111 | # echo "****Showing working dir and listing files.****" 112 | # pwd && ls -lah 113 | # echo "****Running delta sync against S3.****" 114 | # s5cmd cp -s -n -u dist/ s3://${{ secrets.AWS_S3_BUCKET_NAME }} 115 | # Use the aws cli tool to perform a glob invalidation of the entire site against CloudFront. 116 | - name: Invalidate cache on CloudFront 117 | if: steps.nothing_committed.conclusion == 'skipped' 118 | run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRO_ID }} --paths "/*" -------------------------------------------------------------------------------- /.github/workflows/cleanup.yaml: -------------------------------------------------------------------------------- 1 | name: Delete old workflow runs 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | days: 6 | description: 'Number of days.' 7 | required: true 8 | default: 30 9 | minimum_runs: 10 | description: 'The minimum runs to keep for each workflow.' 11 | required: true 12 | default: 6 13 | delete_workflow_pattern: 14 | description: 'The name or filename of the workflow. if not set then it will target all workflows.' 15 | required: false 16 | delete_workflow_by_state_pattern: 17 | description: 'Remove workflow by state: active, deleted, disabled_fork, disabled_inactivity, disabled_manually' 18 | required: true 19 | default: "All" 20 | type: choice 21 | options: 22 | - "All" 23 | - active 24 | - deleted 25 | - disabled_inactivity 26 | - disabled_manually 27 | delete_run_by_conclusion_pattern: 28 | description: 'Remove workflow by conclusion: action_required, cancelled, failure, skipped, success' 29 | required: true 30 | default: "All" 31 | type: choice 32 | options: 33 | - "All" 34 | - action_required 35 | - cancelled 36 | - failure 37 | - skipped 38 | - success 39 | dry_run: 40 | description: 'Only log actions, do not perform any delete operations.' 41 | required: false 42 | 43 | jobs: 44 | del_runs: 45 | runs-on: ubuntu-latest 46 | permissions: 47 | actions: write 48 | steps: 49 | - name: Delete workflow runs 50 | uses: Mattraks/delete-workflow-runs@v2 51 | with: 52 | token: ${{ github.token }} 53 | repository: ${{ github.repository }} 54 | retain_days: ${{ github.event.inputs.days }} 55 | keep_minimum_runs: ${{ github.event.inputs.minimum_runs }} 56 | delete_workflow_pattern: ${{ github.event.inputs.delete_workflow_pattern }} 57 | delete_workflow_by_state_pattern: ${{ github.event.inputs.delete_workflow_by_state_pattern }} 58 | delete_run_by_conclusion_pattern: ${{ github.event.inputs.delete_run_by_conclusion_pattern }} 59 | dry_run: ${{ github.event.inputs.dry_run }} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | public/ 2 | node_modules/ 3 | .DS_Store 4 | package-lock.json 5 | yarn.lock 6 | __generated__ 7 | .hugo_build.lock 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Our Standards 2 | 3 | Examples of behavior that contributes to creating a positive environment 4 | include: 5 | 6 | * Will be civil 7 | * Focusing on what is best for the community 8 | 9 | Examples of unacceptable behavior by participants include: 10 | 11 | * Trolling, insulting/derogatory comments, and personal or political attacks 12 | * Publishing others' private information, such as a physical or electronic 13 | address, without explicit permission 14 | 15 | ## Our Responsibilities 16 | 17 | Project maintainers are responsible for clarifying the standards of acceptable 18 | behavior. They also have the right to proceed as they wish. Usually on a __good-faith__ basis. 19 | 20 | ## Enforcement 21 | 22 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 23 | reported by contacting the project team at . All 24 | complaints will be neither be reviewed nor investigated. Instigators will simply be ignored or blocked. 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Weru 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Compose 2 | 3 | Compose is a [Hugo](https://gohugo.io/) theme for documentation websites. The theme provides a simple navigation & structure. 4 | 5 | ![Hugo Compose Theme](https://raw.githubusercontent.com/onweru/compose/master/images/tn.png) 6 | 7 | ## Features 8 | 9 | 1. Documentation 10 | 2. Gallery Support 11 | 3. Native lazy loading of images 12 | 4. Live search 13 | 5. Flowcharts, Piecharts, doughnut & bar charts support 14 | 6. Searchable & Sortable tables 15 | 7. Syntax highlighting 16 | 8. Mermaid Support 17 | 18 | ## Documentation 19 | 20 | - [Install Compose theme](https://composedocs.netlify.app/docs/compose/install-theme/) 21 | - [Use Tina CMS](https://composedocs.netlify.app/docs/compose/use-tina-cms/) 22 | - [Customize your site](https://composedocs.netlify.app/docs/compose/customize/) 23 | - [Configure search](https://composedocs.netlify.app/docs/compose/search/) 24 | - [Shortcodes](https://composedocs.netlify.app/docs/compose/shortcodes/) 25 | - [Mermaid](https://composedocs.netlify.app/docs/compose/mermaid/) 26 | 27 | ## ExampleSite 28 | 29 | The [exampleSite](https://github.com/onweru/compose/tree/master/exampleSite) serves as this theme's [user guide](https://composedocs.netlify.app/docs/compose/install-theme/) . 30 | 31 | This guide covers the necessary bits. As the project evolves, the user-guide will get more comprehensive 32 | 33 | You can use Hugo to generate and serve a local copy of the guide (also useful for testing local theme changes). 34 | 35 | ``` 36 | git clone --recurse-submodules --depth 1 https://github.com/onweru/compose.git 37 | cd compose/exampleSite/ 38 | hugo server --themesDir ../.. 39 | ``` 40 | 41 | ### Also built by Weru 42 | 43 | 1. [Clarity Theme](https://github.com/chipzoller/hugo-clarity) 44 | 2. [Newsroom Theme](https://github.com/onweru/newsroom) 45 | 3. [Swift Theme](https://github.com/onweru/hugo-swift-theme) 46 | 4. [Browse Theme](https://github.com/onweru/browse) 47 | 48 | ## License 49 | 50 | This theme is available under the [MIT license](https://github.com/onweru/compose/blob/master/LICENSE). 51 | -------------------------------------------------------------------------------- /assets/js/custom.js: -------------------------------------------------------------------------------- 1 | // add custom js in this file -------------------------------------------------------------------------------- /assets/js/functions.js: -------------------------------------------------------------------------------- 1 | function isObj(obj) { 2 | return (obj && typeof obj === 'object' && obj !== null) ? true : false; 3 | } 4 | 5 | function createEl(element = 'div') { 6 | return document.createElement(element); 7 | } 8 | 9 | function emptyEl(el) { 10 | while(el.firstChild) 11 | el.removeChild(el.firstChild); 12 | } 13 | 14 | function elem(selector, parent = document){ 15 | let elem = isObj(parent) ? parent.querySelector(selector) : false; 16 | return elem ? elem : false; 17 | } 18 | 19 | function elems(selector, parent = document) { 20 | return isObj(parent) ? parent.querySelectorAll(selector) : []; 21 | } 22 | 23 | function pushClass(el, targetClass) { 24 | if (isObj(el) && targetClass) { 25 | let elClass = el.classList; 26 | elClass.contains(targetClass) ? false : elClass.add(targetClass); 27 | } 28 | } 29 | 30 | function deleteClass(el, targetClass) { 31 | if (isObj(el) && targetClass) { 32 | let elClass = el.classList; 33 | elClass.contains(targetClass) ? elClass.remove(targetClass) : false; 34 | } 35 | } 36 | 37 | function modifyClass(el, targetClass) { 38 | if (isObj(el) && targetClass) { 39 | const elClass = el.classList; 40 | elClass.contains(targetClass) ? elClass.remove(targetClass) : elClass.add(targetClass); 41 | } 42 | } 43 | 44 | function containsClass(el, targetClass) { 45 | if (isObj(el) && targetClass && el !== document ) { 46 | return el.classList.contains(targetClass) ? true : false; 47 | } 48 | } 49 | 50 | function isChild(node, parentClass) { 51 | let objectsAreValid = isObj(node) && parentClass && typeof parentClass == 'string'; 52 | return (objectsAreValid && node.closest(parentClass)) ? true : false; 53 | } 54 | 55 | function elemAttribute(elem, attr, value = null) { 56 | if (value) { 57 | elem.setAttribute(attr, value); 58 | } else { 59 | value = elem.getAttribute(attr); 60 | return value ? value : false; 61 | } 62 | } 63 | 64 | function deleteChars(str, subs) { 65 | let newStr = str; 66 | if (Array.isArray(subs)) { 67 | for (let i = 0; i < subs.length; i++) { 68 | newStr = newStr.replace(subs[i], ''); 69 | } 70 | } else { 71 | newStr = newStr.replace(subs, ''); 72 | } 73 | return newStr; 74 | } 75 | 76 | function isBlank(str) { 77 | return (!str || str.trim().length === 0); 78 | } 79 | 80 | function isMatch(element, selectors) { 81 | if(isObj(element)) { 82 | if(selectors.isArray) { 83 | let matching = selectors.map(function(selector){ 84 | return element.matches(selector) 85 | }) 86 | return matching.includes(true); 87 | } 88 | return element.matches(selectors) 89 | } 90 | } 91 | 92 | function closestInt(goal, collection) { 93 | return collection.reduce(function (prev, curr) { 94 | return (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev); 95 | }); 96 | } 97 | 98 | function hasClasses(el) { 99 | if(isObj(el)) { 100 | const classes = el.classList; 101 | return classes.length 102 | } 103 | } 104 | 105 | function wrapEl(el, wrapper) { 106 | el.parentNode.insertBefore(wrapper, el); 107 | wrapper.appendChild(el); 108 | } 109 | 110 | function wrapText(text, context, wrapper = 'mark') { 111 | let open = `<${wrapper}>`; 112 | let close = ``; 113 | let escapedOpen = `%3C${wrapper}%3E`; 114 | let escapedClose = `%3C/${wrapper}%3E`; 115 | function wrap(context) { 116 | let c = context.innerHTML; 117 | let pattern = new RegExp(text, "gi"); 118 | let matches = text.length ? c.match(pattern) : null; 119 | 120 | if(matches) { 121 | matches.forEach(function(matchStr){ 122 | c = c.replaceAll(matchStr, `${open}${matchStr}${close}`); 123 | context.innerHTML = c; 124 | }); 125 | 126 | const images = elems('img', context); 127 | 128 | if(images) { 129 | images.forEach(image => { 130 | image.src = image.src.replaceAll(open, '').replaceAll(close, '').replaceAll(escapedOpen, '').replaceAll(escapedClose, ''); 131 | }); 132 | } 133 | } 134 | } 135 | 136 | const contents = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "code", "td"]; 137 | 138 | contents.forEach(function(c){ 139 | const cs = elems(c, context); 140 | if(cs.length) { 141 | cs.forEach(function(cx, index){ 142 | if(cx.children.length >= 1) { 143 | Array.from(cx.children).forEach(function(child){ 144 | wrap(child); 145 | }) 146 | wrap(cx); 147 | } else { 148 | wrap(cx); 149 | } 150 | // sanitize urls and ids 151 | }); 152 | } 153 | }); 154 | 155 | const hyperLinks = elems('a'); 156 | if(hyperLinks) { 157 | hyperLinks.forEach(function(link){ 158 | link.href = link.href.replaceAll(encodeURI(open), "").replaceAll(encodeURI(close), ""); 159 | }); 160 | } 161 | } 162 | 163 | function parseBoolean(string = "") { 164 | string = string.trim().toLowerCase(); 165 | switch (string) { 166 | case 'true': 167 | return true; 168 | case 'false': 169 | return false; 170 | default: 171 | return undefined; 172 | } 173 | } 174 | 175 | function loadSvg(icon, parent) { 176 | parent.innerHTML = ` 177 | 178 | 179 | `; 180 | } 181 | 182 | function copyToClipboard(str) { 183 | let copy, selection, selected; 184 | copy = createEl('textarea'); 185 | copy.value = str; 186 | copy.setAttribute('readonly', ''); 187 | copy.style.position = 'absolute'; 188 | copy.style.left = '-9999px'; 189 | selection = document.getSelection(); 190 | doc.appendChild(copy); 191 | // check if there is any selected content 192 | selected = selection.rangeCount > 0 ? selection.getRangeAt(0) : false; 193 | copy.select(); 194 | document.execCommand('copy'); 195 | doc.removeChild(copy); 196 | if (selected) { // if a selection existed before copying 197 | selection.removeAllRanges(); // unselect existing selection 198 | selection.addRange(selected); // restore the original selection 199 | } 200 | } -------------------------------------------------------------------------------- /assets/js/mode.js: -------------------------------------------------------------------------------- 1 | function prefersColor(mode){ 2 | return `(prefers-color-scheme: ${mode})`; 3 | } 4 | 5 | function systemMode() { 6 | if (window.matchMedia) { 7 | return window.matchMedia(prefersColor(dark)).matches ? dark : light; 8 | } 9 | return light; 10 | } 11 | 12 | function currentMode() { 13 | let acceptable_chars = light + dark; 14 | acceptable_chars = [...acceptable_chars]; 15 | let mode = getComputedStyle(doc).getPropertyValue(key).replace(/\"/g, '').trim(); 16 | 17 | return [...mode] 18 | .filter(letter => acceptable_chars.includes(letter)) 19 | .join(''); 20 | } 21 | 22 | function changeMode(is_dark_mode) { 23 | if(is_dark_mode) { 24 | bank.setItem(storageKey, light) 25 | elemAttribute(doc, mode_data, light); 26 | } else { 27 | bank.setItem(storageKey, dark); 28 | elemAttribute(doc, mode_data, dark); 29 | } 30 | } 31 | 32 | 33 | function pickModePicture(mode) { 34 | elems('picture').forEach(function(picture){ 35 | let source = picture.firstElementChild; 36 | const picture_data = picture.dataset; 37 | const images = [picture_data.lit, picture_data.dark]; 38 | source.src = mode == 'dark' ? images[1] : images[0]; 39 | }); 40 | } 41 | 42 | function setMermaidTheme(mode) { 43 | bank.setItem(mermaidThemeKey, mode); 44 | let theme_input = elem('.color_choice'); 45 | theme_input.value = mode; 46 | } 47 | 48 | function setUserColorMode(mode = false) { 49 | const is_dark_mode = currentMode() == dark; 50 | const stored_mode = bank.getItem(storageKey); 51 | const sys_mode = systemMode(); 52 | if(stored_mode) { 53 | mode ? changeMode(is_dark_mode) : elemAttribute(doc, mode_data, stored_mode); 54 | } else { 55 | mode === true ? changeMode(is_dark_mode) : changeMode(sys_mode!==dark); 56 | } 57 | const user_mode = doc.dataset.mode; 58 | doc.dataset.systemmode = sys_mode; 59 | user_mode ? pickModePicture(user_mode) : false; 60 | 61 | setMermaidTheme(user_mode); 62 | } 63 | 64 | setUserColorMode(); -------------------------------------------------------------------------------- /assets/js/search/variables.js: -------------------------------------------------------------------------------- 1 | const search_result_class = 'search_result'; 2 | const empty_string = ''; 3 | const search_field_class = '.search_field'; 4 | const search_class = '.search'; 5 | let search_term = empty_string; 6 | const search_field = elem(search_field_class); 7 | 8 | // values defined under config/_default/params.toml 9 | let other_searchable_fields = '{{ delimit (default slice site.Params.otherSearchableFields) ", " }}' 10 | 11 | if(other_searchable_fields.length > 2) { 12 | other_searchable_fields = other_searchable_fields 13 | .split(",") 14 | .map(search_value => search_value.toLowerCase().trim()); 15 | } else { 16 | other_searchable_fields = []; 17 | } 18 | 19 | const search_page_element = elem('#searchpage'); 20 | let search_scope_global = `{{ trim site.Params.search.global " " }}`; 21 | search_scope_global = search_scope_global == 'true' ? true : false; 22 | 23 | // Fuse specific 24 | let search_keys = ['body', 'title', 'link', 'section', 'id',]; 25 | search_keys = search_keys.concat(other_searchable_fields); 26 | 27 | const search_options = { 28 | ignoreLocation: true, 29 | findAllMatches: true, 30 | includeScore: true, 31 | shouldSort: true, 32 | keys: search_keys, 33 | threshold: 0.1 34 | }; 35 | 36 | // Algolia specific 37 | const algolia_config = JSON.parse(`{{ partialCached "functions/getAlgoliaConfig" . }}`); 38 | -------------------------------------------------------------------------------- /assets/js/variables.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const doc = document.documentElement; 4 | const toggle_id = 'toggle'; 5 | const show_id = 'show'; 6 | const menu = 'menu'; 7 | const active = 'active'; 8 | let site_title = `{{ replace (lower site.Title) " " "-" }}`; 9 | let root_url = '{{ strings.TrimSuffix "/" .Site.BaseURL }}/'; 10 | root_url = root_url.startsWith('http') ? root_url : window.location.origin; 11 | 12 | const go_back_class = 'button_back'; 13 | const line_class = '.line'; 14 | 15 | // config defined values 16 | const code_block_config = JSON.parse('{{ partial "functions/getCodeConfig" . }}'); 17 | const iconsPath = `{{ partialCached "functions/getIconPath" . }}`; 18 | 19 | const shell_based = ['sh', 'shell', 'zsh', 'bash']; 20 | 21 | const body = elem('body'); 22 | const max_lines = code_block_config.maximum; 23 | const show_lines = code_block_config.show; 24 | const copy_id = 'panel_copy'; 25 | const wrap_id = 'panel_wrap'; 26 | const lines_id = 'panel_lines'; 27 | const panel_expand = 'panel_expand'; 28 | const panel_expanded = 'panel_expanded'; 29 | const panel_box = 'panel_box'; 30 | const panel_hide = 'panel_hide'; 31 | const panel_from = 'panel_from'; 32 | const full_height = 'initial'; 33 | const highlight = 'highlight'; 34 | const highlight_wrap = 'highlight_wrap' 35 | const hash = '#'; 36 | 37 | const light = 'light'; 38 | const dark = 'dark'; 39 | const storageKey = `${site_title}-color-mode`; 40 | const mermaidThemeKey = `${site_title}-mermaid`; 41 | const key = '--color-mode'; 42 | const mode_data = 'data-mode'; 43 | const bank = window.localStorage; 44 | -------------------------------------------------------------------------------- /assets/sass/_base.sass: -------------------------------------------------------------------------------- 1 | * 2 | box-sizing: border-box 3 | margin: 0 4 | padding: 0 5 | scrollbar-color: var(--scroll-thumb) transparent 6 | scrollbar-width: thin 7 | 8 | ::-webkit-scrollbar 9 | width: .5rem 10 | 11 | ::-webkit-scrollbar-thumb 12 | background: var(--scroll-thumb) 13 | border-radius: .25rem 14 | 15 | body, html 16 | scroll-behavior: smooth 17 | scroll-padding-top: 1rem 18 | font-kerning: normal 19 | -webkit-text-size-adjust: 100% 20 | font-size: 18px 21 | 22 | @keyframes flash 23 | 0% 24 | opacity: 0 25 | 75% 26 | opacity: 0 27 | 100% 28 | opacity: 1 29 | 30 | body 31 | font-family: var(--font) 32 | background-color: var(--bg) 33 | color: var(--text) 34 | line-height: 1.5 35 | margin: 0 auto 36 | position: relative 37 | font-kerning: normal 38 | display: flex 39 | min-width: 0 40 | flex-direction: column 41 | justify-content: space-between 42 | min-height: 100vh 43 | -webkit-font-smoothing: antialiased 44 | -moz-osx-font-smoothing: grayscale 45 | -webkit-overflow-scrolling: touch 46 | max-width: 1440px 47 | animation: 0.67s flash ease-in 48 | 49 | @media screen and (min-width: 1640px) 50 | max-width: 1600px 51 | 52 | a 53 | text-decoration: none 54 | color: inherit 55 | p 56 | padding: 0.75rem 0 57 | // opacity: 0.9 58 | &:empty 59 | display: none 60 | li 61 | &, p 62 | padding: 0.25rem 0 63 | blockquote 64 | opacity: 0.8 65 | padding: 1rem 66 | position: relative 67 | quotes: '\201C''\201D''\2018''\2019' 68 | margin: 0.75rem 0 69 | display: flex 70 | flex-flow: row wrap 71 | background-repeat: no-repeat 72 | background-size: 5rem 73 | background-position: 50% 50% 74 | position: relative 75 | background-color: var(--accent) 76 | border-radius: 0.25rem 77 | overflow: hidden 78 | &::before 79 | content: "" 80 | padding: 2px 81 | position: absolute 82 | top: 0 83 | bottom: 0 84 | left: 0 85 | background: var(--theme) 86 | 87 | p 88 | padding-left: 0.5rem !important 89 | font-size: 1.1rem !important 90 | width: 100% 91 | font-style: italic 92 | 93 | h1,h2,h3,h4,h5 94 | font-family: inherit 95 | font-weight: 500 96 | padding: 0.33rem 0 97 | color: inherit 98 | line-height: 1.35 99 | 100 | h1 101 | font-size: 200% 102 | h2 103 | font-size: 175% 104 | h3 105 | font-size: 150% 106 | h4 107 | font-size: 125% 108 | h5 109 | font-size: 120% 110 | h6 111 | font-size: 100% 112 | 113 | img, svg, figure 114 | max-width: 100% 115 | vertical-align: middle 116 | img 117 | height: auto 118 | margin: 1rem auto 119 | padding: 0 120 | 121 | main 122 | flex: 1 123 | @media screen and (min-width: 42rem) 124 | padding-bottom: 45px 125 | 126 | ol, ul 127 | list-style: none 128 | 129 | b, strong 130 | font-weight: 500 131 | 132 | hr 133 | border: none 134 | padding: 1px 135 | background: var(--border-color) 136 | margin: 1rem 0 137 | 138 | .aside 139 | overflow-y: auto 140 | background: var(--bg) 141 | border-radius: 0.25rem 142 | align-self: start 143 | max-height: 80vh 144 | position: sticky 145 | z-index: 9999 146 | top: 0 147 | padding: 1rem 0 148 | @media screen and (min-width: 42rem) 149 | padding: 1rem 1.5rem 150 | top: 2.5rem 151 | margin-top: 1rem 152 | padding-top: 0 153 | &_inner 154 | height: 0 155 | overflow: hidden 156 | @media screen and (min-width: 42rem) 157 | height: initial 158 | &.show &_inner 159 | height: initial 160 | overflow: visible 161 | &_toggle 162 | padding: 0.5rem 1.5rem 163 | border-radius: 0.5rem 164 | background: var(--accent) 165 | transform: translateY(-1rem) 166 | display: flex 167 | justify-content: space-between 168 | @media screen and (min-width: 42rem) 169 | display: none 170 | h3 171 | position: relative 172 | ul 173 | padding: 0 174 | list-style: none 175 | 176 | th, td 177 | padding: 0.5rem 178 | font-weight: 400 !important 179 | &:not(:first-child) 180 | padding-left: 1.5rem 181 | 182 | thead 183 | background: var(--theme) 184 | color: var(--light) 185 | font-weight: 400 186 | text-align: left 187 | 188 | tbody 189 | tr 190 | &:nth-child(even) 191 | background-color: var(--accent) !important 192 | box-shadow: 0 1rem 0.75rem -0.75rem rgba(0,0,0,0.07) 193 | 194 | table 195 | margin: 1.5rem 0 196 | width: 100% 197 | 198 | .main 199 | flex: 1 200 | > .grid-auto 201 | @media screen and (max-width: 667px) 202 | grid-gap: 0 203 | 204 | .page 205 | &-home 206 | h1 207 | font-weight: 300 208 | 209 | .content 210 | ul, ol 211 | padding-left: 1.1rem 212 | ul 213 | list-style: initial 214 | ol 215 | list-style: decimal 216 | a:not(.button) 217 | color: var(--theme) 218 | 219 | ::placeholder 220 | font-size: 1rem 221 | 222 | svg 223 | &.icon_sort 224 | fill: var(--light) 225 | height: 0.7rem 226 | width: 0.7rem 227 | display: inline-block 228 | margin-left: auto 229 | vertical-align: middle 230 | 231 | canvas 232 | margin: 2.5rem auto 0 auto 233 | max-width: 450px !important 234 | max-height: 450px !important 235 | 236 | footer 237 | min-height: 150px 238 | 239 | del 240 | opacity: 0.5 241 | 242 | #toTop 243 | background: transparent 244 | outline: 0.5rem solid transparent 245 | height: 2rem 246 | width: 2rem 247 | cursor: pointer 248 | padding: 0.5rem 249 | display: flex 250 | align-items: center 251 | justify-content: center 252 | position: fixed 253 | right: 0 254 | bottom: 2.25rem 255 | transform: rotate(45deg) translate(5rem) 256 | opacity: 0 257 | transition: opacity 0.5s var(--ease), transform 0.25s var(--ease) 258 | z-index: 5 259 | &.active 260 | right: 1.5rem 261 | opacity: 1 262 | transform: rotate(45deg) translate(0) 263 | &::after, &::before 264 | position: absolute 265 | display: block 266 | width: 1rem 267 | height: 1rem 268 | content: "" 269 | border-left: 1px solid var(--text) 270 | border-top: 1px solid var(--text) 271 | &::after 272 | width: 0.67rem 273 | height: 0.67rem 274 | transform: translate(0.1rem, 0.1rem) 275 | 276 | #searchpage 277 | padding-top: 5rem 278 | -------------------------------------------------------------------------------- /assets/sass/_chart.sass: -------------------------------------------------------------------------------- 1 | @keyframes chartjs-render-animation 2 | 0% 3 | opacity: .99 4 | 100% 5 | opacity: 1 6 | 7 | .chartjs 8 | &-render-monitor 9 | animation: chartjs-render-animation 1ms 10 | 11 | &-size-monitor 12 | &, &-expand, &-shrink 13 | position: absolute 14 | direction: ltr 15 | left: 0 16 | top: 0 17 | right: 0 18 | bottom: 0 19 | overflow: hidden 20 | pointer-events: none 21 | visibility: hidden 22 | z-index: -1 23 | 24 | &-expand 25 | > div 26 | position: absolute 27 | width: 1000000px 28 | height: 1000000px 29 | left: 0 30 | top: 0 31 | 32 | &-shrink 33 | > div 34 | position: absolute 35 | width: 200% 36 | height: 200% 37 | left: 0 38 | top: 0 39 | -------------------------------------------------------------------------------- /assets/sass/_custom.sass: -------------------------------------------------------------------------------- 1 | // add customs styles and general overrides here 2 | // due to the cascading nature of css, if you try to override theme css variables in this file, those changes will not apply. Instead, override css variables in the `override.sass` file 3 | // we recommend not editing this file directly. Instead, create an `assets/sass/_custom.sass` file at the root level of your site. 4 | // if you edit this file directly, you will have to resolve git conflicts when and if you decide to pull changes we make on the theme 5 | -------------------------------------------------------------------------------- /assets/sass/_fonts.sass: -------------------------------------------------------------------------------- 1 | $font-path: "../fonts" 2 | @font-face 3 | font-family: 'Metropolis' 4 | font-style: normal 5 | font-weight: 400 6 | src: local('Metropolis Regular'), local('Metropolis-Regular'), url('#{$font-path}/Metropolis-Regular.woff2') format('woff2'), url('#{$font-path}/Metropolis-Regular.woff') format('woff') 7 | font-display: swap 8 | 9 | @font-face 10 | font-family: 'Metropolis' 11 | font-style: normal 12 | font-weight: 300 13 | src: local('Metropolis Light'), local('Metropolis-Light'), url('#{$font-path}/Metropolis-Light.woff2') format('woff2'), url('#{$font-path}/Metropolis-Light.woff') format('woff') 14 | font-display: swap 15 | 16 | @font-face 17 | font-family: 'Metropolis' 18 | font-style: italic 19 | font-weight: 300 20 | src: local('Metropolis Light Italic'), local('Metropolis-LightItalic'), url('#{$font-path}/Metropolis-LightItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-LightItalic.woff') format('woff') 21 | font-display: swap 22 | 23 | @font-face 24 | font-family: 'Metropolis' 25 | font-style: normal 26 | font-weight: 500 27 | src: local('Metropolis Medium'), local('Metropolis-Medium'), url('#{$font-path}/Metropolis-Medium.woff2') format('woff2'), url('#{$font-path}/Metropolis-Medium.woff') format('woff') 28 | font-display: swap 29 | 30 | @font-face 31 | font-family: 'Metropolis' 32 | font-style: italic 33 | font-weight: 500 34 | src: local('Metropolis Medium Italic'), local('Metropolis-MediumItalic'), url('#{$font-path}/Metropolis-MediumItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-MediumItalic.woff') format('woff') 35 | font-display: swap 36 | 37 | @font-face 38 | font-family: 'Cookie' 39 | font-style: normal 40 | font-weight: 400 41 | src: local('Cookie-Regular'), url('#{$font-path}/cookie-v10-latin-regular.woff2') format('woff2'), url('#{$font-path}/cookie-v10-latin-regular.woff') format('woff') 42 | font-display: swap 43 | -------------------------------------------------------------------------------- /assets/sass/_mermaid.sass: -------------------------------------------------------------------------------- 1 | html[data-mode="dark"] .mermaid 2 | --theme: darkgoldenrod 3 | background-color: transparent !important 4 | margin-bottom: 2.5rem 5 | svg 6 | margin: 0 auto 7 | display: block -------------------------------------------------------------------------------- /assets/sass/_nav.sass: -------------------------------------------------------------------------------- 1 | .nav 2 | display: grid 3 | grid-gap: 1rem 4 | padding: 0 1.5rem !important 5 | align-items: center 6 | background-color: var(--bg) 7 | @media screen and (min-width: 992px) 8 | grid-template-columns: 10rem 1fr 9 | &_brand 10 | position: relative 11 | picture, img 12 | max-width: 10rem 13 | &_header 14 | position: absolute 15 | top: 0 16 | left: 0 17 | width: 100% 18 | background-color: var(--bg) 19 | z-index: 999999 20 | &_toggle 21 | position: absolute 22 | top: 0 23 | bottom: 0 24 | width: 3rem 25 | display: flex 26 | align-items: center 27 | justify-content: flex-end 28 | text-align: center 29 | right: 0 30 | color: var(--text) 31 | @media screen and (min-width: 992px) 32 | display: none 33 | &_body 34 | display: flex 35 | flex-direction: column 36 | background: var(--accent) 37 | position: fixed 38 | left: 0 39 | top: 0 40 | bottom: 0 41 | height: 100vh 42 | transition: transform 0.25s var(--ease) 43 | transform: translateX(-101vw) 44 | @media screen and (min-width: 992px) 45 | transform: translateX(0) 46 | position: relative 47 | height: initial 48 | justify-content: flex-end 49 | background: transparent 50 | flex-direction: row 51 | &.show &_body 52 | transform: translateX(0) 53 | box-shadow: 0 1rem 4rem rgba(0,0,0,0.1) 54 | background: var(--bg) 55 | li:first-child 56 | margin: 1.5rem 1rem 0.5rem 1rem 57 | overflow-y: auto 58 | // input 59 | // background: var(--accent) 60 | &-link 61 | display: inline-flex 62 | padding: 0.5rem 1rem 63 | &-item 64 | display: grid 65 | align-items: center 66 | .search 67 | @media screen and (min-width: 992px) 68 | margin-right: 1.5rem 69 | &_repo 70 | picture, img 71 | max-width: 1.25rem 72 | -------------------------------------------------------------------------------- /assets/sass/_syntax.sass: -------------------------------------------------------------------------------- 1 | @keyframes pulse 2 | 0% 3 | opacity: 1 4 | 75% 5 | opacity: 0.1 6 | 100% 7 | opacity: 1 8 | 9 | code 10 | font-size: 15px 11 | font-weight: 400 12 | overflow-y: hidden 13 | display: block 14 | font-family: 'Monaco', monospace 15 | word-break: break-all 16 | &.noClass 17 | color: var(--inline-color) 18 | display: inline 19 | line-break: anywhere 20 | .windows .highlight 21 | overflow-x: hidden 22 | &:hover 23 | overflow-x: auto 24 | 25 | .highlight 26 | display: grid 27 | width: 100% 28 | border-radius: 0 0.2rem 0.2rem 0 29 | overflow-x: auto 30 | position: relative 31 | &_wrap 32 | display: grid 33 | background: var(--code-bg) !important 34 | border-radius: 0.5rem 35 | position: relative 36 | padding: 0 1rem 37 | margin: 1.5rem auto 1rem auto 38 | & & 39 | margin: 0 40 | padding: 0 41 | & + & 42 | margin-top: 2.25rem 43 | &:hover > div 44 | opacity: 1 45 | .lang 46 | position: absolute 47 | top: 0 48 | right: 0 49 | text-align: right 50 | width: 7.5rem 51 | padding: 0.5rem 1rem 52 | font-style: italic 53 | text-transform: uppercase 54 | font-size: 67% 55 | opacity: 0.5 56 | color: var(--text) 57 | &:hover .lang 58 | opacity: 0.1 59 | & & 60 | margin: 0 61 | pre 62 | color: var(--text) !important 63 | border-radius: 4px 64 | font-family: 'Monaco', monospace 65 | padding-top: 1.5rem 66 | padding-bottom: 2rem 67 | 68 | table 69 | display: grid 70 | max-width: 100% 71 | margin-bottom: 0 72 | background: transparent 73 | td, th 74 | padding: 0 75 | 76 | .lntd 77 | width: 100% 78 | border: none 79 | &:first-child 80 | &, pre 81 | width: 2.5rem !important 82 | padding-left: 0 83 | padding-right: 0 84 | color: rgba(255,255,255,0.5) 85 | user-select: none 86 | 87 | pre 88 | width: 100% 89 | display: flex 90 | min-width: 0 91 | align-items: center 92 | flex-direction: column 93 | 94 | .err 95 | color: #a61717 96 | .hl 97 | width: 100% 98 | background: var(--inline-color) 99 | .ln, .lnt 100 | margin-right: 0.75rem 101 | padding: 0 102 | transition: opacity 0.3s var(--ease) 103 | &, span 104 | color: var(--text) 105 | opacity: 0.5 106 | user-select: none 107 | 108 | .k, .kc, .kd, .kn, .kp, .kr, .kt, .nt 109 | color: #6ab825 110 | font-weight: 500 111 | 112 | .kn, .kp 113 | font-weight: 400 114 | 115 | .nb, .no, .nv 116 | color: #24909d 117 | 118 | .nc, .nf, .nn 119 | color: #447fcf 120 | 121 | .s, .sa, .sb, .sc, .dl, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss 122 | color: #ed9d13 123 | 124 | .m, .mb, .mf, .mh, .mi, .il, .mo 125 | color: #3677a9 126 | 127 | .ow 128 | color: #6ab825 129 | font-weight: 500 130 | 131 | .c, .ch, .cm, .c1 132 | color: #999 133 | font-style: italic 134 | 135 | .cs 136 | color: #e50808 137 | background-color: #520000 138 | font-weight: 500 139 | 140 | .cp, .cpf 141 | color: #cd2828 142 | font-weight: 500 143 | 144 | .gd, .gr 145 | color: #d22323 146 | 147 | .ge 148 | font-style: italic 149 | 150 | .gh, .gu, .nd, .na, .ne 151 | color: #ffa500 152 | font-weight: 500 153 | 154 | .gi 155 | color: #589819 156 | 157 | .go 158 | color: #ccc 159 | 160 | .gp 161 | color: #aaa 162 | 163 | .gs 164 | font-weight: 500 165 | 166 | .gt 167 | color: #d22323 168 | .w 169 | color: #666 170 | 171 | .hljs 172 | &-string 173 | color: #6ab825 174 | &-attr 175 | color: #ed9d13 176 | .p &-attr 177 | color: var(--light) 178 | 179 | .pre 180 | &_wrap 181 | white-space: pre-wrap 182 | white-space: -moz-pre-wrap 183 | white-space: -pre-wrap 184 | white-space: -o-pre-wrap 185 | word-wrap: break-word 186 | 187 | &_nolines.ln 188 | display: none 189 | 190 | // crayon-like widget styles 191 | .panel 192 | &_box 193 | display: inline-flex 194 | perspective: 300px 195 | grid-gap: 1rem 196 | transition: opacity 0.3s var(--easing) 197 | background: var(--code-bg) 198 | padding: 0.5rem 1.5rem 199 | border-radius: 2rem 200 | align-items: center 201 | position: absolute 202 | right: 0rem 203 | top: -2.1rem 204 | opacity: 0 205 | min-width: 0 206 | &_icon 207 | display: inline-flex 208 | align-items: center 209 | justify-content: center 210 | cursor: pointer 211 | padding: 0.1rem 212 | transform-origin: 50% 50% 213 | margin: 0 214 | min-width: 0 215 | &.active 216 | animation: pulse 0.1s linear 217 | svg 218 | fill: var(--text) 219 | width: 1.5rem 220 | height: 1.5rem 221 | &_hide 222 | // hide icon if not needed 223 | display: none 224 | &_from 225 | position: absolute 226 | color: var(--theme) 227 | bottom: 0 228 | font-size: 1.5rem 229 | font-weight: 500 230 | padding: 0.5rem 0 231 | cursor: pointer 232 | letter-spacing: 0.1px 233 | z-index: 19 234 | &_expanded &_from 235 | display: none 236 | 237 | .shell 238 | position: relative 239 | // display: flex 240 | // align-items: center 241 | // gap: 0.5rem 242 | &::before 243 | content: "$" 244 | position: relative 245 | margin-right: 0.36rem 246 | 247 | .line 248 | &-flex 249 | display: flex 250 | min-width: 0 251 | -------------------------------------------------------------------------------- /assets/sass/_utils.sass: -------------------------------------------------------------------------------- 1 | .wrap 2 | max-width: 1240px 3 | @media screen and (min-width: 1640px) 4 | max-width: 1600px 5 | &, & 6 | width: 100% 7 | padding: 0 25px 8 | margin: 0 auto 9 | 10 | @for $i from 1 through 8 11 | $size: $i * 1.5rem 12 | $x-size: $size * 0.5 13 | .pt-#{$i} 14 | padding-top: $size 15 | 16 | .pb-#{$i} 17 | padding-bottom: $size 18 | 19 | .mt-#{$i} 20 | margin-top: $size 21 | 22 | .mb-#{$i} 23 | margin-bottom: $size 24 | 25 | %grid 26 | display: grid 27 | grid-template-columns: 1fr 28 | 29 | [class*='grid-'] 30 | grid-gap: 2rem 31 | 32 | .grid-2, .grid-3, .grid-4, .grid-auto, .grid-reverse 33 | @extend %grid 34 | 35 | @media screen and (min-width: 42rem) 36 | .grid-auto 37 | grid-template-columns: 2fr 5fr 38 | 39 | .grid-reverse 40 | grid-template-columns: 3fr 1fr 41 | 42 | .grid-2 43 | grid-template-columns: repeat(2, 1fr) 44 | 45 | .grid-3 46 | grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)) 47 | 48 | .grid-4 49 | grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)) 50 | 51 | .active 52 | color: var(--theme) 53 | 54 | .is 55 | background: var(--theme) 56 | color: var(--light) 57 | 58 | .toggle 59 | svg 60 | fill: var(--text) 61 | display: inline-block 62 | transform-origin: 50% 50% 63 | transform: scale(1.2) 64 | cursor: pointer 65 | margin: 0 66 | 67 | .scrollable 68 | width: 100% 69 | overflow-x: hidden 70 | max-width: calc(100vw - 48px) 71 | @media screen and (min-width: 768px) 72 | max-width: 100% 73 | &:hover 74 | overflow-x: auto 75 | 76 | .chart 77 | display: grid 78 | grid-gap: 1.5rem 79 | min-width: 0 80 | max-width: 98vw !important 81 | max-height: 98vw !important 82 | 83 | 84 | .link 85 | display: inline-flex 86 | align-items: center 87 | width: 2.5rem 88 | margin: 0 0.25rem 0 0 89 | padding: 0 0.25rem 90 | opacity: 0 91 | transform: translate(-0.33rem, 0.33rem) 92 | transition: opacity 0.3s cubic-bezier(0.39, 0.575, 0.565, 1) 93 | svg, img 94 | width: 1.5rem 95 | height: 1.5rem 96 | fill: var(--theme) 97 | &_owner:hover & 98 | opacity: 1 99 | 100 | .copy 101 | cursor: pointer 102 | 103 | .standardize-input 104 | appearance: none 105 | -webkit-appearance: none 106 | -------------------------------------------------------------------------------- /assets/sass/_variables.sass: -------------------------------------------------------------------------------- 1 | 2 | html 3 | --color-mode: "light" 4 | --light: #fff 5 | --dark: rgb(28,28,30) 6 | --haze: #f2f5f7 7 | --bubble: rgb(36,36,38) 8 | --accent: var(--haze) 9 | --bg: var(--light) 10 | --code-bg: var(--accent) 11 | --overlay: var(--light) 12 | //--text: #111 13 | --text: #141010 14 | --font: 'Metropolis', sans-serif 15 | --border-color: #eee 16 | --inline-color: darkgoldenrod 17 | --theme: rgb(52,199,89) 18 | --ease: ease 19 | --scroll-thumb: rgba(0,0,0,.06) 20 | --search-border-color: transparent 21 | --next-icon-path: url(../images/icons/double-arrow.svg) 22 | --never-icon-path: url(../images/sitting.svg) 23 | 24 | @mixin darkmode 25 | --color-mode: "dark" 26 | --theme: rgb(48,209,88) 27 | --bg: var(--dark) 28 | --text: #eee 29 | --text-light: #fff 30 | --accent: var(--bubble) 31 | --overlay: var(--bubble) 32 | --border-color: transparent 33 | --scroll-thumb: rgba(255,255,255,.06) 34 | --search-bg: var(--accent) 35 | --search-border-color: var(--accent) 36 | * 37 | box-shadow: none !important 38 | 39 | &[data-mode="dark"] 40 | @include darkmode 41 | .color 42 | &_choice 43 | &::after 44 | background-image: var(--moon-icon) 45 | 46 | &[data-mode="auto"] 47 | @media (prefers-color-scheme: dark) 48 | @include darkmode 49 | 50 | %narrow 51 | max-width: 750px 52 | margin: 0 auto 53 | 54 | blockquote 55 | + .highlight_wrap 56 | margin-top: 2.25rem -------------------------------------------------------------------------------- /assets/sass/main.sass: -------------------------------------------------------------------------------- 1 | {{ $iconsPath := partialCached "functions/getIconPath" . }} 2 | html 3 | --info-icon: url('{{ absURL $iconsPath }}info.svg') 4 | --sun-icon: url('{{ absURL $iconsPath }}sun.svg') 5 | --moon-icon: url('{{ absURL $iconsPath }}moon.svg') 6 | --next-icon: url('{{ absURL $iconsPath }}next.svg') 7 | @import "variables" 8 | @import "base" 9 | @import "nav" 10 | @import "components" 11 | @import "mermaid" 12 | @import "blog" 13 | @import "utils" 14 | @import "syntax" 15 | @import "fonts" 16 | @import "chart" 17 | @import "custom" 18 | @import "mermaid" 19 | -------------------------------------------------------------------------------- /dist/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/dist/.gitkeep -------------------------------------------------------------------------------- /exampleSite/.github/workflows/agolia-update.yaml: -------------------------------------------------------------------------------- 1 | name: Update Algolia Search Index 2 | 3 | off: # change to `on:` to turn on 4 | workflow_dispatch: 5 | branches: 6 | - production 7 | push: 8 | paths: 9 | - content/**/* 10 | - hugo.toml 11 | 12 | env: 13 | # Name of the branch in your repository which will store your generated site. 14 | SITE-BRANCH: master 15 | 16 | jobs: 17 | build: 18 | # In this phase, the code is pulled from main and the site rendered in Hugo. The built site is stored as an artifact for other stages. # deploy: 19 | runs-on: ubuntu-20.04 20 | concurrency: 21 | group: ${{ github.workflow }}-${{ github.ref }} 22 | steps: 23 | - uses: actions/checkout@v3 24 | with: 25 | submodules: true # Fetch Hugo themes (true OR recursive) 26 | fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod 27 | 28 | - name: Setup Hugo 29 | uses: peaceiris/actions-hugo@v2 30 | with: 31 | hugo-version: 'latest' 32 | extended: true 33 | 34 | - name: Build 35 | run: hugo -e "production" -d "dist" --minify 36 | # If build succeeds, store the dist/ dir as an artifact to be used in subsequent phases. 37 | - name: Upload output dist dir as artifact 38 | uses: actions/upload-artifact@v1 39 | with: 40 | name: dist 41 | path: dist/ 42 | publish: 43 | # In the publish phase, the site is pushed up to a different branch which only stores the dist/ folder ("site" branch) and is also delta synchronized to the S3 bucket. CloudFront invalidation happens last. 44 | runs-on: ubuntu-20.04 45 | needs: build 46 | steps: 47 | # Check out the site branch this time since we have to ultimately commit those changes there. 48 | - name: Checkout site branch 49 | uses: actions/checkout@v3 50 | with: 51 | submodules: true 52 | fetch-depth: 0 53 | ref: ${{ env.SITE-BRANCH }} 54 | # Download the artifact containing the newly built site. This overwrites the dist/ dir from the check out above. 55 | - name: Download artifact from build stage 56 | uses: actions/download-artifact@v1 57 | with: 58 | name: dist 59 | # Add all the files/changes in dist/ that were pulled down from the build stage and then commit them. 60 | # The final line sets a GitHub Action output value that can be read by other steps. 61 | # This function cannot store mult-line values so newline chars must be stripped. 62 | - name: Commit files 63 | id: can_commit 64 | run: | 65 | git config --local user.email "action@github.com" 66 | git config --local user.name "GitHub Action" 67 | cp dist/index.json index.json 68 | git add -A index.json 69 | commit_message=$(git commit -m "Build search index." -a | tr -d '\n' || true) 70 | echo "commit_message=$commxit_message >> $GITHUB_OUTPUT" 71 | 72 | # Checks if previous stage had any valid commit. 73 | - name: Nothing to commit 74 | id: nothing_committed 75 | if: contains(steps.can_commit.outputs.commit_message, 'nothing to commit') 76 | run: echo "Saw that no changes were made to Hugo site." 77 | # Push those changes back to the site branch. 78 | - name: Push to site branch 79 | if: steps.nothing_committed.conclusion == 'skipped' 80 | uses: ad-m/github-push-action@master 81 | with: 82 | github_token: ${{ secrets.GITHUB_TOKEN }} 83 | branch: ${{ env.SITE-BRANCH }} 84 | index: 85 | runs-on: ubuntu-latest 86 | needs: publish 87 | name: Upload Algolia Index 88 | steps: 89 | - uses: actions/checkout@v2 90 | with: 91 | fetch-depth: 0 92 | - uses: wangchucheng/algolia-uploader@master 93 | with: 94 | # Such as `Z0U0ACGBN8` 95 | app_id: ${{ secrets.AGOLIA_INDEX_ID }} 96 | # Go to https://github.com/dimi365/website/settings/secrets/actions and set an AGOLIA_ADMIN_KEY secret key 97 | admin_key: ${{ secrets.AGOLIA_ADMIN_KEY }} 98 | # The algolia search index name. 99 | index_name: compose # edit appropriately 100 | # The index file path relative to repo root. no leading forward slash 101 | index_file_path: index.json -------------------------------------------------------------------------------- /exampleSite/.github/workflows/aws-deploy.yaml: -------------------------------------------------------------------------------- 1 | # PREREQUISITES: 2 | # The following secrets must be stored in your repository where this Action runs: 3 | # AWS_ACCESS_KEY_ID 4 | # AWS_CLOUDFRONT_DISTRO_ID 5 | # AWS_S3_BUCKET_NAME 6 | # AWS_SECRET_ACCESS_KEY 7 | 8 | name: AWS DEPLOY CI 9 | off: # change to `on:` to turn on 10 | workflow_dispatch: 11 | branches: 12 | - main 13 | push: 14 | paths: 15 | - content/**/* 16 | - hugo.toml 17 | # pull_request: 18 | # branches: 19 | # - production 20 | env: 21 | # Default AWS region where S3 pushes and CloudFront invalidations will occur. 22 | AWS-DEFAULT-REGION: us-east-2 23 | # Name of the branch in your repository which will store your generated site. 24 | SITE-BRANCH: site 25 | 26 | jobs: 27 | build: 28 | # In this phase, the code is pulled from main and the site rendered in Hugo. The built site is stored as an artifact for other stages. # deploy: 29 | runs-on: ubuntu-20.04 30 | concurrency: 31 | group: ${{ github.workflow }}-${{ github.ref }} 32 | steps: 33 | - uses: actions/checkout@v3 34 | with: 35 | submodules: true # Fetch Hugo themes (true OR recursive) 36 | fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod 37 | 38 | - name: Setup Hugo 39 | uses: peaceiris/actions-hugo@v2 40 | with: 41 | hugo-version: 'latest' 42 | extended: true 43 | 44 | - name: Build 45 | run: hugo -e "production" -d "dist" --minify 46 | # If build succeeds, store the dist/ dir as an artifact to be used in subsequent phases. 47 | - name: Upload output public dir as artifact 48 | uses: actions/upload-artifact@v1 49 | with: 50 | name: dist 51 | path: dist/ 52 | publish: 53 | # In the publish phase, the site is pushed up to a different branch which only stores the dist/ folder ("site" branch) and is also delta synchronized to the S3 bucket. CloudFront invalidation happens last. 54 | runs-on: ubuntu-20.04 55 | needs: build 56 | steps: 57 | # Check out the site branch this time since we have to ultimately commit those changes there. 58 | - name: Checkout site branch 59 | uses: actions/checkout@v3 60 | with: 61 | submodules: true 62 | fetch-depth: 0 63 | ref: ${{ env.SITE-BRANCH }} 64 | # Download the artifact containing the newly built site. This overwrites the dist/ dir from the check out above. 65 | - name: Download artifact from build stage 66 | uses: actions/download-artifact@v1 67 | with: 68 | name: public 69 | # Add all the files/changes in dist/ that were pulled down from the build stage and then commit them. 70 | # The final line sets a GitHub Action output value that can be read by other steps. 71 | # This function cannot store mult-line values so newline chars must be stripped. 72 | - name: Commit files 73 | id: can_commit 74 | run: | 75 | git config --local user.email "action@github.com" 76 | git config --local user.name "GitHub Action" 77 | git add -A dist/ 78 | commit_message=$(git commit -m "Publish generated Hugo site." -a | tr -d '\n' || true) 79 | echo "commit_message=$commit_message >> $GITHUB_OUTPUT" 80 | # Checks if previous stage had any valid commit. 81 | - name: Nothing to commit 82 | id: nothing_committed 83 | if: contains(steps.can_commit.outputs.commit_message, 'nothing to commit') 84 | run: echo "Saw that no changes were made to Hugo site." 85 | # Push those changes back to the site branch. 86 | - name: Push to site branch 87 | if: steps.nothing_committed.conclusion == 'skipped' 88 | uses: ad-m/github-push-action@master 89 | with: 90 | github_token: ${{ secrets.GITHUB_TOKEN }} 91 | branch: ${{ env.SITE-BRANCH }} 92 | # Store the AWS credentials on the runner. 93 | - name: Configure AWS credentials 94 | if: steps.nothing_committed.conclusion == 'skipped' 95 | uses: aws-actions/configure-aws-credentials@v1-node16 96 | with: 97 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 98 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 99 | aws-region: ${{ env.AWS-DEFAULT-REGION }} 100 | - name: Delta sync site to S3 with aws cli 101 | if: steps.nothing_committed.conclusion == 'skipped' 102 | run: aws s3 sync --size-only --delete --exclude "/authors/*/page/*" --cache-control max-age=2592000 dist/ s3://${{ secrets.AWS_S3_BUCKET_NAME }} 103 | # Use s5cmd to perform only a delta sync to the destination S3 bucket. This minimizes transfer traffic since it only uploads changed files. 104 | # - name: Delta sync site to S3 bucket 105 | # if: steps.nothing_committed.conclusion == 'skipped' 106 | # run: | 107 | # curl -sLO https://github.com/peak/s5cmd/releases/download/v1.0.0/s5cmd_1.0.0_Linux-64bit.tar.gz 108 | # tar -xzf s5cmd_1.0.0_Linux-64bit.tar.gz 109 | # chmod +x s5cmd 110 | # sudo mv s5cmd /usr/local/bin/ 111 | # echo "****Showing working dir and listing files.****" 112 | # pwd && ls -lah 113 | # echo "****Running delta sync against S3.****" 114 | # s5cmd cp -s -n -u dist/ s3://${{ secrets.AWS_S3_BUCKET_NAME }} 115 | # Use the aws cli tool to perform a glob invalidation of the entire site against CloudFront. 116 | - name: Invalidate cache on CloudFront 117 | if: steps.nothing_committed.conclusion == 'skipped' 118 | run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRO_ID }} --paths "/*" -------------------------------------------------------------------------------- /exampleSite/README.md: -------------------------------------------------------------------------------- 1 | ## Guide 2 | 3 | This guide covers the necessary bits. As the project evolves, it will only become more comprehensive 4 | -------------------------------------------------------------------------------- /exampleSite/config/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/config/.gitkeep -------------------------------------------------------------------------------- /exampleSite/config/_default/languages.toml: -------------------------------------------------------------------------------- 1 | [en] 2 | LanguageName = "English" 3 | weight = 2 4 | # [tr] 5 | # LanguageName = "Turkish" 6 | # weight = 1 7 | -------------------------------------------------------------------------------- /exampleSite/config/_default/markup.toml: -------------------------------------------------------------------------------- 1 | [goldmark] 2 | [goldmark.renderer] 3 | unsafe = true 4 | [goldmark.extensions] 5 | typographer = false 6 | [highlight] 7 | codeFences = true 8 | guessSyntax = false 9 | hl_Lines = "" 10 | lineNoStart = 1 11 | lineNos = true 12 | lineNumbersInTable = false 13 | noClasses = false 14 | style = "monokai" 15 | tabWidth = 2 16 | [tableOfContents] 17 | endLevel = 4 18 | ordered = false 19 | startLevel = 2 -------------------------------------------------------------------------------- /exampleSite/config/_default/menus/menu.en.toml: -------------------------------------------------------------------------------- 1 | # menu items 2 | [[main]] 3 | name = "Blog" 4 | weight = 5 5 | url = "blog/" 6 | 7 | [[main]] 8 | name = "Docs" 9 | weight = 2 10 | url = "docs/" 11 | 12 | [[main]] 13 | name = "Tutorials" 14 | weight = 2 15 | url = "tutorials/" 16 | 17 | [[main]] 18 | name = "Example" 19 | weight = 3 20 | url = "https://docs.neuralvibes.com" 21 | 22 | # [[main]] 23 | # name = "Blog" 24 | # weight = 4 25 | # url = "blog/" -------------------------------------------------------------------------------- /exampleSite/config/_default/params.toml: -------------------------------------------------------------------------------- 1 | # use the setting below to set multiple docs directories. 2 | # docSections = ["docs", "tutorials"] 3 | 4 | uniqueHomePage = true # change to false to add sidebar to homepage 5 | 6 | blogDir = "blog" # can be posts, blog e.t.c 7 | 8 | repo = "https://github.com/onweru/compose" 9 | 10 | time_format_blog = "Monday, January 02, 2006" 11 | time_format_default = "January 2, 2006" 12 | enableDarkMode = false # set to false to disable darkmode by default # user will still have the option to use dark mode 13 | defaultLightingMode = "auto" # other possible values: "dark", "light" 14 | 15 | # sets the maximum number of lines per codeblock. The codeblock will however be scrollable and expandable. 16 | codeMaxLines = 10 17 | 18 | # show/hide line numbers by default. Switch to `true` if you'd rather have them on. 19 | showLineNumbers = false 20 | 21 | # By default the template will look for icons under the icons directory. In some situations you might wanna change that. edit the line below 22 | # iconsPath = 'icons/' 23 | 24 | otherSearchableFields = [ 25 | "Tags", 26 | "Categories", 27 | "CustomField", 28 | ] # As they appear in frontmatter 29 | 30 | # Defaults to true if not set 31 | # Enable copyRight Footer Stamp. Takes in attribution 32 | enableCopyright = false 33 | 34 | # search 35 | [search] 36 | on = true 37 | global = false # turn to `true` to enable global search 38 | [search.algolia] 39 | enable = false # if false search will default to fusejs 40 | id = "Q40WQQX84U" # Application ID 41 | index = "compose" # Index name 42 | key = "da87401a458102ec6bbd6cc5e5cf8d95" # Search-Only API Key 43 | 44 | # Site logo 45 | [logo] 46 | lightMode = "images/compose.svg" 47 | darkMode = "images/compose-light.svg" 48 | 49 | [source] 50 | name = "GitHub" 51 | iconLight = "images/GitHubMarkLight.svg" 52 | iconDark = "images/GitHubMarkDark.svg" 53 | url = "https://github.com/onweru/compose/" 54 | 55 | # optional 56 | # attribution. Feel free to delete this 57 | [author] 58 | name = "Weru" 59 | url = "https://neuralvibes.com/author/" 60 | -------------------------------------------------------------------------------- /exampleSite/content/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Compose" 3 | [data] 4 | baseChartOn = 3 5 | colors = ["#627c62", "#11819b", "#ef7f1a", "#4e1154"] 6 | columnTitles = ["Section", "Status", "Author"] 7 | fileLink = "content/projects.csv" 8 | title = "Projects" 9 | +++ 10 | 11 | {{< block "grid-2" >}} 12 | {{< column >}} 13 | 14 | # Compose your Docs with **Ease**. 15 | 16 | Compose is a lean `Hugo` documentation theme, inspired by [forestry.io](https://forestry.io/docs/welcome/). 17 | 18 | {{< tip "warning" >}} 19 | Feel free to open a [PR](https://github.com/onweru/compose/pulls), raise an [issue](https://github.com/onweru/compose/issues/new/choose "Open a Github Issue")(s) or request new feature(s). {{< /tip >}} 20 | 21 | {{< tip >}} 22 | You can generate diagrams, flowcharts, and piecharts from text in a similar manner as markdown using [mermaid](./docs/compose/mermaid/). 23 | 24 | Or, [generate graphs, charts](docs/compose/graphs-charts-tables/#show-a-pie-doughnut--bar-chart-at-once) and tables from a csv, ~~or a json~~ file. 25 | {{< /tip >}} 26 | 27 | {{< button "docs/compose/" "Read the Docs" >}}{{< button "https://github.com/onweru/compose" "Download Theme" >}} 28 | {{< /column >}} 29 | 30 | {{< column >}} 31 | ![diy](/images/scribble.jpg) 32 | {{< /column >}} 33 | {{< /block >}} 34 | -------------------------------------------------------------------------------- /exampleSite/content/blog/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Blog" 3 | +++ -------------------------------------------------------------------------------- /exampleSite/content/blog/emoji-support.md: -------------------------------------------------------------------------------- 1 | +++ 2 | author = "Hugo Authors" 3 | title = "Emoji Support" 4 | date = "2019-03-05" 5 | description = "Guide to emoji usage in Hugo" 6 | tags = ["emoji"] 7 | image = "/images/artist.jpg" 8 | +++ 9 | 10 | Emoji can be enabled in a Hugo project in a number of ways. 11 | 12 | 13 | The `[emojify](https://gohugo.io/functions/emojify/)` function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes). 14 | 15 | {{< youtube "https://www.youtube.com/watch?v=eW7Twd85m2g" >}} 16 | 17 | To enable emoji globally, set `enableEmoji` to `true` in your site’s [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g. 18 | 19 |

🙈 :see_no_evil: 🙉 :hear_no_evil: 🙊 :speak_no_evil:

20 |
21 | 22 | The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes. 23 | 24 | *** 25 | 26 | **N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g. 27 | 28 | ### Inline CSS 29 | 30 | ```html 31 | 44 | ``` 45 | 46 | ### Javascript 47 | 48 | ```javascript 49 | function createEl(element) { 50 | return document.createElement(element); 51 | } 52 | 53 | function elem(selector, parent = document){ 54 | let elem = parent.querySelector(selector); 55 | return elem != false ? elem : false; 56 | } 57 | 58 | let navBar = elem(`.${bar}`); 59 | let nav = elem('.nav-body'); 60 | let open = 'nav-open'; 61 | let exit = 'nav-exit'; 62 | let drop = 'nav-drop'; 63 | let pop = 'nav-pop'; 64 | let navDrop = elem(`.${drop}`); 65 | let hidden = 'hidden'; 66 | 67 | ``` 68 | 69 | ### Swift 70 | 71 | ```swift 72 | class Person { 73 | var residence: Residence? 74 | } 75 | 76 | class Residence { 77 | var rooms = [Room]() 78 | var numberOfRooms: Int { 79 | return rooms.count 80 | } 81 | 82 | 83 | subscript(i: Int) -> Room { 84 | get { 85 | return rooms[i] 86 | } 87 | set { 88 | rooms[i] = newValue 89 | } 90 | } 91 | 92 | func printNumberOfRooms() { 93 | print("The number of rooms is \(numberOfRooms)") 94 | } 95 | 96 | var address: Address? 97 | 98 | } 99 | ``` 100 | -------------------------------------------------------------------------------- /exampleSite/content/blog/hugoisforlovers.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Getting Started with Hugo" 3 | description = "" 4 | tags = [ "go", "golang", "hugo", "development" ] 5 | date = 2014-04-02T00:00:00.000Z 6 | categories = [ "Development", "golang" ] 7 | image = "/images/stuck.jpg" 8 | +++ 9 | 10 | ## Step 1. Install Hugo 11 | 12 | Go to [Hugo releases](https://github.com/spf13/hugo/releases) and download the 13 | appropriate version for your OS and architecture. 14 | 15 | Save it somewhere specific as we will be using it in the next step. 16 | 17 | More complete instructions are available at [Install Hugo](https://gohugo.io/getting-started/installing/) 18 | 19 | ## Step 2. Build the Docs 20 | 21 | Hugo has its own example site which happens to also be the documentation site 22 | you are reading right now. 23 | 24 | Follow the following steps: 25 | 26 | 1. Clone the [Hugo repository](http://github.com/spf13/hugo) 27 | 2. Go into the repo 28 | 3. Run hugo in server mode and build the docs 29 | 4. Open your browser to http://localhost:1313 30 | 31 | Corresponding pseudo commands: 32 | 33 | ```shell 34 | git clone https://github.com/spf13/hugo 35 | cd hugo 36 | /path/to/where/you/installed/hugo server --source=./docs 37 | > 29 pages created 38 | > 0 tags index created 39 | > in 27 ms 40 | > Web Server is available at http://localhost:1313 41 | > Press ctrl+c to stop 42 | ``` 43 | 44 | Once you've gotten here, follow along the rest of this page on your local build. 45 | 46 | ## Step 3. Change the docs site 47 | 48 | Stop the Hugo process by hitting Ctrl+C. 49 | 50 | Now we are going to run hugo again, but this time with hugo in watch mode. 51 | 52 | ```shell 53 | /path/to/hugo/from/step/1/hugo server --source=./docs --watch 54 | > 29 pages created 55 | > 0 tags index created 56 | > in 27 ms 57 | > Web Server is available at http://localhost:1313 58 | > Watching for changes in /Users/spf13/Code/hugo/docs/content 59 | > Press ctrl+c to stop 60 | ``` 61 | 62 | Open your [favorite editor](http://vim.spf13.com) and change one of the source 63 | content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*. 64 | 65 | Content files are found in `docs/content/`. Unless otherwise specified, files 66 | are located at the same relative location as the url, in our case 67 | `docs/content/overview/quickstart.md`. 68 | 69 | Change and save this file.. Notice what happened in your terminal. 70 | 71 | ```shell 72 | > Change detected, rebuilding site 73 | 74 | > 29 pages created 75 | > 0 tags index created 76 | > in 26 ms 77 | ``` 78 | 79 | Refresh the browser and observe that the typo is now fixed. 80 | 81 | Notice how quick that was. Try to refresh the site before it's finished building. I double dare you. 82 | Having nearly instant feedback enables you to have your creativity flow without waiting for long builds. 83 | 84 | ## Step 4. Have fun 85 | 86 | The best way to learn something is to play with it... 87 | -------------------------------------------------------------------------------- /exampleSite/content/docs/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Themes' Docs" 3 | weight = 1 4 | +++ 5 | 6 | These docs consists of two parts: 7 | 8 | 1. Hugo Compose Themes docs 9 | 2. Hugo Clarity Theme docs. 10 | 11 | Please note that the features listed under each theme are independent of each other. That is to say, some features may only be found in one theme and not in both. 12 | 13 | 14 | 15 | {{< button "./compose/" "Compose Theme Docs" "mb-1" >}} 16 | 17 | {{< button "./clarity/" "Clarity Theme Docs" >}} 18 | 19 | -------------------------------------------------------------------------------- /exampleSite/content/docs/clarity/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | Title = "Clarity Docs" 3 | weight = 10 4 | +++ 5 | 6 | __Hugo Clarity__ is a technology-minded theme for Hugo based on VMware's open-source [Clarity Design System](https://clarity.design/) featuring rich code support, dark/light mode, mobile support, and much more. See [a live demo at __neonmirrors.net__](https://neonmirrors.net/). 7 | 8 | {{< button "./getting-started/" "Get started with Clarity" >}} 9 | -------------------------------------------------------------------------------- /exampleSite/content/docs/clarity/blogging.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title="Blogging" 3 | weight=16 4 | +++ 5 | 6 | ### Blog directory 7 | 8 | Edit the `config.toml` file and change the `blogDir` key. Value will be name of the folder where the blog articles reside. 9 | 10 | ```yaml 11 | [params] 12 | ... 13 | blogDir = "blog" 14 | ... 15 | ``` 16 | 17 | For more info, see the [Hugo docs](https://gohugo.io/functions/where/#mainsections). 18 | 19 | ### Mobile menu positioning 20 | 21 | The navigation menu when mobile browsing can be configured in `config.toml` to open right or left depending on preference. The "hamburger" menu icon will always display in the upper right hand corner regardless. 22 | 23 | ```yaml 24 | [params] 25 | ... 26 | mobileNavigation = "left" # Mobile nav menu will open to the left of the screen. 27 | ... 28 | ``` 29 | 30 | ### Tags and Taxonomies 31 | 32 | #### Show number of tags 33 | 34 | The number of tags and taxonomies (including categories) that should be shown can be configured so that any more than this value will only be accessible when clicking the All Tags button. This is to ensure a large number of tags or categories can be easily managed without consuming excess screen real estate. Edit the `numberOfTagsShown` parameter and set accordingly. 35 | 36 | ```yaml 37 | [params] 38 | ... 39 | numberOfTagsShown = 14 # Applies for all other default & custom taxonomies. e.g categories, brands see https://gohugo.io/content-management/taxonomies#what-is-a-taxonomy 40 | ... 41 | ``` 42 | 43 | #### Number of tags example 44 | 45 | ![Tags](../../../images/clarity/tags.png) 46 | 47 | 48 | 49 | ### Table of contents 50 | 51 | Each article can optionally have a table of contents (TOC) generated for it based on top-level links. By configuring the `toc` parameter in the article frontmatter and setting it to `true`, a TOC will be generated only for that article. The TOC will then render under the featured image. 52 | 53 | #### Table of contents (TOC) example 54 | 55 | ![Article table of contents](../../../images/clarity/article-toc.png) 56 | -------------------------------------------------------------------------------- /exampleSite/content/docs/clarity/customize.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Customization" 3 | weight = 14 4 | +++ 5 | 6 | ## Configuration 7 | 8 | If set, jump over to the `config.toml` file and start [configuring](#configuration) your site. 9 | 10 | This section will mainly cover settings that are unique to this theme. If something is not covered here (or elsewhere in this file), there's a good chance it is covered in [this Hugo docs page](https://gohugo.io/getting-started/configuration/#configuration-file). 11 | 12 | ### Global Parameters 13 | 14 | These options set global values that some pages or all pages in the site use by default. 15 | 16 | | Parameter | Value Type | Overidable on Page | 17 | |:---- | ---- | ---- | 18 | | author | string | no | 19 | | twitter | string | no | 20 | | largeTwitterCard | boolean | no | 21 | | ga_analytics | string | no | 22 | | description | string | yes | 23 | | introDescription | string | no | 24 | | numberOfTagsShown | integer | no | 25 | | fallBackOgImage | file path (string) | no | 26 | | codeMaxLines | integer | yes | 27 | | codeLineNumbers | boolean | yes | 28 | | mainSections | array/string | no | 29 | | centerLogo | boolean | no | 30 | | logo | file path (string) | no | 31 | | mobileNavigation | string | no | 32 | | figurePositionShow | boolean | yes | 33 | | figurePositionLabel | string | no | 34 | | customCSS | array of file path (string) | no | 35 | | customJS | array of file path (string) | no | 36 | | enforceLightMode | boolean | N/A | 37 | | enforceDarkMode | boolean | N/A | 38 | | titleSeparator| string | no | 39 | | comment | boolean | no | 40 | 41 | ### Page Parameters 42 | 43 | These options can be set from a page [frontmatter](https://gohugo.io/content-management/front-matter#readout) or via [archetypes](https://gohugo.io/content-management/archetypes/#readout). 44 | 45 | | Parameter | Value Type | Overrides Global | 46 | |:---- | ---- | ---- | 47 | | title | string | N/A | 48 | | date | date | N/A | 49 | | description | string | N/A | 50 | | draft | boolean | N/A | 51 | | featured | boolean | N/A | 52 | | tags | array/string | N/A | 53 | | categories | array/string | N/A | 54 | | toc | boolean | N/A | 55 | | thumbnail | file path (string) | N/A | 56 | | featureImage | file path (string) | N/A | 57 | | shareImage | file path (string) | N/A | 58 | | codeMaxLines | integer | yes | 59 | | codeLineNumbers | boolean | yes | 60 | | figurePositionShow | boolean | yes | 61 | | figurePositionLabel | string | no | 62 | | comment | boolean | no | 63 | 64 | ### Modify links menu 65 | 66 | To add, remove, or reorganize top menu items, [edit this YAML file](https://github.com/chipzoller/hugo-clarity/blob/master/exampleSite/data/menu.yaml). These menu items also display any categories (taxonomies) that might be configured for articles. 67 | 68 | ### Social media 69 | 70 | To edit your social media profile links, [edit this YAML file](https://github.com/chipzoller/hugo-clarity/blob/master/exampleSite/data/social.yaml). 71 | 72 | If you wish to globally use a [large Twitter summary card](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image) when sharing posts, set the global parameter `largeTwitterCard` to `true`. 73 | 74 | ### Search engine 75 | 76 | If using Google Analytics, configure the `ga_analytics` global parameter in your site with your ID. 77 | 78 | ### Forcing light or dark mode 79 | 80 | By default, sites authored using Clarity will load in the browser with the user's system-wide settings. I.e., if the underlying OS is set to dark mode, the site will automatically load in dark mode. Regardless of the default mode, a UI control switch exists to override the theme mode at the user's discretion. 81 | 82 | In order to override this behavior and force one mode or another, add either `enforceLightMode` or `enforceDarkMode` to your `config.toml` file. If neither value is present, add it. 83 | 84 | To enforce Light Mode by default, turn `enforceLightMode` to `true`. 85 | 86 | To enforce Dark Mode by default, turn `enforceDarkMode` to `true` 87 | 88 | ```yaml 89 | [params] 90 | ... 91 | enforceLightMode = true # Force the site to always load in light mode. 92 | ... 93 | ``` 94 | 95 | Please note that you cannot enforce both modes at the same time. It wouldn't make sense, would it? 96 | 97 | {{< tip "warning" >}} 98 | > Please also note that the mode toggle UI will remain in place. That way, if a user prefers dark mode, they can have their way. The best of both worlds. 99 | {{< /tip >}} 100 | 101 | ### I18N 102 | 103 | This theme supports Multilingual (i18n / internationalization / translations) 104 | 105 | The `exampleSite` gives you some examples already. 106 | You may extend the multilingual functionality by following the [official documentation](https://gohugo.io/content-management/multilingual/). 107 | 108 | Things to consider in multilingual: 109 | 110 | * **supported languages** are configured in [config/_default/languages.toml](./exampleSite/config/_default/languages.toml) 111 | * **add new language support** by creating a new file inside [i18n](./i18n/) directory. 112 | Check for missing translations using `hugo server --i18n-warnings` 113 | * **taxonomy** names (tags, categories, etc...) are translated in [i18n](./i18n/) as well (translate the key) 114 | * **menus** are translated manually in the config files [config/_default/menus/menu.xx.toml](./exampleSite/config/_default/menus/) 115 | * **menu's languages list** are semi-hardcoded. You may chose another text for the menu entry with [languageMenuName](./exampleSite/config.toml). Please, do better and create a PR for that. 116 | * **content** must be translated individually. Read the [official documentation](https://gohugo.io/content-management/multilingual/#translate-your-content) for information on how to do it. 117 | 118 | **Note:** if you do NOT want any translations (thus removing the translations menu entry), then you must not have any translations. 119 | In the exampleSite that's as easy as removing the extra translations from the `config/_default/...` or executing this onliner: 120 | 121 | ```shell 122 | sed '/^\[pt]$/,$d' -i config/_default/languages.toml && rm config/_default/menus/menu.pt.toml 123 | ``` 124 | 125 | ### Comments 126 | 127 | Clarity supports Hugo built-in Disqus partial, you can enable Disqus simply by setting [`disqusShortname`](https://gohugo.io/templates/internal/#configure-disqus) in your configuration file. 128 | 129 | {{< tip >}} 130 | > `disqusShortname` should be placed in root level of configuration. 131 | {{< /tip >}} 132 | 133 | You can also create a file named `layouts/partials/comments.html` for customizing the comments, checkout [Comments Alternatives](https://gohugo.io/content-management/comments/#comments-alternatives) for details. 134 | -------------------------------------------------------------------------------- /exampleSite/content/docs/clarity/features.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Features" 3 | Weight = 13 4 | +++ 5 | 6 | * Blog with tagging and category options 7 | * Deeplinks 8 | * Native Image Lazy Loading 9 | * Customizable (see config) 10 | * Dark Mode (with UI controls for user preference setting) 11 | * Toggleable table of contents 12 | * Flexible image configuration 13 | * Logo alignment 14 | * Mobile support with configurable menu alignment 15 | * Syntax Highlighting 16 | * Rich code block functions including: 17 | 1. Copy to clipboard 18 | 2. Toggle line wrap (dynamic) 19 | 3. Toggle line numbers 20 | 4. Language label 21 | 5. Toggle block expansion/contraction (dynamic) 22 | 23 | To put it all in context, here is a preview showing all functionality. 24 | 25 | ![code block functions](../../../images/clarity/syntax-block.gif) 26 | -------------------------------------------------------------------------------- /exampleSite/content/docs/clarity/getting-started.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Getting started" 3 | weight = 11 4 | +++ 5 | 6 | ## Prerequisites 7 | 8 | Firstly, __ensure you have installed the [extended version of Hugo](https://github.com/gohugoio/hugo/releases)__. See installation steps from [Hugo's official docs](https://gohugo.io/getting-started/installing/). 9 | 10 | ## Getting up and running 11 | 12 | Read the [prerequisites](#prerequisites) above and verify you're using the extended version of Hugo. There are at least two ways of quickly getting started with Hugo and the VMware Clarity theme: 13 | 14 | ### Option 1 (recommended) 15 | 16 | Generate a new Hugo site and add this theme as a Git submodule inside your themes folder: 17 | 18 | ```bash 19 | hugo new site yourSiteName 20 | cd yourSiteName 21 | git init 22 | git submodule add https://github.com/chipzoller/hugo-clarity themes/hugo-clarity 23 | cp -a themes/hugo-clarity/exampleSite/* . 24 | ``` 25 | 26 | Then run 27 | 28 | ```bash 29 | hugo server 30 | ``` 31 | 32 | Hurray! 33 | 34 | ### Option 2 (Great for testing quickly) 35 | 36 | You can run your site directly from the `exampleSite`. To do so, use the following commands: 37 | 38 | ```bash 39 | git clone https://github.com/chipzoller/hugo-clarity 40 | cd hugo-clarity/exampleSite/ 41 | hugo server --themesDir ../.. 42 | ``` 43 | 44 | > Although, option 2 is great for quick testing, it is somewhat problematic when you want to update your theme. You would need to be careful not to overwrite your changes. 45 | 46 | ### Option 3 (The new, most fun & painless approach) 47 | 48 | This option enables you to load this theme as a hugo module. It arguably requires the least effort to run and maintain in your website. 49 | 50 | First things first, ensure you have `go` binary [installed on your machine](https://golang.org/doc/install). 51 | 52 | ```bash 53 | git clone https://github.com/chipzoller/hugo-clarity.git clarity 54 | cd clarity/exampleSite/ 55 | hugo mod init my-site 56 | ``` 57 | Open config.toml file in your code editor, replace `theme = "hugo-clarity"` with `theme = ["github.com/chipzoller/hugo-clarity"]` or just `theme = "github.com/chipzoller/hugo-clarity"`. 58 | 59 | Hurray you can now run 60 | 61 | ```yaml 62 | hugo server 63 | ``` 64 | 65 | To pull in theme updates, run `hugo mod get -u ./...` from the theme folder. If unsure, [learn how to update hugo modules](https://gohugo.io/hugo-modules/use-modules/#update-modules) 66 | 67 | > There [is more you could do with hugo modules](https://discourse.gohugo.io/t/hugo-modules-for-dummies/20758), but this will suffice for our use case here. 68 | -------------------------------------------------------------------------------- /exampleSite/content/docs/clarity/images.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Manipulating Images" 3 | weight = 15 4 | +++ 5 | 6 | ## Images 7 | 8 | ### Image figure captions 9 | 10 | You have the option of adding captions to images in blog posts and automatically prepending a desired string such as "Figure N" to the alt text. This is controlled via two global settings. 11 | 12 | `figurePositionLabel` is a string which will be prepended to any alt text of an article image. By default, this is set to "Figure." And `figurePositionShow` controls, globally, whether to show this label. It does not affect whether to show the image alt text, only the prefix figure caption. For more granular control, `figurePositionShow` can be overridden at the article level if desired. 13 | 14 | The number will be automatically calculated and assigned after the `figurePositionLabel` text starting from the top of the article and counting down. Featured images will be excluded from this figuration. 15 | 16 | ### Image figure captions example 17 | 18 | In this example, `figurePositionLabel` is set to "Figure" in `config.toml` and this is the first image in a given article. 19 | 20 | ```markdown 21 | ![Antrea Kubernetes nodes prepared](./images/calrity/image-figure.png) 22 | ``` 23 | 24 | ![Here is my alt text for this image.](../../../images/clarity/image-figure.png) 25 | 26 | ### Inline images 27 | 28 | To make a blog image inline, append `:inline` to its alt text. Typically, inline images will have no alt text associated with them. 29 | 30 | ### Inline images example 31 | 32 | ```markdown 33 | 34 | ![:inline](someImageUrl) 35 | 36 | 37 | 38 | ![some alt text:inline](someOtherImageUrl) 39 | ``` 40 | 41 | ![Inline image example](../../../images/clarity/image-inline.png) 42 | 43 | ### Float images to the left 44 | 45 | To align a blog image to the left, append `:left` to its alt text. Article text will then flow to the right of the image. 46 | 47 | ### Float images left example 48 | 49 | ```markdown 50 | 51 | ![:left](someImageUrl) 52 | 53 | 54 | 55 | ![some alt text:left](someOtherImageUrl) 56 | ``` 57 | 58 | ### Add classes to images 59 | 60 | To add a class image to the left, append `::` to its alt text. You can also add multiple classes to an image separated by space. `:: `. 61 | 62 | ### Image class example 63 | 64 | ```markdown 65 | 66 | ![::img-medium](someImageUrl) 67 | 68 | 69 | 70 | ![some alt text::img-large img-shadow](someOtherImageUrl) 71 | ``` 72 | 73 | ### Article thumbnail image 74 | 75 | Blog articles can specify a thumbnail image which will be displayed to the left of the card on the home page. Thumbnails should be square (height:width ratio of `1:1`) and a suggested dimension of 150 x 150 pixels. They will be specified using a frontmatter variable as follows: 76 | 77 | ```yaml 78 | ... 79 | thumbnail: "images/2020-04/capv-overview/thumbnail.jpg" 80 | ... 81 | ``` 82 | 83 | The thumbnail image will take precedence on opengraph share tags if the [shareImage](#share-image) parameter is not specified. 84 | 85 | ### Article featured image 86 | 87 | Each article can specify an image that appears at the top of the content. When sharing the blog article on social media, if a thumnail is not specified, the featured image will be used as a fallback on opengraph share tags. 88 | 89 | ```yaml 90 | ... 91 | featureImage: "images/2020-04/capv-overview/featured.jpg" 92 | ... 93 | ``` 94 | 95 | ### Share Image 96 | 97 | Sometimes, you want to explicitly set the image that will be used in the preview when you share an article on social media. You can do so in the front matter. 98 | 99 | ```yaml 100 | ... 101 | shareImage = "images/theImageToBeUsedOnShare.png" 102 | ... 103 | ``` 104 | 105 | Note that if a share image is not specified, the order of precedence that will be used to determine which image applies is `thumbnail` => `featureImage` => `fallbackOgImage`. When sharing a link to the home page address of the site (as opposed to a specific article), the `fallbackOgImage` will be used. 106 | 107 | ### Align logo 108 | 109 | You can left align or center your site's logo. 110 | 111 | ```yaml 112 | ... 113 | centerLogo = true # Change to false to align left 114 | ... 115 | ``` 116 | 117 | If no logo is specified, the title of the site will appear in its place. 118 | -------------------------------------------------------------------------------- /exampleSite/content/docs/clarity/syntax-highlighting.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Syntax Highlighting" 3 | weight = 17 4 | +++ 5 | 6 | ### Code 7 | 8 | #### Display line numbers 9 | 10 | Choose whether to display line numbers within a code block globally with the parameter `codeLineNumbers` setting to `true` or `false`. 11 | 12 | ```yaml 13 | [params] 14 | ... 15 | codeLineNumbers = true # Shows line numbers for all code blocks globally. 16 | ... 17 | ``` 18 | 19 | #### Limit code block height 20 | 21 | You can globally control the number of lines which are displayed by default for your code blocks. Code which has the number of lines exceed this value will dynamically cause two code block expansion buttons to appear, allowing the user to expand to full length and contract. This is useful when sharing code or scripts with tens or hundreds of lines where you wish to control how many are displayed. Under params in `config.toml` file, add a value as follows: 22 | 23 | ```yaml 24 | [params] 25 | ... 26 | codeMaxLines = 10 # Maximum number of lines to be shown by default across all articles. 27 | ... 28 | ``` 29 | 30 | > If the value already exists, change it to the desired number. This will apply globally. 31 | 32 | If you need more granular control, this parameter can be overridden at the blog article level. Add the same value to your article frontmatter as follows: 33 | 34 | ```yaml 35 | ... 36 | codeMaxLines = 15 # Maximum number of lines to be shown in code blocks in this blog post. 37 | ... 38 | ``` 39 | 40 | If `codeMaxLines` is specified both in `config.toml` and in the article frontmatter, the value specified in the article frontmatter will apply to the given article. In the above example, the global default is `10` and yet the article value is `15` so code blocks in this article will auto-collapse after 15 lines. 41 | 42 | If `codeMaxLines` is not specified anywhere, an internal default value of `100` will be assumed. -------------------------------------------------------------------------------- /exampleSite/content/docs/clarity/theme-overrides.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Theme Overrides" 3 | weight = 18 4 | +++ 5 | 6 | ### Custom CSS and JS 7 | 8 | To minimize HTTP requests per page, we would recommend loading CSS styles and JavaScript helpers in single bundles. That is to say, one CSS file and one JavaScript file. Using Hugo minify functions, these files will be minified to optimize the size. 9 | 10 | Going by the above 👆🏻 reason, we recommend adding custom CSS and JS via the custom SASS file ([Compose](https://github.com/onweru/compose/blob/master/assets/sass/_custom.sass), [Clarity](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_custom.sass)) and the custom JS file ([Compose](https://github.com/onweru/compose/hugo-compose/blob/master/assets/js/custom.js), [Clarity](https://github.com/chipzoller/hugo-clarity/blob/master/assets/js/custom.js)). 11 | 12 | However, sometimes you may need to load additional style or script files. In such cases, you can add custom `.css` and `.js` files by listing them in the `config.toml` file (see the snippet below). Similar to images, these paths should be relative to the `static` directory. 13 | 14 | ```yaml 15 | [params] 16 | ... 17 | customCSS = ["css/custom.css"] # Include custom CSS files 18 | customJS = ["js/custom.js"] # Include custom JS files 19 | ... 20 | ``` 21 | 22 | > __Pro Tip__: You can change the theme colors via the [this variable's SASS file](https://github.com/chipzoller/hugo-clarity/blob/master/assets/sass/_variables.sass) 23 | 24 | ### Hooks 25 | 26 | Clarity provides some hooks for adding code on page. 27 | 28 | If you need to add some code(CSS import, HTML meta or similar) to the head section on every page, add a partial to your project: 29 | 30 | ``` 31 | layouts/partials/hooks/head-end.html 32 | ``` 33 | 34 | Similar, if you want to add some code right before the body end, create your own version of the following file: 35 | 36 | ``` 37 | layouts/partials/hooks/body-end.html 38 | ``` 39 | -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Compose Docs" 3 | weight = 1 4 | +++ 5 | 6 | Welcome to the Compose theme user guide! This guide shows you how to get started creating technical documentation sites using Compose, including site customization and how to use Compose's blocks and templates. 7 | 8 | {{< button "./install-theme/" "Get started now" >}} 9 | -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/customize.md: -------------------------------------------------------------------------------- 1 | +++ 2 | description = "basic configuration" 3 | title = "Customize layouts & components" 4 | weight = 10 5 | +++ 6 | 7 | ### Shortcodes modifiers 8 | 9 | These modifiers are classes you can use with shortcodes to customize the look and feel of your layouts and components. 10 | 11 | #### Grid 12 | 13 | | modifier | space | 14 | | --- | --- | 15 | | grid-2 | 2 columns | 16 | | grid-3 | 3 columns | 17 | | grid-4 | 4 columns | 18 | 19 | #### Spacing 20 | 21 | | modifier | space | 22 | | --- | --- | 23 | | mt-1 | 1.5rem top margin | 24 | | mt-2 | 3rem top margin | 25 | | mt-3 | 4.5rem top margin | 26 | | mt-4 | 6rem top margin | 27 | 28 | > use pt-1 \~ pt-4 for top padding 29 | 30 | | modifier | space | 31 | | --- | --- | 32 | | mb-1 | 1.5rem bottom margin | 33 | | mb-2 | 3rem bottom margin | 34 | | mb-3 | 4.5rem bottom margin | 35 | | mb-4 | 6rem bottom margin | 36 | 37 | > use pb-1 \~ pb-4 for bottom padding 38 | 39 | ### How do I disable dark mode? 40 | 41 | Under `params` add `enableDarkMode = false` to your `hugo.toml` file. If your site is based on the exampleSite, the value is already included; you only need to uncomment it. 42 | 43 | > The user will still have the option to activate dark mode, if they so wish through the UI 44 | 45 | ### How do I change the theme color? 46 | 47 | If the theme is a git submodule, you can copy the file `assets/sass/_variables.sass` from the theme into your own site. 48 | The location must be exactly the same as in the theme, so put it in `YourFancySite/assets/sass/`. 49 | You can then edit the file to customize the theme color in your site without having to modify the theme itself. 50 | 51 | ### How can I change the address bar color on mobile devices? 52 | 53 | Just put the following line in the `[params]` section in your `hugo.toml` file (and of course change the color): 54 | 55 | ```toml 56 | metaThemeColor = "#123456" 57 | ``` 58 | 59 | ### How do I add custom styles, scripts, meta tags e.t.c 60 | 61 | Use hooks. Ideally, you should not override the them directly. 62 | 63 | Instead, you should duplicate [these files](https://github.com/onweru/compose/tree/master/layouts/partials/hooks) at the root of you site directory. 64 | 65 | 1. layouts/partials/hooks/head.html 66 | 2. layouts/partials/hooks/scripts.html 67 | 68 | The contents of the first file will be attached just before the `` tag. 69 | 70 | The contents of the second file will be attached just before the `` tag. 71 | 72 | Alternatively, if you want to use the `hugo.toml` to track your custom styles or scripts, declare them as slices under `[params]` like so: 73 | 74 | ```toml 75 | ... 76 | [params] 77 | customCSS = [styleURL1, styleURL2 ...] 78 | customJS = [scriptURL1, scriptURL2 ... ] 79 | ... 80 | ``` 81 | 82 | ### I want to add custom SASS or JS 83 | 84 | Add custom SASS and JS via [this custom SASS file](https://github.com/onweru/compose/blob/master/assets/sass/_custom.sass) and [this custom JavaScript file](https://github.com/onweru/compose/hugo-compose/blob/master/assets/js/custom.js). 85 | 86 | ### How to change site favicon 87 | 88 | Your favicons should be stored inside `static/favicons` directory. 89 | 90 | Here are some of the favicon files that you should have in that folder: 91 | 92 | ``` 93 | . 94 | ├── android-chrome-192x192.png 95 | ├── android-chrome-512x512.png 96 | ├── apple-touch-icon.png 97 | ├── favicon-16x16.png 98 | ├── favicon-32x32.png 99 | ├── favicon.ico 100 | └── site.webmanifest 101 | ``` 102 | 103 | We recommend you consider using this [tool](https://realfavicongenerator.net/) while generating your favicons. -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/github-actions.md: -------------------------------------------------------------------------------- 1 | +++ 2 | description = "Use github actions with compose theme" 3 | title = "Leverage Github actions" 4 | weight = 11 5 | +++ 6 | 7 | This theme ships with 2 github actions inside the exampleSite folder: 8 | 9 | 1. AWS CI 10 | 2. Algolia CI 11 | 12 | ## AWS CI 13 | 14 | This helps you to autodeploy your hugo website from github to an AWS s3 bucket. Set the secrets in the action accordingly and voila. 15 | 16 | ## Algolia CI 17 | 18 | This action will automatically update your algolia search index. No extra npm manual setup will be needed. 19 | 20 | These actions are customizable to fire off under your specified set of circumstances. 21 | 22 | By default, the actions will be off, so be sure to turn them on, and set the github actions secrets appropriately. 23 | 24 | ```shell 25 | name: Update Algolia Search Index 26 | 27 | off: # change to `on:` to turn on 28 | ``` -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/graphs-charts-tables.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Graphs, charts & dynamic tables" 3 | weight = 9 4 | [dataset1] 5 | fileLink = "content/projects.csv" # path to where csv is stored 6 | colors = ["#ef7f1a", "#627c62", "#11819b", "#4e1154"] # chart colors 7 | columnTitles = ["Section", "Status", "Author"] # optional if not table will be displayed from dataset 8 | baseChartOn = 3 # number of column the chart(s) and graph should be drawn from # can be overridden directly via shortcode parameter # it's therefore optional 9 | title = "Projects" 10 | 11 | [dataset2] 12 | fileLink = "content/themes.csv" # path to where csv is stored 13 | colors = ["#ef7f1a", "#627c62", "#11819b", "#4e1154"] # chart colors 14 | columnTitles = ["Theme", "Latest Version", "Repo Owner"] # Optional if no table will be displayed from dataset 15 | baseChartOn = 2 # number of column the chart(s) and graph should be drawn from # can be overridden directly via shortcode parameter # it's therefore optional 16 | title = "Hugo Themes" 17 | +++ 18 | 19 | Using [chart js library](https://www.chartjs.org/) you can display data you have stored in a `csv` file as a pie chart, bar graph or doughnut chart. 20 | 21 | At this point if you want to display data from a json or yaml file, you would need to [convert it into csv](http://convertcsv.com/json-to-csv.htm) first. Else the template will error out. 22 | 23 | Once you have a csv file, you display the charts as follows: 24 | 25 | #### Show a pie, doughnut & bar chart at once 26 | 27 | Firstly define the data you want to display from the front matter: 28 | 29 | ```markdown 30 | # from front matter 31 | ... 32 | [dataset1] # this key will in the chart shortcode 33 | fileLink = "content/projects.csv" # path to where csv is stored 34 | colors = ["#627c62", "#11819b", "#ef7f1a", "#4e1154"] # chart colors 35 | columnTitles = ["Section", "Status", "Author"] 36 | charts = ["bar", "doughnut", "pie", "table"] 37 | baseChartOn = 3 # number of column the chart(s) and graph should be drawn from 38 | piechart = true 39 | doughnutchart = true 40 | bargraph = true 41 | title = "Projects" 42 | table = true # show table listing the chart data 43 | 44 | // from page content 45 | ... 46 | {{}} 47 | {{}} 48 | {{}} 49 | ... 50 | ``` 51 | 52 | {{< grid "3 mt-2 mb-2" >}} 53 | {{< chart "dataset1" "pie,doughnut,bar" >}} 54 | {{< /grid >}} 55 | 56 | #### __Show Table at once__ 57 | 58 | {{< block >}} 59 | {{< chart "dataset1" "table" >}} 60 | {{< /block >}} 61 | 62 | Firstly define the data you want to display from the front matter: 63 | 64 | ```toml 65 | # from page front matter 66 | [dataset2] 67 | fileLink = "content/themes.csv" # path to where csv is stored # this key will in the chart shortcode 68 | colors = ["#627c62", "#11819b", "#ef7f1a", "#4e1154"] # chart colors 69 | columnTitles = ["Theme", "Latest Version", "Owner"] 70 | title = "Hugo Themes" 71 | baseChartOn = 2 # number of column the chart(s) and graph should be drawn from 72 | piechart = false 73 | doughnutchart = true 74 | bargraph = true 75 | table = false # show table listing the chart data 76 | ``` 77 | 78 | #### Show only a pie and a doughnut chart 79 | 80 | ```markdown 81 | // from page content 82 | ... 83 | {{}} 84 | {{}} 85 | {{}} 86 | ... 87 | ``` 88 | 89 | {{< grid "3 mt-2 mb-2" >}} 90 | {{< chart "dataset2" "pie,doughnut" "1" >}} 91 | {{< /grid >}} 92 | 93 | #### Show table with filter 94 | 95 | {{< grid "3" >}} 96 | {{< chart "dataset2" "table" >}} 97 | {{< /grid >}} 98 | 99 | #### Show table only 100 | 101 | {{< grid "3" >}} 102 | {{< chart "dataset2" "table,noFilter" >}} 103 | {{< /grid >}} 104 | -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/install-theme.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Install theme" 3 | weight = 2 4 | description = """ 5 | This page tells you how to get started with the Compose theme. 6 | """ 7 | +++ 8 | 9 | ### Prerequisites 10 | 11 | First ensure that you have hugo installed. 12 | 13 | You need a [recent **extended** version](https://github.com/gohugoio/hugo/releases) (we recommend version 0.61 or later) of [Hugo](https://gohugo.io/) to do local builds and previews of sites (like this one) that uses this theme. 14 | 15 | If you install from the release page, make sure to get the `extended` Hugo version, which supports [sass](https://sass-lang.com/documentation/file.SCSS_FOR_SASS_USERS.html); you may need to scroll down the list of releases to see it. 16 | 17 | For comprehensive Hugo documentation, see [gohugo.io](https://gohugo.io/). 18 | 19 | ## Run your site with compose theme 20 | 21 | You could go with the options right below. 22 | 23 | ### Option 1 (my favorite) 24 | 25 | This option enables you to load compose theme as a hugo module. First things first, ensure you have `go` binary [installed on your machine](https://golang.org/doc/install). 26 | 27 | ```shell 28 | $ git clone https://github.com/onweru/compose/ 29 | cd compose/exampleSite/ 30 | hugo server 31 | ``` 32 | 33 | To pull in theme updates, run `hugo mod get -u ./...` from the theme folder. If unsure, [learn how to update hugo modules](https://gohugo.io/hugo-modules/use-modules/#update-modules) 34 | 35 | {{< tip "warning" >}} 36 | The exampleSite uses the theme as a hugo module by default. 37 | 38 | If you choose __Option 2__ or __Option 3__ below, ensure you edit [these lines in the hugo.toml file](https://github.com/onweru/compose/blob/b3e30e0816621223224897edc45eeeabd0d9cd16/exampleSite/hugo.toml#L4-L7) as advised on the comments. Else, you will not be able to pull theme updates. 39 | {{< /tip >}} 40 | 41 | ### Option 2 (recommended) 42 | 43 | Generate a new Hugo site and add this theme as a Git submodule inside your themes folder: 44 | 45 | ```bash 46 | hugo new site yourSiteName 47 | cd yourSiteName 48 | git init 49 | git submodule add https://github.com/onweru/compose/ themes/compose 50 | cp -a themes/compose/exampleSite/* . 51 | git commit -m "setup compose theme" 52 | ``` 53 | 54 | Then run 55 | 56 | ```bash 57 | hugo server 58 | ``` 59 | 60 | Hurray! 61 | 62 | ### Option 3 (Great for testing quickly) 63 | 64 | You can run your site directly from the `exampleSite`. To do so, use the following commands: 65 | 66 | ```bash 67 | git clone https://github.com/onweru/compose/ 68 | cd compose/exampleSite/ 69 | hugo server --themesDir ../.. 70 | ``` 71 | 72 | {{< tip >}} 73 | Although, option 3 is great for quick testing, it is somewhat problematic when you want to update your theme. You would need to be careful not to overwrite your changes. 74 | {{< /tip >}} 75 | 76 | Once set, jump over to the [hugo.toml](https://github.com/onweru/compose/blob/afdf1cd76408aeac11547a6abd51bdc5138a295f/exampleSite/hugo.toml#L4-L7) file and start configuring your site. 77 | 78 | -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/organize-content.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Content organization" 3 | weight = 4 4 | +++ 5 | 6 | This theme is primarily meant for documentation. 7 | 8 | #### Documentation 9 | 10 | By default, the theme will look for all your documentation content within the `docs` directory. 11 | 12 | However, if you would like to have your docs content across multiple directories, please list those directories inside `config/_default/params.toml` under `docSections` like so: 13 | 14 | ``` 15 | ... 16 | docSections = ["docs", "tutorials"] 17 | ... 18 | ``` 19 | 20 | Unlike other regular pages, the documentation pages will have a left sidebar. This sidebar will list links to all the pages in the documentation pages. Beneath each link, there will be a collapsible list of __table of contents'__ links. These nested lists will unfold automatically on the active/current page. 21 | 22 | #### Home Page 23 | 24 | At the root level there's an `_index.md` page which is the homepage. Feel free to edit it as you like. 25 | 26 | #### Other pages 27 | 28 | You can also add as many regular pages as you like e.g `about.md`, `contact.md`... 29 | 30 | Take advantage of [shortcodes](../shortcodes) to customize the layouts of these pages and any other. 31 | 32 | #### Does this theme support blogging function? 33 | 34 | Currently, no. 35 | -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/search.md: -------------------------------------------------------------------------------- 1 | +++ 2 | description = "" 3 | title = "Search Function" 4 | weight = 7 5 | +++ 6 | 7 | Firstly, ensure you have these lines inside your hugo.toml file 8 | 9 | ```toml 10 | [outputs] 11 | home = ["HTML", "RSS","JSON"] 12 | ``` 13 | 14 | Compose implements [Fuse js](https://fusejs.io/) or [Algolia](https://www.algolia.com/doc/rest-api/search/) to enable search functionality. By default Fuse is applied. Algolia can be enabled by adding this settings to `config/_default/params.toml` file 15 | 16 | ```toml 17 | # search 18 | [search] 19 | on = true 20 | global = false 21 | [search.algolia] 22 | enable = false # if false search will default to fusejs 23 | id = "Q40WQQX84U" # Application ID 24 | index = "compose" # Index name 25 | key = "da87401a458102ec6bbd6cc5e5cf8d95" # Search-Only API Key 26 | ``` 27 | 28 | Both search engines will display results using the same UI. By choosing the default (.ie fuse js), you will be opting for local search. This way, no additional setup is needed. 29 | 30 | Algolia will require you to build and host your index. For those using Github, this theme ships with an [algolia github action](/docs/compose/github-actions/#algolia-ci). 31 | 32 | By default, search will return results from the current content section. Searches from the top level section e.g the homepage, will return global results. This way, the results are scoped. You can override this behaviour using this setting 33 | 34 | ```toml 35 | ... 36 | [search] 37 | ... 38 | global = false # turn to `true` to enable global search 39 | ... 40 | ``` 41 | 42 | At the time of this writing, search on these theme takes either of this forms: 43 | 44 | ### 1. Passive search 45 | 46 | This occurs only when the user loads the search page i.e `/search/`. They can directly navigate to that url. Alternatively, the user can type you search query on the search field and click enter. They will be redirected to the search page which will contain matched results if any. 47 | 48 | ### 2. Live search 49 | 50 | This behaviour will be obvious as the user types a search query on the search field. All `valid search queries`, will yield a list of `quick links` or a simple `no matches found`. Else, the user will be prompted to continue typing. 51 | 52 | > Please note that the results under quick links will be a truncated list of the most relevant results. Only a maximum of 8 items will be returned. This number is pragmatic at best if not arbitrary. On the search page, the number is set to 12. 53 | 54 | Note that live search on the search page will behave differently than on the other pages. Nonetheles, the pages apply the same live search principle. 55 | 56 | > Hitting enter while typing on the search page will be moot as that page’s content will live update as you type in the search word / phrase. 57 | 58 | ### Customize search feedback labels 59 | 60 | Use the `i18n` files to do so. 61 | 62 | ### What is a valid search query 63 | 64 | A valid search query must be long enough. If the search query can be cast as a float, then it only need contain one or more characters. 65 | 66 | Else the search query must be at least 2 characters long. 67 | 68 | -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/shortcodes-example.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Shortcodes Applied" 3 | weight = 7 4 | description = "This is how the shortcodes would look like in action" 5 | draft = true 6 | +++ 7 | 8 | ### Blocks, columns & buttons 9 | 10 | ```sh 11 | {{}} 12 | {{}} 13 | #### Coumn 1 14 | 15 | Lorem ipsum dolor sit amet, 16 | ... 17 | 18 | {{}} 19 | 20 | {{}} 21 | {{}} 22 | 23 | 24 | ``` 25 | 26 | {{< block "grid-2" >}} 27 | {{< column >}} 28 | #### Coumn 1 29 | 30 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 31 | 32 | dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 33 | 34 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 35 | 36 | > Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 37 | 38 | {{< button "https://github.com/onweru/compose" "Download Theme" >}} 39 | 40 | {{< /column >}} 41 | {{< column >}} 42 | #### Coumn 2 43 | 44 | 45 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et 46 | 47 | > dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 48 | 49 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 50 | 51 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 52 | 53 | {{< button "docs/" "Read the Docs" >}} 54 | 55 | {{< /column >}} 56 | {{< /block >}} -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/shortcodes.md: -------------------------------------------------------------------------------- 1 | +++ 2 | description = "Use hugo shortcodes to quickly compose your documentation pages." 3 | title = "Shortcodes" 4 | weight = 5 5 | 6 | +++ 7 | Instead of writing all your site pages from scratch, Hugo lets you define and use [shortcodes](https://gohugo.io/content-management/shortcodes/). 8 | 9 | Why shortcodes? While markdown is sufficient to produce simple pages, it's insufficient where complex page structures are needed. Thusly, whenever we need special styling, shortcodes compliment the shortcomings of markdown. 10 | 11 | This way, you can side step complex html and css boilerplate in your content files. 12 | 13 | Sometimes, the shortcode will wrap content, sometimes it won't. When content is wrapped, a closing shortcode tag is needed. Please see the link I provided above and the markdown files for examples. You'll get the gist pretty quickly. 14 | 15 | I've setup the following shortcodes: 16 | 17 | ### Block 18 | 19 | Takes positional modifiers 20 | 21 | **Example** 22 | 23 | ```markdown 24 | ... 25 | {{}} 26 | 27 | {{}} 28 | ... 29 | ``` 30 | 31 | ### Column 32 | 33 | It takes positional parameters 34 | 35 | **Example** 36 | 37 | ```markdown 38 | {{}} 39 | 40 | {{}} 41 | ``` 42 | 43 | ### Youtube Video 44 | 45 | This allows you to embed a youtube video in you content. You would achieve that using a positional parameter (needs no name )parameter, like so: 46 | 47 | **Syntax** 48 | 49 | ```markdown 50 | {{}} 51 | 52 | ``` 53 | 54 | **Result** 55 | 56 | {{< youtube "25QyCxVkXwQ" >}} 57 | 58 | **OR** 59 | 60 | **Syntax** 61 | 62 | ```markdown 63 | 64 | {{}} 65 | ``` 66 | 67 | **Result** 68 | 69 | {{< youtube "https://www.youtube.com/watch?v=MmG2ah5Df4g" >}} 70 | 71 | #### Lite YouTube 72 | 73 | The `liteyoutube` shortcode supports three parameters: 74 | 75 | | PARAMETER | PURPOSE | OPTIONAL | 76 | | :--- | :--- | :--- | 77 | | videoid | YouTube video identifier | no | 78 | | params | YouTube parameters | yes | 79 | | img | Background image from static/images | yes | 80 | 81 | ##### With no Parameters 82 | 83 | This example shows only supplying the required `videoid` (without a named parameter). You can also add the `img` and `params` parameters (in that order) without using named parameters. 84 | 85 | ```markdown 86 | {{}} 87 | ``` 88 | 89 | {{< liteyoutube "MmG2ah5Df4g" >}} 90 | 91 | ##### With `videoid` and `params` 92 | 93 | The params string instructs YouTube to play only 20 seconds of the video starting at ten seconds and ending at 30 seconds. It also disables the player controls and enables the YouTube `JSAPI`. 94 | 95 | ```markdown 96 | {{}} 97 | ``` 98 | 99 | {{< liteyoutube videoid="MmG2ah5Df4g" params="controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" >}} 100 | 101 | ##### With All Three Positional Parameters 102 | 103 | ```markdown 104 | {{}} 105 | ``` 106 | 107 | {{< liteyoutube "MmG2ah5Df4g" "painting.jpg" "controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" >}} 108 | 109 | {{< tip >}} 110 | You can browse the full list of YouTube parameters [here](https://developers.google.com/youtube/player_parameters#Parameters) 111 | {{< /tip >}} 112 | 113 | ### Button 114 | 115 | This adds a styled link (styled like a button). It takes two no-optional parameters: 116 | 117 | | PARAMETER | PURPOSE | OPTIONAL | 118 | | :--- | :--- | :--- | 119 | | label | button text | no | 120 | | url | button link | no | 121 | | modifier | styling classes | yes | 122 | 123 | **Example** 124 | 125 | ```markdown 126 | {{}} 127 | ``` 128 | 129 | ### Picture 130 | 131 | You want to use darkmode images when darkmode is enabled on a device and a regular image on lightmode? It takes 3 positional parameter 132 | 133 | Store these images in the `static/images` directory. 134 | 135 | **Syntax** 136 | 137 | ```markdown 138 | ... 139 | {{}} 140 | ... 141 | ``` 142 | 143 | **Result** 144 | 145 | {{< picture "compose.svg" "compose-light.svg" "Compose Logo" >}} 146 | 147 | ### Gallery 148 | 149 | Include inline galleries within your articles. These galleries can contain `N` number of images. It takes 2 positional parameters. 150 | 151 | The 1st parameter is required. It's a _comma-separated list_ (`,`) of your images' paths. 152 | 153 | The 2nd parameter is optional. It's a _double-collon-separated list_ (`::`) of your images' alt/description/captions text. It's always a good SEO practice to include alt text for your images. 154 | 155 | **Syntax** 156 | 157 | ```markdown 158 | ... 159 | {{}} 160 | ... 161 | ``` 162 | 163 | {{< tip >}} 164 | 165 | > For legibility, you may include a space after the delimiters `,` & `::` 166 | > {{< /tip >}} 167 | 168 | **Result** 169 | 170 | {{< gallery "images/painting.jpg,images/scribble.jpg,images/painting.jpg" "Gallery Image 1::gallery image 2::gallery image 1 copy" >}} 171 | 172 | ### Tab(s) 173 | 174 | Use this short if you want to publish a multiple tabs component. 175 | 176 | **Syntax** 177 | 178 | ```markdown 179 | {{}} 180 | {{}} 181 | What could such a tab include? 182 | {{}} 183 | {{}} 184 | - Some *bulletpoints* 185 | - and more… 186 | - … 187 | {{}} 188 | {{}} 189 | > great wise words? 190 | {{}} 191 | {{}} 192 | ``` 193 | 194 | **Result** 195 | 196 | {{< tabs "tabsId" >}} 197 | {{< tab "First" >}} 198 | What could such a tab include? 199 | {{< /tab >}} 200 | {{< tab "Second" >}} 201 | - Some *bulletpoints* 202 | - and more… 203 | - … 204 | {{< /tab >}} 205 | {{< tab "Third" >}} 206 | > great wise words? 207 | {{< /tab >}} 208 | {{< /tabs >}} 209 | 210 | ### Tip 211 | 212 | Use this short if you want to publish informational tooltips that look like: 213 | 214 | This tooltips may take either of the following forms: 215 | 216 | **Syntax** 217 | 218 | ```markdown 219 | {{}} 220 | Something of __interest__ you want to highlight 221 | {{}} 222 | ``` 223 | 224 | **Result** 225 | 226 | {{< tip >}} 227 | Something of **interest** you want to highlight 228 | {{< /tip >}} 229 | 230 | **OR** 231 | 232 | **Syntax** 233 | 234 | ```markdown 235 | {{}} 236 | Something of __interest__ the user should be careful about 237 | {{}} 238 | ``` 239 | 240 | **Result** 241 | 242 | {{< tip "warning" >}} 243 | Something of **interest** the user should be careful about 244 | {{< /tip >}} 245 | -------------------------------------------------------------------------------- /exampleSite/content/docs/compose/use-tina-cms.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Use Tina.io CMS" 3 | description = "" 4 | weight = 3 5 | +++ 6 | 7 | Do you prefer managing your site using a CMS? Or would you like to make it easier for someone (a non-techie, perhaps) in your team to make edits easily? If interested, follow along. Else, skip to the [next section](../organize-content/) 8 | 9 | Let's sync your site with Tina CMS. 10 | 11 | ## Prerequisites !! 12 | 13 | Obviously you ought to have __a github account__. This is where your website source will live. Basically, Tina will read from github and write (commit) to your github repo. 14 | 15 | {{< tip "warning" >}} 16 | Gitlab or bitbucket will work too. Just check their [implementation here](https://Tina.io/docs/git-sync/gitlab/). Happy fishing. 17 | {{< /tip >}} 18 | 19 | ### Requirement 1 : A Tina.io account 20 | 21 | Jump over to [Tina.io](https://tina.io/) and sign up for an account. Consider signing up using your github account. That way, you don't have to deal with passwords. 22 | 23 | ### Requirement 2: A Netlify account _(optional)_ 24 | 25 | If you intend to host with something other than Netlify _e.g github pages_, please scroll on. Hosting with Netlify is a lot of fun though; I highly recommend it. 26 | 27 | ### Step 1 : Fork or Clone Compose theme 28 | 29 | First we will fork [this theme's](https://github.com/onweru/compose) template. 30 | 31 | ### Step 2 : Add your repository in Tina CMS 32 | 33 | {{< tip >}} 34 | The exampleSite already comes with prefilled placeholder Tina settings. If you set up your site using [option 2](../install-theme/#option-2-recommended) 35 | 36 | {{< /tip >}} 37 | 38 | Edit `./static/tina/config.js` and replace tina CMS tokens with values from your own Tina account 39 | 40 | ```json 41 | ... 42 | clientId: "6ff9830b-b18a-4d21-b38c-cae1679e335f", // replace 43 | token: "2954980a0db18868974dc57a66be9ecdfe6f336b", // replace 44 | ... 45 | search: { 46 | ... 47 | tina: { 48 | indexerToken: "977c145439dda036080dd7a33478d2ba385ab5af", // replace 49 | stopwordLanguages: ["deu", "eng", "fra", "ita", "spa", "nld"] // consider adding or removing languages https://github.com/fergiemcdowall/stopword#language-code 50 | }, 51 | ... 52 | } 53 | ... 54 | ``` 55 | 56 | Go to your [Tina](https://tina.io/) account 57 | -------------------------------------------------------------------------------- /exampleSite/content/projects.csv: -------------------------------------------------------------------------------- 1 | project 6,alpha,weru 2 | project 4,beta,dan 3 | project 4,candidate,dahl 4 | project y,abandoned,weru 5 | project 1,alpha,weru 6 | project 4,beta,ryan 7 | project 4,candidate,dan 8 | project y,abandoned,weru 9 | project 11,alpha,dahl 10 | project 4,beta,dan 11 | project 4,candidate,dan 12 | project A,abandoned,weru 13 | -------------------------------------------------------------------------------- /exampleSite/content/search.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Search" 3 | searchPage = true 4 | type = "search" 5 | +++ -------------------------------------------------------------------------------- /exampleSite/content/themes.csv: -------------------------------------------------------------------------------- 1 | clarity,V.1,chipzoller 2 | compose,V.1,weru 3 | swift,V.2,weru 4 | newsroom,V.1,weru 5 | -------------------------------------------------------------------------------- /exampleSite/content/tutorials/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Tutorials' Docs" 3 | weight = 1 4 | +++ 5 | 6 | Just an example of an additional docs folder. 7 | 8 | Surprised that it doesn't have a left sidebar menu? Worry not; just [follow this instructions to enable it](../docs/compose/organize-content/#documentation). 9 | 10 | 11 | 12 | {{< button "./example" "Tutorials" "mb-1" >}} 13 | 14 | {{< button "../docs/" "Back to docs" >}} 15 | 16 | -------------------------------------------------------------------------------- /exampleSite/content/tutorials/example/_index.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = "Compose Docs" 3 | weight = 1 4 | +++ 5 | 6 | Welcome to the Compose theme user guide! This guide shows you how to get started creating technical documentation sites using Compose, including site customization and how to use Compose's blocks and templates. 7 | 8 | {{< button "../../docs/compose/install-theme/" "Get started now" >}} 9 | -------------------------------------------------------------------------------- /exampleSite/dist/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/dist/.gitkeep -------------------------------------------------------------------------------- /exampleSite/go.mod: -------------------------------------------------------------------------------- 1 | module compose-exampleSite 2 | 3 | go 1.19 4 | 5 | require github.com/onweru/compose v0.0.0-20250603154739-3e6a31685aae // indirect 6 | -------------------------------------------------------------------------------- /exampleSite/go.sum: -------------------------------------------------------------------------------- 1 | github.com/onweru/compose v0.0.0-20230709163331-af3e133abf10 h1:6+OU3YpznL1bAy1s4B9KhEteRN+qo5T9vgYTWuGHpLw= 2 | github.com/onweru/compose v0.0.0-20230709163331-af3e133abf10/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= 3 | github.com/onweru/compose v0.0.0-20230709170553-cdf6b3d268e3 h1:LQ9aw508QrowSWfr8m7Q43AelhGTaNhX+obnkCWefKg= 4 | github.com/onweru/compose v0.0.0-20230709170553-cdf6b3d268e3/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= 5 | github.com/onweru/compose v0.0.0-20230717085020-14357bb3e167 h1:btK2EwB8mRaebaNkvzsEjnxQt6dI9corw9n5kyPQoMk= 6 | github.com/onweru/compose v0.0.0-20230717085020-14357bb3e167/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= 7 | github.com/onweru/compose v0.0.0-20230729163245-27b84dc22eb8 h1:aVItqjRfGwyOZHloHxVY6kEjjR+e8AQVXlpWiQtO0dw= 8 | github.com/onweru/compose v0.0.0-20230729163245-27b84dc22eb8/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= 9 | github.com/onweru/compose v0.0.0-20230730204557-43a58bce3d5a h1:o/x7EfZKZquisgw30cKagraXVccTNydxPGQYV9LadZY= 10 | github.com/onweru/compose v0.0.0-20230730204557-43a58bce3d5a/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= 11 | github.com/onweru/compose v0.0.0-20230730204838-eb9964865cd0 h1:xIK8kxui2ulVqJRO9tjbGuhNPxr1QlmmnswX8Tcs+Js= 12 | github.com/onweru/compose v0.0.0-20230730204838-eb9964865cd0/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= 13 | github.com/onweru/compose v0.0.0-20230817095514-20a7d0ddbfcb h1:azper7pbfQ92zfd8rV7HBjhF8AsZbZmGqxFqqTYEef8= 14 | github.com/onweru/compose v0.0.0-20230817095514-20a7d0ddbfcb/go.mod h1:tf1kQIBUcwJ/3mRFU5eiMrMvsDScVTK2IEFsZE3hZOc= 15 | github.com/onweru/compose v0.0.0-20230823103345-61fa78130dec h1:8iFU5Cf76/ww5+gLyyRrI7dpJpcKmnpBXtraIIq4AT0= 16 | github.com/onweru/compose v0.0.0-20230823103345-61fa78130dec/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 17 | github.com/onweru/compose v0.0.0-20240111174942-cdf2ef5f4da1 h1:evqwOllx6XwfmYG2NKGFmfloNQXazxOCPir914Myjpk= 18 | github.com/onweru/compose v0.0.0-20240111174942-cdf2ef5f4da1/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 19 | github.com/onweru/compose v0.0.0-20240111175353-5392252575a2 h1:jqoBc1FPDJNxRrrieLlRvyKCumTLa5XkehgXz3yBdvE= 20 | github.com/onweru/compose v0.0.0-20240111175353-5392252575a2/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 21 | github.com/onweru/compose v0.0.0-20240111181611-61cf3194699c h1:4SSQgoXXBQS9iZ5IQIGLxXOExaeODx5Hg0+fDzcsLB0= 22 | github.com/onweru/compose v0.0.0-20240111181611-61cf3194699c/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 23 | github.com/onweru/compose v0.0.0-20240113175534-20909d29d9a8 h1:g9eo2danSDAQ8wD/HDLWqFt7s01YaAGAVJZhN4ODBs8= 24 | github.com/onweru/compose v0.0.0-20240113175534-20909d29d9a8/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 25 | github.com/onweru/compose v0.0.0-20240114134437-91252edd0478 h1:n5wqTvZ1RLOHHwJoHal5WmhSF/gqhxaDr/w1+wW9Dsw= 26 | github.com/onweru/compose v0.0.0-20240114134437-91252edd0478/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 27 | github.com/onweru/compose v0.0.0-20240114135539-a7a9df6d34b9 h1:pRRosz/W2ZKxruZ5fTYxN+BAFIybNg+V8IhGMVdZfbE= 28 | github.com/onweru/compose v0.0.0-20240114135539-a7a9df6d34b9/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 29 | github.com/onweru/compose v0.0.0-20240711165024-0ea6ac76134e h1:ljas9s4I9bPPkSEkk7CXkDitWxrHUmIlrfLmojpHCcI= 30 | github.com/onweru/compose v0.0.0-20240711165024-0ea6ac76134e/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 31 | github.com/onweru/compose v0.0.0-20250123191723-478f5b77f140 h1:/TtnPfRGcs/vxLf1nCrkQ1XE8qqKh4DTdE2kBxDx83U= 32 | github.com/onweru/compose v0.0.0-20250123191723-478f5b77f140/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 33 | github.com/onweru/compose v0.0.0-20250123191918-095317e5c72c h1:7yWUB0saRkxfw5sSaQF9/sRegrcCZnwV3pFi2YI3RxU= 34 | github.com/onweru/compose v0.0.0-20250123191918-095317e5c72c/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 35 | github.com/onweru/compose v0.0.0-20250603154739-3e6a31685aae h1:YVEMXrH3wp2DvYgHLyJ7CvoZbToIEkEin/5mp4cWl7M= 36 | github.com/onweru/compose v0.0.0-20250603154739-3e6a31685aae/go.mod h1:2eSBLsKzvKf3r4/vHiKdakIBqDtWACDAqAD7tRdt00o= 37 | -------------------------------------------------------------------------------- /exampleSite/hugo.toml: -------------------------------------------------------------------------------- 1 | baseURL = "https://example.com/" 2 | title = "Compose Docs" 3 | enableRobotsTXT = true 4 | # this example loads the theme as hugo module 5 | # comment out line below, and uncomment the line after it if you prefer to load the theme normally 6 | theme = [ 7 | "github.com/onweru/compose", 8 | ] # edit this if you'ld rather use a fork of this repo 9 | # theme = "compose" 10 | enableGitInfo = true 11 | 12 | [pagination] 13 | disableAliases = false 14 | pagerSize = 10 15 | path = 'page' 16 | 17 | # disableKinds = ["taxonomy"] 18 | 19 | [outputs] 20 | home = ["HTML", "RSS", "JSON"] 21 | -------------------------------------------------------------------------------- /exampleSite/netlify.toml: -------------------------------------------------------------------------------- 1 | [build] 2 | publish = "public" 3 | #command = "hugo --gc --minify" 4 | command = "hugo --gc --minify --baseURL https://composedocs.netlify.app/" 5 | 6 | [context.production.environment] 7 | HUGO_VERSION = "0.147.2" 8 | GO_VERSION = "1.21.0" 9 | NODE_VERSION = "20.5.1" 10 | HUGO_ENV = "production" 11 | HUGO_ENABLEGITINFO = "true" 12 | 13 | [context.split1] 14 | command = "hugo --gc --minify --enableGitInfo" 15 | 16 | [context.split1.environment] 17 | HUGO_VERSION = "0.147.2" 18 | GO_VERSION = "1.21.0" 19 | NODE_VERSION = "20.5.1" 20 | HUGO_ENV = "production" 21 | 22 | [context.deploy-preview] 23 | command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL" 24 | 25 | [context.deploy-preview.environment] 26 | HUGO_VERSION = "0.147.2" 27 | GO_VERSION = "1.21.0" 28 | NODE_VERSION = "20.5.1" 29 | 30 | [context.branch-deploy] 31 | command = "hugo --gc --minify -b $DEPLOY_PRIME_URL" 32 | 33 | [context.branch-deploy.environment] 34 | HUGO_VERSION = "0.147.2" 35 | GO_VERSION = "1.21.0" 36 | NODE_VERSION = "20.5.1" 37 | 38 | [context.next.environment] 39 | HUGO_ENABLEGITINFO = "true" 40 | -------------------------------------------------------------------------------- /exampleSite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "examplesite", 3 | "version": "1.0.0", 4 | "description": "This guide covers the necessary bits. As the project evolves, it will only become more comprehensive", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "@tinacms/cli": "^1.5.31", 14 | "tinacms": "^1.5.22", 15 | "@tinacms/auth": "^1.0.3", 16 | "next-tinacms-cloudinary": "^4.3.0" 17 | } 18 | } -------------------------------------------------------------------------------- /exampleSite/resources/_gen/assets/sass/main.sass_ad0d8311f7d21d831066e97916b5dca2.json: -------------------------------------------------------------------------------- 1 | {"Target":"css/styles.8d8085f7db497b3f3b3071490f89d4ce22990b40da7e429db3a4bfbf559eb93c93a40c627e51f10b618139145d468ecfdccb9425643cc38726adff2ceaf5ad10.css","MediaType":"text/css","Data":{"Integrity":"sha512-jYCF99tJez87MHFJD4nUziKZC0DafkKds6S/v1WeuTyTpAxiflHxC2GBORRdRo7P3MuUJWQ8w4cmrf8s6vWtEA=="}} -------------------------------------------------------------------------------- /exampleSite/resources/_gen/assets/sass/main.sass_ae9eb86df8175869edaecf50caadd93b.json: -------------------------------------------------------------------------------- 1 | {"Target":"css/styles.8d8085f7db497b3f3b3071490f89d4ce22990b40da7e429db3a4bfbf559eb93c93a40c627e51f10b618139145d468ecfdccb9425643cc38726adff2ceaf5ad10.css","MediaType":"text/css","Data":{"Integrity":"sha512-jYCF99tJez87MHFJD4nUziKZC0DafkKds6S/v1WeuTyTpAxiflHxC2GBORRdRo7P3MuUJWQ8w4cmrf8s6vWtEA=="}} -------------------------------------------------------------------------------- /exampleSite/resources/_gen/assets/sass/sass/main.sass_ae9eb86df8175869edaecf50caadd93b.json: -------------------------------------------------------------------------------- 1 | {"Target":"css/styles.5403a82853549c7143980076de5a74b1acfa655a8f3f490771cdeb6b1bb85c19fc018d76c22b67654b39bb14a35e359f243b77c63d68aa963df466a37735b351.css","MediaType":"text/css","Data":{"Integrity":"sha512-VAOoKFNUnHFDmAB23lp0saz6ZVqPP0kHcc3raxu4XBn8AY12witnZUs5uxSjXjWfJDt3xj1oqpY99GajdzWzUQ=="}} -------------------------------------------------------------------------------- /exampleSite/resources/_gen/assets/sass/sass/main.sass_ca26857cefa9076967ab300682271513.json: -------------------------------------------------------------------------------- 1 | {"Target":"css/styles.cd62b2f2422cc4a7954bb12c250bb5a506c534f9f0e02d12144999181257b8046df4a087b684fbe4fa2e60fc50b054922f83d5cb594351423c6425a8cb80434c.css","MediaType":"text/css","Data":{"Integrity":"sha512-zWKy8kIsxKeVS7EsJQu1pQbFNPnw4C0SFEmZGBJXuARt9KCHtoT75PouYPxQsFSSL4PVy1lDUUI8ZCWoy4BDTA=="}} -------------------------------------------------------------------------------- /exampleSite/static/admin/.gitignore: -------------------------------------------------------------------------------- 1 | index.html 2 | assets/ -------------------------------------------------------------------------------- /exampleSite/static/images/GitHubMarkDark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /exampleSite/static/images/GitHubMarkLight.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /exampleSite/static/images/artist.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/artist.jpg -------------------------------------------------------------------------------- /exampleSite/static/images/boy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/boy.jpg -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/article-toc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/article-toc.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/image-figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/image-figure.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/image-inline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/image-inline.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/screenshot-darkmode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/screenshot-darkmode.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/screenshot-mobile-darkmode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/screenshot-mobile-darkmode.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/screenshot-mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/screenshot-mobile.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/screenshot.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/syntax-block.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/syntax-block.gif -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/tags.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/tn-darkmode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/tn-darkmode.png -------------------------------------------------------------------------------- /exampleSite/static/images/clarity/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/clarity/tn.png -------------------------------------------------------------------------------- /exampleSite/static/images/frustrated.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/frustrated.jpg -------------------------------------------------------------------------------- /exampleSite/static/images/painting.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/painting.jpg -------------------------------------------------------------------------------- /exampleSite/static/images/scribble.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/scribble.jpg -------------------------------------------------------------------------------- /exampleSite/static/images/speakers.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/speakers.jpg -------------------------------------------------------------------------------- /exampleSite/static/images/street.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/street.jpg -------------------------------------------------------------------------------- /exampleSite/static/images/stuck.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/exampleSite/static/images/stuck.jpg -------------------------------------------------------------------------------- /exampleSite/tina/config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "tinacms"; 2 | 3 | // Your hosting provider likely exposes this as an environment variable 4 | const branch = process.env.HEAD || process.env.VERCEL_GIT_COMMIT_REF || "master"; 5 | 6 | export default defineConfig({ 7 | branch, 8 | clientId: "cf05fea4-4f23-47cf-be81-bf18b623b233", // Get this from tina.io 9 | token: "bdce3e17adfa4a16da812d6c538a22cd61dd057b", // Get this from tina.io 10 | 11 | build: { 12 | outputFolder: "admin", 13 | publicFolder: "static", 14 | }, 15 | media: { 16 | tina: { 17 | mediaRoot: "images", 18 | publicFolder: "static", 19 | }, 20 | }, 21 | schema: { 22 | collections: [ 23 | { 24 | name: "docs", 25 | label: "Docs", 26 | path: "content/docs", 27 | frontmatterFormat: "toml", 28 | frontmatterDelimiters: "+++", 29 | format: "md", 30 | fields: [ 31 | { 32 | type: "string", 33 | name: "title", 34 | label: "Title", 35 | isTitle: true, 36 | required: true, 37 | }, 38 | { 39 | type: "number", 40 | name: "weight", 41 | label: "Weight" 42 | }, 43 | { 44 | type: "string", 45 | name: "description", 46 | label: "Description" 47 | }, 48 | { 49 | type: "rich-text", 50 | name: "body", 51 | label: "Body", 52 | isBody: true, 53 | }, 54 | ], 55 | }, 56 | { 57 | name: "post", 58 | label: "Posts", 59 | path: "content/blog", 60 | frontmatterFormat: "toml", 61 | frontmatterDelimiters: "+++", 62 | format: "md", 63 | fields: [ 64 | { 65 | type: "string", 66 | name: "title", 67 | label: "Title", 68 | isTitle: true, 69 | required: true, 70 | }, 71 | { 72 | type: "string", 73 | name: "author", 74 | label: "Author", 75 | }, 76 | { 77 | type: "string", 78 | name: "categories", 79 | label: "Categories", 80 | list: true 81 | }, 82 | { 83 | type: "string", 84 | name: "tags", 85 | label: "Tags", 86 | list: true 87 | }, 88 | { 89 | type: "datetime", 90 | name: "date", 91 | label: "Date", 92 | }, 93 | { 94 | type: "image", 95 | name: "image", 96 | label: "Image", 97 | }, 98 | { 99 | type: "rich-text", 100 | name: "body", 101 | label: "Body", 102 | isBody: true, 103 | }, 104 | ], 105 | }, 106 | { 107 | name: "tutorials", 108 | label: "Tutorials", 109 | path: "content/tutorials", 110 | frontmatterFormat: "toml", 111 | frontmatterDelimiters: "+++", 112 | format: "md", 113 | fields: [ 114 | { 115 | type: "string", 116 | name: "title", 117 | label: "Title", 118 | isTitle: true, 119 | required: true, 120 | }, 121 | { 122 | type: "number", 123 | name: "weight", 124 | label: "Weight", 125 | }, 126 | { 127 | type: "rich-text", 128 | name: "body", 129 | label: "Body", 130 | isBody: true, 131 | }, 132 | ], 133 | }, 134 | ], 135 | }, 136 | search: { 137 | tina: { 138 | indexerToken: "876018600e28b19feaf033cc3364f588fe8a6248", 139 | stopwordLanguages: ["deu", "eng", "fra", "ita", "spa", "nld"] 140 | }, 141 | indexBatchSize: 100, 142 | maxSearchIndexFieldLength: 100 143 | } 144 | }); 145 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/onweru/compose 2 | 3 | go 1.20 4 | -------------------------------------------------------------------------------- /i18n/de.toml: -------------------------------------------------------------------------------- 1 | [copy] 2 | other = "Kopieren" 3 | [copied] 4 | other = "Kopiert" 5 | [docs_menu] 6 | other = "Dokumentationsmenü" 7 | [no_matches] 8 | other = "Keine Übereinstimmung gefunden" 9 | [not_set] 10 | other = "undefiniert" 11 | [resize_snippet] 12 | other = "Höhe des Snippets ändern" 13 | [quick_links] 14 | other = "Schnellzugriff" 15 | [search_field_placeholder] 16 | other = "Suche" 17 | [search_results_label] 18 | other = "Suchergebnisse" 19 | [short_search_query] 20 | other = "Anfrage ist zu kurz" 21 | [site] 22 | other = "Webseite" 23 | [site_menu] 24 | other = "Menü der Webseite" 25 | [toggle_line_numbers] 26 | other = "Zeilennummern ein- oder ausblenden" 27 | [toggle_line_wrap] 28 | other = "Zeilenumbruch aktivieren oder deaktivieren" 29 | [to_top] 30 | other = "Zurück zum Anfang" 31 | [type_to_search] 32 | other = "Suchbegriff eingeben" 33 | -------------------------------------------------------------------------------- /i18n/en.toml: -------------------------------------------------------------------------------- 1 | [copy] 2 | other = "Copy" 3 | [copied] 4 | other = "Copied" 5 | [docs_menu] 6 | other = "Docs Menu" 7 | [no_matches] 8 | other = "No matches found" 9 | [not_set] 10 | other = "not set" 11 | [resize_snippet] 12 | other = "Resize snippet height" 13 | [quick_links] 14 | other = "Quick links" 15 | [search_field_placeholder] 16 | other = "Search" 17 | [search_results_label] 18 | other = "Search Results" 19 | [short_search_query] 20 | other = "Query is too short" 21 | [site] 22 | other = "site" 23 | [site_menu] 24 | other = "Site Menu" 25 | [toggle_line_numbers] 26 | other = "Toggle line numbers" 27 | [toggle_line_wrap] 28 | other = "Toggle line wrap" 29 | [to_top] 30 | other = "Back to top" 31 | [type_to_search] 32 | other = "Type to search" -------------------------------------------------------------------------------- /i18n/eo.toml: -------------------------------------------------------------------------------- 1 | [copy] 2 | other = "Kopii" 3 | [copied] 4 | other = "Kopiita" 5 | [docs_menu] 6 | other = "Dokumentara menuo" 7 | [no_matches] 8 | other = "Ne trovis kongrŭojn" 9 | [not_set] 10 | other = "ne agordita" 11 | [resize_snippet] 12 | other = "Ĝustigi kodaĵan alton" 13 | [quick_links] 14 | other = "Rapidaj ligiloj" 15 | [search_field_placeholder] 16 | other = "Serĉi" 17 | [search_results_label] 18 | other = "Serĉi rezultojn" 19 | [short_search_query] 20 | other = "La serĉoteksto estas tro mallonga" 21 | [site] 22 | other = "retejon" 23 | [site_menu] 24 | other = "Reteja menuo" 25 | [toggle_line_numbers] 26 | other = "Baskuligi liniajn nombrojn" 27 | [toggle_line_wrap] 28 | other = "Baskuligi linifaldon" 29 | [to_top] 30 | other = "Reiri supren" 31 | [type_to_search] 32 | other = "Tajpu por serĉi" 33 | -------------------------------------------------------------------------------- /i18n/es.toml: -------------------------------------------------------------------------------- 1 | [copy] 2 | other = "Copiar" 3 | [copied] 4 | other = "Copiado" 5 | [docs_menu] 6 | other = "Menú de documentos" 7 | [no_matches] 8 | other = "No se encontraron coincidencias" 9 | [not_set] 10 | other = "no asignado" 11 | [resize_snippet] 12 | other = "Ajustar la altura del fragmento" 13 | [quick_links] 14 | other = "Enlaces rápidos" 15 | [search_field_placeholder] 16 | other = "Buscar" 17 | [search_results_label] 18 | other = "Buscar resultados" 19 | [short_search_query] 20 | other = "La consulta es demasiado corta" 21 | [site] 22 | other = "sitio web" 23 | [site_menu] 24 | other = "Menú del sitio web" 25 | [toggle_line_numbers] 26 | other = "Alterna números de línea" 27 | [toggle_line_wrap] 28 | other = "Alterna ajuste de línea" 29 | [to_top] 30 | other = "Volver arriba" 31 | [type_to_search] 32 | other = "Escribe para buscar" 33 | -------------------------------------------------------------------------------- /i18n/tr.toml: -------------------------------------------------------------------------------- 1 | [copy] 2 | other = "Kopyala" 3 | [copied] 4 | other = "kopyalandı" 5 | [docs_menu] 6 | other = "Belgeleme menüsü" 7 | [no_matches] 8 | other = "Eşleşme bulunamadı" 9 | [not_set] 10 | other = "ayarlanmadı" 11 | [resize_snippet] 12 | other = "Snippet yüksekliğini yeniden boyutlandır" 13 | [quick_links] 14 | other = "Hızlı bağlantılar" 15 | [search_field_placeholder] 16 | other = "Belgelerde arayın" 17 | [search_results_label] 18 | other = "Arama sonuçları" 19 | [short_search_query] 20 | other = "Sorgu çok kısa" 21 | [site] 22 | other = "site" 23 | [site_menu] 24 | other = "Site menüsü" 25 | [toggle_line_numbers] 26 | other = "Satır numaralarını değiştir" 27 | [toggle_line_wrap] 28 | other = "Satır kaydırmayı değiştir" 29 | [to_top] 30 | other = "Retour au sommet" 31 | [type_to_search] 32 | other = "Aramak için yazın" 33 | -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/images/screenshot.png -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/images/tn.png -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{- define "main"}} 2 |
3 |

Not found

4 |

Bummer! This page doesn't exist. back home.

5 |
6 | {{- end }} 7 | -------------------------------------------------------------------------------- /layouts/_default/_markup/render-heading.html: -------------------------------------------------------------------------------- 1 | 2 | {{ .Text | safeHTML }} 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /layouts/_default/baseof.html: -------------------------------------------------------------------------------- 1 | {{- $config := site.Params }} 2 | {{- $context := . }} 3 | {{- $item_type := "http://schema.org/WebPage" }} 4 | {{- $lang := site.Language.Lang }} 5 | {{- $is_dark := $config.enableDarkMode }} 6 | {{- $default_mode := $config.defaultLightingMode -}} 7 | 8 | 9 | 10 | {{- partial "head/index" . }} 11 | 12 | 13 | 16 | {{- if or (eq .Section $config.blogDir) (eq .Type "search" ) }} 17 | {{- block "main" . }}{{ end }} 18 | {{- else }} 19 |
20 | {{- $docSections := $config.docSections }} 21 | {{- with $docSections }}{{- else }} 22 | {{- $docSections = "docs" }} 23 | {{- end }} 24 | {{- $uniqueHomepage := .IsHome }} 25 | {{- if $config.uniqueHomepage }} 26 | {{- if .IsHome }} 27 | {{- $uniqueHomepage = true }} 28 | {{- end }} 29 | {{- else }} 30 | {{- $uniqueHomepage = false }} 31 | {{- end }} 32 | {{- if and (in $docSections .Section) (ne $uniqueHomepage true) }} 33 | {{- partial "document" . }} 34 | {{- else }} 35 |
36 | {{- block "main" . }}{{ end }} 37 |
38 | {{- end -}} 39 |
40 | {{- end }} 41 | {{- partial "scripts/translations" . -}} 42 | {{- partialCached "footer" . -}} 43 | {{- partialCached "sprites" . -}} 44 | {{- partial "scripts/bundle" . -}} 45 | {{- partial "scripts/mermaid" . -}} 46 | 47 | 48 | -------------------------------------------------------------------------------- /layouts/_default/index.json: -------------------------------------------------------------------------------- 1 | {{- $.Scratch.Add "index" slice -}} 2 | {{- $searchableExtras := site.Params.otherSearchableFields }} 3 | {{- range site.Pages -}} 4 | {{ $params := .Params }} 5 | {{- if ne .Type "search" -}} 6 | {{- $searchEntry := dict "title" .Title "body" .Plain "link" .Permalink "section" .Section }} 7 | {{- range $index, $value := $searchableExtras }} 8 | {{- $extraFieldValue := index $params $value }} 9 | {{- $extraFieldValues := dict }} 10 | {{- with $extraFieldValue }} 11 | {{- $v := . }} 12 | {{- if reflect.IsSlice . }} 13 | {{- $v = delimit . "," }} 14 | {{- end }} 15 | {{- $extraFieldValues = dict (lower $value) $v }} 16 | {{- end }} 17 | {{- $searchEntry = merge $searchEntry $extraFieldValues }} 18 | {{- end }} 19 | {{- $.Scratch.Add "index" $searchEntry -}} 20 | {{- end -}} 21 | {{- end -}} 22 | {{- jsonify (uniq ($.Scratch.Get "index")) -}} -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 | {{- .Content }} 3 | {{ if eq .Kind "taxonomy" }} 4 |
    5 | {{ range .Data.Pages }} 6 |
  1. 7 | 8 | {{ .Title }} 9 | 10 |
  2. 11 | {{ end }} 12 |
13 | {{ end }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 |
3 |

{{ .Title }}

4 | {{ with .Params.description }}
{{ markdownify . }}
{{ end }} 5 | {{- .Content }} 6 |
7 | {{- end }} 8 | -------------------------------------------------------------------------------- /layouts/_default/term.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{- $pages := .Data.Pages }} 3 | {{- .Data.Terms }} 4 |
5 | {{- $paginator := .Paginate $pages -}} 6 | {{- $size := $paginator.PagerSize }} 7 | {{- $scratch := newScratch }} 8 | {{- range $index, $value := $paginator.Pages }} 9 | {{- if isset .Params "image" }} 10 | {{- $scratch.Set "image" .Params.image }} 11 | {{- else }} 12 | {{- $scratch.Set "image" "thumbnail.svg" }} 13 | {{- end }} 14 | {{- $image := $scratch.Get "image" }} 15 | {{- $bg := (absURL (printf "images/%s" $image)) }} 16 | {{- if in $image "https://" }} 17 | {{- $bg = $image }} 18 | {{- end }} 19 | 31 | {{- if and (eq $index 0) (gt $size 1) }}
{{ end }} 32 | {{- if and (eq $index (add $size -1)) (gt $size 1) }}
{{ end }} 33 | {{- end }} 34 |
35 | 36 | {{- end -}} -------------------------------------------------------------------------------- /layouts/blog/list.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 | {{- $pages := where site.RegularPages "Section" site.Params.blogDir }} 3 |
4 | {{- $paginator := .Paginate $pages -}} 5 | {{- $size := $paginator.PagerSize }} 6 | {{- $scratch := newScratch }} 7 | {{- range $index, $value := $paginator.Pages }} 8 | {{- if isset .Params "image" }} 9 | {{- $scratch.Set "image" .Params.image }} 10 | {{- else }} 11 | {{- $scratch.Set "image" "thumbnail.svg" }} 12 | {{- end }} 13 | {{- $image := $scratch.Get "image" }} 14 | {{- $bg := $image }} 15 | {{- if ne (in $image "images") true }} 16 | {{- $bg = (absURL (printf "images/%s" $image)) }} 17 | {{- end }} 18 | {{- if in $image "https://" }} 19 | {{- $bg = $image }} 20 | {{- end }} 21 | 33 | {{- if and (eq $index 0) (gt $size 1) }}
{{ end }} 34 | {{- if and (eq $index (add $size -1)) (gt $size 1) }}
{{ end }} 35 | {{- end }} 36 |
37 | 38 | 45 | {{- end }} -------------------------------------------------------------------------------- /layouts/blog/single.html: -------------------------------------------------------------------------------- 1 | {{ define "main" }} 2 |
3 |
4 | {{- $date := (dateFormat "02. January 2006" .Date) -}} 5 | 6 |

{{ .Title }}

7 |
8 |
9 | {{- with .Params.image }} 10 | {{- $image := . }} 11 | {{- if ne (in . "images") true }} 12 | {{- $image = printf "images/%s" . }} 13 | {{- end }} 14 | {{- $image = absURL $image }} 15 | {{- if in . "https://" }} 16 | {{- $image = . }} 17 | {{- end }} 18 | {{ . }} 19 | {{- end }} 20 | {{- .Content }} 21 |
22 |
23 | {{- partialCached "share" . }} 24 |
25 |
26 | {{ template "_internal/disqus.html" . }} 27 |
28 |
29 |
30 |
31 | {{ end }} 32 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 |
3 | {{ .Content }} 4 |
5 | {{- end }} 6 | -------------------------------------------------------------------------------- /layouts/partials/document.html: -------------------------------------------------------------------------------- 1 |
2 | {{- partial "sidebar" . }} 3 |
4 |

{{ .Title }}

5 | {{- .Content }} 6 | {{ partial "pager" . }} 7 |
8 |
9 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | {{- $config := site.Params }} 2 | {{- $author := $config.author }} 3 |
4 |
5 |

6 | © {{ now.Year }} 7 | {{- if $config.enableCopyright }} 8 | {{ with $author }} 9 | {{ .name }} 10 | {{ end }} 11 | {{ end }} 12 |

13 | 14 |
15 |
16 | -------------------------------------------------------------------------------- /layouts/partials/functions/getAlgoliaConfig.html: -------------------------------------------------------------------------------- 1 | {{- $defaults := (dict "id" "#" "key" "#") }} 2 | {{- $config := default $defaults site.Params.search.algolia }} 3 | 4 | {{- return (jsonify (dict "on" $config.enable "id" $config.id "key" $config.key "index" $config.index)) }} -------------------------------------------------------------------------------- /layouts/partials/functions/getCodeConfig.html: -------------------------------------------------------------------------------- 1 | {{- $s := site.Params }} 2 | {{- $p := .Params }} 3 | {{- $maxCodeLines := default 100 $s.codeMaxLines }} 4 | {{- with $p.codeMaxLines }} 5 | {{- $maxCodeLines = . }} 6 | {{- end }} 7 | {{- $showLineNumbers := default false $s.showLineNumbers }} 8 | {{ with $p.showLineNumbers }} 9 | {{- $showLineNumbers = . }} 10 | {{ else }} 11 | {{ if eq $p.showLineNumbers false }} 12 | {{- $showLineNumbers = false }} 13 | {{ end }} 14 | {{- end }} 15 | {{- return (jsonify (dict "show" $showLineNumbers "maximum" $maxCodeLines)) }} -------------------------------------------------------------------------------- /layouts/partials/functions/getIconPath.html: -------------------------------------------------------------------------------- 1 | {{ $sp := site.Params }} 2 | {{ $iconsPath := "icons/" }} 3 | {{ with $sp.iconsPath }} 4 | {{ $iconsPath = . }} 5 | {{ end }} 6 | {{ return $iconsPath }} -------------------------------------------------------------------------------- /layouts/partials/functions/getScript.html: -------------------------------------------------------------------------------- 1 | {{ $scriptPath := printf "js/%s.js" .slug }} 2 | {{ return (resources.Get $scriptPath | resources.ExecuteAsTemplate $scriptPath .) }} -------------------------------------------------------------------------------- /layouts/partials/functions/getSearchConfig.html: -------------------------------------------------------------------------------- 1 | {{ $config := site.Params }} 2 | {{ $enableSearch := default true $config.enableSearch }} 3 | {{ if eq $config.search.on false }} 4 | {{ $enableSearch = false }} 5 | {{ end }} 6 | {{ return $enableSearch }} -------------------------------------------------------------------------------- /layouts/partials/head/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{- hugo.Generator }} 4 | {{- $iconsPath := "favicons/" }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | {{- $t := .Title }} 13 | {{- $s := site.Title }} 14 | {{- if in (lower $s) (lower $t) }} 15 | {{- $t = false }} 16 | {{- end }} 17 | {{ if and $t (ne (trim (lower $s) "") (trim (lower $t) "")) }}{{ $t }} | {{ end }}{{ $s }} 18 | 19 | {{- partial "opengraph.html" . }} 20 | {{- partial "schema.html" . }} 21 | {{- partial "twitter_cards.html" . }} 22 | {{- if hugo.IsProduction }} 23 | {{- partial "google_analytics.html" . }} 24 | {{- end }} 25 | 26 | {{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}} 27 | {{- $styles := resources.Get "sass/main.sass" | resources.ExecuteAsTemplate "main.sass" . | 28 | css.Sass $options | fingerprint "sha512" }} 29 | 30 | 31 | {{- $config := site.Params }} 32 | {{- with $config.customCSS }} 33 | {{- range . -}} 34 | 35 | {{- end }} 36 | {{- end }} 37 | 38 | {{- with $config.metaThemeColor }} 39 | 40 | {{- end }} 41 | 42 | {{- if .Description }} 43 | 44 | {{- else if .IsPage }} 45 | 46 | {{- else if $config.Description }} 47 | 48 | {{- end }} 49 | {{- partial "head/liteyoutube" . }} 50 | {{- partialCached "hooks/head" . -}} -------------------------------------------------------------------------------- /layouts/partials/head/liteyoutube.html: -------------------------------------------------------------------------------- 1 | {{- $baseurl := absURL "" }} 2 | {{- $includeLiteYT := false }} 3 | 4 | {{- if .IsNode }} 5 | {{- range .Pages }} 6 | {{- range .Pages }} 7 | 8 | {{- $rawsummary := split .RawContent "" }} 9 | 10 | {{- if (findRE "liteyoutube" (index $rawsummary 0)) }} 11 | {{- $includeLiteYT = true }} 12 | {{- end }} 13 | {{- end }} 14 | {{- end }} 15 | {{- end }} 16 | {{- if (.HasShortcode "liteyoutube") }} 17 | {{- $includeLiteYT = true }} 18 | {{- end }} 19 | {{- if $includeLiteYT }} 20 | {{- $styles := printf "%s/css/lite-yt-embed.css" $baseurl }} 21 | {{- $scripts := printf "%s/js/lite-yt-embed.js" $baseurl }} 22 | 23 | 24 | {{- end -}} 25 | -------------------------------------------------------------------------------- /layouts/partials/hooks/head.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/hooks/scripts.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/mode.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | -------------------------------------------------------------------------------- /layouts/partials/nav.html: -------------------------------------------------------------------------------- 1 | {{- $config := site.Params }} 2 | 49 | -------------------------------------------------------------------------------- /layouts/partials/pager.html: -------------------------------------------------------------------------------- 1 |
2 | {{- $searchURL := "/search/" }} 3 | {{ with .NextInSection }} 4 | {{ if and (ne .RelPermalink $searchURL) (.InSection .) }} 5 | 10 | {{ end }} 11 | {{ end }} 12 | 13 | {{ with .PrevInSection }} 14 | {{ if and (ne .RelPermalink $searchURL) (.InSection .) }} 15 | 20 | {{ end }} 21 | {{ end }} 22 |
-------------------------------------------------------------------------------- /layouts/partials/scripts/bundle.html: -------------------------------------------------------------------------------- 1 | {{- $variables := partial "functions/getScript" (dict "slug" "variables") }} 2 | {{- $functions := partial "functions/getScript" (dict "slug" "functions") }} 3 | {{- $code := partial "functions/getScript" (dict "slug" "code") }} 4 | {{- $mode := partial "functions/getScript" (dict "slug" "mode") }} 5 | {{- $main := partial "functions/getScript" (dict "slug" "index") }} 6 | 7 | {{- $customScriptPath := "js/custom.js" }} 8 | {{- $customScriptRelPath := "../../assets/js/custom.js" }} 9 | {{- if (fileExists $customScriptRelPath) }} 10 | {{- $customScriptPath = $customScriptRelPath }} 11 | {{- end }} 12 | {{- $custom := resources.Get $customScriptPath | resources.ExecuteAsTemplate $customScriptPath . }} 13 | 14 | {{- partial "scripts/getJsBundle" (dict "scripts" (slice $variables $functions $code $mode $main $custom) "slug" "bundle" "inline" true) }} 15 | 16 | {{- partial "scripts/search" . -}} 17 | {{- partialCached "hooks/scripts" . -}} 18 | 19 | {{- with site.Params.customJS }} 20 | {{- range . -}} 21 | 22 | {{- end }} 23 | {{- end -}} 24 | -------------------------------------------------------------------------------- /layouts/partials/scripts/getJsBundle.html: -------------------------------------------------------------------------------- 1 | {{- $bundle := .scripts | resources.Concat (printf "js/%s.js" .slug) | resources.Minify | resources.Fingerprint "sha512" }} 2 | {{- if .inline }} 3 | 6 | {{- else }} 7 | 8 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/scripts/mermaid.html: -------------------------------------------------------------------------------- 1 | 2 | {{ if in .Content "mermaid" }} 3 | 25 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/scripts/search.html: -------------------------------------------------------------------------------- 1 | {{- $searchEnabled := partialCached "functions/getSearchConfig" . }} 2 | {{ if $searchEnabled }} 3 | {{- $fuse := partial "functions/getScript" (dict "slug" "search/fuse") }} 4 | {{- $variables := partial "functions/getScript" (dict "slug" "search/variables") }} 5 | {{- $algolia := partial "functions/getScript" (dict "slug" "search/algolia") }} 6 | {{- $search := partial "functions/getScript" (dict "slug" "search/index") }} 7 | 8 | {{- $searchLib := $fuse }} 9 | {{- if site.Params.search.algolia.enable }} 10 | {{- $searchLib = $algolia }} 11 | {{- end }} 12 | 13 | {{- partial "scripts/getJsBundle" (dict "scripts" (slice $searchLib $variables $search) "slug" "search") }} 14 | {{ end }} -------------------------------------------------------------------------------- /layouts/partials/scripts/translations.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /layouts/partials/search.html: -------------------------------------------------------------------------------- 1 | {{- $searchEnabled := partialCached "functions/getSearchConfig" . }} 2 | {{- if $searchEnabled }} 3 | {{- $section := .Section }} 4 | {{- $config := site.Params }} 5 | {{- $default := T "search_field_placeholder" (dict "section" "") }} 6 | {{- $scope := T "site" }} 7 | {{- if and $section (eq $config.search.global false) }} 8 | {{- $scope = $section }} 9 | {{- end }} 10 | 20 | {{- end }} -------------------------------------------------------------------------------- /layouts/partials/share.html: -------------------------------------------------------------------------------- 1 | {{- $s := T "share_story" }} 2 | {{- $lc := T "link_copied" }} 3 |
4 | 5 | 6 | 7 |
-------------------------------------------------------------------------------- /layouts/partials/sidebar.html: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /layouts/partials/sprite.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /layouts/search/single.html: -------------------------------------------------------------------------------- 1 | {{- define "main" }} 2 |
3 |
4 |
5 | {{- end }} -------------------------------------------------------------------------------- /layouts/shortcodes/block.html: -------------------------------------------------------------------------------- 1 | {{- $modifier := .Get 0 -}} 2 | {{- $bg := .Get 1 -}} 3 |
4 | {{- .Inner -}} 5 |
6 | -------------------------------------------------------------------------------- /layouts/shortcodes/button.html: -------------------------------------------------------------------------------- 1 | {{- $link := .Get 0 -}} 2 | {{- $label := .Get 1 -}} 3 | {{- $modifier := .Get 2 -}} 4 | {{- $label | markdownify -}} 5 | -------------------------------------------------------------------------------- /layouts/shortcodes/chart.html: -------------------------------------------------------------------------------- 1 | {{- $datasetKey := .Get 0 }} 2 | {{- $charts := .Get 1 }} 3 | {{- $data := index $.Page.Params $datasetKey }} 4 | {{- $dataURL := $data.fileLink }} 5 | {{- $separator := "," }} 6 | {{- $dataFile := unmarshal (dict "delimiter" $separator) (readFile $dataURL) }} 7 | 8 | {{- $dataCompactData := dict -}} 9 | {{- $activeColumn := sub $data.baseChartOn 1 }} 10 | {{- with .Get 2 }} 11 | {{- $activeColumn = sub (int .) 1 }} 12 | {{- end }} 13 | {{- range $dataFile -}} 14 | {{- $value := trim (index . $activeColumn) " " -}} 15 | {{- with index $dataCompactData $value -}} 16 | {{- $dataCompactData = merge $dataCompactData (dict $value (add 1 .)) -}} 17 | {{- else -}} 18 | {{- $dataCompactData = merge $dataCompactData (dict $value 1) -}} 19 | {{- end -}} 20 | {{- end -}} 21 | 22 | {{- $labels := slice }} 23 | {{- range $key, $value := $dataCompactData }} 24 | {{- $labels = append $key $labels }} 25 | {{- end }} 26 | 27 | {{- if in $charts "table" }} 28 | 29 |
30 | {{- if not (in $charts "noFilter") }} 31 |

32 | 34 |

35 | {{- end }} 36 | 37 | 38 | {{- range $index, $title := $data.columnTitles }} 39 | 41 | {{- end }} 42 | 43 | 44 | {{- range $dataFile }} 45 | {{- $entry := . }} 46 | 47 | {{- range $index, $_ := $data.columnTitles }} 48 | 49 | {{- end }} 50 | 51 | {{- end }} 52 |
{{ $title }} {{ partial 40 | "sprite" (dict "icon" "sort") . }}
{{ index $entry $index }}
53 |
54 | {{- end }} 55 | 56 | {{- $labels = split (delimit $labels ",") "," }} 57 | {{- $dataTally := split (delimit $dataCompactData ",") "," }} 58 | 59 | 60 | 78 | 79 | {{- if in $charts "pie" }} 80 |
81 | 82 |
83 | 91 | {{- end }} 92 | 93 | {{- if in $charts "bar" }} 94 |
95 | 96 |
97 | 113 | {{- end }} 114 | 115 | {{ if in $charts "doughnut" }} 116 |
117 | 118 |
119 | 127 | {{- end }} -------------------------------------------------------------------------------- /layouts/shortcodes/column.html: -------------------------------------------------------------------------------- 1 | {{- $modifier := .Get 0 -}} 2 |
3 | {{- .Inner | markdownify -}} 4 |
5 | -------------------------------------------------------------------------------- /layouts/shortcodes/gallery.html: -------------------------------------------------------------------------------- 1 | {{- $images := split (replace (.Get 0) ", " ",") "," }} 2 | {{- $descriptions := split (replace (.Get 1) ":: " "::") "::" }} 3 | 13 | -------------------------------------------------------------------------------- /layouts/shortcodes/grid.html: -------------------------------------------------------------------------------- 1 | {{- $grids := .Get 0 }} 2 | {{- $modifiers := .Get 1 }} 3 |
4 | {{ .Inner }} 5 |
-------------------------------------------------------------------------------- /layouts/shortcodes/icon.html: -------------------------------------------------------------------------------- 1 | {{- $src := .Get 0 }} 2 | {{- $alt := .Get 1 }} 3 | {{- $modifier := .Get 2 -}} 4 |
5 | {{ $alt }} 6 |
7 | -------------------------------------------------------------------------------- /layouts/shortcodes/image.html: -------------------------------------------------------------------------------- 1 | {{- $src := .Get 0 }} 2 | {{- $alt := .Get 1 }} 3 | {{- $modifier := .Get 2 -}} 4 | {{ . }} 5 | -------------------------------------------------------------------------------- /layouts/shortcodes/liteyoutube.html: -------------------------------------------------------------------------------- 1 |
2 | {{- $videoid := .Get 0 -}} 3 | {{- $img := .Get 1 -}} 4 | {{- $params := .Get 2 -}} 5 | {{ $bkImg := "" }} 6 | {{ if .IsNamedParams }} 7 | {{ $videoid = .Get "videoid" }} 8 | {{ $img = .Get "img" }} 9 | {{ $bkImg = "" }} 10 | {{ $params = .Get "params" }} 11 | {{ end }} 12 | {{ with $img }} 13 | {{ $bkImg := absURL (printf "images/%s" .) }} 14 | {{ end }} 15 | 16 |
17 | -------------------------------------------------------------------------------- /layouts/shortcodes/mermaid.html: -------------------------------------------------------------------------------- 1 |
{{- .Inner -}}
2 | -------------------------------------------------------------------------------- /layouts/shortcodes/partial.html: -------------------------------------------------------------------------------- 1 | {{- $partial := .Get 0 }} 2 | {{- partial $partial . }} -------------------------------------------------------------------------------- /layouts/shortcodes/picture.html: -------------------------------------------------------------------------------- 1 | {{- $normal := .Get 0 }} 2 | {{- $dark := .Get 1 }} 3 | {{- $alt := .Get 2 }} 4 | {{- $litPath := absURL (printf "images/%s" $normal) }} 5 | {{- $darkPath := absURL (printf "images/%s" $dark) }} 6 | 9 | -------------------------------------------------------------------------------- /layouts/shortcodes/tab.html: -------------------------------------------------------------------------------- 1 | {{- $name := .Get 0 | default "Name Me!" }} 2 | {{ $group := .Page.Scratch.Get "tabGroupIndex" | default 0 }} 3 | {{ $index := .Page.Scratch.Get "tabElementIndex" | default 0 }} 4 | 5 | 10 | 11 | 12 | 13 |
14 | {{ markdownify .Inner }} 15 |
16 | 17 | {{ .Page.Scratch.Set "tabElementIndex" (add 1 $index) }} 18 | -------------------------------------------------------------------------------- /layouts/shortcodes/tabs.html: -------------------------------------------------------------------------------- 1 | {{ $id := .Get 0 | default "id" }} 2 | {{ $align := .Get "align" | default "left" }} 3 | {{ $group := .Page.Scratch.Get "tabGroupIndex" | default 0 }} 4 | {{ $index := .Page.Scratch.Set "tabElementIndex" 0 }} 5 | 6 |
7 | {{ .Inner }} 8 |
9 | 10 | {{ .Page.Scratch.Set "tabGroupIndex" (add 1 $group) }} 11 | -------------------------------------------------------------------------------- /layouts/shortcodes/tip.html: -------------------------------------------------------------------------------- 1 | {{- $type := .Get 0 }} 2 |
3 | {{ markdownify .Inner }} 4 |
5 | -------------------------------------------------------------------------------- /layouts/shortcodes/youtube.html: -------------------------------------------------------------------------------- 1 | {{- $youtubeHost := "https://www.youtube.com/watch?v=" }} 2 | {{- $url := .Get 0 }} 3 | {{- if in $url $youtubeHost }} 4 | {{- $url = strings.TrimPrefix $youtubeHost $url }} 5 | {{- end }} 6 |
7 | 8 |
9 | -------------------------------------------------------------------------------- /static/css/lite-yt-embed.css: -------------------------------------------------------------------------------- 1 | /* Originally obtained from Paul Irish https://github.com/paulirish/lite-youtube-embed */ 2 | lite-youtube { 3 | background-color: #000; 4 | position: relative; 5 | display: block; 6 | contain: content; 7 | background-position: center; 8 | background-size: cover; 9 | cursor: pointer; 10 | } 11 | 12 | /* gradient */ 13 | lite-youtube::before { 14 | content: ''; 15 | display: block; 16 | position: absolute; 17 | top: 0; 18 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==); 19 | background-position: top; 20 | background-repeat: repeat-x; 21 | height: 60px; 22 | padding-bottom: 50px; 23 | width: 100%; 24 | transition: all 0.2s cubic-bezier(0, 0, 0.2, 1); 25 | } 26 | 27 | /* responsive iframe with a 16:9 aspect ratio 28 | thanks https://css-tricks.com/responsive-iframes/ 29 | */ 30 | lite-youtube::after { 31 | content: ""; 32 | display: block; 33 | padding-bottom: calc(100% / (16 / 9)); 34 | } 35 | lite-youtube > iframe { 36 | width: 100%; 37 | height: 100%; 38 | position: absolute; 39 | top: 0; 40 | left: 0; 41 | border: 0; 42 | } 43 | 44 | /* play button */ 45 | lite-youtube > .lty-playbtn { 46 | display: block; 47 | width: 68px; 48 | height: 48px; 49 | position: absolute; 50 | cursor: pointer; 51 | transform: translate3d(-50%, -50%, 0); 52 | top: 50%; 53 | left: 50%; 54 | z-index: 1; 55 | background-color: transparent; 56 | /* YT's actual play button svg */ 57 | background-image: url('data:image/svg+xml;utf8,'); 58 | filter: grayscale(100%); 59 | transition: filter .1s cubic-bezier(0, 0, 0.2, 1); 60 | border: none; 61 | } 62 | 63 | lite-youtube:hover > .lty-playbtn, 64 | lite-youtube .lty-playbtn:focus { 65 | filter: none; 66 | } 67 | 68 | /* Post-click styles */ 69 | lite-youtube.lyt-activated { 70 | cursor: unset; 71 | } 72 | lite-youtube.lyt-activated::before, 73 | lite-youtube.lyt-activated > .lty-playbtn { 74 | opacity: 0; 75 | pointer-events: none; 76 | } 77 | 78 | .lyt-visually-hidden { 79 | clip: rect(0 0 0 0); 80 | clip-path: inset(50%); 81 | height: 1px; 82 | overflow: hidden; 83 | position: absolute; 84 | white-space: nowrap; 85 | width: 1px; 86 | } 87 | -------------------------------------------------------------------------------- /static/favicons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/favicons/android-chrome-192x192.png -------------------------------------------------------------------------------- /static/favicons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/favicons/android-chrome-512x512.png -------------------------------------------------------------------------------- /static/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /static/favicons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/favicons/favicon-16x16.png -------------------------------------------------------------------------------- /static/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /static/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/favicons/favicon.ico -------------------------------------------------------------------------------- /static/favicons/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /static/fonts/Metropolis-Black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Black.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-Black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Black.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-BlackItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-BlackItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-BlackItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-BlackItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Bold.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-BoldItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-BoldItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-ExtraBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ExtraBold.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-ExtraBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ExtraBold.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-ExtraBoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ExtraBoldItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-ExtraBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ExtraBoldItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-ExtraLight.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ExtraLight.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-ExtraLight.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ExtraLight.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-ExtraLightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ExtraLightItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-ExtraLightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ExtraLightItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Light.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Light.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-LightItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-LightItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-LightItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-LightItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Medium.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Medium.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-MediumItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-MediumItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-MediumItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-MediumItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Regular.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-RegularItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-RegularItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-RegularItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-RegularItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-SemiBold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-SemiBold.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-SemiBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-SemiBold.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-SemiBoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-SemiBoldItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-SemiBoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-SemiBoldItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Thin.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-Thin.woff2 -------------------------------------------------------------------------------- /static/fonts/Metropolis-ThinItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ThinItalic.woff -------------------------------------------------------------------------------- /static/fonts/Metropolis-ThinItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onweru/compose/053f7d2f6f523fc804d159fd8cebe737a4c90759/static/fonts/Metropolis-ThinItalic.woff2 -------------------------------------------------------------------------------- /static/icons/carly.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/icons/check.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /static/icons/copy.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/icons/expand.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/icons/info.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/icons/link.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/icons/moon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/icons/next.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /static/icons/order.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/icons/sun.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/images/github.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/images/next.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /static/images/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | name = "Compose" 2 | license = "MIT" 3 | licenselink = "https://github.com/onweru/compose/blob/master/LICENSE" 4 | description = "A hugo theme for documentation sites. It's inspired by forestry.io's docs page" 5 | homepage = "https://github.com/onweru/compose" 6 | demosite = "https://composedocs.netlify.app/" 7 | tags = ["dark mode", "docs", "dark", "blog", "search", "documentation"] 8 | features = ["dark mode", "docs", "dark", "blog", "search", "documentation"] 9 | min_version = "0.123.0" 10 | 11 | [author] 12 | name = "Weru" 13 | homepage = "https://github.com/onweru" 14 | --------------------------------------------------------------------------------