@@ -90,10 +90,6 @@ struct ParseContext {
90 fn_lines: HashMap<String, usize>,
90 fn_lines: HashMap<String, usize>,
91 /// Line numbers of attribute bundle definitions (name -> line)
91 /// Line numbers of attribute bundle definitions (name -> line)
92 define_lines: HashMap<String, usize>,
92 define_lines: HashMap<String, usize>,
94− canonical: Option<String>,
95− /// Base URL for relative links
96− base_url: Option<String>,
99/// Evaluates a syntax tree (see `syntax.rs`) into the document's nodes.
95/// Evaluates a syntax tree (see `syntax.rs`) into the document's nodes.
@@ -170,8 +166,6 @@ pub fn parse_with_base(input: &str, base_path: Option<&Path>) -> ParseResult {
170 let_lines: HashMap::new(),
166 let_lines: HashMap::new(),
171 fn_lines: HashMap::new(),
167 fn_lines: HashMap::new(),
172 define_lines: HashMap::new(),
168 define_lines: HashMap::new(),
176 load_prelude(&mut ctx);
170 load_prelude(&mut ctx);
177 let nodes = Evaluator.eval_block(&tree, &mut ctx);
171 let nodes = Evaluator.eval_block(&tree, &mut ctx);
@@ -189,8 +183,6 @@ pub fn parse_with_base(input: &str, base_path: Option<&Path>) -> ParseResult {
189 css_vars: ctx.css_vars,
183 css_vars: ctx.css_vars,
190 custom_css: ctx.custom_css,
184 custom_css: ctx.custom_css,
191 og_tags: ctx.og_tags,
185 og_tags: ctx.og_tags,
192− canonical: ctx.canonical,
193− base_url: ctx.base_url,
196 diagnostics: ctx.diagnostics,
188 diagnostics: ctx.diagnostics,
@@ -292,7 +284,7 @@ impl Evaluator {
295− // @page [lang en, favicon /f.png, canonical URL, base URL] Title
287+ // @page [lang en, favicon /f.png] Title
296 if let Some(rest) = content.strip_prefix("@page ") {
288 if let Some(rest) = content.strip_prefix("@page ") {
297 let rest = rest.trim_start();
289 let rest = rest.trim_start();
298 let title = if rest.starts_with('[') {
290 let title = if rest.starts_with('[') {
@@ -302,13 +294,11 @@ impl Evaluator {
302 match attr.key.as_str() {
294 match attr.key.as_str() {
303 "lang" => ctx.lang = Some(value),
295 "lang" => ctx.lang = Some(value),
304 "favicon" => ctx.favicon = Some(value),
296 "favicon" => ctx.favicon = Some(value),
305− "canonical" => ctx.canonical = Some(value),
306− "base" => ctx.base_url = Some(value),
307 other => ctx.diagnostics.push(Diagnostic {
297 other => ctx.diagnostics.push(Diagnostic {
308 line: line_num,
298 line: line_num,
309 column: None,
299 column: None,
310 message: format!(
300 message: format!(
311− "unknown @page attribute '{}' (expected lang, favicon, canonical or base)",
301+ "unknown @page attribute '{}' (expected lang or favicon)",
314 severity: Severity::Warning,
304 severity: Severity::Warning,
@@ -1447,8 +1437,8 @@ const REMOVED_SYNTAX: &[(&str, &str)] = &[
1447 ("@css-property", "write an `@property` rule in an `@style` block"),
1437 ("@css-property", "write an `@property` rule in an `@style` block"),
1448 ("@lang", "use `@page [lang ...] Title`"),
1438 ("@lang", "use `@page [lang ...] Title`"),
1449 ("@favicon", "use `@page [favicon ...] Title`"),
1439 ("@favicon", "use `@page [favicon ...] Title`"),
1450− ("@canonical", "use `@page [canonical ...] Title`"),
1440+ ("@canonical", "write `<link rel=\"canonical\" href=\"...\">` in `@head`"),
1451− ("@base", "use `@page [base ...] Title`"),
1441+ ("@base", "write `<base href=\"...\">` in `@head`"),
1452 ("@og", "use `@meta og:NAME VALUE`"),
1442 ("@og", "use `@meta og:NAME VALUE`"),
1453 ("@debug", "removed: a layout needs no compile-time messages"),
1443 ("@debug", "removed: a layout needs no compile-time messages"),
1454 ("@svg", "use `@image [inline] file.svg`"),
1444 ("@svg", "use `@image [inline] file.svg`"),