Skip to content

Commit abb5ae6

Browse files
committed
GitHub pages not playing nice with pngs and static linkage
1 parent 97291e8 commit abb5ae6

File tree

2 files changed

+26
-33
lines changed

2 files changed

+26
-33
lines changed

src/components/ProjectCarousel/index.tsx

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,78 +8,55 @@ import styles from './styles.module.css';
88
type Project = {
99
title: string;
1010
description: string;
11-
imagePath: string;
11+
image: string;
1212
link: string;
1313
};
1414

1515
const projects: Project[] = [
1616
{
1717
title: 'CodeMirror LaTeX Language',
1818
description: 'Syntax highlighting and language support for LaTeX in CodeMirror 6',
19-
imagePath: '/img/codemirror-lang-latex.png',
19+
image: 'img/codemirror-lang-latex.png',
2020
link: 'https://texlyre.github.io/codemirror-lang-latex/',
2121
},
2222
{
2323
title: 'CodeMirror BibTeX Language',
2424
description: 'Syntax highlighting and language support for BibTeX in CodeMirror 6',
25-
imagePath: '/img/codemirror-lang-bib.png',
25+
image: 'img/codemirror-lang-bib.png',
2626
link: 'https://texlyre.github.io/codemirror-lang-bib/',
2727
},
2828
{
2929
title: 'WASM LaTeX Tools',
3030
description: 'WebAssembly-powered LaTeX utilities for browser-based compilation',
31-
imagePath: '/img/wasm-latex-tools.png',
31+
image: 'img/wasm-latex-tools.png',
3232
link: 'https://texlyre.github.io/wasm-latex-tools/',
3333
},
3434
{
3535
title: 'CodeMirror LaTeX Visual',
3636
description: 'Visual editing enhancements for LaTeX in CodeMirror',
37-
imagePath: '/img/codemirror-latex-visual.png',
37+
image: 'img/codemirror-latex-visual.png',
3838
link: 'https://texlyre.github.io/codemirror-latex-visual/',
3939
},
4040
{
4141
title: 'Vector PDF Converter',
4242
description: 'Convert between vector PDF formats in the browser',
43-
imagePath: '/img/vector-pdf-converter.png',
43+
image: 'img/vector-pdf-converter.png',
4444
link: 'https://texlyre.github.io/vector-pdf-converter/',
4545
},
4646
{
4747
title: 'FilePizza Client',
4848
description: 'Peer-to-peer file transfer directly in your browser',
49-
imagePath: '/img/filepizza-client.png',
49+
image: 'img/filepizza-client.png',
5050
link: 'https://texlyre.github.io/filepizza-client/',
5151
},
5252
{
5353
title: 'TeXlyre Templates',
5454
description: 'Collection of LaTeX and Typst templates for various use cases',
55-
imagePath: '/img/texlyre-templates.png',
55+
image: 'img/texlyre-templates.png',
5656
link: 'https://texlyre.github.io/texlyre-templates/',
5757
},
5858
];
5959

60-
function ProjectSlide({ project }: { project: Project }) {
61-
const imageUrl = useBaseUrl(project.imagePath);
62-
63-
return (
64-
<a
65-
href={project.link}
66-
target="_blank"
67-
rel="noopener noreferrer"
68-
className={styles.slideLink}
69-
>
70-
<img
71-
src={imageUrl}
72-
alt={project.title}
73-
className={styles.slideImage}
74-
/>
75-
<div className={styles.slideInfo}>
76-
<h3 className={styles.slideTitle}>{project.title}</h3>
77-
<p className={styles.slideDescription}>{project.description}</p>
78-
</div>
79-
</a>
80-
);
81-
}
82-
8360
export default function ProjectCarousel(): ReactNode {
8461
const [currentIndex, setCurrentIndex] = useState(0);
8562
const [isAutoPlaying, setIsAutoPlaying] = useState(true);
@@ -143,7 +120,22 @@ export default function ProjectCarousel(): ReactNode {
143120
[styles.slideActive]: index === currentIndex,
144121
})}
145122
>
146-
<ProjectSlide project={project} />
123+
<a
124+
href={project.link}
125+
target="_blank"
126+
rel="noopener noreferrer"
127+
className={styles.slideLink}
128+
>
129+
<img
130+
src={useBaseUrl(project.image)}
131+
alt={project.title}
132+
className={styles.slideImage}
133+
/>
134+
<div className={styles.slideInfo}>
135+
<h3 className={styles.slideTitle}>{project.title}</h3>
136+
<p className={styles.slideDescription}>{project.description}</p>
137+
</div>
138+
</a>
147139
</div>
148140
))}
149141
</div>
@@ -172,4 +164,4 @@ export default function ProjectCarousel(): ReactNode {
172164
</div>
173165
</section>
174166
);
175-
}
167+
}

static/img/screenshot_site.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
##################################### PNG ####################################
12
google-chrome --headless --no-sandbox --hide-scrollbars \
23
--window-size=1920,1080 \
34
--incognito \

0 commit comments

Comments
 (0)