-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Document how to use a custom Shiki theme #1749
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
Thanks for tackling this issue, @nujovich! 🥳 A great first contribution! I'm wondering whether this deserves an entire new code block, though, and maybe we can work it into the existing example itself? Or at the very least, what about a condensed second example that just shows the |
Sure @sarah11918! Let me work on that! |
Hello @nujovich and @sarah11918, I was trying to add a new theme to my config file. I noticed that any string passed to So in order to add your own theme to the package you will need follow shiki's guide: add a new theme. This will modify your shiki package and add the theme to the list of themes. However, shiki is not a direct dependency of your project then there would be more steps to add your own theme 😥 An easier way to do this is to import the json and pass it to import { defineConfig } from 'astro/config';
import customTheme from './src/custom-themes/dracula.json';
export default defineConfig({
site: 'https://example.com',
markdown: {
shikiConfig: {
theme: customTheme,
},
},
}); Hope this helps 😇 Oh btw here is the stackblitz |
Awesome ! I will try that and add it to the docs. |
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Thanks again for your contribution @nujovich! Welcome to team docs 🥳 |
* i18n(es): add docs for alternative markdown file extensions * i18n(es): document how to escape special characters in markdown * i18n(es): apply review suggestions * i18n(es): document how to use a custom Shiki theme (#1749) Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
Hi!! I tryed this with a custom theme. The thing is when I change anything on the Any thoughts why it doesn't work?? thanks a lot!! |
Hey @Ivluengo! Little bit hard to see without seeing more of your project. If this isn’t working, the best would be to create a bug report with a reproduction in the astro repo so we can look at fixing it: https://github.com/withastro/astro/issues/new/choose Alternatively, we have a really active |
What kind of changes does this PR include?
Description
markdown.shikiConfig.theme
can be a relative path #1715Before
After
I am actively participating in Hacktoberfest and Hacksquad 2022 🙌.