Remove rests of .navigation class to hijack links rendered obsolete by 2c29b33

This commit is contained in:
Tissevert 2019-03-02 22:45:26 +01:00
parent f9a82cb088
commit 91bef62fbb
3 changed files with 7 additions and 12 deletions

View file

@ -56,7 +56,7 @@ function DomRenderer(modules) {
var div = getDiv(lines.slice(0, limit).join('\n'));
return modules.dom.make('article', {}, [
modules.dom.make('header', {}, [
modules.dom.make('a', {class: (limit != undefined ? 'navigation' : []), href: url}, [
modules.dom.make('a', {href: url}, [
modules.dom.make('h1', {innerText: blog.articles[key].title})
])
]),
@ -83,7 +83,6 @@ function DomRenderer(modules) {
return [
modules.dom.make('h2', {innerText: pageTitle(tag, all)}),
modules.dom.make('a', {
class: 'navigation',
innerText: all ? blog.wording.latestLink : blog.wording.allLink,
href: otherUrl(tag, all)
}),

View file

@ -30,7 +30,7 @@ function Navigation(modules) {
for(var i = 0; i < links.length; i++) {
var a = links[i];
var href = a.getAttribute("href");
if(href[0] == "/" || href[0] == "#") {
if((href[0] == "/" && href.slice(-3) != ".md") || href[0] == "#") {
a.addEventListener('click', visit(a.getAttribute("href")));
}
}

View file

@ -47,7 +47,7 @@ instance Page ArticlesList where
content al@(ArticlesList {featured, full}) = do
preview <- Article.preview <$> (Blog.get $skin.$previewLinesCount)
h2_ . toHtml =<< pageTitle al
navigationA [href_ . pack $ otherUrl al] . toHtml =<< otherLink
a_ [href_ . pack $ otherUrl al] . toHtml =<< otherLink
div_ [class_ "articles"] (
mapM_ (article False . preview) featured
)
@ -59,12 +59,11 @@ article raw (Article {key, body, title}) = do
url <- absoluteLink . (</> key <.> extension) <$> (Blog.get $path.$articlesPath)
article_ (do
header_ (do
aElem [href_ . pack $ url] . h1_ $ toHtml title
a_ [href_ . pack $ url] . h1_ $ toHtml title
)
pre_ . toHtml $ unlines body
)
where
(aElem, extension) = if raw then (a_, "md") else (navigationA, "html")
where extension = if raw then "md" else "html"
makeCard :: String -> Text -> Maybe String -> HtmlGenerator ()
makeCard title description image = do
@ -76,16 +75,13 @@ makeCard title description image = do
og attribute value = meta_ [makeAttribute "property" $ "og:" <> attribute , content_ value]
maybeImage = maybe (return ()) (og "image" . pack)
navigationA :: Term arg result => arg -> result
navigationA = "a" `termWith` [class_ "navigation"]
tag :: String -> HtmlGenerator ()
tag tagName = li_ (navigationA [href_ . pack $ absoluteLink tagName] $ toHtml tagName)
tag tagName = li_ (a_ [href_ . pack $ absoluteLink tagName] $ toHtml tagName)
defaultBanner :: HtmlGenerator ()
defaultBanner = do
div_ [id_ "header"] (
navigationA [href_ "/"] (
a_ [href_ "/"] (
h1_ . toHtml =<< Blog.get name
)
)