1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-16 20:16:20 +02:00

Version 1.5.1: Fix code syntax in raw editor, fix codeblocks, fix post errors, load post-vue conditionally

This commit is contained in:
trendschau
2021-11-21 15:39:45 +01:00
parent 63c8b204d7
commit 1f06da7b19
9 changed files with 22 additions and 9 deletions

View File

@@ -8,6 +8,7 @@ Typemill provides easy and intuitive authoring tools and we work hard to create
You can create, structure and reorder all pages with the navigation on the left side. To structure your content, you can create new folders and files with the "add item" button. To reorder the pages, just drag an item and drop it wherever you want. Play around with it and you will notice, that it works pretty similar to the folder- and file-system of your laptop. And in fact, this is exactly what Typemill does in the background: It stores your content in files and folders on the server.
sdf
However, there are some limitations when you try to reorder elements. For example, you cannot move a complete folder to another folder, because this would change all the urls of the pages inside that folder, which is a nightmare for readers and search engines.
## The Editor

View File

@@ -722,7 +722,7 @@ class ControllerAuthorArticleApi extends ControllerAuthor
# update the structure for editor
$this->setFreshStructureDraft();
$folder = Folder::getItemWithKeyPath($this->structureYaml, $folderKeyPath);
$folder = Folder::getItemWithKeyPath($this->structureDraft, $folderKeyPath);
# activate this if you want to redirect after creating the page...
# $url = $this->uri->getBaseUrl() . '/tm/content/' . $this->settings['editor'] . $folder->urlRelWoF . '/' . $slug;
@@ -1031,7 +1031,6 @@ class ControllerAuthorArticleApi extends ControllerAuthor
{
$content[0] = trim($content[0], "# ");
}
return $response->withJson(array('data' => $content, 'errors' => false));
}

View File

@@ -994,6 +994,11 @@ class ParsedownExtension extends \ParsedownExtra
);
}
# keep empty lines in pre-tags
if($CurrentBlock['type'] == 'FencedCode' && isset($current['text']))
{
$current['text'] .= "\n";
}
continue;
}
@@ -1050,7 +1055,6 @@ class ParsedownExtension extends \ParsedownExtra
# current block failed to "eat" current line
# let's see if we can start a new block
$marker = $text[0];
# ~

View File

@@ -45,7 +45,8 @@
</div>
<div class="large" :class="{'error' : errors.content}">
<label for="content">{{ __('Content') }}*</label>
<textarea id="content" v-model="form.content" @input="changeContent" required>{{ content }}</textarea>
<textarea @input="changeContent" v-model="form.content" required></textarea>
<div id="content" style="display:none" v-pre>{{ content }}</div>
<span class="error" v-if="errors.content">${ errors.content }</span>
</div>
<input id="path" type="hidden" value="{{ item.urlRel }}" required readonly />

View File

@@ -8,7 +8,7 @@ let editor = new Vue({
},
form: {
title: document.getElementById("title").value,
content: document.getElementById("content").value,
content: document.getElementById("content").innerHTML,
},
showEditor: 'show',
},

View File

@@ -146,8 +146,8 @@ let meta = new Vue({
{
editor.showEditor = 'hidden';
posts.showPosts = 'hidden';
}
return 'tab-' + this.currentTab.toLowerCase()
}
}
},
mounted: function(){

View File

@@ -66,4 +66,4 @@ let posts = new Vue({
});
}
}
})
})

View File

@@ -62,7 +62,11 @@
{{ assets.renderEditorJS() }}
<script src="{{ base_url }}/system/author/js/vue-blox.js?20211010"></script>
<script src="{{ base_url }}/system/author/js/vue-posts.js?20211010"></script>
{% if item.elementType == "folder" %}
<script src="{{ base_url }}/system/author/js/vue-posts.js?20211010"></script>
{% else %}
<script>let posts = false;</script>
{% endif %}
<script src="{{ base_url }}/system/author/js/sortable.min.js?20211010"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20211010"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20211010"></script>

View File

@@ -59,7 +59,11 @@
{{ assets.renderEditorJS() }}
<script src="{{ base_url }}/system/author/js/vue-editor.js?20211010"></script>
<script src="{{ base_url }}/system/author/js/vue-posts.js?20211010"></script>
{% if item.elementType == "folder" %}
<script src="{{ base_url }}/system/author/js/vue-posts.js?20211010"></script>
{% else %}
<script>let posts = false;</script>
{% endif %}
<script src="{{ base_url }}/system/author/js/sortable.min.js?20211010"></script>
<script src="{{ base_url }}/system/author/js/vuedraggable.umd.min.js?20211010"></script>
<script src="{{ base_url }}/system/author/js/vue-navi.js?20211010"></script>