Commit Graph

5 Commits

Author SHA1 Message Date
google-labs-jules[bot]
2e308ed606
Optimize Google Scholar Citations Regex Definition (#3449)
💡 **What:** Moved the regex definition `/Cited by (\d+[,\d]*)/` from the
method scope to a class-level constant `CITED_BY_REGEX`.

🎯 **Why:** To improve code cleanliness and avoid potential re-definition
of the regex object in every method call (or loop), adhering to best
practices.

📊 **Measured Improvement:**
* **Baseline:** The regex was defined as a literal inside the `render`
method, which is called for each tag usage.
*   **Optimization:** The regex is now defined once as a constant.
* **Note:** Performance benchmarks were not possible in the current
environment due to missing Ruby runtime. However, this is a standard
Ruby optimization that improves maintainability and theoretically avoids
object allocation overhead in older Ruby versions or complex scenarios.
Modern Ruby optimizes literals well, but the constant approach is
cleaner and DRYer.

---
*PR created automatically by Jules for task
[10688912524063334698](https://jules.google.com/task/10688912524063334698)
started by @alshedivat*

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-01-15 21:41:10 -08:00
George
5bc4703a76
Fix google scholar citations (#2893)
Signed-off-by: George Araújo <george.gcac@gmail.com>
2024-12-12 15:17:49 -03:00
George
08d562a104
Offline mode (closes #1181) (#2312)
Created a plugin to tackle #1181. Currently have an issue with tikzjax
since it imports some wasm file from its javascript. The rest should
work as expected.

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
2024-04-08 14:51:28 -03:00
George
b4e423286b
Fixed bug when number has , on scholar citations 2024-02-13 13:56:13 -03:00
George
a0bcaaf13f
Added support for google scholar citations (#2193)
Closes #1809, but there are caveats:
1 - it only works at build time, which means it won't update the numbers
unless you build your site again
2 - Google might block the request if it receives lots of it, failing
the whole process.

This is how it looks like when it can fetch the information:

![Screenshot from 2024-02-13
00-37-52](https://github.com/alshedivat/al-folio/assets/31376482/646d1f3c-1294-491b-bc13-9013e38918b4)

And this when it fails:


![image](https://github.com/alshedivat/al-folio/assets/31376482/516eefff-d394-44ad-8702-8982233f8c4f)

Signed-off-by: George Araujo <george.gcac@gmail.com>
2024-02-13 13:47:42 -03:00