Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ede2965
Create index.html
automationxpert Dec 31, 2025
d337398
Revise HTML structure and update book titles
automationxpert Dec 31, 2025
a942555
make it npm supportable
automationxpert Dec 31, 2025
ce660e8
adding the template html file that was Missed
automationxpert Dec 31, 2025
49c2a31
Update build.js
automationxpert Dec 31, 2025
255e10a
fix path
automationxpert Dec 31, 2025
6b2f244
Update the build logic
automationxpert Dec 31, 2025
f3b890c
Refactor template.html for improved styling and functionality
automationxpert Dec 31, 2025
f4a6663
Merge pull request #1 from automationxpert/site
automationxpert Dec 31, 2025
8e36827
Improve display name formatting in build.js
automationxpert Dec 31, 2025
ae25f5f
Fix formatting and update links in README.md
automationxpert Dec 31, 2025
cadbbe4
Merge pull request #2 from automationxpert/site
automationxpert Jan 1, 2026
95fa4a5
Refactor: Organize PDFs into books folder with standardized naming co…
automationxpert Jan 18, 2026
ec66d40
Refactor code structure for improved readability and maintainability
automationxpert Jan 18, 2026
232502f
Fix: Update BOOKS_DIR path to point to the books folder
automationxpert Jan 18, 2026
68f1b1c
Merge pull request #3 from automationxpert/site
automationxpert Jan 18, 2026
32d5895
Add GitHub Actions workflow for building project
automationxpert Jan 18, 2026
666808a
Change build script command to use node
automationxpert Jan 18, 2026
8b1ec2e
Improve display name formatting and update links
automationxpert Jan 18, 2026
3522fd3
Add GitHub Actions workflow for deploying pages
automationxpert Jan 18, 2026
426fd83
Rename deploy to deploy.yml
automationxpert Jan 18, 2026
abc979d
Uodate Readme for the static site
automationxpert Jan 18, 2026
fe9a1a8
Clean up README.md formatting
automationxpert Jan 18, 2026
502f402
Revamp DevOps Books Library layout and theme
automationxpert Jan 19, 2026
69a14ca
Enhance build.js for better template and repo URL handling
automationxpert Jan 21, 2026
01d5867
Refactor template.html for improved structure and styles
automationxpert Jan 21, 2026
81ea3b2
Update tag rules with additional keywords
automationxpert Jan 21, 2026
28f5b1d
Merge pull request #4 from automationxpert/new-features
automationxpert Jan 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy Pages

on:
push:
branches: [ main ]

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 24

- run: node build.js

- uses: actions/upload-pages-artifact@v3
with:
path: .

- uses: actions/deploy-pages@v4
214 changes: 120 additions & 94 deletions README.md

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 51 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const fs = require("fs");
const path = require("path");

const BOOKS_DIR = path.join(__dirname, "books/");
const TEMPLATE_FILE = "template.html";

// 1. Repo URL Logic - Accurate and filtered
let repoUrl = "#";
if (process.env.GITHUB_REPOSITORY) {
repoUrl = `https://github.com/${process.env.GITHUB_REPOSITORY}`;
} else if (process.env.REPOSITORY_URL) {
repoUrl = process.env.REPOSITORY_URL;
}

try {
if (!fs.existsSync(TEMPLATE_FILE)) throw new Error("template.html missing");

const TEMPLATE = fs.readFileSync(TEMPLATE_FILE, "utf8");

// 2. Original Book Scanning Logic
const files = fs
.readdirSync(BOOKS_DIR)
.filter(f => f.toLowerCase().endsWith(".pdf"))
.sort();

// 3. Generate <a> tags (The template handles the Card UI)
const listItems = files.map(file => {
const encoded = encodeURIComponent(file);
// Preserving your exact naming logic
const displayName = file
.replace(/\.pdf$/i, "")
.replace(/_/g, " ")
.replace(/[_-]+/g, " ")
.replace(/\s+/g, " ")
.trim();

return `<a href="books/${encoded}">${displayName}</a>`;
}).join("\n");

// 4. Injection
let output = TEMPLATE
.replace("{{BOOK_LIST}}", listItems)
.replace("{{REPO_URL}}", repoUrl);

fs.writeFileSync("index.html", output);

console.log(`Successfully built library for: ${repoUrl}`);
} catch (err) {
console.error("Build failed:", err.message);
process.exit(1);
}
72 changes: 72 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DevOps Books Library</title>

<style>
body {
font-family: Arial, Helvetica, sans-serif;
background: #f4f6f8;
margin: 0;
}
header {
background: #0f172a;
color: white;
padding: 40px 20px;
text-align: center;
}
#search {
display: block;
margin: 20px auto;
width: 300px;
padding: 10px 15px;
border-radius: 25px;
}
ul {
max-width: 1100px;
margin: auto;
padding: 20px;
list-style: none;
}
li {
background: #fff;
margin-bottom: 8px;
border-radius: 6px;
}
a {
display: block;
padding: 12px 16px;
text-decoration: none;
color: #1e293b;
}
a:hover {
background: #eef2ff;
}
</style>

<script>
function search() {
const q = document.getElementById('search').value.toLowerCase();
document.querySelectorAll('li').forEach(li => {
li.style.display = li.innerText.toLowerCase().includes(q) ? '' : 'none';
});
}
</script>
</head>

<body>
<header>
<h1>📘 DevOps Books Library</h1>
<p>Auto-updated on every deployment</p>
</header>

<input id="search" placeholder="Search books…" onkeyup="search()">

<ul>
{{BOOK_LIST}}
</ul>

</body>
</html>
3 changes: 3 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build]
command = "npm run build"
publish = "."
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "devops-books",
"version": "1.0.0",
"scripts": {
"build": "node build.js"
}
}
Loading