Skip to content

Commit b788e8c

Browse files
committed
Fix eleventy config and publish cv
1 parent a55b0a7 commit b788e8c

1 file changed

Lines changed: 34 additions & 17 deletions

File tree

.eleventy.js

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,57 @@
11
const pluginRss = require("@11ty/eleventy-plugin-rss");
22

3-
module.exports = function(eleventyConfig) {
4-
/* ==== Static passthrough (لازم) ==== */
5-
eleventyConfig.addPassthroughCopy({ "css": "css" });
6-
eleventyConfig.addPassthroughCopy({ "js": "js" });
7-
eleventyConfig.addPassthroughCopy({ "img": "img" });
8-
eleventyConfig.addPassthroughCopy({ "files": "files" }); // لو موجود
9-
10-
/* ==== Watch targets ==== */
3+
module.exports = function (eleventyConfig) {
4+
// Static passthrough
5+
eleventyConfig.addPassthroughCopy("css");
6+
eleventyConfig.addPassthroughCopy("js");
7+
eleventyConfig.addPassthroughCopy("img");
8+
eleventyConfig.addPassthroughCopy("files");
9+
10+
// Watch targets
1111
eleventyConfig.addWatchTarget("css");
1212
eleventyConfig.addWatchTarget("js");
1313
eleventyConfig.addWatchTarget("img/showreel");
1414

15-
/* ==== RSS filters & fixes (علاج absoluteUrl/htmlDate/readableDate) ==== */
15+
// RSS plugin + filters
1616
eleventyConfig.addPlugin(pluginRss);
17-
eleventyConfig.addFilter("absoluteUrl", (url, base) => pluginRss.absoluteUrl(url, base));
17+
18+
eleventyConfig.addFilter("absoluteUrl", (url, base) =>
19+
pluginRss.absoluteUrl(url, base)
20+
);
21+
1822
eleventyConfig.addFilter("htmlDateString", (dateObj) => {
19-
try { return new Date(dateObj).toISOString(); } catch { return ""; }
23+
try {
24+
return new Date(dateObj).toISOString();
25+
} catch {
26+
return "";
27+
}
2028
});
29+
2130
eleventyConfig.addFilter("readableDate", (dateObj) => {
2231
try {
2332
const d = new Date(dateObj);
24-
return new Intl.DateTimeFormat("en-GB", { day:"2-digit", month:"short", year:"numeric" }).format(d);
25-
} catch { return ""; }
33+
return new Intl.DateTimeFormat("en-GB", {
34+
day: "2-digit",
35+
month: "short",
36+
year: "numeric",
37+
}).format(d);
38+
} catch {
39+
return "";
40+
}
2641
});
2742

28-
/* ==== tagList collection (عشان tags.njk ما يهنّش) ==== */
43+
// tagList collection
2944
eleventyConfig.addCollection("tagList", (collectionsApi) => {
3045
const set = new Set();
31-
collectionsApi.getAll().forEach(item => (item.data.tags || []).forEach(t => set.add(t)));
46+
collectionsApi.getAll().forEach((item) => {
47+
(item.data.tags || []).forEach((t) => set.add(t));
48+
});
3249
return [...set];
3350
});
3451

35-
/* ==== Server options (نقفل liveReload اللي كان عامل RSV1) ==== */
52+
// Eleventy config
3653
return {
3754
dir: { input: ".", includes: "_includes", data: "_data", output: "_site" },
38-
serverOptions: { liveReload: false, domDiff: false, port: 8087 }
55+
serverOptions: { liveReload: false, domDiff: false, port: 8087 },
3956
};
4057
};

0 commit comments

Comments
 (0)