From cb1e9788307308b1c13cfbbc9e3ad05755f17c5c Mon Sep 17 00:00:00 2001 From: s-ol Date: Tue, 27 Nov 2018 15:12:49 +1100 Subject: fix og:url --- build/layout.moon | 27 +++++++++++++++++++++++++++ build/render_fileder.moon | 32 +------------------------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/build/layout.moon b/build/layout.moon index c188db9..5548281 100644 --- a/build/layout.moon +++ b/build/layout.moon @@ -56,4 +56,31 @@ logo = svg { { height: '1.3em', 'margin-left': '.3em', 'margin-top': '-0.12em' } } } + get_meta: => + title = (@get 'title: text/plain') or @gett 'name: alpha' + + l = (str) -> + str = str\gsub '[%s\\n]+$', '' + str\gsub '\\n', ' ' + e = (str) -> string.format '%q', l str + + meta = " + + #{l title} + " + + if page_meta = @get '_meta: mmm/dom' + meta ..= page_meta + else + meta ..= " + + + + " + + if desc = @get 'description: text/plain' + meta ..= " + " + + meta } diff --git a/build/render_fileder.moon b/build/render_fileder.moon index 280be25..76c7856 100644 --- a/build/render_fileder.moon +++ b/build/render_fileder.moon @@ -2,7 +2,7 @@ require 'mmm' import get_path from require 'build.util' import tohtml from require 'mmm.component' import Browser from require 'mmm.mmmfs.browser' -import header, footer from require 'build.layout' +import get_meta, header, footer from require 'build.layout' export BROWSER @@ -34,36 +34,6 @@ do seed path -get_meta = => - title = (@get 'title: text/plain') or @gett 'name: alpha' - - l = (str) -> - str = str\gsub '[%s\\n]+$', '' - str\gsub '\\n', ' ' - e = (str) -> string.format '%q', l str - - meta = " - - #{l title} - " - - if page_meta = @get '_meta: mmm/dom' - meta ..= page_meta - else - _path = path - _path = '/' if _path == '' - meta ..= " - - - - " - - if desc = @get 'description: text/plain' - meta ..= " - " - - meta - root = dofile '$bundle.lua' assert root, "couldn't load $bundle.lua" root\mount path, true -- cgit v1.2.3