mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Support Prism in the blog template example (#2622)
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.
This commit is contained in:
parent
5d7a92b563
commit
55f007f30a
3 changed files with 12 additions and 1 deletions
|
@ -10,6 +10,7 @@ const { title, description, publishDate, author, heroImage, permalink, alt } = c
|
|||
|
||||
<html lang={content.lang || 'en'}>
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prism-themes@1.9.0/themes/prism-lucario.css"/>
|
||||
<BaseHead {title} {description} {permalink} />
|
||||
</head>
|
||||
|
||||
|
|
|
@ -14,3 +14,13 @@ description: Just a Hello World Post!
|
|||
This is so cool!
|
||||
|
||||
Do variables work {frontmatter.value * 2}?
|
||||
|
||||
```javascript
|
||||
// Example JavaScript
|
||||
|
||||
const x = 7;
|
||||
function returnSeven() {
|
||||
return x;
|
||||
}
|
||||
|
||||
```
|
||||
|
|
|
@ -232,7 +232,7 @@ pre {
|
|||
padding: var(--padding-block) var(--padding-inline);
|
||||
padding-right: calc(var(--padding-inline) * 2);
|
||||
margin-left: calc(50vw - var(--padding-inline));
|
||||
transform: translateX(-50vw);
|
||||
transform: translateX(-50);
|
||||
|
||||
line-height: 1.414;
|
||||
width: calc(100vw + (var(--padding-inline) * 2));
|
||||
|
|
Loading…
Reference in a new issue