-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Features - Automated data push to Algolia search engine via GitHub Actions. - Added new Hugo theme submodule for Algolia integration. - Enhanced security and access control in device provisioning service. - Updated disaster recovery documentation with improved backup approaches and DNS/IP handling. - Added HTML structure to the main website layout for better content rendering. - Introduced a script for managing data push to Algolia. Bug Fixes - Corrected a typo in the dashboard branding tutorial. - Fixed a formatting issue in the device provisioning service documentation. Chores - Updated .gitignore and .gitmodules configurations. - Updated subproject commit references for theme integration. --------- Co-authored-by: Patrik Matiaško <[email protected]> Co-authored-by: Jozef Kralik <[email protected]>
- Loading branch information
1 parent
ae4d0c9
commit bbae8a4
Showing
14 changed files
with
1,977 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Algolia Push | ||
|
||
#tmp just for developing | ||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# fetch branches and history so `git merge-base` in check-format-on-diff works correctly | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "^1.20" # The Go version to download (if necessary) and use. | ||
check-latest: true | ||
|
||
- name: Install npm dependencies | ||
run: npm install -g --legacy-peer-deps hugo-algolia | ||
|
||
- name: Check if hugo-algolia is installed | ||
run: hugo-algolia --version | ||
|
||
- name: Generate algolia.json | ||
run: | | ||
mkdir -p public | ||
hugo-algolia --config config/_default/config.yaml | ||
- name: Build Go binary | ||
run: | | ||
cd tools/adjust-algolia-output | ||
go build -o /usr/local/bin/adjust-algolia-output | ||
- name: Adjust algolia.json using binary | ||
run: adjust-algolia-output < ./public/algolia.json | jq > public/algolia_final.json | ||
|
||
- name: Install Node.js | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Push to Algolia | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
run: | | ||
cd scripts | ||
npm install algoliasearch | ||
APPLICATION_ID=${{ secrets.ALGOLIA_APPLICATION_ID }} API_KEY=${{ secrets.ALGOLIA_API_KEY }} node push-to-algolia.js ../public/algolia_final.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ nohup.out | |
trace.out | ||
.idea | ||
node_modules | ||
.hugo_build.lock | ||
.hugo_build.lock | ||
adjust-algolia-output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
{{ with .GetPage "docs/" }}{{ .Render }}{{ end }} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>{{ .Title }}</title> | ||
</head> | ||
<body> | ||
<!-- <header>--> | ||
<!-- <h1>{{ .Title }}</h1>--> | ||
<!-- </header>--> | ||
<main> | ||
<!-- Your home page content goes here --> | ||
{{ with .GetPage "docs/" }}{{ .Render }}{{ end }} | ||
</main> | ||
<footer> | ||
<!-- Footer content goes here --> | ||
</footer> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const algoliasearch = require('algoliasearch'); | ||
const fs = require('fs'); | ||
|
||
// Initialize Algolia client | ||
const client = algoliasearch(process.env.APPLICATION_ID, process.env.API_KEY); | ||
const index = client.initIndex('doc'); | ||
|
||
|
||
process.argv.forEach((val, index) => { | ||
console.log(`args ${index}: ${val}`); | ||
}); | ||
|
||
// Read JSON file | ||
const jsonData = fs.readFileSync(process.argv[2], 'utf8'); | ||
|
||
// Parse JSON data | ||
const records = JSON.parse(jsonData); | ||
|
||
// Clear the existing index | ||
index.clearObjects() | ||
.then(() => { | ||
console.log('Existing records cleared'); | ||
// Add or update records in Algolia index | ||
return index.saveObjects(records, { autoGenerateObjectIDIfNotExist: true }); | ||
}) | ||
.then(({ objectIDs }) => { | ||
console.log('Records added/updated:', objectIDs); | ||
}) | ||
.catch(error => { | ||
console.error('Error adding/updating records:', error); | ||
}); | ||
|
Submodule plgd
updated
from 6ea8a1 to eb3f6a
Oops, something went wrong.