Skip to content

Article pages Table of Contents feature #32

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
642298c
Created basic table of contents, and astro components
HesitantlyHuman Apr 15, 2025
5ce4e39
Remove unnecessary file
HesitantlyHuman Apr 15, 2025
2f83943
Attempting to style TOC to be a sticky bar
HesitantlyHuman Apr 17, 2025
34ee81f
Styling for the TOC
HesitantlyHuman Apr 17, 2025
8521daa
Move next article buttons into context where they can span the page, …
HesitantlyHuman Apr 19, 2025
939ddfa
Styling fixes are completed, rendering changes partially done
HesitantlyHuman Apr 19, 2025
51a89d6
Passing props from the code blocks to our custom component
HesitantlyHuman Apr 20, 2025
c7c983e
Get functioning copy button using Astro middleware and props to minim…
HesitantlyHuman Apr 22, 2025
e0a033d
Finalized copy button fixes, fixed copy content formatting issues
HesitantlyHuman Apr 22, 2025
57ca9b1
Fix issue using b64 to avoid whitespace stripping
HesitantlyHuman Apr 22, 2025
59f3b02
Merge branch 'bugfix/copy-button-issues' into feature/table-of-contents
HesitantlyHuman Apr 23, 2025
3218454
Fix TOC indentation, fix scrolling behaviour, remove overview TOC ele…
HesitantlyHuman Apr 26, 2025
13a374c
Add highlight styling to TOC, improve TOC link clickable area, add mi…
HesitantlyHuman Apr 26, 2025
de136f3
Fix sizing for pages without TOC, when at large breakpoint
HesitantlyHuman Apr 26, 2025
a596924
Fix TOC building to handle orphans and enforce max depth and nesting
HesitantlyHuman Apr 26, 2025
81b0727
Fix broken TOC for blog post 04
HesitantlyHuman Apr 26, 2025
625a94c
Working TOC
HesitantlyHuman Apr 27, 2025
12536e0
Add styling to indicate when TOC is scrollable
HesitantlyHuman Apr 28, 2025
8b12e1a
Fix styling now that markdown content is wrapped with sections, add l…
HesitantlyHuman Apr 28, 2025
f3f2571
Finished ToC
HesitantlyHuman Apr 30, 2025
1e014d1
Change project slugs to use ArticleLayout
HesitantlyHuman Apr 30, 2025
fb4344e
Change integrations order
HesitantlyHuman May 19, 2025
b15fe30
Fix mdx import issue from sectionization
HesitantlyHuman May 20, 2025
b6eaa1d
Defer header script to optimize page load on mobile
HesitantlyHuman May 20, 2025
ab27794
Packages and package lock
HesitantlyHuman May 20, 2025
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
18 changes: 16 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,23 @@ import mdx from "@astrojs/mdx"
import sitemap from "@astrojs/sitemap"
import tailwind from "@astrojs/tailwind"
import solidJs from "@astrojs/solid-js"
import sectionize from "remark-sectionize"

// https://astro.build/config
export default defineConfig({
site: "https://astro-sphere-demo.vercel.app",
integrations: [mdx(), sitemap(), solidJs(), tailwind({ applyBaseStyles: false })],
})
integrations: [sitemap(), solidJs(), tailwind({ applyBaseStyles: false }), mdx()],
markdown: {
shikiConfig: {
transformers: [{
pre(hast) {
hast.properties['data-meta'] = this.options.meta?.__raw;
// Somewhere along the line, the properties are getting encoded in a
// way which does not preserve whitespace. See CodeSnippet.astro
hast.properties['data-code'] = JSON.stringify(this.source);
}
}]
},
remarkPlugins: [sectionize],
}
});
Loading