Skip to content

Commit b5a9430

Browse files
initial commit by Stackbit
0 parents  commit b5a9430

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+23078
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ko_fi: alexanderheimbuch
2+
custom: https://www.amazon.de/hz/wishlist/ls/237T6KS5438PE

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
publish/

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "chrome",
9+
"request": "launch",
10+
"name": "Launch Chrome against localhost",
11+
"url": "http://localhost:8080",
12+
"webRoot": "${workspaceFolder}"
13+
}
14+
]
15+
}

README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Casper Theme
2+
3+
Ghosts default theme [Casper](https://github.com/TryGhost/Casper) for Vuepress.
4+
5+
## Create with Stackbit
6+
7+
[![Create with Stackbit](https://assets.stackbit.com/badge/create-with-stackbit.svg)](https://app.stackbit.com/create?theme=https://github.com/alexander-heimbuch/vuepress-theme-casper)
8+
9+
## Installation
10+
11+
Install the npm package:
12+
13+
```bash
14+
$ npm i vuepress-theme-casper --save
15+
# or
16+
$ yarn add vuepress-theme-casper
17+
```
18+
19+
Adapt your vuepress config `config.js`:
20+
21+
```js
22+
module.exports = {
23+
title: 'Theme Title',
24+
description: 'Theme description',
25+
base: '/',
26+
theme: 'casper',
27+
head: [
28+
['link', { rel: 'icon', href: '/favicon.png' }]
29+
],
30+
markdown: {
31+
anchor: {
32+
permalink: false,
33+
permalinkBefore: false
34+
}
35+
},
36+
themeConfig: {
37+
cover: '/images/cover.jpg',
38+
logo: '/images/logo.png',
39+
nav: [{
40+
text: 'Home',
41+
link: '/'
42+
}, {
43+
text: 'Posts',
44+
link: '/posts'
45+
}, {
46+
text: 'Category',
47+
link: '/category/some-category'
48+
}, {
49+
text: 'Page',
50+
link: '/a-page.html'
51+
}],
52+
53+
footer: [{
54+
text: 'Latest Posts',
55+
link: '/posts'
56+
}, {
57+
text: 'Facebook',
58+
link: 'https://facebook.com/'
59+
}, {
60+
text: 'Twitter',
61+
link: 'https://twitter.com'
62+
}, {
63+
text: 'Github',
64+
link: 'https://github.com/'
65+
}],
66+
social: {
67+
github: 'https://github.com',
68+
twitter: 'https://twitter.com',
69+
facebook: 'https://facebook.com',
70+
xing: 'https://xing.de',
71+
instagram: 'https://instagram.com',
72+
linkedin: 'https://linkedin.com'
73+
}
74+
}
75+
}
76+
```
77+
78+
## Page/Post Parameters
79+
80+
The following parameters are available:
81+
82+
```
83+
---
84+
title: And when we woke up, we had these bodies.
85+
image: https://picsum.photos/1920/1080/?random&date=2018-04-15
86+
publish: 2018-04-15
87+
type: post|page
88+
tags:
89+
- toe-tappingly tragic
90+
- thanks to the Internet
91+
categories:
92+
- futurama
93+
readingTime: 10 Minutes
94+
---
95+
```
96+
97+
The post intro uses the `<!-- more -->` tag.
98+
99+
## Caveats
100+
101+
* For simplicity this theme doesn't support multiple authors

blog/.vuepress/config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const config = require('./data/config.json');
2+
3+
module.exports = Object.assign(config, {
4+
head: [
5+
['link', { rel: 'icon', href: '/favicon.png' }]
6+
],
7+
markdown: {
8+
anchor: {
9+
permalink: false,
10+
permalinkBefore: false
11+
}
12+
}
13+
});
83.8 KB
Loading
8.79 KB
Loading
216 KB
Loading

blog/.vuepress/theme/Layout.vue

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<template>
2+
<div class="site-wrapper">
3+
<site-header :blog="blog" :header="header">
4+
<site-navigation slot="header"></site-navigation>
5+
</site-header>
6+
<component :is="content"></component>
7+
<site-footer />
8+
</div>
9+
</template>
10+
11+
<script>
12+
import { mapActions, mapGetters } from 'vuex'
13+
14+
import Post from './layouts/Post'
15+
import Page from './layouts/Page'
16+
import Posts from './layouts/Posts'
17+
18+
import SiteHeader from './partials/Header'
19+
import SiteFooter from './partials/Footer'
20+
import SiteNavigation from './partials/Navigation'
21+
22+
export default {
23+
components: { Page, Posts, Post, SiteFooter, SiteHeader, SiteNavigation },
24+
methods: {
25+
...mapActions(['updateSite', 'updatePage', 'updateParams']),
26+
updateLayoutClass () {
27+
this.$el.parentNode.className = `${this.type}-template`
28+
}
29+
},
30+
computed: {
31+
...mapGetters(['type', 'blog', 'header']),
32+
33+
content () {
34+
switch (this.type) {
35+
case 'home':
36+
case 'tags':
37+
case 'posts':
38+
case 'category':
39+
return 'posts'
40+
case 'post':
41+
return 'post'
42+
case 'page':
43+
return 'page'
44+
}
45+
},
46+
},
47+
watch: {
48+
$page () {
49+
this.updatePage(this.$page)
50+
this.updateLayoutClass()
51+
},
52+
$route () {
53+
this.updateParams(this.$route.params)
54+
this.updateLayoutClass()
55+
}
56+
},
57+
mounted () {
58+
this.updatePage(this.$page)
59+
this.updateSite(this.$site)
60+
this.updateParams(this.$route.params)
61+
this.updateLayoutClass()
62+
63+
}
64+
}
65+
</script>
66+
67+
<style lang="scss">
68+
@import './styles/reset';
69+
@import './styles/defaults';
70+
71+
/* 1. Global - Set up the things
72+
/* ---------------------------------------------------------- */
73+
74+
body {
75+
background: #f4f8fb;
76+
}
77+
78+
.img {
79+
display: block;
80+
width: 100%;
81+
height: 100%;
82+
background-position: center center;
83+
background-size: cover;
84+
border-radius: 100%;
85+
}
86+
87+
.hidden {
88+
visibility: hidden;
89+
position: absolute;
90+
text-indent: -9999px;
91+
}
92+
93+
94+
/* 2. Layout - Page building blocks
95+
/* ---------------------------------------------------------- */
96+
97+
.site-wrapper {
98+
display: flex;
99+
flex-direction: column;
100+
min-height: 100vh;
101+
}
102+
103+
.site-main {
104+
z-index: 90;
105+
flex-grow: 1;
106+
}
107+
108+
/* Full width page blocks */
109+
.outer {
110+
position: relative;
111+
padding: 0 4vw;
112+
}
113+
114+
/* Centered content container blocks */
115+
.inner {
116+
margin: 0 auto;
117+
max-width: 1040px;
118+
width: 100%;
119+
}
120+
121+
/* 3. Special Template Styles
122+
/* ---------------------------------------------------------- */
123+
@media (min-width: 900px) {
124+
.home-template,
125+
.category-template,
126+
.tags-template,
127+
.posts-template,
128+
.author-template {
129+
.post-feed {
130+
margin-top: -70px;
131+
padding-top: 0;
132+
}
133+
134+
.site-nav {
135+
position: relative;
136+
top: -70px;
137+
}
138+
}
139+
140+
}
141+
142+
</style>

0 commit comments

Comments
 (0)