Markdown display fixes + error pages

This commit is contained in:
NGPixel 2016-12-05 21:42:41 -05:00
parent f7ce81e8c9
commit 593481c7e1
11 changed files with 48 additions and 26 deletions

View File

@ -20,6 +20,7 @@ before_script:
- npm install -g snyk - npm install -g snyk
- snyk auth $SNYK_TOKEN - snyk auth $SNYK_TOKEN
before_deploy: before_deploy:
- npm install github:requarks/core -f
- npm install -g gulp - npm install -g gulp
- gulp deploy - gulp deploy
- snyk monitor - snyk monitor

View File

@ -1,8 +1,8 @@
<a href="https://github.com/Requarks/wiki"> <a href="https://github.com/Requarks/wiki">
<img src="https://raw.githubusercontent.com/Requarks/wiki/master/assets/favicons/favicon-96x96.png" alt="Requarks Wiki" title="Requarks Wiki" align="right" /> <img src="https://raw.githubusercontent.com/Requarks/wiki/master/assets/favicons/favicon-96x96.png" alt="Wiki.js" title="Wiki.js" align="right" />
</a> </a>
# Requarks Wiki # Wiki.js
[![Release](https://img.shields.io/github/release/Requarks/wiki.svg?maxAge=86400)](https://github.com/Requarks/wiki/releases) [![Release](https://img.shields.io/github/release/Requarks/wiki.svg?maxAge=86400)](https://github.com/Requarks/wiki/releases)
[![License](https://img.shields.io/badge/license-AGPLv3-blue.svg)](https://github.com/requarks/wiki/blob/master/LICENSE) [![License](https://img.shields.io/badge/license-AGPLv3-blue.svg)](https://github.com/requarks/wiki/blob/master/LICENSE)
@ -16,7 +16,7 @@
### Documentation ### Documentation
- [Installation Guide](https://requarks-wiki.readme.io/docs/prerequisites) - [Installation Guide](https://wiki.requarks.io/install)
##### Milestones ##### Milestones
- [ ] Account Management - [ ] Account Management

View File

@ -91,7 +91,7 @@ var job = new cron({
}); });
fs.walk(repoPath).on('data', function (item) { fs.walk(repoPath).on('data', function (item) {
if(path.extname(item.path) === '.md') { if(path.extname(item.path) === '.md' && path.basename(item.path) !== 'README.md') {
let entryPath = entries.parsePath(entries.getEntryPathFromFullPath(item.path)); let entryPath = entries.parsePath(entries.getEntryPathFromFullPath(item.path));
let cachePath = entries.getCachePath(entryPath); let cachePath = entries.getCachePath(entryPath);

File diff suppressed because one or more lines are too long

1
assets/css/error.css Normal file

File diff suppressed because one or more lines are too long

9
client/scss/error.scss Normal file
View File

@ -0,0 +1,9 @@
$primary: 'indigo';
@import 'core-client/scss/core';
@import 'core-client/scss/components/button';
@import 'core-client/scss/components/grid';
@import 'core-client/scss/components/typography';
@import 'core-client/scss/pages/error';

View File

@ -35,6 +35,8 @@ paths:
# Site Authentication # Site Authentication
# --------------------------------------------------------------------- # ---------------------------------------------------------------------
public: false
auth: auth:
local: local:
enabled: true enabled: true

View File

@ -55,7 +55,7 @@ var mkdown = md({
// Rendering rules // Rendering rules
mkdown.renderer.rules.emoji = function(token, idx) { mkdown.renderer.rules.emoji = function(token, idx) {
return '<i class="twa twa-' + token[idx].markup + '"></i>'; return '<i class="twa twa-' + _.replace(token[idx].markup, /_/g, '-') + '"></i>';
}; };
/** /**
@ -171,6 +171,19 @@ const parseContent = (content) => {
cr(elm).replaceWith(txtLink); cr(elm).replaceWith(txtLink);
}); });
//-> Re-attach blockquote styling classes to their parents
cr.root().children('blockquote').each((i, elm) => {
if(cr(elm).children().length > 0) {
let bqLastChild = cr(elm).children().last()[0];
let bqLastChildClasses = cr(bqLastChild).attr('class');
if(bqLastChildClasses.length > 0) {
cr(bqLastChild).removeAttr('class');
cr(elm).addClass(bqLastChildClasses);
}
}
});
output = cr.html(); output = cr.html();
return output; return output;

View File

@ -1,7 +1,7 @@
footer.footer footer.footer
span span
= t('footer.poweredby') + ' ' = t('footer.poweredby') + ' '
a(href='https://github.com/Requarks/wiki') Requarks Wiki a(href='https://github.com/Requarks/wiki') Wiki.js
| . | .
ul ul
li: a(href='/')= t('footer.home') li: a(href='/')= t('footer.home')

View File

@ -19,13 +19,11 @@ html
// CSS // CSS
link(type='text/css', rel='stylesheet', href='/css/libs.css') link(type='text/css', rel='stylesheet', href='/css/libs.css')
link(type='text/css', rel='stylesheet', href='/css/app.css') link(type='text/css', rel='stylesheet', href='/css/error.css')
body(class='server-error') body(class='is-forbidden')
section.hero.is-danger.is-fullheight .container
.hero-body a(href='/'): img(src='/favicons/android-icon-96x96.png')
.container h1.title(style={ 'margin-top': '30px'}) Forbidden
a(href='/'): img(src='/favicons/android-icon-96x96.png') h2.subtitle(style={ 'margin-bottom': '50px'}) Sorry, you don't have the necessary permissions to access this page.
h1.title(style={ 'margin-top': '30px'}) Forbidden a.button.is-amber.is-inverted(href='/') Go Home
h2.subtitle(style={ 'margin-bottom': '50px'}) Sorry, you don't have the necessary permissions to access this page.
a.button.is-dark.is-inverted(href='/') Go Home

View File

@ -19,14 +19,12 @@ html
// CSS // CSS
link(type='text/css', rel='stylesheet', href='/css/libs.css') link(type='text/css', rel='stylesheet', href='/css/libs.css')
link(type='text/css', rel='stylesheet', href='/css/app.css') link(type='text/css', rel='stylesheet', href='/css/error.css')
body(class='server-error') body(class='is-notexist')
section.hero.is-dark.is-fullheight .container
.hero-body a(href='/'): img(src='/favicons/android-icon-96x96.png')
.container h1= message
a(href='/'): img(src='/favicons/android-icon-96x96.png') h2 Would you like to create this entry?
h1.title(style={ 'margin-top': '30px'})= message a.button.is-amber.is-inverted(href='/create/' + newpath) Create
h2.subtitle(style={ 'margin-bottom': '50px'}) Would you like to create this entry? a.button.is-amber.is-inverted(href='/') Go Home
a.button.is-dark.is-inverted(href='/create/' + newpath, style={'margin-right': '5px'}) Create
a.button.is-dark.is-inverted(href='/') Go Home