cost 242 ms
哈姆雷特 html 未注册或<title>为我的主路由处理程序正确标记&lt;/div&gt;</title><div id="text_translate"><p> 由于某种原因,我的网站主页的&lt;head&gt;标记没有按照我想要的方式进行处理。 这是我从 firefox 获得的网站源代码。 请注意,第一个 head 和 title 标签是空的:</p><pre> &lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;style&gt;form{margin:0 auto;width:250px}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;head&gt;&lt;title&gt;Fishing Weather Hub &lt;/title&gt; &lt;meta name="description" content="Completely free fishing weather data provided by NOAA and Open Weather Maps. Designed to be simple and easy to use."&gt; &lt;meta name="keywords" content="fishing weather,fishing,weather"&gt; &lt;meta name="robots" content="index,follow"&gt; &lt;/head&gt; &lt;header&gt;&lt;center style="font-size:30px"&gt;Fishing Weather Hub&lt;/center&gt;...</pre><p> 这是此路由处理程序的 Haskell 代码。 对我来说,我已经明确表示我想在 head 标签中指定标题和元标签。 上面的 HTML 似乎与此代码不一致。</p><pre> getHomeR:: Handler Html getHomeR = do clearSession key &lt;- liftIO $ MYP.randomString 9 setSession "cache_key" (T.pack key) sess &lt;- getSession -- Generate the location form (widget, enctype) &lt;- generateFormPost $ renderDivs locationForm defaultLayout $ do [whamlet| &lt;head&gt; &lt;title&gt;Fishing Weather Hub &lt;meta name="description" content="Completely free fishing weather data provided by NOAA and Open Weather Maps. Designed to be simple and easy to use."&gt; &lt;meta name="keywords" content="fishing weather,fishing,weather"&gt; &lt;meta name="robots" content="index,follow"&gt; &lt;header&gt; &lt;center style="font-size:30px"&gt;Fishing Weather Hub &lt;br&gt; &lt;form method=post action=@{ProcessLocationFormR} enctype=#{enctype}&gt; ^{widget} &lt;button&gt;Submit &lt;a href="https://www.anglerwise.com/2010/02/09/how-does-barometric-pressure-affect-fishing/"&gt;How does barometric pressure affect fishing? |] --CSS toWidget [lucius| form { margin: 0 auto; width:250px; } |]</pre><p> 我不知道问题是什么。</p></div> - Hamlet html not registering <head> or <title> tags correctly for my home route handler

由于某种原因,我的网站主页的&lt;head&gt;标记没有按照我想要的方式进行处理。 这是我从 firefox 获得的网站源代码。 请注意,第一个 head 和 title 标签是空的: 这是此路由处理程序的 Haskell 代码。 对我来说,我已经明确表示我想在 head 标签中指定标题和元标 ...

如何将键/值对附加到在 yesod 中的 hamlet 块中生成的 url - How to append key / value pair to url generated in a hamlet block in yesod

我想创建一个链接,将键/值对附加到 hamlet 块内的 href 上的 URL。 以上似乎不太奏效。 我能够让它在 hamlet 之外的另一个部分工作,如下所示。 我在 Yesod 书中找到了一个类似的例子,但我无法将其翻译成我想要的。 上面是示例,但它用于将#变量附加到 URL。 我 ...

Yesod Hamlet 通过用双引号替换单引号来打破 HTML - Yesod Hamlet breaks HTML by replacing single quotes with double quotes

我有一些在哈姆雷特中使用的 HTML 代码: 请注意, data-options的单引号允许在字符串中使用双引号。 问题是,当 Hamlet 呈现页面时,Hamlet 将"放在'周围,因此 HTML 被破坏: 一些外部 JS 库插件代码运行,它尝试解析data-options中的 JSON 并失败 ...

2019-10-12 15:31:28   1   60    yesod / hamlet  
Haskell Yesod问题 - Haskell Yesod problems

有人可以帮我吗?! 我在Haskell Yesod网站上工作,在C9工作区上大学,我已经通过命令Yesod安装并更新了cabal,但是当我尝试“stack build”命令时,会出现这个可怜的错误消息: 说真的,我尝试了很多东西来解决它,但没有任何工作= S. ...

如何在Hamlet模板中的标记(链接)后避免空白? - How to avoid whitespace after a tag (link) in Hamlet templates?

我无法找到一种方法来呈现链接,然后在它之后立即逗号或完全停止,链接和标点符号之间没有空格。 这是我最初的尝试: 要么 这会在单词“here”和“。”之间插入空格。 另一种选择是: 这看起来像一场胜利,但HTML格式不正确: 有没有办法避免链接和标点/其他元 ...

Yesod从村庄访问持久性实体ID - Yesod accessing a persistent entity id from hamlet

我目前一直在不断从数据库中提取产品列表,并将其显示在屏幕上。 我想使用数据库中的ID将有关这些产品的一些信息存储在cookie中,并链接到更详细的信息页面。 据我了解,ID仅存在于持久实体中,而不存在于实际产品类型中? 这是否意味着我应该在Cookie中使用随机字符串存储其他字段,或者是否 ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM