Skip to content

Commit

Permalink
Fix robots.txt url (ocaml#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
desirekaleba authored Nov 5, 2021
1 parent 39e7328 commit b97edbc
Show file tree
Hide file tree
Showing 20 changed files with 56 additions and 54 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- Fix robots.txt URL (#178, by @desirekaleba)

- Fix handling of trailing slashes (#170, by @desirekaleba)

- Demarcate include blocks (#54, by @JiaeK)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/ocamlorg_web/lib/router.ml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ let router t =
; graphql_route t
; redirection_routes
; toplevels_route
; Dream.get "/assets/**" (Dream.static ~loader "")
; Dream.get "/media/**" (Dream.static ~loader:media_loader "")
; Dream.get "/**" (Dream.static ~loader "")
(* Last one so that we don't apply the index html middleware on every
route. *)
]
4 changes: 2 additions & 2 deletions src/ocamlorg_web/lib/templates/components/footer_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ let render () =
<footer aria-labelledby="footerHeading" class="max-w-8xl mx-auto py-12 px-4 sm:px-6 lg:py-16 lg:px-8">
<h2 class="sr-only" id="footerHeading"><%s gettext "Footer" %></h2>
<div class="xl:grid xl:grid-cols-3 xl:gap-8">
<div class="space-y-8 xl:col-span-1"><img class="h-10" alt="OCaml" src="/assets/logo.jpeg">
<div class="space-y-8 xl:col-span-1"><img class="h-10" alt="OCaml" src="/logo.jpeg">
<p class="text-gray-500 text-base "><%s gettext "Innovation. Community. Security." %></p>
<div class="flex space-x-6"><a aria-label="Discourse" class="text-gray-400 hover:text-gray-500"
href="https://discuss.ocaml.org" target="_blank"><img aria-hidden="true" class="h-6 w-6" alt=""
src="/assets/img/discourselogo.png"></a><a aria-label="GitHub" class="text-gray-400 hover:text-gray-500"
src="/img/discourselogo.png"></a><a aria-label="GitHub" class="text-gray-400 hover:text-gray-500"
href="https://sourcegraph.com/search?q=repo:ocaml/ocaml%24+or+repo:janestreet/base+or+repo:gitlab.com/tezos/tezos%24+or+repo:c-cube/ocaml-containers+or+repo:ocaml-batteries-team/batteries-included+or+repo:mirage/mirage%24+or+repo:ocsigen/lwt+or+repo:janestreet/async%24&amp;patternType=literal"
target="_blank"><svg aria-hidden="true" class="h-6 w-6" fill="currentColor" viewBox="0 0 24 24">
<path clip-rule="evenodd"
Expand Down
4 changes: 2 additions & 2 deletions src/ocamlorg_web/lib/templates/components/header_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ let render () =
<div class="flex justify-start">
<a href="/">
<span class="sr-only"><%s gettext "OCaml.org" %></span>
<img class="h-8 w-auto sm:h-10" src="/assets/logo.jpeg" alt="">
<img class="h-8 w-auto sm:h-10" src="/logo.jpeg" alt="">
</a>
</div>
<nav class="hidden md:flex space-x-10" x-data="Components.popoverGroup()" x-init="init()">
Expand Down Expand Up @@ -97,7 +97,7 @@ let render () =
<div class="pt-5 pb-6 px-5">
<div class="flex items-center justify-between">
<div>
<img class="h-8 w-auto" src="/assets/logo.jpeg" alt="Workflow">
<img class="h-8 w-auto" src="/logo.jpeg" alt="Workflow">
</div>
<div class="-mr-2">
<button type="button"
Expand Down
20 changes: 10 additions & 10 deletions src/ocamlorg_web/lib/templates/layouts/package_layout_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ let render ?(extra_nav="") ~title ~description ~tab ~package ~status ~versions ?
<meta name="theme-color" content="#fff">
<meta name="color-scheme" content="white">
<meta name=”robots” content="noindex, nofollow">
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
<link rel="manifest" href="/assets/manifest.json">
<link rel="stylesheet" href="/assets/main.css" />
<link rel="stylesheet" href="/assets/doc.css" />
<link rel="stylesheet" href="/assets/vendors/font-files/inter.css" />
<link rel="stylesheet" href="/assets/toplevel.css" />
<script src="/assets/vendors/components-v2.js"></script>
<script src="/assets/vendors/alpine-turbo-drive-adapter.min.js"></script>
<script src="/assets/vendors/alpine.min.js"></script>
<script src="/assets/vendors/turbo.es2017-umd.js"></script>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="manifest" href="/manifest.json">
<link rel="stylesheet" href="/main.css" />
<link rel="stylesheet" href="/css/doc.css" />
<link rel="stylesheet" href="/vendors/font-files/inter.css" />
<link rel="stylesheet" href="/css/toplevel.css" />
<script src="/vendors/components-v2.js"></script>
<script src="/vendors/alpine-turbo-drive-adapter.min.js"></script>
<script src="/vendors/alpine.min.js"></script>
<script src="/vendors/turbo.es2017-umd.js"></script>
<title><%s title %></title>
</head>

Expand Down
20 changes: 10 additions & 10 deletions src/ocamlorg_web/lib/templates/layouts/page_layout_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ let render ?(turbo_full_reload=false) ~title ~description inner =
<meta name="color-scheme" content="white">
<meta name=”robots” content="noindex, nofollow">
<%s! full_reload turbo_full_reload %>
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
<link rel="manifest" href="/assets/manifest.json">
<link rel="stylesheet" href="/assets/main.css" />
<link rel="stylesheet" href="/assets/vendors/font-files/inter.css" />
<link rel="stylesheet" href="/assets/toplevel.css" />
<link rel="stylesheet" href="/assets/syntax.css" />
<script src="/assets/vendors/components-v2.js"></script>
<script src="/assets/vendors/alpine-turbo-drive-adapter.min.js"></script>
<script src="/assets/vendors/alpine.min.js"></script>
<script src="/assets/vendors/turbo.es2017-umd.js"></script>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="manifest" href="/manifest.json">
<link rel="stylesheet" href="/main.css" />
<link rel="stylesheet" href="/vendors/font-files/inter.css" />
<link rel="stylesheet" href="/css/toplevel.css" />
<link rel="stylesheet" href="/css/syntax.css" />
<script src="/vendors/components-v2.js"></script>
<script src="/vendors/alpine-turbo-drive-adapter.min.js"></script>
<script src="/vendors/alpine.min.js"></script>
<script src="/vendors/turbo.es2017-umd.js"></script>
<title><%s title %></title>
</head>

Expand Down
4 changes: 2 additions & 2 deletions src/ocamlorg_web/lib/templates/pages/academic_template.eml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let render (items : Ood.Academic_institution.t list) =
<main class="relative bg-graylight">
<%s! Hero_with_background_template.render ~img:"/assets/img/acad.png" ~title:"Academic Excellence" ~subtitle:"" %>
<%s! Hero_with_background_template.render ~img:"/img/acad.png" ~title:"Academic Excellence" ~subtitle:"" %>
<div class="max-w-8xl mx-auto">
<div class="mx-auto pb-20 px-4 sm:pb-20 sm:px-6 lg:px-8">
<div class="text-center">
Expand Down Expand Up @@ -51,7 +51,7 @@ let render (items : Ood.Academic_institution.t list) =
</div>
<div class="mb-10 lg:mb-32 mx-auto sm:max-w-screen-sm lg:max-w-screen-lg">
<div class="bg-white flex flex-wrap justify-center lg:justify-between ">
<img alt="" src="/assets/img/worldmap.jpg">
<img alt="" src="/img/worldmap.jpg">
</div>
</div>
</main>
12 changes: 6 additions & 6 deletions src/ocamlorg_web/lib/templates/pages/applications_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let render () =
href="/packages">Explore the Docs</a>
</div>
<div class="order-1 sm:order-2 mt-10 sm:mt-0 ml-10 sm:flex-shrink-0"><img class="h-56 "
src="/assets/img/api-img.jpeg"></div>
src="/img/api-img.jpeg"></div>
</div>
</div>
<div class="bg-white overflow-hidden shadow rounded-lg mx-auto max-w-3xl mb-2">
Expand All @@ -37,10 +37,10 @@ let render () =
</div>
</div>
<div class="order-1 sm:order-2 mt-10 sm:mt-0 ml-10 sm:flex-shrink-0"><img class="h-24 "
src="/assets/img/app-image.png"></div>
src="/img/app-image.png"></div>
</div>
<div class="flex flex-col items-center sm:flex-row sm:justify-evenly mb-11">
<div class="mb-10 sm:mb-0 mr-10 sm:flex-shrink-0"><img class="h-24 " src="/assets/img/jvs.png"></div>
<div class="mb-10 sm:mb-0 mr-10 sm:flex-shrink-0"><img class="h-24 " src="/img/jvs.png"></div>
<div>
<div>
<h4 class="text-base font-bold mb-3"><a class="hover:underline"
Expand Down Expand Up @@ -73,12 +73,12 @@ let render () =
<div class="grid grid-cols-3 gap-x-16 mb-6">
<div class="flex justify-center items-center mb-6"><a
href="https://github.com/bcpierce00/unison/wiki/Downloading-Unison" target="_blank"><img
class="border-1 max-h-24" alt="Unison" src="/assets/img/unison2.png"></a></div>
class="border-1 max-h-24" alt="Unison" src="/img/unison2.png"></a></div>
<div class="flex justify-center items-center mb-6"><a href="https://coq.inria.fr/download"
target="_blank"><img class="border-1 max-h-24" alt="Coq" src="/assets/img/coq.png"></a></div>
target="_blank"><img class="border-1 max-h-24" alt="Coq" src="/img/coq.png"></a></div>
<div class="flex justify-center items-center mb-6"><a
href="https://www.liquidsoap.info/doc-1.4.4/install.html" target="_blank"><img class="border-1 max-h-24"
alt="Liquid Soap" src="/assets/img/liq.png"></a></div>
alt="Liquid Soap" src="/img/liq.png"></a></div>
<div>
<p class="font-bold text-center mb-2">Unison</p>
<p>Dolor sit amet, consectetur adipiscing elit. Integer at tristique odio.</p>
Expand Down
14 changes: 7 additions & 7 deletions src/ocamlorg_web/lib/templates/pages/around_web_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let events = Ood.Event.all in
</h2>
<div class="flex flex-col items-center sm:flex-row sm:justify-evenly ">
<div class="mb-10 sm:mb-0 mr-10 sm:flex-shrink-0"><img class="h-28 sm:h-64 w-28 sm:w-64 rounded-full"
src="/assets/img/typewriter.jpeg"></div>
src="/img/typewriter.jpeg"></div>
<div>
<div class="bg-white border border-gray-300 overflow-hidden rounded-md mb-2">
<ul class="divide-y divide-gray-300">
Expand Down Expand Up @@ -102,22 +102,22 @@ let events = Ood.Event.all in
<div class="grid grid-cols-1 lg:grid-cols-2 gap-x-28 gap-y-4 px-8"><a
class="font-roboto flex items-center justify-start space-x-8 bg-white rounded-md shadow-md overflow-hidden px-8 py-4"
href="https://github.com/ocaml/ocaml" target="_blank"><img class="w-12 h-12 lg:w-20 lg:h-20"
src="/assets/img/github.png"><span class="text-2xl">Github.com</span></a><a
src="/img/github.png"><span class="text-2xl">Github.com</span></a><a
class="font-roboto flex items-center justify-start space-x-8 bg-white rounded-md shadow-md overflow-hidden px-8 py-4"
href="https://discord.gg/cCYQbqN" target="_blank"><img class="w-12 h-12 lg:w-20 lg:h-20"
src="/assets/img/discord.png"><span class="text-2xl">Discord.com</span></a><a
src="/img/discord.png"><span class="text-2xl">Discord.com</span></a><a
class="font-roboto flex items-center justify-start space-x-8 bg-white rounded-md shadow-md overflow-hidden px-8 py-4"
href="https://www.reddit.com/r/ocaml" target="_blank"><img class="w-12 h-12 lg:w-20 lg:h-20"
src="/assets/img/reddit.png"><span class="text-2xl">Reddit.com</span></a><a
src="/img/reddit.png"><span class="text-2xl">Reddit.com</span></a><a
class="font-roboto flex items-center justify-start space-x-8 bg-white rounded-md shadow-md overflow-hidden px-8 py-4"
href="https://sympa.inria.fr/sympa/arc/caml-list" target="_blank"><img class="w-12 h-12 lg:w-20 lg:h-20"
src="/assets/img/camllist.png"><span class="text-2xl">Caml-list</span></a><a
src="/img/camllist.png"><span class="text-2xl">Caml-list</span></a><a
class="font-roboto flex items-center justify-start space-x-8 bg-white rounded-md shadow-md overflow-hidden px-8 py-4"
href="https://twitter.com/search?q=%23ocaml" target="_blank"><img class="w-12 h-12 lg:w-20 lg:h-20"
src="/assets/img/twitter.png"><span class="text-2xl">Twitter.com</span></a><a
src="/img/twitter.png"><span class="text-2xl">Twitter.com</span></a><a
class="font-roboto flex items-center justify-start space-x-8 bg-white rounded-md shadow-md overflow-hidden px-8 py-4"
href="irc://irc.libera.chat/#ocaml" target="_blank"><img class="w-12 h-12 lg:w-20 lg:h-20"
src="/assets/img/irc.png"><span class="text-2xl">OCaml IRC Chat</span></a></div>
src="/img/irc.png"><span class="text-2xl">OCaml IRC Chat</span></a></div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/ocamlorg_web/lib/templates/pages/blog_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let render () =
<div class="absolute inset-x-0 bottom-0 h-1/2 bg-gray-100"></div>
<div class="relative shadow-xl sm:overflow-hidden">
<div class="absolute inset-0">
<img class="h-full w-full object-cover" src="/assets/img/news-bg.jpeg" alt="Highlighed Story" />
<img class="h-full w-full object-cover" src="/img/news-bg.jpeg" alt="Highlighed Story" />
<div class="absolute inset-0 bg-orange-700 mix-blend-multiply"></div>
</div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8">
Expand Down
2 changes: 1 addition & 1 deletion src/ocamlorg_web/lib/templates/pages/books_template.eml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let render_book (book : Ood.Book.t) =
let open Ood.Book in
let src = Option.map (fun x -> "/media/" ^ x) book.cover |> Option.value ~default:"/assets/default.png" in
let src = Option.map (fun x -> "/media/" ^ x) book.cover |> Option.value ~default:"/default.png" in
<div class="space-y-4 sm:grid sm:grid-cols-5 sm:items-start sm:gap-6 sm:space-y-0 sm:px-6">
<div class="aspect-w-3 aspect-h-2 sm:aspect-w-3 sm:aspect-h-4">
<img class="object-cover shadow-lg rounded-lg" src="<%s src %>" alt="" />
Expand Down
6 changes: 3 additions & 3 deletions src/ocamlorg_web/lib/templates/pages/index_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let render () =
</div>
</div>
<div class="relative w-full h-64 sm:h-72 md:h-96 lg:absolute lg:inset-y-0 lg:right-0 lg:w-1/2 lg:h-full"><img
class="absolute inset-0 w-full h-full object-cover" alt="" src="/assets/img/oc-sq.jpeg"></div>
class="absolute inset-0 w-full h-full object-cover" alt="" src="/img/oc-sq.jpeg"></div>
</div>
</div>
</div>
Expand Down Expand Up @@ -85,7 +85,7 @@ let render () =
</div>
</div>
<div class="mt-12 sm:mt-16 sm:flex sm:max-w-5xl sm:mx-auto px-4 sm:px-6 lg:px-8">
<div class="mb-4 sm:flex-shrink-0 sm:mb-0 sm:mr-4"><img aria-hidden="true" class="h-36" src="/assets/img/opam.png">
<div class="mb-4 sm:flex-shrink-0 sm:mb-0 sm:mr-4"><img aria-hidden="true" class="h-36" src="/img/opam.png">
</div>
<div>
<h2 class="text-2xl font-bold">Opam: the OCaml Package Manager</h2>
Expand All @@ -108,7 +108,7 @@ let render () =
</defs>
<rect height="404" width="404" fill="url(#ad119f34-7694-4c31-947f-5c9d249b21f3)"></rect>
</svg>
<div class="relative"><img class="mx-auto h-24" alt="Jane Street" src="/assets/img/js.svg">
<div class="relative"><img class="mx-auto h-24" alt="Jane Street" src="/img/js.svg">
<blockquote class="mt-10">
<div class="max-w-3xl mx-auto text-center text-2xl leading-9 font-medium text-gray-900">
<p><span class="text-orangedark"></span>OCaml helps us to quickly adopt to changing market conditions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let render (items : Ood.Industrial_user.t list) =
<main class="relative bg-graylight">
<%s! Hero_with_background_template.render ~img:"/assets/img/user.jpg" ~title:"Industrial Users of OCaml" ~subtitle:"" %>
<%s! Hero_with_background_template.render ~img:"/img/user.jpg" ~title:"Industrial Users of OCaml" ~subtitle:"" %>
<div class="mx-auto">
<p class="max-w-4xl mt-5 py-4 sm:py-8 mx-auto text-2xl text-center">With its strong security features and high
performance, several companies rely on OCaml to keep their data operating both safely and efficiently. On this
Expand Down
2 changes: 1 addition & 1 deletion src/ocamlorg_web/lib/templates/pages/language_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ let books = Ood.Book.all in
<p class="text-right"><a class="text-orangedark underline" href="/applications">Go to
Applications &gt;</a></p>
</div>
<div class="flex-shrink-0"><img class="h-48" src="/assets/img/app-image2.png"></div>
<div class="flex-shrink-0"><img class="h-48" src="/img/app-image2.png"></div>
</div>
</div>
<div class="mx-auto max-w-4xl flex items-center space-x-20 mb-20">
Expand Down
2 changes: 1 addition & 1 deletion src/ocamlorg_web/lib/templates/pages/package_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let render ~readme ~license:_ package =
<div class="grid grid-cols-1 gap-8 sm:grid-flow-col-dense sm:grid-cols-5 lg:grid-cols-7 sm:px-6 lg:px-8">
<div class="px-4 sm:px-0 lg:px-0 sm:col-span-2 sm:col-start-4 lg:col-start-6 lg:col-span-2 space-y-6">
<section>
<script src="/assets/vendors/alpine-clipboard.js"></script>
<script src="/vendors/alpine-clipboard.js"></script>

<h1 class="inline-flex items-center text-lg font-medium text-gray-900">
<svg xmlns="http://www.w3.org/2000/svg" class="mr-4 h-6 w-6 text-orange-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
Expand Down
10 changes: 5 additions & 5 deletions src/ocamlorg_web/lib/templates/pages/successes_template.eml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ let render success_stories =
<div class="max-w-8xl mx-auto py-12 px-4 sm:px-6 lg:px-8">
<div class="grid grid-cols-2 gap-8 md:grid-cols-6 lg:grid-cols-5">
<div class="col-span-1 flex justify-center md:col-span-2 lg:col-span-1">
<img class="h-12" src="/assets/logos/ahrefs.svg" alt="Ahrefs">
<img class="h-12" src="/logos/ahrefs.svg" alt="Ahrefs">
</div>
<div class="col-span-1 flex justify-center md:col-span-2 lg:col-span-1">
<img class="h-12" src="/assets/logos/facebook.svg" alt="Facebook">
<img class="h-12" src="/logos/facebook.svg" alt="Facebook">
</div>
<div class="col-span-1 flex justify-center md:col-span-2 lg:col-span-1">
<img class="h-12" src="/assets/logos/bloomberg.svg" alt="Boomberg">
<img class="h-12" src="/logos/bloomberg.svg" alt="Boomberg">
</div>
<div class="col-span-1 flex justify-center md:col-span-3 lg:col-span-1">
<img class="h-12" src="/assets/logos/janestreet.svg" alt="Jane Street">
<img class="h-12" src="/logos/janestreet.svg" alt="Jane Street">
</div>
<div class="col-span-2 flex justify-center md:col-span-3 lg:col-span-1">
<img class="h-12" src="/assets/logos/tezos.svg" alt="Tesoz">
<img class="h-12" src="/logos/tezos.svg" alt="Tesoz">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let render_tutorial name id image =
<figure>
<div class="relative bg-gray-100 pt-[50%] overflow-hidden">
<div class="absolute inset-0 w-full h-full rounded-t-lg overflow-hidden">
<img src="/assets/tutorials/<%s image %>" alt="" class="absolute inset-0 w-full h-full" />
<img src="/tutorials/<%s image %>" alt="" class="absolute inset-0 w-full h-full" />
</div>
</div>
<figcaption class="py-3 px-4">
Expand Down

0 comments on commit b97edbc

Please sign in to comment.