Skip to content

Commit 5bc941a

Browse files
committed
17.0 RC1
- recursive search for css and js files - url encoder/decoder webutil - error mesages - style changes to webutils - minor changes
1 parent a4fc4f5 commit 5bc941a

19 files changed

Lines changed: 180 additions & 75 deletions

File tree

.eleventy.js

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,54 @@
1+
const fs = require("fs");
2+
const path = require("path");
13
const { EleventyRenderPlugin } = require("@11ty/eleventy");
24

5+
function findFileInDir(dir, filename) {
6+
let files = fs.readdirSync(dir);
7+
8+
for (const file of files) {
9+
let filepath = path.join(dir, file);
10+
11+
if (fs.statSync(filepath).isDirectory()) {
12+
let result = findFileInDir(filepath, filename);
13+
if (result) return result;
14+
} else if (path.basename(filepath) === filename) {
15+
return filepath;
16+
}
17+
}
18+
19+
return null;
20+
}
21+
322
module.exports = function (eleventyConfig) {
423
eleventyConfig.addPlugin(EleventyRenderPlugin);
524

6-
eleventyConfig.addPassthroughCopy("./src/static/js/**");
7-
eleventyConfig.addPassthroughCopy("./assets/**");
25+
eleventyConfig.addPassthroughCopy("./src/static/js");
26+
eleventyConfig.addPassthroughCopy("./assets");
827
eleventyConfig.addPassthroughCopy("**.data.json");
9-
eleventyConfig.addGlobalData('repo', async () => fetch('https://api.github.com/repos/11ty/eleventy'));
1028
eleventyConfig.setDataFileSuffixes([".data", ""]);
29+
eleventyConfig.setQuietMode(true);
1130
eleventyConfig.setServerOptions({
12-
watch: ["_site/static/**"]
31+
watch: ["_site/static/css/**"]
1332
});
1433

1534
eleventyConfig.addShortcode("addScript", function (filename) {
16-
return `<script src="/static/js/app/${filename}.js"></script>`;
35+
let filepath = findFileInDir("./src/static/js", `${filename}.js`);
36+
if (filepath) {
37+
return `<script src="${filepath.replace('src', '')}"></script>`;
38+
}
39+
40+
console.log(`JS file ${filename} not found in ./src/static/js`);
41+
return '';
1742
});
1843

1944
eleventyConfig.addShortcode("addStyle", function (filename) {
20-
return `<link rel="stylesheet" href="/static/css/app/${filename}.css">`;
45+
let filepath = findFileInDir("./src/static/css", `${filename}.sass`);
46+
if (filepath) {
47+
return `<link rel="stylesheet" href="${filepath.replace('src', '').replace('.sass', '.css')}">`;
48+
}
49+
50+
console.log(`JS file ${filename} not found in ./src/static/js`);
51+
return '';
2152
});
2253

2354
eleventyConfig.addShortcode("keywords", function() {

package-lock.json

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/content/collections/experience/grado.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: universidad de oviedo
33
role: computer engineering degree
44
period: 2020-2024 (expected)
5-
logo: 'epi'
5+
logo: epi
66
---
77

88
**grades:** 3.0 GPA, <b style="color: gold;"><i>12 honors</i></b>
@@ -19,4 +19,4 @@ some relevant projects and assignments:
1919
- [network and binary analysis in Assembly and C](https://github.com/miermontoto/HackingForce).
2020
- [RPC, MOM and consensus/sync algorithms in C](https://github.com/miermontoto/Distribuidos/tree/main/PL/entregas/entrega1).
2121
- data analysis and manipulation in [R](https://github.com/miermontoto/Estadistica/tree/main/PL) and [MATLAB](https://github.com/miermontoto/Computacion/tree/main/PL).
22-
- [cybersecurity, digital signing and certificates in C#](https://github.com/miermontoto/Seguridad/tree/master/PL)
22+
- [cybersecurity, digital signing and certificates in C#](https://github.com/miermontoto/Seguridad/tree/master/PL).

src/content/collections/experience/okticket.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ period: 2023 (3 months)
55
icons: [fa-brands fa-laravel fa-solid, fa-brands fa-php, fa-brands fa-docker, devicon-ruby-plain]
66
class: okticket
77
---
8-
extracurricular internship at *okticket*, a Fintech SaaS that digitizes and manages employee tickets.
8+
extracurricular internship at *okticket*, a fintech SaaS that digitizes and manages employee tickets.
99

1010
---
1111

12-
- back-end system migration (laravel 10, PHP 8.2, composer 2)
12+
- back-end system migration (laravel 10, PHP 8.2, composer 2).
1313
- local deploy automation with Docker and Ruby.
1414
- load and stress tests with [Locust](https://locust.io/).
15-
- implementation of code styling and linting tools such as [duster](https://github.com/tighten/duster)
15+
- implementation of code styling and linting tools such as [duster](https://github.com/tighten/duster).
1616
- deployment of brand new features to testing environments in Mexico.
1717
- general back-end and development tasks.

src/content/collections/projects/gti.njk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ source: https://github.com/search?q=repo%3Amiermontoto%2Fmiermontoto+gti.&type=c
1414
<span id="correct">0</span> / <span id="total">?</span>
1515
<span id="">→</span>
1616
<span id="scored"><span id="score">0</span>%</span>
17+
<noscript class=".error">ERROR: JavaScript is NEEDED for the quiz to work!</noscript>
1718
</div>
1819
<span class="button" id="reset">reset</span>
1920

src/content/collections/projects/webutils.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: webutils
3-
desc: wip!!
3+
desc: 'small collection of web utilities: md5, base64, url encode/decode, etc.'
44
icons: [devicon-javascript-plain]
55
permalink: /webutils/
66
demo: /webutils/

src/content/collections/webutils/base64.njk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
{% addStyle 'webutils' %}
33

44
<div id="decoded">
5-
<textarea class="input" id="decoded-text" placeholder="Plain text"></textarea>
6-
<span class="button" id="decoded-copy">⎘</span>
5+
<textarea class="input" id="decoded-text" placeholder="plain text"></textarea>
6+
{# <span class="button" id="decoded-copy">⎘</span> #}
77
</div>
88
<span><=></span>
99
<div id="encoded">
10-
<textarea class="output" id="encoded-text" placeholder="Encoded text"></textarea>
11-
<span class="button" id="encoded-copy">⎘</span>
10+
<textarea class="output" id="encoded-text" placeholder="encoded text"></textarea>
11+
{# <span class="button" id="encoded-copy">⎘</span> #}
1212
</div>

src/content/collections/webutils/md5.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
{% addScript 'md5' %}
33
{% addStyle 'webutils' %}
44

5-
<input id="md5-input" class="input" type="text" placeholder="String to hash using MD5">
5+
<input id="md5-input" class="input" type="text" placeholder="string to hash using MD5">
66
<span id="md5-output" class="output"></span>
77
<span class="button" id="md5-copy">copy</span>

src/content/collections/webutils/tiny.njk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<input type="checkbox" id="tiny-ignore">
66
<label for="tiny-ignore">Ignore untinifyable content</label>
77
</div>
8-
<input class="input" id="tiny-input" type="text" placeholder="String to tinify">
8+
<input class="input" id="tiny-input" type="text" placeholder="string to tinify">
9+
<br>
910
<span class="output" id="tiny-output"></span>
1011
<span class=button id="tiny-copy">copy</span>

0 commit comments

Comments
 (0)