Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8219fd0
feat: migrate blog posts from ipynb/md to qmd format
Shivampal157 Mar 3, 2026
6f2b54a
fix: add docstring and fix line length in convert script
Shivampal157 Mar 3, 2026
98acf8e
fix: apply ruff formatting
Shivampal157 Mar 3, 2026
085b7d1
fix: fix trailing whitespace, end of file and prettier formatting
Shivampal157 Mar 3, 2026
14e9e42
fix: fix trailing whitespace, end of file and prettier formatting
Shivampal157 Mar 4, 2026
7db059f
fix: add quarto to conda dependencies for CI
Shivampal157 Mar 4, 2026
22cee0b
fix: remove convert script and legacy ipynb files from blog folders
Shivampal157 Mar 5, 2026
526c2e7
fix: fix quarto render command in makim.yaml
Shivampal157 Mar 5, 2026
f512261
ci: fix pre-commit flag and conda warning for setup-miniconda
Shivampal157 Mar 5, 2026
4237ea3
ci: activate conda in Linter and Build steps, set -e in pre-build
Shivampal157 Mar 5, 2026
934d156
ci: use bash -el so conda env is active in all steps (setup-miniconda…
Shivampal157 Mar 5, 2026
fc1eca3
update artbox link
xmnlab Mar 12, 2026
8832951
roll back check-broken-links-internal.py
xmnlab Mar 12, 2026
111745b
Update blog list and fix makim.yaml
xmnlab Mar 12, 2026
f26053a
fix: preserve YAML front matter in Quarto GFM output and fail if quar…
Shivampal157 Mar 12, 2026
5de34e3
fix: inject YAML from .qmd into generated .md so metadata header is a…
Shivampal157 Mar 12, 2026
18af6f1
fix: preserve intro content when injecting YAML (body after Quarto he…
Shivampal157 Mar 12, 2026
071a175
ci: run pre-build before Linter and skip mkdocs-build in pre-commit o…
Shivampal157 Mar 12, 2026
b184279
chore: add _quarto.yml for GFM YAML preservation and document blog md…
Shivampal157 Mar 13, 2026
866059f
chore: sync rendered blog index.md from qmd (YAML preserved)
Shivampal157 Mar 13, 2026
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
15 changes: 12 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ jobs:
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
# bash -el required so conda activation persists (README: IMPORTANT)
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -45,18 +46,26 @@ jobs:
activate-environment: osl-web
auto-update-conda: true
conda-solver: libmamba
conda-remove-defaults: true

- name: Install dependencies
run: |
poetry check
poetry install
python -m nltk.downloader punkt

# Render blog .qmd → .md so Build uses correct index.md (with YAML)
- name: Pre-build blog (quarto + inject)
run: makim pages.pre-build

# Skip mkdocs-build in pre-commit so we don't fail when repo's md != pre-build output
- name: Linter
if: ${{ github.event_name == 'pull_request' }}
env:
PRE_COMMIT_SKIP: mkdocs-build
run: |
pre-commit install
pre-commit run --all-file --verbose
pre-commit run --all-files --verbose

- name: Build the book
run: |
Expand Down
25 changes: 19 additions & 6 deletions .makim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,32 @@ groups:
help: pre-build step
backend: bash
run: |
set -e
mkdir -p build
# Directory to search for .ipynb files
# Directory to search for blog sources
export SEARCH_DIR="pages/blog"

# Find all .ipynb files, excluding .ipynb_checkpoints,
# and convert them to Markdown named 'index.md'
# 1) Convert legacy .ipynb posts to Markdown (for now)
# This keeps existing notebook-based posts working while we
# migrate everything to Quarto.
find "$SEARCH_DIR" -path "*/.ipynb_checkpoints/*" -prune -o -name \
"*.ipynb" -exec sh -c \
'jupyter nbconvert --to markdown --template=theme/custom-markdown.tpl --output-dir "$(dirname "$0")" --output "index" "$0"' {} \;

# remove console colors from md files
find "$SEARCH_DIR" -name \
"index.md" -exec sh -c \
# 2) Convert .qmd blog posts to Markdown using Quarto
# Run quarto render from inside each blog folder (Quarto rejects --output path).
if ! command -v quarto >/dev/null 2>&1; then
echo "[EE] Quarto CLI is required but not found on PATH. Install it (e.g. conda install quarto) and retry."
exit 1
fi
find "$SEARCH_DIR" -name "*.qmd" -exec sh -c \
'dir=$(dirname "$0"); base=$(basename "$0" .qmd); (cd "$dir" && quarto render "$base.qmd" --to gfm)' {} \;

# 3) Ensure generated index.md have YAML from .qmd (Quarto may drop it)
python scripts/inject-qmd-yaml-into-md.py

# 4) Remove console colors from generated md files
find "$SEARCH_DIR" -name "index.md" -exec sh -c \
'cat "$(dirname "$0")/index.md" | python scripts/clean-output.py > "$(dirname "$0")/temp_index.md" && mv "$(dirname "$0")/temp_index.md" "$(dirname "$0")/index.md"' {} \;

build:
Expand Down
57 changes: 44 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,22 @@ dependencies and activate it.

### Creating a New Blog Post

1. **Prepare the Blog Post:**
1. **Prepare the Blog Post (Quarto-first workflow):**

- Navigate to `pages/blog` and create a new folder with a slugified version
of your blog post's title. Use
[https://slugify.online/](https://slugify.online/) to generate a slug.
- Inside this folder, create your blog post file:
- For Markdown: `index.md`
- For Jupyter Notebooks: `index.ipynb` (use Jupyter Lab to create this
directly)
- Inside this folder, create your blog post as a **Quarto document**:
- `index.qmd`

2. **Include a Header Image:**
- Place a header image (either `header.png` or `header.jpg`) in your blog
post folder. Make sure the image is under a free license.

### Metadata and Formatting

- **Markdown Posts:** Add a metadata block at the beginning of your `index.md`
file:
- **Quarto (`.qmd`) Posts:** Add a metadata block at the beginning of your
`index.qmd` file:

```markdown
---
Expand All @@ -75,20 +73,53 @@ dependencies and activate it.
---
```

- **Jupyter Notebook Posts:** The first cell of your `index.ipynb` should be in
`raw` mode containing the same metadata as above.
The body of the file uses standard Markdown plus any Quarto features you need
(code chunks, figures, etc.). During the build, `makim pages.build` will
render `index.qmd` to `index.md` using Quarto so that MkDocs can consume the
generated Markdown.

3. **Building and Viewing:**
- If using a Jupyter Notebook, run `makim pages.build` to convert the
notebook into a Markdown file (`index.md`).
- Add the generated `index.md` to your repository as it will be used to
render the webpage.
- Run `makim pages.build` to render `index.qmd` to `index.md` and build the
site. The generated `index.md` is used to render the webpage.

### Regenerating blog Markdown (for CI)

CI expects the rendered `index.md` files under `pages/blog/*/` to be committed.
If you change `.qmd` content or metadata, regenerate and push the markdown:

```bash
# From repo root with conda env active (e.g. on WSL or Linux)
$ makim pages.pre-build
$ git add pages/blog/*/index.md
$ git commit -m "chore: sync rendered blog index.md from qmd"
$ git push
```

On Windows, use WSL or a Linux environment so `makim pages.pre-build` (Quarto) runs correctly.

### Commit messages

Keep commit messages professional and descriptive. Do not add tool or editor tags
(e.g. "Made-with: Cursor") to commit messages.

To fix existing commits that contain such a line (e.g. before pushing a PR):

```bash
# Rebase the last N commits (replace 3 with how many need fixing)
$ git rebase -i HEAD~3
# In the editor, change 'pick' to 'reword' for each commit whose message you want to fix. Save and close.
# For each chosen commit, Git will open the message: remove the "Made-with: ..." line, save and close.
# Then force-push your branch (only for your own PR branch):
$ git push --force-with-lease
```

## Final Steps

Before submitting your blog post:

- Ensure all files are added to your repository.
- For new or migrated posts, confirm that `index.qmd` exists and that
`makim pages.build` successfully generates the corresponding `index.md`.
- Submit a pull request to the main `opensciencelabs.github.io` repository for
review.

Expand Down
5 changes: 5 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Project-level Quarto config. Ensures GFM output keeps YAML front matter
# so blog index.md have title, date, authors, tags, etc. for MkDocs.
format:
gfm:
variant: +yaml_metadata_block
2 changes: 1 addition & 1 deletion bkp/blogs/call-for-interns-2024-01/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ requirements.
bunch of useful functions.
- **Category:** Multimedia Processing.
- **Organization/Project Webpage URL:**
[https://osl-incubator.github.io/artbox/](https://osl-incubator.github.io/artbox/)
[https://mediatoolbox-org.github.io/artbox/](https://mediatoolbox-org.github.io/artbox/)
- **Contact:** Ivan Ogasawara
[ivan.ogasawara@gmail.com](mailto:ivan.ogasawara@gmail.com)
- **Project Ideas URL:**
Expand Down
2 changes: 1 addition & 1 deletion bkp/opportunities/internship/cycles/2024-01.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ requirements.
- **Description**: ArtBox is a tool set for handling multimedia files with a
bunch of useful functions.
- **Organization/Project Webpage URL**:
<https://osl-incubator.github.io/artbox/>
<https://mediatoolbox-org.github.io/artbox/>
- **Contact**: Ivan Ogasawara (ivan.ogasawara@gmail.com)
- **Project Ideas URL**: <https://github.com/osl-incubator/artbox/issues/10>
- **Application Record**:
Expand Down
2 changes: 1 addition & 1 deletion bkp/opportunities/internship/cycles/2024-02.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ requirements.
- **Description**: ArtBox is a tool set for handling multimedia files with a
bunch of useful functions.
- **Organization/Project Webpage URL**:
<https://osl-incubator.github.io/artbox/>
<https://mediatoolbox-org.github.io/artbox/>
- **Contact**: Ivan Ogasawara (ivan.ogasawara@gmail.com)
- **Project Ideas URL**:
<https://github.com/osl-incubator/artbox/wiki/OSL-Internship-%E2%80%90-2024-%E2%80%90-2nd-Cycle>
Expand Down
1 change: 1 addition & 0 deletions conda/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dependencies:
- pip
- poetry
- nodejs
- quarto
Loading
Loading