Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 21 additions & 2 deletions .github/workflows/update-search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: Update Search Database

on:
schedule:
- cron: '0 */4 * * *' # Run every 4 hours
- cron: '0 */12 * * *' # Run every 12 hours
workflow_dispatch: # Allow manual trigger
push:
branches: [ main ]
paths:
- '**/*.md'
- '**/*.html'
- 'scripts/generate_search_db.rb'
- 'scripts/fetch_blog_content.js'
- 'scripts/package.json'

jobs:
update-search:
Expand All @@ -24,13 +26,30 @@ jobs:
ruby-version: '3.2'
bundler-cache: true

- name: Install dependencies
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: scripts/package-lock.json

- name: Install Ruby dependencies
run: |
gem install bundler
bundle config path vendor/bundle
bundle install
gem install nokogiri

- name: Install Node.js dependencies
run: |
cd scripts
npm ci

- name: Fetch blog content
run: |
cd scripts
node fetch_blog_content.js

- name: Generate search database
run: ruby scripts/generate_search_db.rb

Expand Down
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Jekyll build output
_site/
.sass-cache/
.jekyll-cache/
Expand All @@ -10,3 +11,28 @@ vendor/
.cursorrules
**/copilot-instructions.md
.DS_Store

# Node.js dependencies
node_modules/
scripts/node_modules/
scripts/package-lock.json
scripts/blog_content.json

# IDE and editor files
.idea/
.vscode/
*.swp
*.swo
*~

# OS generated files
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Search database (generated file)
assets/js/search_db.json
_site/assets/js/search_db.json
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ A static website for the Computational Multiphase Physics Laboratory, built with
[![DOI](https://img.shields.io/static/v1.svg?style=flat-square&label=DOI&message=NUMBER&color=orange)](URL)
[![JFM](https://img.shields.io/static/v1.svg?style=flat-square&label=JFM&message=Open%20Access&color=orange)](URL)
[![GitHub](https://img.shields.io/badge/GitHub-100000?style=flat-square&logo=github&logoColor=white)](URL)
[![Blog](https://img.shields.io/badge/Blog-Coming%20Soon-yellow?style=flat-square&logo=obsidian&logoColor=white)](URL)
[![Blog](https://img.shields.io/badge/Blog-blogs.comphy--lab.org-blue?style=flat-square&logo=obsidian&logoColor=white)](https://blogs.comphy-lab.org)
```

### Search Functionality
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<li><a href="/team/">Team</a></li>
<li><a href="/research">Research</a></li>
<li><a href="/join">Join Us</a></li>
<li><a href="https://blogs-comphy-lab.org/" target="_blank">Blog <i class="fa-solid fa-arrow-up-right-from-square" style="font-size: 0.8em;"></i></a></li>
<li><a href="https://blogs.comphy-lab.org/">Blog</a></li>
<li style="background: none;"><a href="https://bsky.app/profile/comphy-lab.org" style="background: none; padding: 0;"><i class="fa-brands fa-bluesky" style="font-size: 1.75em; color: #0085ff;"></i></a></li>
<!-- Search Container -->
<li class="search-container">
Expand Down
7 changes: 4 additions & 3 deletions _layouts/research.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@
<li><a href="/#about">About</a></li>
<li><a href="/team">Team</a></li>
<li><a href="/research">Research</a></li>
<li><a href="https://blogs-comphy-lab.org/" target="_blank">Blog <i class="fa-solid fa-arrow-up-right-from-square" style="font-size: 0.8em;"></i></a></li>
<li><a href="/join">Join Us</a></li>
<li><a href="https://blogs.comphy-lab.org/">Blog</a></li>
<li style="background: none;"><a href="https://bsky.app/profile/comphy-lab.org" style="background: none; padding: 0;"><i class="fa-brands fa-bluesky" style="font-size: 1.75em; color: #0085ff;"></i></a></li>
<!-- Search Container -->
<li class="search-container">
Expand Down Expand Up @@ -362,7 +363,7 @@ <h3>Contents</h3>
// Handle inline badges
const paragraphs = researchContent.getElementsByTagName('p');
for (let p of paragraphs) {
const badges = p.querySelectorAll('a[href*="arxiv.org"], a[href*="github.com"], a[href*="blogs-comphy-lab.org"]');
const badges = p.querySelectorAll('a[href*="arxiv.org"], a[href*="github.com"], a[href*="blogs.comphy-lab.org"]');
if (badges.length > 0) {
const badgeContainer = document.createElement('span');
badgeContainer.className = 'badge-container';
Expand All @@ -380,7 +381,7 @@ <h3>Contents</h3>
}
} else if (node.nodeType === 1) { // Element node
const href = node.getAttribute('href');
if (!href || (!href.includes('arxiv.org') && !href.includes('github.com') && !href.includes('blogs-comphy-lab.org'))) {
if (!href || (!href.includes('arxiv.org') && !href.includes('github.com') && !href.includes('blogs.comphy-lab.org'))) {
textContent += node.outerHTML;
hasNonBadgeContent = true;
}
Expand Down
3 changes: 2 additions & 1 deletion _layouts/team.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
<li><a href="/#about">About</a></li>
<li><a href="/team">Team</a></li>
<li><a href="/research">Research</a></li>
<li><a href="https://blogs-comphy-lab.org/" target="_blank">Blog <i class="fa-solid fa-arrow-up-right-from-square" style="font-size: 0.8em;"></i></a></li>
<li><a href="/join">Join Us</a></li>
<li><a href="https://blogs.comphy-lab.org/">Blog</a></li>
<li style="background: none;"><a href="https://bsky.app/profile/comphy-lab.org" style="background: none; padding: 0;"><i class="fa-brands fa-bluesky" style="font-size: 1.75em; color: #0085ff;"></i></a></li>
<!-- Search Container -->
<li class="search-container">
Expand Down
Loading
Loading