forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 4
Spring 26 Changes and GitHub autoinclude #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4803752
Update dogan.md
kastnerp 06a758a
Team Updates
kastnerp 47c5691
Team Updates
kastnerp 3b95412
Merge branch 'dev' of https://github.com/SustainableUrbanSystemsLab/S…
kastnerp 25e128a
Update thach.md
kastnerp fe3434b
Update gomez.md
kastnerp d794509
GitHub profile autoinclude
kastnerp ddf7482
GitHub autoinclude
kastnerp 90ed785
Update yang.md
kastnerp 8527f83
fixed run files
kastnerp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,8 @@ | ||
| {% assign readme_offset = include.offset | default: 0 %} | ||
| {% assign readme_limit = include.limit | default: 100 %} | ||
| {% assign readme_content = include.github | github_profile_readme: readme_offset, readme_limit %} | ||
| {% if readme_content and readme_content != "" %} | ||
| <div class="github-readme mt-4"> | ||
| {{ readme_content | markdownify }} | ||
| </div> | ||
| {% endif %} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,59 @@ | ||
| require 'open-uri' | ||
|
|
||
| module Jekyll | ||
| module GithubProfileReadme | ||
| @@readme_cache = {} | ||
|
|
||
| def github_profile_readme(username, offset = 0, limit = nil) | ||
| handle = sanitize_github_handle(username) | ||
| return '' if handle.empty? | ||
|
|
||
| content = fetch_readme(handle) | ||
| return '' if content.nil? || content.strip.empty? | ||
|
|
||
| lines = content.split(/\r?\n/) | ||
| offset_i = offset.to_i | ||
| limit_i = limit.nil? ? nil : limit.to_i | ||
|
|
||
| lines = lines.drop(offset_i) if offset_i.positive? | ||
| lines = lines.take(limit_i) if limit_i && limit_i.positive? | ||
|
|
||
| lines.join("\n") | ||
| end | ||
|
|
||
| private | ||
|
|
||
| def sanitize_github_handle(username) | ||
| return '' if username.nil? | ||
| username.to_s.strip.sub(/\A@/, '') | ||
| end | ||
|
|
||
| def fetch_readme(handle) | ||
| return @@readme_cache[handle] if @@readme_cache.key?(handle) | ||
|
|
||
| urls = [ | ||
| "https://raw.githubusercontent.com/#{handle}/#{handle}/refs/heads/main/README.md", | ||
| "https://raw.githubusercontent.com/#{handle}/#{handle}/refs/heads/master/README.md" | ||
| ] | ||
|
|
||
| content = nil | ||
| urls.each do |url| | ||
| begin | ||
| content = URI.open(url, "User-Agent" => "Jekyll").read | ||
| break if content && !content.strip.empty? | ||
| rescue OpenURI::HTTPError, SocketError, Timeout::Error, Errno::ECONNRESET, | ||
| Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, | ||
| Errno::ENETUNREACH | ||
| content = nil | ||
| rescue StandardError | ||
| content = nil | ||
| end | ||
| end | ||
|
|
||
| @@readme_cache[handle] = content | ||
| content | ||
| end | ||
| end | ||
| end | ||
|
|
||
| Liquid::Template.register_filter(Jekyll::GithubProfileReadme) | ||
This file contains hidden or 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 hidden or 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,12 @@ | ||
| --- | ||
| layout: page | ||
| title: Aura Carroll # https://github.com/Aura-Carroll | ||
| description: BArch Architecture | ||
| img: https://avatars.githubusercontent.com/u/256623668?v=4 | ||
| importance: 74 | ||
| category: Lab | ||
| --- | ||
|
|
||
| <div class="profile mb-3"> | ||
| <img src="https://avatars.githubusercontent.com/u/256623668?v=4" class="img-fluid z-depth-1 rounded"/> | ||
| </div> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,12 @@ | ||
| --- | ||
| layout: page | ||
| title: Aiko Hayashi | ||
| description: BArch Architecture | ||
| img: https://avatars.githubusercontent.com/u/188734734?v=4 | ||
| importance: 71 | ||
| category: Lab | ||
| --- | ||
|
|
||
| <div class="profile mb-3"> | ||
| <img src="https://avatars.githubusercontent.com/u/188734734?v=4" class="img-fluid z-depth-1 rounded"/> | ||
| </div> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,20 @@ | ||
| --- | ||
| layout: page | ||
| title: Arthur Thach | ||
| description: MS Computer Science | ||
| img: https://avatars.githubusercontent.com/u/109921292?v=4 | ||
| importance: 44 | ||
| category: Lab | ||
| --- | ||
|
|
||
| <div class="profile mb-3 float-right mb-3"> | ||
| <img src="https://avatars.githubusercontent.com/u/109921292?v=4" class="img-fluid z-depth-1 rounded"/> | ||
| </div> | ||
|
|
||
|
|
||
| {% capture remote_content %}{% remote_include https://raw.githubusercontent.com/AtharvaBeesen/AtharvaBeesen/refs/heads/main/README.md %}{% endcapture %} | ||
| {% assign lines = remote_content | split: ' | ||
| ' %} | ||
| {% for line in lines offset: 1 limit: 100 %} | ||
| {{ line }} | ||
| {% endfor %} |
This file contains hidden or 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 hidden or 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 hidden or 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,5 +1,10 @@ | ||
| REM Stop all running Docker containers | ||
| FOR /f "tokens=*" %%i IN ('docker ps -q') DO docker stop %%i | ||
| @echo off | ||
| setlocal | ||
|
|
||
| REM Stop only this project's containers | ||
| docker compose down --remove-orphans | ||
|
|
||
| REM Pull latest base images, then build and serve | ||
| docker compose pull | ||
| docker compose build | ||
| docker compose up | ||
| PAUSE |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / CodeQL
Use of `Kernel.open` or `IO.read` or similar sinks with a non-constant value Critical
Copilot Autofix
AI 26 days ago
In general, the fix is to avoid
URI.openwith a dynamic argument and instead either (a) construct aURIobject explicitly and callopenon it, which avoids theKernel.openresolution that static analysis tools complain about, or (b) use a dedicated HTTP client (such asNet::HTTP) to fetch remote content. Both approaches make the intent explicit and avoid the ambiguousURI.openshortcut.For this specific code, the minimal, behavior-preserving change is to replace
URI.open(url, "User-Agent" => "Jekyll").readwithURI(url).open("User-Agent" => "Jekyll").read. This continues to useopen-uri(already required at the top of the file), preserves the customUser-Agentheader, and keeps the same exception-handling behavior, while addressing the CodeQL complaint. No other parts of the file need to change, and no new imports are required becauserequire 'open-uri'already brings inURIextensions.Concretely, in
_plugins/github-profile-readme.rb, insidefetch_readme(handle), change line 42 fromcontent = URI.open(url, "User-Agent" => "Jekyll").readtocontent = URI(url).open("User-Agent" => "Jekyll").read. No additional methods, helper functions, or definitions are needed.