diff --git a/assets/styles/main.scss b/assets/styles/main.scss
index e7a456a08..b53052abb 100644
--- a/assets/styles/main.scss
+++ b/assets/styles/main.scss
@@ -80,3 +80,38 @@ blockquote {
width: 100%;
z-index: 10;
}
+
+.hc-editor-content {
+ h1,
+ h2,
+ h3,
+ h4,
+ h5,
+ h6 {
+ &:not(:first-child) {
+ margin-top: 2rem;
+ }
+ }
+ p {
+ &:not(:last-child) {
+ margin-top: 0;
+ margin-bottom: 0;
+ }
+ }
+ dl,
+ ol,
+ ul,
+ blockquote,
+ pre,
+ table {
+ &:not(:first-child) {
+ margin-top: 15px;
+ }
+ }
+ .linebreak {
+ display: none;
+ }
+ // br {
+ // display: none;
+ // }
+}
diff --git a/components/Author.vue b/components/Author.vue
index f3f20caeb..ddb005cc8 100644
--- a/components/Author.vue
+++ b/components/Author.vue
@@ -28,7 +28,7 @@
- {{ post.createdAt | dateTime }}
+ {{ post.createdAt | dateTime('dd. MMMM yyyy HH:mm') }}
diff --git a/components/PostCard.vue b/components/PostCard.vue
index 723ab402f..cf9bcdf97 100644
--- a/components/PostCard.vue
+++ b/components/PostCard.vue
@@ -7,7 +7,9 @@
:header="post.title"
:image="post.image"
style="cursor: pointer; position: relative;">
-
+
@@ -183,12 +183,6 @@ export default {
// max-width: 800px;
margin: auto;
- .content {
- br {
- display: none;
- }
- }
-
.comments {
margin-top: $space-small;
diff --git a/pages/profile/_slug.vue b/pages/profile/_slug.vue
index 05aac7045..1e19849be 100644
--- a/pages/profile/_slug.vue
+++ b/pages/profile/_slug.vue
@@ -20,6 +20,12 @@
tag="h3"
align="center"
no-margin>{{ user.name }}
+
+ Mitglied seid {{ user.createdAt | date('MMMM yyyy') }}
+
{
+ const keepAlivePages = process.env.keepAlivePages || []
+
+ Vue.mixin({
+ // Save route if this instance is a page (has metaInfo)
+ mounted() {
+ if (this.$metaInfo) {
+ lastRoute = this.$route.name
+ }
+ },
+ activated() {
+ if (this.$metaInfo) {
+ lastRoute = this.$route.name
+ }
+ },
+ deactivated() {
+ // If this is a page and we don't want it to be kept alive
+ if (this.$metaInfo && !keepAlivePages.includes(lastRoute)) {
+ this.$destroy()
+ }
+ }
+ })
+}
+Vue.use(keepAliveHook)
diff --git a/plugins/vue-filters.js b/plugins/vue-filters.js
index 7f93ab098..4e7ac215e 100644
--- a/plugins/vue-filters.js
+++ b/plugins/vue-filters.js
@@ -1,19 +1,25 @@
import Vue from 'vue'
+import { en, de } from 'date-fns/locale'
import format from 'date-fns/format'
-import addSeconds from 'date-fns/add_seconds'
+import formatRelative from 'date-fns/formatRelative'
+import addSeconds from 'date-fns/addSeconds'
import accounting from 'accounting'
export default ({ app }) => {
app.$filters = Object.assign(app.$filters || {}, {
- date: (value, fmt = 'DD. MMM YYYY') => {
+ date: (value, fmt = 'dd. MMM yyyy') => {
if (!value) return ''
- return format(new Date(value), fmt)
+ return format(new Date(value), fmt, { locale: de })
},
- dateTime: (value, fmt = 'DD. MMM YYYY HH:mm') => {
+ dateTime: (value, fmt = 'dd. MMM yyyy HH:mm') => {
if (!value) return ''
- return format(new Date(value), fmt)
+ return format(new Date(value), fmt, { locale: de })
+ },
+ relativeDateTime: value => {
+ if (!value) return ''
+ return formatRelative(new Date(value), new Date(), { locale: de })
},
number: (
value,
diff --git a/yarn.lock b/yarn.lock
index 29454854b..d2dec62e3 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2482,9 +2482,9 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
-date-fns@^1.29.0:
- version "1.29.0"
- resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6"
+date-fns@^2.0.0-alpha.24:
+ version "2.0.0-alpha.24"
+ resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.0.0-alpha.24.tgz#2988c137c72275af29d7d21cc53eb52b3a8c2586"
date-now@^0.1.4:
version "0.1.4"