Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Start-Page-Generator.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extra-source-files:
library
ghc-options: -Wall
build-depends:
base ^>=4.18.0.0,
base ^>=4.21.0.0,
text,
parsec
hs-source-dirs: lib
Expand All @@ -29,7 +29,7 @@ executable Start-Page-Generator
hs-source-dirs: app
default-language: Haskell2010
build-depends:
base ^>=4.18.0.0,
base ^>=4.21.0.0,
Start-Page-Generator

test-suite test
Expand All @@ -43,7 +43,7 @@ test-suite test
TemplateEngineSpec,
ParsedSites
build-depends:
base ^>=4.18.0.0,
base ^>=4.21.0.0,
HUnit ^>= 1.6,
hspec ==2.*,
Start-Page-Generator
Expand Down
4 changes: 2 additions & 2 deletions lib/SiteMapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ mapSite (parsedName, parsedUrl, parsedLogo) =
replacementLogo =
Url
{ protocol = "https://",
hostname = "logo.clearbit.com",
path = "/" ++ hostname parsedUrl
hostname = "img.logo.dev",
path = "/" ++ hostname parsedUrl ++ "?token=pk_CRpvkunsQi2ojaUrvTgQZA"
}
5 changes: 4 additions & 1 deletion lib/TemplateEngine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ linkTag Site {url = u, displayName = name, logo = l} =
++ "</p>\n"
++ "</a>\n"
where
fullLink uri = protocol uri ++ hostname uri ++ "/" ++ path uri
fullLink uri = protocol uri ++ hostname uri ++ addSlash (path uri)
addSlash [] = []
addSlash p@('/':_) = p
addSlash p = '/' : p

generateLinks :: Favorites -> String
generateLinks = concatMap linkTag
Expand Down
6 changes: 3 additions & 3 deletions links.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This file list the links that will be shown, see the readme for syntax.
If no logo is specified they are taken from https://clearbit.com/logo
If no logo is specified they are taken from https://logo.dev

* FB -> Facebook.com
* youtube.com/feed/subscriptions/
Expand All @@ -12,8 +12,8 @@ If no logo is specified they are taken from https://clearbit.com/logo
* Reddit.com
* LinkedIn -> linkedin.com <- https://img.freepik.com/premium-vector/linkedin-icon_488108-5.jpg
* Rotendahl.dk <- https://rotendahl.dk/assets/logo.png
* amazon.de <- https://logo.clearbit.com//amazon.com
* Jira -> https://monthio.atlassian.net/jira/your-work <- https://logo.clearbit.com//jira.com
* amazon.de <- https://img.logo.dev/amazon.com?token=pk_CRpvkunsQi2ojaUrvTgQZA
* Jira -> https://monthio.atlassian.net/jira/your-work <- https://img.logo.dev/jira.com?token=pk_CRpvkunsQi2ojaUrvTgQZA
* GPT -> https://chat.openai.com
* Ops -> https://grafana.monthio.com/d/ew54Gu9Mz/screen-2-system-health?orgId=1
* Pipelines -> https://dev.azure.com/monthio/monthio/_build?view=folders
Expand Down
3 changes: 3 additions & 0 deletions template.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
<div id="container">
<!-- sites -->
</div>
<footer style="text-align: center; margin-top: 20px; font-size: 12px; color: #666;">
<a href='https://logo.dev' title='Logo API'>Logos provided by Logo.dev</a>
</footer>
</body>
</html>
4 changes: 2 additions & 2 deletions test/TemplateEngineSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ spec = do
}
]
`shouldBe` "<div>\n"
++ "\t<a href=\"https://site-a.com/\">\n"
++ "\t<a href=\"https://site-a.com\">\n"
++ "\t\t<img src=\"https://site-a.com/logo.png\" />\n"
++ "\t\t<p>site a</p>\n"
++ "\t</a>\n"
++ "\t<a href=\"https://site-b.com/logo.png\">\n"
++ "\t\t<img src=\"https://site-b.com/\" />\n"
++ "\t\t<img src=\"https://site-b.com\" />\n"
++ "\t\t<p>site b</p>\n"
++ "\t</a>\n"
++ "\n<div>\n"
Loading