diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml
index c7fa281..ecacdc7 100644
--- a/.github/workflows/build-push.yml
+++ b/.github/workflows/build-push.yml
@@ -1,9 +1,6 @@
name: build preview
on:
- release:
- types:
- - published
pull_request:
branches:
- "*"
diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml
new file mode 100644
index 0000000..92068eb
--- /dev/null
+++ b/.github/workflows/release-build.yml
@@ -0,0 +1,24 @@
+name: Build preview on documentation repo upon release publish
+
+on:
+ release:
+ types:
+ - published
+
+env:
+ OWNER: nginx
+ REPO: documentation
+
+jobs:
+ trigger-documentation-build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Trigger 'Build and deploy' workflow in 'documentation' repo
+ run: |
+ curl -L \
+ -X POST \
+ -H "Accept: application/vnd.github+json" \
+ -H "Authorization: Bearer ${{ secrets.DOCUMENTATION_SLACK_FLOW_PAT }}" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ "https://api.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/dispatches" \
+ -d "{\"event_type\": \"trigger-preview-build\", \"client_payload\": {\"environment\": \"preview\", \"hugo_theme_override\": \"\", \"author\": \"${{ github.event.release.author.login }}\", \"tag_name\": \"${{ github.event.release.tag_name }}\", \"release_name\": \"${{ github.event.release.name }}\"}}"
\ No newline at end of file
diff --git a/.github/workflows/slack-notification.yml b/.github/workflows/slack-notification.yml
new file mode 100644
index 0000000..8eacab0
--- /dev/null
+++ b/.github/workflows/slack-notification.yml
@@ -0,0 +1,49 @@
+name: Slack notification for new theme release
+
+on:
+ repository_dispatch:
+ types: [trigger-slack-notification]
+
+permissions:
+ contents: read
+
+jobs:
+ release-notification:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ actions: read # for 8398a7/action-slack
+ checks: read
+ steps:
+ - name: Send notification
+ uses: 8398a7/action-slack@1750b5085f3ec60384090fb7c52965ef822e869e # v3.18.0
+ with:
+ status: custom
+ custom_payload: |
+ {
+ username: 'Github',
+ mention: 'channel',
+ attachments: [{
+ title: `New theme release - ${{ github.event.client_payload.release_name }}`,
+ color: '#009223',
+ fields: [
+ {
+ title: 'Tag',
+ value: ${{ github.event.client_payload.tag_name }},
+ short: true
+ },
+ {
+ title: 'Author',
+ value: ${{ github.event.client_payload.author }},
+ short: true
+ },
+ {
+ title: 'Preview URL',
+ value: ${{ github.event.client_payload.previewURL }},
+ short: true
+ }]
+ }]
+ }
+ env:
+ SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
diff --git a/layouts/_default/docs.html b/layouts/_default/docs.html
index 3b66e9a..cfd11f4 100644
--- a/layouts/_default/docs.html
+++ b/layouts/_default/docs.html
@@ -5,59 +5,8 @@
{{ partial "sidebar.html" . }}
- {{$content := .Content}}
- {{$pattern := `]*class=["'][^"']*(?:fas?|fa-solid|fa-regular|fa-brands|far)\s+fa-([^"'\s]+)[^"']*["'][^>]*?(?:\s+style=["']([^"']*)["'])?[^>]*>`}}
- {{$matches := findRE $pattern $content}}
-
- {{range $matches}}
- {{$currentMatch := .}}
- {{$iconName := ""}}
- {{$styleAttr := ""}}
-
- {{$submatches := findRESubmatch $pattern $currentMatch}}
- {{if gt (len $submatches) 0}}
- {{$iconName = index (index $submatches 0) 1}}
- {{$styleAttr = index (index $submatches 0) 2}}
-
- {{- $iconMappings := dict
- "bug-slash" "bug-off"
- "circle-info" "info"
- "info-circle" "info"
- "file-circle-plus" "file-plus"
- "check-circle" "circle-check"
- "heartbeat" "heart-pulse"
- "code-branch" "git-branch"
- "desktop" "monitor"
- "certificate" "badge"
- "cogs" "cog"
- "shield-alt" "shield-half"
- "memory" "cpu"
- "hdd" "hard-drive"
- "exclamation-triangle" "triangle-alert"
- "triangle-exclamation" "triangle-alert"
- "tachometer-alt" "circle-gauge"
- "circle-exclamation" "circle-alert"
- "arrow-up-right-from-square" "external-link"
- "pen-to-square" "square-pen"
- "flask" "flask-conical"
- -}}
-
- {{ with index $iconMappings $iconName }}
- {{$iconName = .}}
- {{ end }}
-
- {{$iconHTML := partial "lucide" (dict
- "context" $
- "icon" $iconName
- "style" $styleAttr
- )}}
-
- {{ $modifiedMatch := replaceRE `>` ` data-mf=false>` $currentMatch 1}}
- {{ $modifiedMFIcon := printf "%s %s" $modifiedMatch $iconHTML }}
- {{$content = replace $content $currentMatch $modifiedMFIcon}}
-
- {{end}}
- {{end}}
+
+ {{ $content := partial "icon-replacement.html" (dict "content" .Content) }}
{{if (.Params.catalog) }}
diff --git a/layouts/partials/icon-replacement.html b/layouts/partials/icon-replacement.html
new file mode 100644
index 0000000..8ae25c4
--- /dev/null
+++ b/layouts/partials/icon-replacement.html
@@ -0,0 +1,54 @@
+{{ $content := .content }}
+{{ $pattern := `]*class=["'][^"']*(?:fas?|fa-solid|fa-regular|fa-brands|far)\s+fa-([^"'\s]+)[^"']*["'][^>]*?(?:\s+style=["']([^"']*)["'])?[^>]*>` }}
+{{ $matches := findRE $pattern $content }}
+
+{{range $matches}}
+ {{$currentMatch := .}}
+ {{$iconName := ""}}
+ {{$styleAttr := ""}}
+
+ {{$submatches := findRESubmatch $pattern $currentMatch}}
+ {{if gt (len $submatches) 0}}
+ {{$iconName = index (index $submatches 0) 1}}
+ {{$styleAttr = index (index $submatches 0) 2}}
+
+ {{- $iconMappings := dict
+ "bug-slash" "bug-off"
+ "circle-info" "info"
+ "info-circle" "info"
+ "file-circle-plus" "file-plus"
+ "check-circle" "circle-check"
+ "heartbeat" "heart-pulse"
+ "code-branch" "git-branch"
+ "desktop" "monitor"
+ "certificate" "badge"
+ "cogs" "cog"
+ "shield-alt" "shield-half"
+ "memory" "cpu"
+ "hdd" "hard-drive"
+ "exclamation-triangle" "triangle-alert"
+ "triangle-exclamation" "triangle-alert"
+ "tachometer-alt" "circle-gauge"
+ "circle-exclamation" "circle-alert"
+ "arrow-up-right-from-square" "external-link"
+ "pen-to-square" "square-pen"
+ "flask" "flask-conical"
+ -}}
+
+ {{ with index $iconMappings $iconName }}
+ {{$iconName = .}}
+ {{ end }}
+
+ {{$iconHTML := partial "lucide" (dict
+ "context" $
+ "icon" $iconName
+ "style" $styleAttr
+ )}}
+
+ {{ $modifiedMatch := replaceRE `>` ` data-mf=false>` $currentMatch 1 }}
+ {{ $modifiedMFIcon := printf "%s %s" $modifiedMatch $iconHTML }}
+ {{ $content = replace $content $currentMatch $modifiedMFIcon }}
+ {{end}}
+{{end}}
+
+{{ return $content }}
\ No newline at end of file