add back-end support for asciidoc and rst #40
parent
7ab6cc7aba
commit
cf23f6362a
File diff suppressed because one or more lines are too long
|
@ -339,7 +339,8 @@ fieldset input {
|
|||
|
||||
.ace_editor {
|
||||
margin: 0;
|
||||
border-radius: .5em;
|
||||
border-bottom-left-radius: .5em;
|
||||
border-bottom-right-radius: 0.5em;
|
||||
}
|
||||
|
||||
.ace_gutter {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
.noty_icon,body>nav{left:0;box-sizing:border-box}.block,.noty_icon,.noty_text,body>nav,fieldset{box-sizing:border-box}.browse a,a,body>nav ul li a{text-decoration:none}.browse .actions .fa,body>nav ul li{vertical-align:middle}body{font-family:Roboto,sans-serif;color:#212121;background-color:#f5f5f5;height:100%;width:100%;padding-top:3em}a{color:#1976D2}code{border-radius:.2em}img{max-width:100%}h2{margin:.83em 0}.container{margin:0 auto;width:95%;max-width:1000px}.hidden{display:none}.left{text-align:left}.right{text-align:right}body>nav{position:fixed;top:0;height:3em;width:100%;background-color:#2196F3;padding:0 1em;z-index:999;color:#eee;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}body>nav ul{margin:0;padding:0;display:-webkit-box;display:-ms-flexbox;display:-webkit-flex;display:flex}body>nav ul li{list-style-type:none;display:inline-block}body>nav ul li:last-child{margin-left:auto}body>nav img{height:2em}body>nav ul li a{padding:.5em;line-height:2em;display:block;color:inherit;-webkit-transition:.5s ease background-color;transition:.5s ease background-color}body>nav ul li a:hover{background-color:rgba(255,255,255,.57)}body>footer{background-color:#ddd;text-align:center;padding:1em 0;margin-top:1em}body>footer p{width:95%;max-width:1000px;margin:0 auto;color:#78909C;font-size:.9em}#noty_topRight_layout_container{font-family:sans-serif;top:4em!important;right:1em!important;position:fixed!important;width:310px;height:auto;margin:0;padding:0;list-style-type:none;z-index:10000000}#noty_topRight_layout_container li{overflow:hidden;margin:0 0 .25em}.noty_bar{color:#fff;background-color:#cfd8dc;border-radius:.3em}.noty_message{font-size:.75em;font-weight:700;line-height:1.2em;text-align:left;padding:1em;width:auto;position:relative}.noty_text{display:block;margin-left:3em;top:1em}.noty_icon{position:absolute;top:0;height:100%;padding:1em;background-color:rgba(0,0,0,.1);border-top-left-radius:.3em;border-bottom-left-radius:.3em;text-align:center}.noty_icon .fa{width:1em!important}.noty_type_success{background-color:#00c853}.noty_type_error{background-color:#ff5252}.noty_type_warning{background-color:#ffd600}.noty_type_information{background-color:#448aff}button,input[type=submit]{border-radius:.2em;border:0;padding:.5em 1em;color:#fff;font-weight:400;background-color:#2196F3;box-shadow:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.12)}button.add,button.delete,button.rename{padding:.063em .375em}button.add{background-color:#8BC34A}button.delete{background-color:#F44336}button.rename{background-color:#1565C0}.frontmatter>.actions{margin-top:0;text-align:right}.frontmatter>.actions button.add{padding:.5em 1em}.toolbar .right{float:right}.toolbar .default{background-color:#8BC34A}.editor h1 textarea{width:100%;border:0;font-size:2em;font-weight:400;resize:none;overflow:hidden;line-height:1em;height:1em;background-color:transparent}.block>.actions,fieldset>.actions{position:absolute;top:.5em;right:.5em}.blocks{-webkit-column-count:4;-moz-column-count:4;column-count:4;-webkit-column-gap:1em;-moz-column-gap:1em;column-gap:1em}.block,fieldset{display:inline-block;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);background-color:#fff;padding:.6em;margin:0 0 1em;position:relative;width:100%;border:0}.block label,fieldset h3,fieldset label{font-weight:700;display:block;margin-top:0;font-size:1em}.block textarea{width:100%;resize:vertical;background-color:inherit;border:0;overflow:hidden}.block input,fieldset input{border:0;outline:0;background-color:transparent;width:100%}fieldset input{width:calc(100% - 1.57em);margin:.5em 0}.editor.complete .block[data-content=title]{display:none}.editor .content{border-radius:.5em;border:1px solid #d8d8d8;background-color:#f7f7f7}.editor .content nav a{padding:1em;line-height:3em;cursor:pointer;font-size:1em}.ace_editor{margin:0;border-radius:.5em}.ace_gutter{background-color:#f7f7f7!important}.browse a{color:inherit}.browse table{width:100%}.browse .actions{background-color:#455a64;color:#fff;padding:1.5em 0}.browse .actions .container{margin:0 auto;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.browse .actions .go-right{margin-left:auto;position:relative}.browse tr{line-height:2em;border-bottom:1px solid rgba(0,0,0,.03)}.browse #new-file{display:none;position:absolute;right:0;top:2.5em;background-color:#263238;color:rgba(255,255,255,.5);border-radius:.5em;padding:1em;width:182%}
|
|
@ -6,6 +6,8 @@ $(document).on('ready pjax:success', function() {
|
|||
// Update the title
|
||||
document.title = document.getElementById('site-title').innerHTML;
|
||||
|
||||
//TODO: navbar titles changing effect when changing page
|
||||
|
||||
// Auto Grow Textarea
|
||||
function autoGrow(element) {
|
||||
this.style.height = "5px";
|
||||
|
|
|
@ -57,7 +57,7 @@ func GET(w http.ResponseWriter, r *http.Request, c *config.Config, filename stri
|
|||
|
||||
// Handle the content depending on the file extension
|
||||
switch page.Mode {
|
||||
case "markdown":
|
||||
case "markdown", "asciidoc", "rst":
|
||||
if hasFrontMatterRune(file) {
|
||||
// Starts a new buffer and parses the file using Hugo's functions
|
||||
buffer := bytes.NewBuffer(file)
|
||||
|
@ -138,12 +138,14 @@ func appendFrontMatterRune(frontmatter []byte, language string) []byte {
|
|||
|
||||
func sanitizeMode(extension string) string {
|
||||
switch extension {
|
||||
case "markdown", "md":
|
||||
case "md", "markdown", "mdown", "mmark":
|
||||
return "markdown"
|
||||
case "css", "scss":
|
||||
return "css"
|
||||
case "html":
|
||||
return "htmlmixed"
|
||||
case "asciidoc", "adoc", "ad":
|
||||
return "asciidoc"
|
||||
case "rst":
|
||||
return "rst"
|
||||
case "html", "htm":
|
||||
return "html"
|
||||
case "js":
|
||||
return "javascript"
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue