+
+### Code Blocks
+
+Pre-formatted code blocks are used for writing about programming or
+markup source code. Rather than forming normal paragraphs, the lines
+of a code block are interpreted literally. Markdown wraps a code block
+in both `` and `` tags.
+
+To produce a code block in Markdown, simply indent every line of the
+block by at least 4 spaces or 1 tab.
+
+This is a normal paragraph:
+
+ This is a code block.
+
+Here is an example of AppleScript:
+
+ tell application "Foo"
+ beep
+ end tell
+
+A code block continues until it reaches a line that is not indented
+(or the end of the article).
+
+Within a code block, ampersands (`&`) and angle brackets (`<` and `>`)
+are automatically converted into HTML entities. This makes it very
+easy to include example HTML source code using Markdown -- just paste
+it and indent it, and Markdown will handle the hassle of encoding the
+ampersands and angle brackets. For example, this:
+
+
+
+Regular Markdown syntax is not processed within code blocks. E.g.,
+asterisks are just literal asterisks within a code block. This means
+it's also easy to use Markdown to write about Markdown's own syntax.
+
+```
+tell application "Foo"
+ beep
+end tell
+```
+
+## Span Elements
+
+### Links
+
+Markdown supports two style of links: *inline* and *reference*.
+
+In both styles, the link text is delimited by [square brackets].
+
+To create an inline link, use a set of regular parentheses immediately
+after the link text's closing square bracket. Inside the parentheses,
+put the URL where you want the link to point, along with an *optional*
+title for the link, surrounded in quotes. For example:
+
+This is [an example](http://example.com/) inline link.
+
+[This link](http://example.net/) has no title attribute.
+
+### Emphasis
+
+Markdown treats asterisks (`*`) and underscores (`_`) as indicators of
+emphasis. Text wrapped with one `*` or `_` will be wrapped with an
+HTML `` tag; double `*`'s or `_`'s will be wrapped with an HTML
+`` tag. E.g., this input:
+
+*single asterisks*
+
+_single underscores_
+
+**double asterisks**
+
+__double underscores__
+
+### Code
+
+To indicate a span of code, wrap it with backtick quotes (`` ` ``).
+Unlike a pre-formatted code block, a code span indicates code within a
+normal paragraph. For example:
+
+Use the `printf()` function.
diff --git a/content/posts/images/alexandr-podvalny-220262-unsplash.jpg b/content/posts/images/alexandr-podvalny-220262-unsplash.jpg
new file mode 100644
index 0000000..af4186b
Binary files /dev/null and b/content/posts/images/alexandr-podvalny-220262-unsplash.jpg differ
diff --git a/gridsome.config.js b/gridsome.config.js
index 794622a..02c5d7e 100644
--- a/gridsome.config.js
+++ b/gridsome.config.js
@@ -6,20 +6,10 @@
module.exports = {
siteName: 'Gridsome Blog Starter',
-
- transformers: {
- remark: {
- externalLinksTarget: '_blank',
- externalLinksRel: ['nofollow', 'noopener', 'noreferrer'],
- anchorClassName: 'icon icon-link',
- plugins: [
- '@gridsome/remark-prismjs'
- ]
- }
- },
plugins: [
{
+ // Create posts from markdown files
use: '@gridsome/source-filesystem',
options: {
path: 'content/posts/*.md',
@@ -35,5 +25,17 @@ module.exports = {
}
}
}
- ]
+ ],
+
+ transformers: {
+ //Add markdown support to all file-system sources
+ remark: {
+ externalLinksTarget: '_blank',
+ externalLinksRel: ['nofollow', 'noopener', 'noreferrer'],
+ anchorClassName: 'icon icon-link',
+ plugins: [
+ '@gridsome/remark-prismjs'
+ ]
+ }
+ },
}
\ No newline at end of file
diff --git a/src/assets/style/_base.scss b/src/assets/style/_base.scss
index 11ff7c3..9d2fff9 100644
--- a/src/assets/style/_base.scss
+++ b/src/assets/style/_base.scss
@@ -23,6 +23,10 @@ a:not(.button) {
}
}
+img {
+ max-width: 100%;
+}
+
h1,h2,h3,h4,h5,h6 {
transition: color .6s;
color: var(--title-color);
diff --git a/src/assets/style/_code.scss b/src/assets/style/_code.scss
index cc7c7aa..d90d2df 100644
--- a/src/assets/style/_code.scss
+++ b/src/assets/style/_code.scss
@@ -12,7 +12,7 @@ pre {
background-color: var(--bg-code);
margin-bottom: var(--space);
border: 1px solid var(--border-color);
- border-radius: 5px;
+ border-radius: var(--radius);
}
code {
@@ -57,7 +57,7 @@ pre[class*="language-"] {
/* Inline code */
:not(pre) > code[class*="language-"] {
- border-radius: .3em;
+ border-radius: var(--radius);
white-space: normal;
}
diff --git a/src/assets/style/_content-box.scss b/src/assets/style/_content-box.scss
index a75bbd7..e6d7f37 100644
--- a/src/assets/style/_content-box.scss
+++ b/src/assets/style/_content-box.scss
@@ -3,7 +3,7 @@
background-color: var(--bg-highlight-color);
transition: background-color .6s;
padding: var(--space);
- border-radius: 5px;
+ border-radius: var(--radius);
box-shadow: 1px 1px 5px 0 rgba(0,0,0,.02), 1px 1px 15px 0 rgba(0,0,0,.03);
transition: transform .3s, background-color .3s, box-shadow .6s;
}
diff --git a/src/assets/style/_variables.scss b/src/assets/style/_variables.scss
index ec9c3c2..368119a 100644
--- a/src/assets/style/_variables.scss
+++ b/src/assets/style/_variables.scss
@@ -13,8 +13,10 @@ body {
--border-color: rgba(0,0,0,.1);;
--space: 2.5rem;
--container-width: 800px;
+ --radius: 5px;
}
+// Make things smaller for mobile
@media screen and (max-width: 650px) {
html {
--base-font-size: 17px;
@@ -25,7 +27,7 @@ body {
}
-// Override variables for Dark style
+// Override variables for Dark theme
body[data-theme="dark"] {
--bg-color: #0D2538;
--bg-highlight-color: #0f2d44;
diff --git a/src/components/PostCard.vue b/src/components/PostCard.vue
index ad8eeb8..68ad8cd 100644
--- a/src/components/PostCard.vue
+++ b/src/components/PostCard.vue
@@ -1,12 +1,14 @@
-
+
@@ -26,16 +28,22 @@ export default {
position: relative;
&__header {
- width: calc(100% + var(--space) * 2);
margin-left: calc(var(--space) * -1);
- margin-top: calc(var(--space) * -1);
+ margin-right: calc(var(--space) * -1);
margin-bottom: calc(var(--space) / 2);
-
+ margin-top: calc(var(--space) * -1);
+ overflow: hidden;
+ border-radius: var(--radius) var(--radius) 0 0;
+
&:empty {
display: none;
}
}
+ &__image {
+ min-width: 100%;
+ }
+
&__title {
margin-top: 0;
}
diff --git a/src/pages/Index.vue b/src/pages/Index.vue
index 59c3407..fe7a41e 100644
--- a/src/pages/Index.vue
+++ b/src/pages/Index.vue
@@ -1,6 +1,5 @@
-
@@ -31,6 +30,7 @@ query {
date (format: "D. MMMM YYYY")
timeToRead
excerpt
+ poster (width: 770, height: 380, blur: 10)
}
}
}
@@ -51,8 +51,3 @@ export default {
}
}
-
-
-
diff --git a/src/templates/Post.vue b/src/templates/Post.vue
index 15c4f5e..8780396 100644
--- a/src/templates/Post.vue
+++ b/src/templates/Post.vue
@@ -7,7 +7,7 @@
@@ -45,6 +45,7 @@ query Post ($path: String!) {
timeToRead
excerpt
content
+ poster (width: 800, height: 460, blur: 10)
}
}
@@ -61,6 +62,9 @@ query Post ($path: String!) {
width: calc(100% + var(--space) * 2);
margin-left: calc(var(--space) * -1);
margin-top: calc(var(--space) * -1);
+ margin-bottom: calc(var(--space) / 2);
+ overflow: hidden;
+ border-radius: var(--radius) var(--radius) 0 0;
&:empty {
display: none;
@@ -72,9 +76,12 @@ query Post ($path: String!) {
color: var(--title-color);
}
- img {
- width: calc(100% + var(--space) * 2);
- margin-left: calc(var(--space) * -1);
+ &__content {
+ img {
+ width: calc(100% + var(--space) * 2);
+ margin-left: calc(var(--space) * -1);
+ display: block;
+ }
}
}