1
0
Fork 0

Various fixes

This commit is contained in:
Tommy Vedvik 2019-02-27 11:06:18 +01:00
parent 76b919b498
commit c2265d0513
11 changed files with 457 additions and 108 deletions

View file

@ -0,0 +1,286 @@
---
title: Markdown test files
date: 2019-02-06
excerpt: "Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions."
---
## Overview
Markdown is intended to be as easy-to-read and easy-to-write as is feasible.
Readability, however, is emphasized above all else. A Markdown-formatted
document should be publishable as-is, as plain text, without looking
like it's been marked up with tags or formatting instructions. While
Markdown's syntax has been influenced by several existing text-to-HTML
filters -- including [Setext](http://docutils.sourceforge.net/mirror/setext.html), [atx](http://www.aaronsw.com/2002/atx/), [Textile](http://textism.com/tools/textile/), [reStructuredText](http://docutils.sourceforge.net/rst.html),
[Grutatext](http://www.triptico.com/software/grutatxt.html), and [EtText](http://ettext.taint.org/doc/) -- the single biggest source of
inspiration for Markdown's syntax is the format of plain text email.
## Block Elements
### Paragraphs and Line Breaks
A paragraph is simply one or more consecutive lines of text, separated
by one or more blank lines. (A blank line is any line that looks like a
blank line -- a line containing nothing but spaces or tabs is considered
blank.) Normal paragraphs should not be indented with spaces or tabs.
The implication of the "one or more consecutive lines of text" rule is
that Markdown supports "hard-wrapped" text paragraphs. This differs
significantly from most other text-to-HTML formatters (including Movable
Type's "Convert Line Breaks" option) which translate every line break
character in a paragraph into a `<br />` tag.
When you *do* want to insert a `<br />` break tag using Markdown, you
end a line with two or more spaces, then type return.
### Headers
Markdown supports two styles of headers, [Setext] [1] and [atx] [2].
Optionally, you may "close" atx-style headers. This is purely
cosmetic -- you can use this if you think it looks better. The
closing hashes don't even need to match the number of hashes
used to open the header. (The number of opening hashes
determines the header level.)
### Blockquotes
Markdown uses email-style `>` characters for blockquoting. If you're
familiar with quoting passages of text in an email message, then you
know how to create a blockquote in Markdown. It looks best if you hard
wrap the text and put a `>` before every line:
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
Markdown allows you to be lazy and only put the `>` before the first
line of a hard-wrapped paragraph:
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
id sem consectetuer libero luctus adipiscing.
Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
adding additional levels of `>`:
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
Blockquotes can contain other Markdown elements, including headers, lists,
and code blocks:
> ## This is a header.
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script");
Any decent text editor should make email-style quoting easy. For
example, with BBEdit, you can make a selection and choose Increase
Quote Level from the Text menu.
### Lists
Markdown supports ordered (numbered) and unordered (bulleted) lists.
Unordered lists use asterisks, pluses, and hyphens -- interchangably
-- as list markers:
* Red
* Green
* Blue
is equivalent to:
+ Red
+ Green
+ Blue
and:
- Red
- Green
- Blue
Ordered lists use numbers followed by periods:
1. Bird
2. McHale
3. Parish
It's important to note that the actual numbers you use to mark the
list have no effect on the HTML output Markdown produces. The HTML
Markdown produces from the above list is:
If you instead wrote the list in Markdown like this:
1. Bird
1. McHale
1. Parish
or even:
3. Bird
1. McHale
8. Parish
you'd get the exact same HTML output. The point is, if you want to,
you can use ordinal numbers in your ordered Markdown lists, so that
the numbers in your source match the numbers in your published HTML.
But if you want to be lazy, you don't have to.
To make lists look nice, you can wrap items with hanging indents:
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.
But if you want to be lazy, you don't have to:
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
viverra nec, fringilla in, laoreet vitae, risus.
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
Suspendisse id sem consectetuer libero luctus adipiscing.
List items may consist of multiple paragraphs. Each subsequent
paragraph in a list item must be indented by either 4 spaces
or one tab:
1. This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.
It looks nice if you indent every line of the subsequent
paragraphs, but here again, Markdown will allow you to be
lazy:
* This is a list item with two paragraphs.
This is the second paragraph in the list item. You're
only required to indent the first line. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit.
* Another item in the same list.
To put a blockquote within a list item, the blockquote's `>`
delimiters need to be indented:
* A list item with a blockquote:
> This is a blockquote
> inside a list item.
To put a code block within a list item, the code block needs
to be indented *twice* -- 8 spaces or two tabs:
* A list item with a code block:
<code goes here>
### 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 `<pre>` and `<code>` 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:
<div class="footer">
&copy; 2004 Foo Corporation
</div>
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 `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML
`<strong>` 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.

View file

@ -1,80 +0,0 @@
---
title: Say hello to Gridsome 2 👶🎉💚
author: [tommyvedvik]
date: 2018-10-10
excerpt: "A new static site generator baby is born. It's highly inspired by Gatsby.js (React based) but built on top of Vue.js. We have been working on it for a year and will have a beta ready soon. You can expect this baby to grow up fast!"
---
We think **Gridsome** is a missing piece to the Vue.js ecosystem. What Gatsby.js does for React.js is a game changer in how we build websites. React.js is excellent, but we think Vue.js is more approachable for most web designers and devs getting started with JAMstack. Gridsome is the Vue.js alternative to Gatsby.
With **Gridsome** you get a **universal GraphQL layer** for all your connected data sources. It's like a single source of truth for your website data ready to be used in any page or components. Connect to any CMS or APIs like Google Spreadsheet, Airtable, Instagram Feed, local markdown files, etc.
Here is an example on how to query posts from the GraphQL layer in a page:
```html
<template>
<Layout>
<h2>Latest blog posts</h2>
<ul>
<li v-for="edge in $page.allWordPressPost.edges">
{{ edge.node.title }}
</li>
</ul>
</Layout>
</template>
<page-query>
query Blog {
allWordPressPost (limit: 5) {
edges {
node {
_id
title
}
}
}
}
</page-query>
```
You don't need to know GraphQL or Vue to get started with Gridsome - It's a great way to get introduced to both.
The GraphQL layer and all the data can be explored in a local GraphQL playground. The playground is usually located at `https://localhost:8080/___explore` when a Gridsome development project is running.
#### Perfect scores on Google Lighthouse - automagically 💚
One of the main goals of Gridsome is to make a framework that let you build websites that are optimized "out-of-the-box." It follows the [PRPL-pattern by Google.](https://developers.google.com/web/fundamentals/performance/prpl-pattern/) You don't need to be a performance expert to make fast websites with Gridsome. Your site gets almost perfect scores on Google lighthouse out-of-the-box. These are some of the performance steps that Gridsome takes care of:
- Image compressing & lazy-loading ⚡️
- CSS & JS minification ⚡️
- Code-splitting ⚡️
- HTML compressing ⚡️
- Critical CSS (Plugin) ⚡️
- Full PWA & Offline-support (plugin) ⚡️
#### A better way to build websites
Gridsome is built for the JAMstack workflow - a new way to build websites that gives you better performance, higher security, cheaper hosting, and a better developer experience. Generate prerendered (static) pages at build time for SEO-purpose and add powerful dynamic functionality with APIs and Vue.js.
We believe the SSGs / JAMstack trend is just getting started. When you have first started to make websites this way there is no way back. You feel almost "dirty" when going back to a traditional WordPress / CMS setup.
Try running the new Chrome Lighthouse (Audit tab in Developer tools) on a WordPress site - It is impossible to get good scores even with the best caching plugins and hosting. With Gridsome you don't even need caching plugins. Website optimization is taken care of at build time.
This is what we think is very exciting and is why we are building Gridsome. It is the **perfect SPA & PWA front-end solution** for any headless CMS or content APIs.
#### Whats next
In the next couple of months we're going to continue to improve the docs, create tutorials, add more source & transformer plugins and fix bugs.
#### Contribute to Gridsome
We're currently just two brothers working on this, so any contribution is very welcome. We're passionate about building a faster web and make website building fun again.
You can also support us by giving [a GitHub star ★](https://github.com/gridsome/gridsome/stargazers) and spread the word :)

View file

@ -1,7 +1,6 @@
---
title: Say hello to Gridsome 👶🎉💚
author: [tommyvedvik]
date: 2018-10-10
title: Say hello to Gridsome 🎉
date: 2019-02-07
excerpt: "A new static site generator baby is born. It's highly inspired by Gatsby.js (React based) but built on top of Vue.js. We have been working on it for a year and will have a beta ready soon. You can expect this baby to grow up fast!"
---

134
src/assets/style/_code.scss Normal file
View file

@ -0,0 +1,134 @@
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
pre {
padding: calc(var(--space) / 2);
font-size: .85em;
background-color: var(--bg-code);
margin-bottom: var(--space);
border: 1px solid var(--border-color);
border-radius: 5px;
}
code {
background-color: var(--bg-code);
border: 1px solid var(--border-color);
font-size: .85em;
padding: .2em .5em;
}
code[class*="language-"],
pre[class*="language-"] {
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
overflow: auto;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #c71b7b;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #20a7e0;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

View file

@ -40,4 +40,14 @@ small {font-size: 0.889em;}
strong {
font-weight: 600;
}
blockquote {
border-left: 4px solid var(--border-color);
padding-left: calc(var(--space) / 2);
color: var(--title-color);
}
em {
font-style: italic;
}

View file

@ -2,10 +2,11 @@
body {
--bg-color: #F3F7F9;
--bg-highlight-color: #FFF;
--bg-code: rgba(0,0,0,.025);
--bg-code: #fffbf3;
--body-color: #444;
--title-color: #111;
--link-color: #2cb2f5;
--border-color: rgba(0,0,0,.1);;
--space: 2.5rem;
--container-width: 800px;
}
@ -23,6 +24,8 @@ body[data-theme="dark"] {
--bg-color: #0D2538;
--bg-highlight-color: #0f2d44;
--bg-code: rgba(0,0,0,.3);
--border-color: rgba(255,255,255,.1);;
--body-color: #ced8de;
--title-color: #fff;
}

View file

@ -2,4 +2,5 @@
@import 'variables';
@import 'typography';
@import 'base';
@import 'code';
@import 'content-box';

View file

@ -1,5 +1,10 @@
<template>
<div class="post-meta">Posted 19. February 2019. <strong>3 min</strong> read</div>
<div class="post-meta">
Posted {{ post.date }}.
<template v-if="post.timeToRead">
<strong>{{ post.timeToRead }} min read</strong>
</template>
</div>
</template>
<script>

View file

@ -17,7 +17,7 @@
</main>
<footer class="footer">
Copyright © {{ new Date().getFullYear() }}. Powered by Gridsome
Copyright © {{ new Date().getFullYear() }}. Powered by <a href="//gridsome.org"> Gridsome </a>
</footer>
</div>
@ -48,6 +48,7 @@ export default {
padding: 0 calc(var(--space) / 2);
top:0;
z-index: 10;
&__left,
&__right {
display: flex;
@ -63,7 +64,7 @@ export default {
.main {
max-width: var(--container-width);
margin: 0 auto;
padding: 2vw 15px 0;
padding: 3.33vw 15px 0;
}
.footer {

View file

@ -1,9 +1,6 @@
// Import main css
import '~/assets/style/index.scss'
// Import PrismJS style
import 'prismjs/themes/prism.css'
// Import default layout so we don't need to import it to every page
import DefaultLayout from '~/layouts/Default.vue'

View file

@ -9,6 +9,7 @@
<div class="post__header">
<!-- Add anything here. Like a featured image -->
</div>
<p v-if="$page.post.excerpt" class="post__excerpt" v-html="$page.post.excerpt" />
<div class="post__content" v-html="$page.post.content" />
<div class="post__footer">
<!-- Add anything here -->
@ -38,7 +39,11 @@ export default {
<page-query>
query Post ($path: String!) {
post: post (path: $path) {
title
title
path
date (format: "D. MMMM YYYY")
timeToRead
excerpt
content
}
}
@ -63,27 +68,15 @@ query Post ($path: String!) {
}
}
&__excerpt {
font-size: 1.2em;
color: var(--title-color);
}
img {
width: calc(100% + var(--space) * 2);
margin-left: calc(var(--space) * -1);
}
pre {
padding: calc(var(--space) / 2);
font-size: .85em;
background-color: var(--bg-code);
color: var(--body-color);
text-shadow: none;
margin-bottom: 2em;
border: 1px solid rgba(0,0,0,.03);
border-radius: 5px;
}
code {
background-color: var(--bg-code)!important;
color: var(--body-color);
text-shadow: none;
}
}
.post-comments {