Skip to content

Commit e78aa94

Browse files
authored
Merge pull request #555 from sylhare/gem-update
Update gemfile with necessary gems
2 parents dc701ca + a999c11 commit e78aa94

7 files changed

Lines changed: 26 additions & 19 deletions

File tree

.github/cli/e2e/screenshots.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ function defineScreenshotTests(): void {
1313
test('mermaid article', async ({ page }) => {
1414
await page.goto('/2016/12/03/Mermaid');
1515
await page.waitForSelector('.mermaid svg, .language-mermaid svg', { timeout: 15_000 });
16-
await takeThemeScreenshots(page, 'mermaid-article');
16+
await page.waitForFunction(() => {
17+
const svgs = document.querySelectorAll('.mermaid svg, .language-mermaid svg');
18+
return [...svgs].every(svg => svg.getBoundingClientRect().height > 0);
19+
});
20+
await takeThemeScreenshots(page, 'mermaid-article', { maxDiffPixelRatio: 0.01 });
1721
});
1822

1923
test('katex article', async ({ page }) => {

.github/cli/e2e/support/helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { expect, test, type Page } from '@playwright/test';
1+
import { expect, test, type Page, type PageAssertionsToHaveScreenshotOptions } from '@playwright/test';
22

33
/**
44
* Helper to open mobile menu - forces menu visibility for mobile tests
@@ -42,12 +42,12 @@ export async function setTheme(page: Page, theme: 'light' | 'dark'): Promise<voi
4242
* compared on subsequent runs (visual regression). Run with `--update-snapshots`
4343
* to create or refresh the baseline.
4444
*/
45-
export async function takeThemeScreenshots(page: Page, name: string): Promise<void> {
45+
export async function takeThemeScreenshots(page: Page, name: string, options: PageAssertionsToHaveScreenshotOptions = {}): Promise<void> {
4646
await setTheme(page, 'light');
47-
await expect(page).toHaveScreenshot(`${name}-light.png`, { fullPage: true });
47+
await expect(page).toHaveScreenshot(`${name}-light.png`, { fullPage: true, ...options });
4848

4949
await setTheme(page, 'dark');
50-
await expect(page).toHaveScreenshot(`${name}-dark.png`, { fullPage: true });
50+
await expect(page).toHaveScreenshot(`${name}-dark.png`, { fullPage: true, ...options });
5151
}
5252

5353
/**

.github/workflows/e2e-visual.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ jobs:
6464
- name: Checkout repository
6565
uses: actions/checkout@v6
6666

67-
- name: Download snapshots from latest main run
67+
- name: Download snapshots from latest master run
6868
id: snapshots
6969
continue-on-error: true
7070
env:
7171
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7272
run: |
7373
RUN_ID=$(gh run list \
7474
--repo ${{ github.repository }} \
75-
--branch main \
75+
--branch master \
7676
--workflow e2e-visual.yml \
7777
--status success \
7878
--limit 1 \

.github/workflows/gem-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
ruby: [ '3.2', '3.3', '3.4' ] # '4.0'
13+
ruby: [ '3.2', '3.3', '3.4', '4.0' ]
1414

1515
steps:
1616
- uses: actions/checkout@v6

.github/workflows/gem-github-page.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
ruby: [ '2.7.4', '3.4', '4.0' ]
13+
ruby: [ '2.7.4', '4.0' ]
1414

1515
steps:
1616
- uses: actions/checkout@v6

Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
source "https://rubygems.org"
22

3-
# Should be included in Jekyll but depending on the version Jekyll and Ruby version, it may not be included
3+
# Required explicitly — removed from Ruby default gems in Ruby 3.2+ (webrick >= 1.9)
44
gem 'webrick'
5+
# Required explicitly in Ruby 3.4+ (removed from default gems)
6+
gem 'base64'
7+
gem 'bigdecimal'
58

69
# For github pages compatibility
710
# gem 'github-pages', group: :jekyll_plugins

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ Based on Rohan Chandra [type-theme](https://github.com/rohanchandra/type-theme)
2727
2828
## Usage
2929

30+
### As a remote theme
31+
32+
The easiest way to use Type-on-Strap is as a remote theme with GitHub Pages.
33+
Add this to your [`_config.yml`](_config.yml):
34+
35+
```yml
36+
remote_theme: sylhare/Type-on-Strap
37+
```
38+
3039
### As a GitHub page 📋
3140
3241
1. Fork and clone the [Type on Strap repo](https://github.com/sylhare/Type-On-Strap): `git clone https://github.com/Sylhare/Type-on-Strap.git`
@@ -629,15 +638,6 @@ Then you can start adding content like:
629638
- Add the feature page you want. (ex: as it is already in `pages`)
630639
- Add posts in `_posts` and `_portfolio` to be displayed
631640

632-
### Remote Theme
633-
634-
Now you can use any theme gem with GitHub pages with [29/11/2017 GitHub Pages Broadcast](https://github.com/blog/2464-use-any-theme-with-github-pages).
635-
For that remove all `theme:` attributes from [`_config.yml`](_config.yml) and add instead:
636-
637-
```yml
638-
remote_theme: sylhare/Type-on-Strap
639-
```
640-
641641
## License
642642

643643
This theme is licensed under the [MIT License (MIT)](/LICENSE)

0 commit comments

Comments
 (0)