Skip to content

Commit

Permalink
Add docs builder.
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-kvashnin committed May 26, 2024
1 parent 2141491 commit 58fc195
Show file tree
Hide file tree
Showing 13 changed files with 623 additions and 4 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Documentation

on: workflow_dispatch

jobs:
build-docs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
deployments: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to GH Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull builder image
run: docker pull ghcr.io/norvica/docs:v0.1.0

- name: Build Documentation
run: |
docker run --rm -v $(pwd)/docs/content:/app/content -v $(pwd)/docs/config/_default:/app/config/_default -v $(pwd)/docs/public:/app/public -e HUGO_ENVIRONMENT=production -e HUGO_ENV=production ghcr.io/norvica/docs:v0.1.0 npm run build -- --gc --minify --baseURL "https://container.norvica.dev"
- name: Publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: $(pwd)/docs/public
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Container
# Dependency Injection Container

[![Latest Stable Version](https://poser.pugx.org/norvica/container/v/stable.png)](https://packagist.org/packages/norvica/container)
[![Checks](https://github.com/norvica/container/actions/workflows/checks.yml/badge.svg)](https://github.com/norvica/container/actions/workflows/checks.yml)
Expand All @@ -20,11 +20,12 @@ Complex tools can quickly become a burden. We believe in the power of simplicity
debug, and adapt over time. This library avoids unnecessary complexity, focusing on features that offer real value
without sacrificing performance.

### Key Benefits
### Key Features

- **Blazing Fast**: Optimized for performance in production environments.
- **Fast**: Optimized for performance in production environments.
- **Framework Agnostic**: Integrates seamlessly with any project using the PSR-11 container interface.
- **Explicit Over Implicit**: Prioritizes explicit, readable configuration over hidden "magic", making your code easier to maintain.
- **Explicit Over Implicit**: Prioritizes explicit, readable configuration over hidden "magic", making your code easier
to maintain.
- **Lightweight**: A minimal footprint keeps your project lean and efficient.
- **Compilation Support**: Optimizes performance further with built-in compilation, including anonymous functions.
- **Autowiring**: Simplify your code with automatic dependency resolution, available even after compilation.
Expand Down
73 changes: 73 additions & 0 deletions docs/config/_default/hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
title = "Dependency Injection Container"
baseurl = "/"
canonifyURLs = false
disableAliases = true
disableHugoGeneratorInject = true
disableKinds = ["taxonomy", "term"]
enableEmoji = true
enableGitInfo = false
enableRobotsTXT = true
languageCode = "en-US"
paginate = 10
rssLimit = 10
summarylength = 20 # 70 (default)

# Multilingual
defaultContentLanguage = "en"
disableLanguages = []
defaultContentLanguageInSubdir = false

copyRight = "Copyright (c) 2024"

[build.buildStats]
enable = true

[outputs]
home = ["HTML", "searchIndex"]
section = ["HTML", "SITEMAP"]

[outputFormats.searchIndex]
mediaType = "application/json"
baseName = "search-index"
isPlainText = true
notAlternative = true

# Add output format for section sitemap.xml
[outputFormats.SITEMAP]
mediaType = "application/xml"
baseName = "sitemap"
isHTML = false
isPlainText = true
noUgly = true
rel = "sitemap"

[sitemap]
changefreq = "monthly"
filename = "sitemap.xml"
priority = 0.5

[caches]
[caches.getjson]
dir = ":cacheDir/:project"
maxAge = -1 # "30m"

#[permalinks]
# docs = "/:sections[1:]/:slug/"

[minify.tdewolff.html]
keepWhitespace = false

[related]
threshold = 80
includeNewer = true
toLower = false
[[related.indices]]
name = "date"
weight = 10

[imaging]
anchor = "Center"
bgColor = "#ffffff"
hint = "photo"
quality = 85
resampleFilter = "Lanczos"
9 changes: 9 additions & 0 deletions docs/config/_default/languages.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[en]
languageName = "English"
contentDir = "content/en"
weight = 10
[en.params]
languageISO = "EN"
languageTag = "en-US"
footer = '<a href="https://getdoks.org/" target="_blank">Doks <svg xmlns="http://www.w3.org/2000/svg" class="ms-1 mb-1 icon icon-tabler icon-tabler-external-link" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6" /><path d="M11 13l9 -9" /><path d="M15 4h5v5" /></svg></a>'
alertText = ''
33 changes: 33 additions & 0 deletions docs/config/_default/markup.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
defaultMarkdownHandler = "goldmark"

[goldmark]
[goldmark.extensions]
linkify = false
[goldmark.parser]
autoHeadingID = true
autoHeadingIDType = "github"
[goldmark.parser.attribute]
block = true
title = true
[goldmark.renderer]
unsafe = true

[highlight]
anchorLineNos = false
codeFences = true
guessSyntax = false
hl_Lines = ''
hl_inline = false
lineAnchors = ''
lineNoStart = 1
lineNos = false
lineNumbersInTable = false
noClasses = false
noHl = false
style = 'monokai'
tabWidth = 2

[tableOfContents]
endLevel = 3
ordered = false
startLevel = 2
22 changes: 22 additions & 0 deletions docs/config/_default/menus/menus.en.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[[main]]
name = "Docs"
url = "/usage/quick-start/"
weight = 10

[[main]]
name = "Issues"
url = "https://github.com/norvica/container/issues"
post = '<svg xmlns="http://www.w3.org/2000/svg" class="ms-1 mb-1 icon icon-tabler icon-tabler-external-link" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6" /><path d="M11 13l9 -9" /><path d="M15 4h5v5" /></svg>'
weight = 20

[[social]]
name = "GitHub"
pre = '<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-github" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5"></path></svg>'
url = "https://github.com/norvica/container"
post = '<svg xmlns="http://www.w3.org/2000/svg" class="ms-1 mb-1 icon icon-tabler icon-tabler-external-link" width="20" height="20" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6" /><path d="M11 13l9 -9" /><path d="M15 4h5v5" /></svg>'
weight = 30

[[footer]]
name = "MIT License"
url = "/license/"
weight = 10
88 changes: 88 additions & 0 deletions docs/config/_default/module.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# mounts
## archetypes
[[mounts]]
source = "node_modules/@hyas/doks-core/archetypes"
target = "archetypes"

[[mounts]]
source = "archetypes"
target = "archetypes"

## assets
[[mounts]]
source = "node_modules/@hyas/core/assets"
target = "assets"
# excludeFiles = ["scss/app.scss", "js/app.js"]

[[mounts]]
source = "node_modules/@hyas/images/assets"
target = "assets"

[[mounts]]
source = "node_modules/@hyas/doks-core/assets"
target = "assets"

[[mounts]]
source = "node_modules/@tabler/icons/icons"
target = "assets/svgs/tabler-icons"

[[mounts]]
source = "assets"
target = "assets"

## content
[[mounts]]
source = "content"
target = "content"

## data
[[mounts]]
source = "node_modules/@hyas/doks-core/data"
target = "data"

[[mounts]]
source = "data"
target = "data"

## i18n
[[mounts]]
source = "node_modules/@hyas/doks-core/i18n"
target = "i18n"

[[mounts]]
source = "i18n"
target = "i18n"

## layouts
[[mounts]]
source = "node_modules/@hyas/core/layouts"
target = "layouts"

[[mounts]]
source = "node_modules/@hyas/seo/layouts"
target = "layouts"

[[mounts]]
source = "node_modules/@hyas/images/layouts"
target = "layouts"

[[mounts]]
source = "node_modules/@hyas/doks-core/layouts"
target = "layouts"

[[mounts]]
source = "node_modules/@hyas/inline-svg/layouts"
target = "layouts"

[[mounts]]
source = "layouts"
target = "layouts"

## static
[[mounts]]
source = "node_modules/@hyas/doks-core/static"
target = "static"

[[mounts]]
source = "static"
target = "static"
Loading

0 comments on commit 58fc195

Please sign in to comment.