{post.data.description}
56 |The page you're looking for doesn't exist. It might have been moved, deleted, or you may have entered the wrong URL.
12 |No posts yet. Check back soon!
16 | ) : ( 17 | posts.map((post) =>Welcome to the Astro Terminal theme! This is a port of the popular Hugo Terminal theme by panr, bringing the same retro terminal aesthetic to Astro.
15 |16 | You can customise the colour scheme using panr's Terminal.css 17 | generator - all generated schemes are fully compatible with this theme. 18 |
19 |
20 |
21 |
22 |
23 |
9 | This is the Astro Terminal theme, a port of the fantastic 10 | Hugo Terminal theme 11 | created by panr. 12 |
13 | 14 |15 | The Astro version maintains all the great features of the original theme whilst using Astro's modern 16 | static site generation capabilities. 17 |
18 | 19 |20 | The theme features syntax highlighting with Shiki, customisable colour schemes via 21 | Terminal.css, 22 | Fira Code monospace font, and a beautiful retro terminal aesthetic. 23 |
24 | 25 |26 | Ported to Astro by Dennis Klappe. 27 |
28 |No posts found with this tag.
32 | ) : ( 33 | posts.map((post) =>{post.data.description}
56 |
36 | Terminal Theme Preview
38 |Test
110 | 111 | 112 | ``` 113 | 114 | For more examples for different programming languages, please go to [code showcase](/blog/code-blocks-examples/). 115 | 116 | ## List Types 117 | 118 | ### Ordered List 119 | 120 | 1. First item 121 | 2. Second item 122 | 3. Third item 123 | 124 | ### Unordered List 125 | 126 | * List item 127 | * Another item 128 | * And another item 129 | 130 | ### Nested list 131 | 132 | * Fruit 133 | * Apple 134 | * Orange 135 | * Banana 136 | * Dairy 137 | * Milk 138 | * Cheese 139 | 140 | ## Other Elements — abbr, sub, sup, kbd, mark 141 | 142 | GIF is a bitmap image format. 143 | 144 | H2O 145 | 146 | Xn + Yn = Zn 147 | 148 | Press CTRL+ALT+Delete to end the session. 149 | 150 | Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures. -------------------------------------------------------------------------------- /src/styles/syntax.css: -------------------------------------------------------------------------------- 1 | /* Syntax highlighting theme for Astro Terminal theme */ 2 | /* This uses a monochrome approach where all syntax elements are in accent color */ 3 | 4 | /* Astro/Shiki CSS Variables for monochrome syntax highlighting */ 5 | :root { 6 | /* Base colors - most text should be white/foreground */ 7 | --astro-code-color-text: var(--foreground); 8 | --astro-code-color-background: color-mix(in srgb, var(--foreground) 5%, transparent); 9 | 10 | /* Default all tokens to foreground (white) */ 11 | --astro-code-foreground: var(--foreground); 12 | --astro-code-token-constant: var(--foreground); 13 | --astro-code-token-string: var(--foreground); 14 | --astro-code-token-comment: color-mix(in srgb, var(--foreground) 50%, transparent); 15 | --astro-code-token-keyword: var(--accent); 16 | --astro-code-token-parameter: var(--foreground); 17 | --astro-code-token-function: color-mix(in srgb, var(--accent) 70%, transparent); 18 | --astro-code-token-string-expression: var(--accent); 19 | --astro-code-token-punctuation: var(--foreground); 20 | --astro-code-token-link: var(--accent); 21 | 22 | /* Additional token types */ 23 | --astro-code-token-namespace: var(--foreground); 24 | --astro-code-token-tag: var(--accent); 25 | --astro-code-token-selector: var(--accent); 26 | --astro-code-token-attribute: var(--foreground); 27 | --astro-code-token-attribute-name: color-mix(in srgb, var(--accent) 70%, transparent); 28 | --astro-code-token-variable: var(--foreground); 29 | --astro-code-token-literal: var(--foreground); 30 | --astro-code-token-number: var(--foreground); 31 | --astro-code-token-unit: var(--foreground); 32 | --astro-code-token-symbol: var(--foreground); 33 | --astro-code-token-regex: var(--accent); 34 | --astro-code-token-boolean: var(--accent); 35 | --astro-code-token-important: var(--accent); 36 | 37 | /* Additional variables for code styling */ 38 | --code-border: color-mix(in srgb, var(--foreground) 25%, transparent); 39 | --comment: color-mix(in srgb, var(--foreground) 50%, transparent); 40 | } 41 | 42 | /* Override Astro's default code block styles */ 43 | .astro-code { 44 | background: color-mix(in srgb, var(--foreground) 5%, transparent) !important; 45 | border: 1px solid color-mix(in srgb, var(--foreground) 25%, transparent) !important; 46 | padding: 20px 10px !important; 47 | } 48 | 49 | /* Override inline styles for specific token types */ 50 | 51 | /* Force all text to be white by default */ 52 | .astro-code, 53 | .astro-code span { 54 | color: var(--foreground) !important; 55 | } 56 | 57 | /* Default foreground/white text */ 58 | .astro-code span[style*="--astro-code-foreground"], 59 | .astro-code span[style*="--astro-code-token-punctuation"], 60 | .astro-code span[style*="--astro-code-token-constant"], 61 | .astro-code span[style*="--astro-code-token-string"], 62 | .astro-code span[style*="--astro-code-token-parameter"], 63 | .astro-code span[style*="--astro-code-token-variable"], 64 | .astro-code span[style*="--astro-code-token-literal"], 65 | .astro-code span[style*="--astro-code-token-number"] { 66 | color: var(--foreground) !important; 67 | } 68 | 69 | /* Full orange for keywords, tags, string expressions */ 70 | .astro-code span[style*="--astro-code-token-keyword"], 71 | .astro-code span[style*="--astro-code-token-string-expression"], 72 | .astro-code span[style*="--astro-code-token-tag"], 73 | .astro-code span[style*="--astro-code-token-selector"], 74 | .astro-code span[style*="--astro-code-token-regex"], 75 | .astro-code span[style*="--astro-code-token-boolean"], 76 | .astro-code span[style*="--astro-code-token-important"] { 77 | color: var(--accent) !important; 78 | } 79 | 80 | /* 70% opacity orange for attribute names (using token-function in HTML) */ 81 | .astro-code span[style*="--astro-code-token-function"] { 82 | color: var(--accent) !important; 83 | opacity: 0.7; 84 | } 85 | 86 | /* Muted comments */ 87 | .astro-code span[style*="--astro-code-token-comment"] { 88 | color: var(--comment) !important; 89 | } 90 | 91 | /* Line highlighting */ 92 | .highlight-line { 93 | display: block; 94 | margin: 0 -10px; 95 | padding: 0 10px; 96 | background: color-mix(in srgb, var(--accent) 10%, transparent); 97 | border-left: 3px solid var(--accent); 98 | } 99 | 100 | /* Diff highlighting */ 101 | .token.deleted { 102 | color: #ff6666 !important; 103 | background: color-mix(in srgb, #ff6666 10%, transparent); 104 | } 105 | 106 | .token.inserted { 107 | color: #66ff66 !important; 108 | background: color-mix(in srgb, #66ff66 10%, transparent); 109 | } 110 | 111 | /* Inline code in different contexts */ 112 | .post-content code, 113 | .page code { 114 | word-break: break-word; 115 | } 116 | 117 | /* Code block containers */ 118 | .code-toolbar { 119 | position: relative; 120 | } 121 | 122 | .code-toolbar .toolbar { 123 | position: absolute; 124 | top: 10px; 125 | right: 10px; 126 | display: flex; 127 | gap: 5px; 128 | } 129 | 130 | .code-toolbar .toolbar-item button { 131 | background: transparent; 132 | border: 1px solid var(--accent); 133 | color: var(--accent); 134 | padding: 2px 8px; 135 | font-size: calc(var(--font-size) * 0.8); 136 | cursor: pointer; 137 | transition: all 0.15s linear; 138 | } 139 | 140 | .code-toolbar .toolbar-item button:hover { 141 | background: color-mix(in srgb, var(--accent) 15%, transparent); 142 | } -------------------------------------------------------------------------------- /src/styles/post.css: -------------------------------------------------------------------------------- 1 | /* Posts */ 2 | .posts { 3 | width: 100%; 4 | } 5 | 6 | .post { 7 | width: 100%; 8 | text-align: left; 9 | padding: 30px 0; 10 | } 11 | 12 | .post:not(:last-of-type) { 13 | border-bottom: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent); 14 | } 15 | 16 | .post-meta { 17 | font-size: inherit; 18 | margin-bottom: 10px; 19 | color: color-mix(in srgb, var(--foreground) 65%, transparent); 20 | } 21 | 22 | .post-author::before { 23 | content: " :: "; 24 | display: inline; 25 | } 26 | 27 | .post-title { 28 | position: relative; 29 | color: var(--accent); 30 | margin-top: 0 !important; 31 | margin-bottom: 15px !important; 32 | padding-bottom: 15px; 33 | border-bottom: 3px dotted var(--accent); 34 | text-decoration: none !important; 35 | } 36 | 37 | .post-title::after { 38 | content: ""; 39 | position: absolute; 40 | bottom: 2px; 41 | display: block; 42 | width: 100%; 43 | border-bottom: 3px dotted var(--accent); 44 | } 45 | 46 | .post-title a { 47 | text-decoration: none; 48 | } 49 | 50 | .post-tags { 51 | display: block; 52 | margin-bottom: 20px; 53 | font-size: inherit; 54 | color: var(--accent); 55 | } 56 | 57 | .post-tags a { 58 | color: var(--accent); 59 | text-decoration: none; 60 | } 61 | 62 | .post-tags a::before { 63 | content: "#"; 64 | } 65 | 66 | .post-tags a:not(:last-child)::after { 67 | content: ", "; 68 | } 69 | 70 | .post-cover { 71 | margin: 20px 0; 72 | } 73 | 74 | .post-cover img { 75 | border: 10px solid var(--accent); 76 | background: transparent; 77 | padding: 20px; 78 | } 79 | 80 | .post ul { 81 | list-style: none; 82 | } 83 | 84 | .post ul li { 85 | position: relative; 86 | } 87 | 88 | .post ul li:not(:empty)::before { 89 | content: "-"; 90 | position: absolute; 91 | left: -20px; 92 | color: var(--accent); 93 | } 94 | 95 | .post-content { 96 | margin-top: 30px; 97 | } 98 | 99 | /* Post navigation */ 100 | .post-nav { 101 | display: flex; 102 | justify-content: space-between; 103 | margin-top: 100px; 104 | padding-top: 25px; 105 | border-top: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent); 106 | } 107 | 108 | .post-nav-prev, 109 | .post-nav-next { 110 | display: flex; 111 | flex-direction: column; 112 | flex: 1; 113 | } 114 | 115 | .post-nav-next { 116 | text-align: right; 117 | } 118 | 119 | /* Metadata in single posts */ 120 | article time { 121 | color: color-mix(in srgb, var(--foreground) 65%, transparent); 122 | } 123 | 124 | /* Removed - handled by .post-author::before instead */ 125 | 126 | /* Video embeds */ 127 | .video-wrapper { 128 | position: relative; 129 | padding-bottom: 56.25%; /* 16:9 aspect ratio */ 130 | height: 0; 131 | overflow: hidden; 132 | margin: 25px 0; 133 | border: 8px solid var(--accent); 134 | background: var(--background); 135 | } 136 | 137 | .video-wrapper iframe { 138 | position: absolute; 139 | top: 0; 140 | left: 0; 141 | width: 100%; 142 | height: 100%; 143 | border: none; 144 | } 145 | 146 | /* Twitter embeds */ 147 | .twitter-tweet { 148 | margin: 25px auto !important; 149 | max-width: 550px !important; 150 | } 151 | 152 | /* Spotify embed */ 153 | iframe[src*="spotify"] { 154 | border: 8px solid var(--accent) !important; 155 | border-radius: 0 !important; 156 | margin: 25px 0; 157 | } 158 | 159 | /* Google Maps */ 160 | iframe[src*="google.com/maps"] { 161 | border: 8px solid var(--accent); 162 | margin: 25px 0; 163 | } 164 | 165 | /* SoundCloud */ 166 | iframe[src*="soundcloud"] { 167 | border: 8px solid var(--accent); 168 | margin: 25px 0; 169 | } 170 | 171 | 172 | /* CodePen embeds */ 173 | iframe[src*="codepen"] { 174 | border: 8px solid var(--accent); 175 | margin: 25px 0; 176 | } 177 | 178 | /* Posts list */ 179 | .posts-list { 180 | list-style: none; 181 | padding: 0; 182 | margin: 0; 183 | } 184 | 185 | .posts-list li { 186 | margin-bottom: 30px; 187 | } 188 | 189 | /* List page title */ 190 | .posts-title { 191 | position: relative; 192 | color: var(--accent); 193 | margin-top: 0 !important; 194 | margin-bottom: 0 !important; 195 | padding-bottom: 15px; 196 | border-bottom: 3px dotted var(--accent); 197 | } 198 | 199 | .posts-title::after { 200 | content: ""; 201 | position: absolute; 202 | bottom: 2px; 203 | display: block; 204 | width: 100%; 205 | border-bottom: 3px dotted var(--accent); 206 | } 207 | 208 | /* Footnotes */ 209 | .footnotes { 210 | margin-top: 50px; 211 | padding-top: 30px; 212 | border-top: 2px solid var(--accent); 213 | } 214 | 215 | .footnotes h2 { 216 | /* Hide the screen reader only heading visually */ 217 | position: absolute; 218 | width: 1px; 219 | height: 1px; 220 | padding: 0; 221 | margin: -1px; 222 | overflow: hidden; 223 | clip: rect(0, 0, 0, 0); 224 | white-space: nowrap; 225 | border: 0; 226 | } 227 | 228 | .footnotes ol { 229 | margin-left: 0; 230 | padding-left: 3ch; 231 | list-style-type: decimal; 232 | } 233 | 234 | .footnotes li { 235 | margin-bottom: 10px; 236 | color: var(--foreground); 237 | } 238 | 239 | .footnotes li::marker { 240 | color: var(--accent); 241 | font-weight: 600; 242 | } 243 | 244 | .footnotes li p { 245 | margin: 0; 246 | display: inline; 247 | } 248 | 249 | /* Footnote references in text */ 250 | sup[data-footnote-ref] { 251 | font-weight: 600; 252 | } 253 | 254 | sup[data-footnote-ref] a { 255 | text-decoration: none; 256 | color: var(--accent); 257 | padding: 0 2px; 258 | } 259 | 260 | sup[data-footnote-ref] a:hover { 261 | background: color-mix(in srgb, var(--accent) 20%, transparent); 262 | } 263 | 264 | /* Footnote back references */ 265 | .data-footnote-backref { 266 | text-decoration: none; 267 | margin-left: 5px; 268 | font-size: 0.9em; 269 | } -------------------------------------------------------------------------------- /src/content/posts/code-blocks-examples.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'Code blocks examples' 3 | description: 'The Astro Terminal theme uses Shiki as syntax highlighter, providing beautiful and customizable code highlighting.' 4 | pubDate: 2019-03-10 5 | author: 'Radek' 6 | tags: [] 7 | --- 8 | 9 | The Astro Terminal theme uses Shiki as syntax highlighter, providing beautiful and customizable code highlighting with a monochrome theme that matches the terminal aesthetic. 10 | 11 | Below you can see many basic presentations of the code blocks you can use depending on your needs. 12 | 13 | ## Examples 14 | 15 | ### Raw block with no specified language (and no syntax highlighting): 16 | 17 | ``` 18 | 19 | 20 | 21 | 22 |Test
26 | 27 | 28 | ``` 29 | 30 | ### With specified language: 31 | 32 | ```html 33 | 34 | 35 | 36 | 37 |Test
41 | 42 | 43 | ``` 44 | 45 | ## Programming Languages 46 | 47 | ### A 48 | 49 | **Astro:** 50 | ```astro 51 | --- 52 | const greeting = "Hello, World!"; 53 | --- 54 |Your content here...
141 |