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 Prism in the blog template example #2622

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

irbull
Copy link
Contributor

@irbull irbull commented Feb 19, 2022

The Prism syntax highlighter failed to render properly when Astro was
initialized with the blog template. This was because the Prism CSS
conflicted with the default blog template.

This change-set removes the Viewport Width from the pre transform as
this property conflicted with the prism CSS. This change-set also
includes Prism in the Blog Post layout and adds a small javascript
example to the sample post.

Changes

  • What does this change?
  • Be short and concise. Bullet points can help!
  • Before/after screenshots can be helpful as well.

Testing

Docs

The Prism syntax highlighter failed to render properly when Astro was
initialized with the blog template. This was because the Prism CSS
conflicted with the default blog template.

This change-set removes the Viewport Width from the `pre` transform as
this property conflicted with the prism CSS. This change-set also
includes Prism in the Blog Post layout and adds a small javascript
example to the sample post.
@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2022

⚠️ No Changeset found

Latest commit: a41aa22

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets
Name Type
@astrojs/markdown-remark Patch
@astrojs/renderer-lit Patch
@astrojs/renderer-preact Patch
@astrojs/renderer-react Patch
@astrojs/renderer-solid Patch
@astrojs/renderer-svelte Patch
@astrojs/renderer-vue Patch
@astrojs/parser Patch
astro Patch

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: example Related to an example package (scope) label Feb 19, 2022
@sarah11918
Copy link
Member

Just confirming that readonlychild and I both confirmed this behaviour in a Discord support thread: https://discord.com/channels/830184174198718474/944312807476830238

The css we currently have in the blog starter template when combined with a Prism stylesheet causes code blocks in a .md file to render shifted off the left side of the page. This doesn't happen in all starter templates, but I haven't checked each and every one.

Perhaps it's also worth checking for this behaviour in the blog (complex) starter, too, since they might have been built similarly?

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! FYI this is probably going away soon when shiki becomes the default, but this is great until then!

@natemoo-re natemoo-re merged commit 55f007f into withastro:main Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: example Related to an example package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants