Skip to content
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

Support separate alt text and captions in Markdown content #14

Merged
merged 13 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
112 changes: 56 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
},
"dependencies": {
"rehype-class-names": "^2.0.0",
"rehype-figure": "^1.0.1",
"rehype-plugin-image-native-lazy-loading": "^1.2.0",
"rehype-rewrite": "^4.0.2",
"rehype-title-figure": "^0.1.2",
"svelte-icons-pack": "^3.1.3"
}
}
2 changes: 1 addition & 1 deletion src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ a:not(.menu-link):not(.icon-link):not(.button):not(.post-link):not(.card-link):h
}

& figcaption {
@apply text-neutral-600 dark:text-neutral-300 text-[0.95rem] mt-3;
@apply text-neutral-600 dark:text-neutral-300 text-[0.95rem] mt-3 text-center;
}
}
2 changes: 1 addition & 1 deletion src/lib/content/code-analysis.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![Get in-depth insight on issues and improvements with your code](/assets/media/code_analysis.webp)
![Get in-depth insight on issues and improvements with your code](/assets/media/code_analysis.webp "Get in-depth insight on issues and improvements with your code")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/lib/content/conda.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![Work with multiple environments at once](/assets/media/conda.webp)
![Work with multiple environments at once](/assets/media/conda.webp "Work with multiple environments at once")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/lib/content/developer-tools.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![Take advantage of real-time hints and help to improve your code](/assets/media/developer_tools.webp)
![Take advantage of real-time hints and help to improve your code](/assets/media/developer_tools.webp "Take advantage of real-time hints and help to improve your code")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/lib/content/matplotlib.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![Browse all your plots in a single place](/assets/media/matplotlib.webp)
![Browse all your plots in a single place](/assets/media/matplotlib.webp "Browse all your plots in a single place")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/lib/content/numpy.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![Explore and edit multi-dimensional arrays](/assets/media/numpy.webp)
![Explore and edit multi-dimensional arrays](/assets/media/numpy.webp "Explore and edit multi-dimensional arrays")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/lib/content/pandas.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![Interact with the contents of your dataframes](/assets/media/pandas.webp)
![Interact with the contents of your dataframes](/assets/media/pandas.webp "Interact with the contents of your dataframes")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/lib/content/projects.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![Easily switch between projects and browse their files](/assets/media/projects.webp)
![Easily switch between projects and browse their files](/assets/media/projects.webp "Easily switch between projects and browse their files")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/lib/content/search.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![Quickly find uses of a variable or word across files](/assets/media/search.webp)
![Quickly find uses of a variable or word across files](/assets/media/search.webp "Quickly find uses of a variable or word across files")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/lib/content/sympy.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
![View rich symbolic expressions rendered with LaTeX](/assets/media/sympy.webp)
![View rich symbolic expressions rendered with LaTeX](/assets/media/sympy.webp "View rich symbolic expressions rendered with LaTeX")
conradolandia marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 3 additions & 8 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ import adapter from "@sveltejs/adapter-static";
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
import { mdsvex } from "mdsvex";
import { visit } from "unist-util-visit";
import figures from "rehype-figure";
import rehypeTitleFigure from 'rehype-title-figure'
import classNames from "rehype-class-names";
//import lazyLoadPlugin from "rehype-plugin-image-native-lazy-loading";

const classNamesOptions = {
h2: "section",
h3: "subsection",
h4: "subsubsection",
a: "link",
};

const figuresOptions = {
className: "figure text-center",
figure: "figure"
};

const blogImages = () => {
Expand All @@ -36,10 +32,9 @@ const blogImages = () => {
const mdsvexOptions = {
extensions: [".md"],
rehypePlugins: [
[figures, figuresOptions],
[rehypeTitleFigure],
[classNames, classNamesOptions],
blogImages,
//lazyLoadPlugin,
],
layout: {
blog: "src/lib/blocks/Post.svelte",
Expand Down
12 changes: 7 additions & 5 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ export default {
display: "flex",
flexDirection: "column",
alignItems: "center",
"& img": {
boxShadow:
"rgba(0, 0, 0, 0.04) 0px 0.5em 2em 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px",
borderRadius: "0.6em",
},
},
img: {
boxShadow:
"rgba(0, 0, 0, 0.04) 0px 0.5em 2em 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px",
borderRadius: "0.6em",
marginLeft: "auto",
marginRight: "auto"
}
},
},
md: {
Expand Down