mirror of
https://github.com/getzola/zola
synced 2024-12-13 13:52:28 +00:00
parent
5ca2b29c49
commit
f7a4ef2617
4 changed files with 8 additions and 8 deletions
|
@ -7,6 +7,7 @@
|
||||||
- `zola serve` now properly returns a 404
|
- `zola serve` now properly returns a 404
|
||||||
- Fix `zola serve` having issues with config files in separate dir
|
- Fix `zola serve` having issues with config files in separate dir
|
||||||
- Fix code blocks content not being escaped when not using syntax highlighting
|
- Fix code blocks content not being escaped when not using syntax highlighting
|
||||||
|
- Add missing `draft` attribute to the `section` variable in templates
|
||||||
|
|
||||||
## 0.14.0 (2021-07-19)
|
## 0.14.0 (2021-07-19)
|
||||||
|
|
||||||
|
|
|
@ -103,10 +103,6 @@ impl Page {
|
||||||
Page { file: FileInfo::new_page(file_path, base_path), meta, ..Self::default() }
|
Page { file: FileInfo::new_page(file_path, base_path), meta, ..Self::default() }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_draft(&self) -> bool {
|
|
||||||
self.meta.draft
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Parse a page given the content of the .md file
|
/// Parse a page given the content of the .md file
|
||||||
/// Files without front matter or with invalid front matter are considered
|
/// Files without front matter or with invalid front matter are considered
|
||||||
/// erroneous
|
/// erroneous
|
||||||
|
|
|
@ -167,7 +167,7 @@ impl<'a> SerializingPage<'a> {
|
||||||
word_count: page.word_count,
|
word_count: page.word_count,
|
||||||
reading_time: page.reading_time,
|
reading_time: page.reading_time,
|
||||||
assets: &page.serialized_assets,
|
assets: &page.serialized_assets,
|
||||||
draft: page.is_draft(),
|
draft: page.meta.draft,
|
||||||
lang: &page.lang,
|
lang: &page.lang,
|
||||||
lighter,
|
lighter,
|
||||||
heavier,
|
heavier,
|
||||||
|
@ -233,7 +233,7 @@ impl<'a> SerializingPage<'a> {
|
||||||
word_count: page.word_count,
|
word_count: page.word_count,
|
||||||
reading_time: page.reading_time,
|
reading_time: page.reading_time,
|
||||||
assets: &page.serialized_assets,
|
assets: &page.serialized_assets,
|
||||||
draft: page.is_draft(),
|
draft: page.meta.draft,
|
||||||
lang: &page.lang,
|
lang: &page.lang,
|
||||||
lighter: None,
|
lighter: None,
|
||||||
heavier: None,
|
heavier: None,
|
||||||
|
@ -253,6 +253,7 @@ pub struct SerializingSection<'a> {
|
||||||
relative_path: &'a str,
|
relative_path: &'a str,
|
||||||
content: &'a str,
|
content: &'a str,
|
||||||
permalink: &'a str,
|
permalink: &'a str,
|
||||||
|
draft: bool,
|
||||||
ancestors: Vec<&'a str>,
|
ancestors: Vec<&'a str>,
|
||||||
title: &'a Option<String>,
|
title: &'a Option<String>,
|
||||||
description: &'a Option<String>,
|
description: &'a Option<String>,
|
||||||
|
@ -292,6 +293,7 @@ impl<'a> SerializingSection<'a> {
|
||||||
SerializingSection {
|
SerializingSection {
|
||||||
relative_path: §ion.file.relative,
|
relative_path: §ion.file.relative,
|
||||||
ancestors,
|
ancestors,
|
||||||
|
draft: section.meta.draft,
|
||||||
content: §ion.content,
|
content: §ion.content,
|
||||||
permalink: §ion.permalink,
|
permalink: §ion.permalink,
|
||||||
title: §ion.meta.title,
|
title: §ion.meta.title,
|
||||||
|
@ -329,6 +331,7 @@ impl<'a> SerializingSection<'a> {
|
||||||
SerializingSection {
|
SerializingSection {
|
||||||
relative_path: §ion.file.relative,
|
relative_path: §ion.file.relative,
|
||||||
ancestors,
|
ancestors,
|
||||||
|
draft: section.meta.draft,
|
||||||
content: §ion.content,
|
content: §ion.content,
|
||||||
permalink: §ion.permalink,
|
permalink: §ion.permalink,
|
||||||
title: §ion.meta.title,
|
title: §ion.meta.title,
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
use config::highlighting::{SyntaxAndTheme, CLASS_STYLE};
|
use config::highlighting::{SyntaxAndTheme, CLASS_STYLE};
|
||||||
use tera::escape_html;
|
|
||||||
use syntect::easy::HighlightLines;
|
use syntect::easy::HighlightLines;
|
||||||
use syntect::highlighting::{Color, Theme};
|
use syntect::highlighting::{Color, Theme};
|
||||||
use syntect::html::{
|
use syntect::html::{
|
||||||
styled_line_to_highlighted_html, line_tokens_to_classed_spans, ClassStyle, IncludeBackground,
|
line_tokens_to_classed_spans, styled_line_to_highlighted_html, ClassStyle, IncludeBackground,
|
||||||
};
|
};
|
||||||
use syntect::parsing::{ParseState, ScopeStack, SyntaxReference, SyntaxSet};
|
use syntect::parsing::{ParseState, ScopeStack, SyntaxReference, SyntaxSet};
|
||||||
|
use tera::escape_html;
|
||||||
|
|
||||||
/// Not public, but from syntect::html
|
/// Not public, but from syntect::html
|
||||||
fn write_css_color(s: &mut String, c: Color) {
|
fn write_css_color(s: &mut String, c: Color) {
|
||||||
|
|
Loading…
Reference in a new issue