Skip to content

Commit

Permalink
Make it functional !
Browse files Browse the repository at this point in the history
  • Loading branch information
xvw committed Aug 1, 2024
1 parent 48264b3 commit 883ac4b
Show file tree
Hide file tree
Showing 21 changed files with 240 additions and 27 deletions.
12 changes: 11 additions & 1 deletion data/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
page_title: Index
description: The index of ring.muhokama.fun
interests:
- title: Software Engineering
url: https://en.wikipedia.org/wiki/Software_engineering
- title: Functional programming
url: https://en.wikipedia.org/wiki/Functional_programming
- title: Type system
url: https://en.wikipedia.org/wiki/Type_system
- title: OCaml
url: https://ocaml.org
- title: Small-Web
url: https://ar.al/2020/08/07/what-is-the-small-web/
---

Index
Welcome to the [Muhokama](https://github.com/muhokama/) webring. A collection of
personal spaces maintained by people who share certain ideas or approaches to
the Internet.
2 changes: 1 addition & 1 deletion lib/model/chain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Metadata = struct

let validate =
let open Yocaml.Data.Validation in
list_of Yocaml.Slug.validate
(null & const []) / list_of Yocaml.Slug.validate
end

module SMap = Map.Make (String)
Expand Down
4 changes: 2 additions & 2 deletions lib/model/index.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let normalize { page; chain; interests } =
Page.normalize page
@ [
("has_interests", has_list interests);
("interests", list_of Link.normalize interests);
("has_members", bool (Chain.is_empty chain));
("interests", Link.normalize_to_semantic_list interests);
("has_members", bool (not (Chain.is_empty chain)));
("chain", Chain.normalize chain);
]
27 changes: 13 additions & 14 deletions lib/model/member.ml
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,22 @@ let validate =
})

let normalize
{
id;
display_name;
bio;
has_avatar;
main_link;
main_feed;
nouns;
additional_links;
additional_feeds;
location;
} =
({
id;
bio;
has_avatar;
main_link;
main_feed;
nouns;
additional_links;
additional_feeds;
location;
_;
} as m) =
let open Yocaml.Data in
[
("id", string id);
("has_display_name", has_opt display_name);
("display_name", option string display_name);
("display_name", string @@ display_name m);
("has_bio", has_opt bio);
("bio", option string bio);
("has_avatar", bool has_avatar);
Expand Down
126 changes: 126 additions & 0 deletions static/css/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,129 @@
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: "Inria Serif";
font-style: italic;
font-weight: 300;
font-display: swap;
src: url("/fonts/inria-latin-1.woff2") format("woff2");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
font-family: "Inria Serif";
font-style: italic;
font-weight: 300;
font-display: swap;
src: url("/fonts/inria-latin-2.woff2") format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: "Inria Serif";
font-style: italic;
font-weight: 400;
font-display: swap;
src: url("/fonts/inria-latin-ext1.woff2") format("woff2");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
font-family: "Inria Serif";
font-style: italic;
font-weight: 400;
font-display: swap;
src: url("/fonts/inria-latin-3.woff2") format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: "Inria Serif";
font-style: italic;
font-weight: 700;
font-display: swap;
src: url("/fonts/inria-latin-ext2.woff2") format("woff2");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
font-family: "Inria Serif";
font-style: italic;
font-weight: 700;
font-display: swap;
src: url("/fonts/inria-latin-4.woff2") format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: "Inria Serif";
font-style: normal;
font-weight: 300;
font-display: swap;
src: url("/fonts/inria-latin-ext3.woff2") format("woff2");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
font-family: "Inria Serif";
font-style: normal;
font-weight: 300;
font-display: swap;
src: url("/fonts/inria-latin-5.woff2") format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: "Inria Serif";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("/fonts/inria-latin-ext4.woff2") format("woff2");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
font-family: "Inria Serif";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("/fonts/inria-latin-6.woff2") format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
font-family: "Inria Serif";
font-style: normal;
font-weight: 700;
font-display: swap;
src: url("/fonts/inria-latin-ext5.woff2") format("woff2");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
font-family: "Inria Serif";
font-style: normal;
font-weight: 700;
font-display: swap;
src: url("/fonts/inria-latin-7.woff2") format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122,
U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
11 changes: 10 additions & 1 deletion static/css/reset.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

body {
font-size: 1rem;
font-size: 1.2rem;
line-height: 1.5;
line-height: calc(1em + 0.5rem);
-webkit-font-smoothing: antialiased;
Expand Down Expand Up @@ -44,6 +44,15 @@ h6 {
overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "Inter";
}

#root,
#__next {
isolation: isolate;
Expand Down
59 changes: 54 additions & 5 deletions static/css/style.css
Original file line number Diff line number Diff line change
@@ -1,28 +1,77 @@
:root {
--main-light-color: #f9f9f9;
--main-light-color: #f0f0f0;
--main-dark-color: #111111;
--main-contrast-dark-color: #052520;
--main-contrast-light-color: #3aac97;
}

body {
min-height: 100vh;
background-color: var(--main-light-color);
color: var(--main-dark-color);
color: var(--main-light-color);
display: flex;
flex-direction: column;
background-color: var(--main-dark-color);
}

a {
color: var(--main-contrast-light-color);
}

p {
margin: 12px 0;
}

header {
margin-top: 32px;
}

header h1 {
font-size: 280%;
}

header h1 span {
color: var(--main-contrast-light-color);
}

main {
flex: 1;
flex: 2;
}

footer {
background-color: var(--main-dark-color);
color: var(--main-light-color);
flex: 1;
}

.container {
width: 100%;
max-width: 1024px;
margin: 0 auto;
padding: 32px 0;
padding: 32px 12px;
}

.members {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 32px;
margin: 68px 0;
}

.members > a {
border-left: 8px solid var(--main-contrast-light-color);
background-color: var(--main-contrast-dark-color);
padding: 8px;
font-family: "Inter";
font-size: 80%;
text-decoration: none;
color: var(--main-contrast-light-color);
}

.no-members {
color: var(--main-contrast-light-color);
border-left: 8px solid var(--main-contrast-dark-color);
padding: 32px;
margin: 64px 0;
font-family: "Inria Serif";
font-size: 180%;
}
Binary file added static/fonts/inria-latin-1.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-2.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-3.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-4.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-5.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-6.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-7.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-ext1.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-ext2.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-ext3.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-ext4.woff2
Binary file not shown.
Binary file added static/fonts/inria-latin-ext5.woff2
Binary file not shown.
22 changes: 21 additions & 1 deletion static/templates/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
{%- autoescape false -%} {{ yocaml_body }} {%- endautoescape -%}
{%- autoescape false -%} {{ yocaml_body }} {%- endautoescape -%} {%- if
has_interests -%}
<p class="interests">
We're interested in a range of subjects, for example {%- for it in interests
%}
<a href="{{it.url.url}}">{{ it.title }}</a>{{ it.sep }}{%- endfor -%}. If you
are interested in the different topics proposed or if you find yourself close
to the ideas presented by the different members of the ring, don't hesitate to
<a href="https://github.com/muhokama/ring">add your own digital space</a>!
</p>
{%- endif -%} {%- if has_members -%}
<section class="members">
{%- for m in chain -%}
<a id="member-{{ m.id }}" href="{{ m.main_link.url.url }}"
>{{ m.display_name }}</a
>
{%- endfor -%}
</section>
{%- else -%}
<section class="no-members">The ring is empty</section>
{%- endif -%}
4 changes: 2 additions & 2 deletions static/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
</head>
<body>
<header>
<div class="container"><h1>ring.muhokama.fun</h1></div>
<div class="container"><h1>ring.<span>muhokama</span>.fun</h1></div>
</header>
<main>
<div class="container">
{%- autoescape false -%} {{ yocaml_body }} {%- endautoescape -%}
</div>
</main>
<footer><div class="container">footer</div></footer>
<footer><div class="container"></div></footer>
</body>
</html>

0 comments on commit 883ac4b

Please sign in to comment.