summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2022-10-25 09:20:15 +0300
committerYuval Adam <_@yuv.al>2022-10-25 09:20:15 +0300
commit1d3ad68adae42f05ddd68c1b5183a8db5f2be338 (patch)
treef9c0cbf1991f068a1926a47118e68d60e0114fad
parent8d9f33a16c09e9c7ec5d37aad638ce80b0b5044e (diff)
Add support for extra optional fields
-rw-r--r--README.md15
-rw-r--r--build.py5
-rw-r--r--names/yuval.yml4
-rw-r--r--templates/index.html58
4 files changed, 49 insertions, 33 deletions
diff --git a/README.md b/README.md
index 4447658..d52c08a 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# namehack.club
-An exclusive club of nerds.
+An exclusive club of nerds that own the domain hack to their name.
## Criteria
@@ -11,10 +11,19 @@ An exclusive club of nerds.
Open a new pull request to this repository that adds a new YAML file to the [`names`](names) directory.
-If your domain name is `examp.le` the file name should be `example.yml`, and should include the following required fields:
+If your domain name is `examp.le` the file name should be `example.yml`, and the following minimal fields are required:
```yaml
domain: examp.le
name: Example Foo
+```
+
+Other optional fields are supported:
+
+```yaml
+domain: examp.le
+name: Example Foo
+url: https://examp.le/about/ # use to specify homepage URL, defaults to https://examp.le
+title: UI/UX designer # maximum 80 chars
email: hi@examp.le
-``` \ No newline at end of file
+```
diff --git a/build.py b/build.py
index f6cba01..8649c73 100644
--- a/build.py
+++ b/build.py
@@ -11,7 +11,7 @@ NAMES_DIR = ROOT_PATH / "names"
BUILD_DIR = ROOT_PATH / "build"
STATIC_DIR = ROOT_PATH / "static"
-REQUIRED_FIELDS = set(["domain", "name", "email"])
+REQUIRED_FIELDS = set(["domain", "name"])
TEMPLATES = ["index.html"]
@@ -29,6 +29,7 @@ for name in listdir(NAMES_DIR):
missing_fields = REQUIRED_FIELDS - set(fields.keys())
if missing_fields:
raise Exception(f"Missing required fields {missing_fields} in {name}")
+
names.append(fields)
# render templates
@@ -40,4 +41,4 @@ for template in TEMPLATES:
t = env.get_template(template)
index = t.render(names=names)
with open(BUILD_DIR / "index.html", "w") as f:
- f.write(index) \ No newline at end of file
+ f.write(index)
diff --git a/names/yuval.yml b/names/yuval.yml
index 811fc7a..22f77d8 100644
--- a/names/yuval.yml
+++ b/names/yuval.yml
@@ -1,3 +1,5 @@
domain: yuv.al
name: Yuval Adam
-email: hello@yuv.al \ No newline at end of file
+email: hello@yuv.al
+title: Full-stack technologist, creator of namehack.club
+# url: https://foo.goo
diff --git a/templates/index.html b/templates/index.html
index ce0ff0e..d080c40 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,36 +1,40 @@
<!DOCTYPE html>
<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>namehack.club</title>
+<head>
+ <meta charset="utf-8">
- <meta name="description" content="An exclusive club of nerds">
- <meta name="keywords" content="domain, name, hack, club, exclusive">
+ <title>namehack.club</title>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="robots" content="all">
+ <meta name="description" content="An exclusive club of nerds that own the domain hack to their name">
+ <meta name="keywords" content="domain, name, hack, club, exclusive">
- <link rel="canonical" href="https://namehack.club/">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="robots" content="all">
- <link href="tachyons.min.css" rel="stylesheet">
- <link href="base.css" rel="stylesheet">
- <script src="https://skilled-twentyeight.namehack.club/script.js" data-site="SSTGQKAU" defer></script>
- </head>
+ <link rel="canonical" href="https://namehack.club/">
- <body class="code mw7-ns ph3 center">
- <h1>Domain Name Hack Club</h1>
- <p>An exclusive club of nerds that own the <a href="https://en.wikipedia.org/wiki/Domain_hack" class="link">domain hack</a> to their name, and serve their personal homepage from it.</p>
+ <link href="tachyons.min.css" rel="stylesheet">
+ <link href="base.css" rel="stylesheet">
+ <script src="https://skilled-twentyeight.namehack.club/script.js" data-site="SSTGQKAU" defer></script>
+</head>
- <ul>
- {% for name in names %}
- <li><a href="https://{{ name.domain }}">{{ name.name }}</li>
- {% endfor %}
- </ul>
- <hr>
- <footer>
- Created by <a href="https://yuv.al">Yuval Adam</a>. Maintained collaboratively on <a href="https://github.com/yuvadm/namehack.club">Github</a>.
- </footer>
- </body>
-</html> \ No newline at end of file
+<body class="code mw7-ns ph3 center">
+ <h1>Domain Name Hack Club</h1>
+ <p>An exclusive club of nerds that own the <a href="https://en.wikipedia.org/wiki/Domain_hack" class="link">domain
+ hack</a> to their name, and serve their personal homepage from it.</p>
+
+ <ul>
+ {% for name in names %}
+ <li><a href="{{ [name.url, 'https://{{ name.domain }}']|first }}">{{ name.name }}</li>
+ {% endfor %}
+ </ul>
+ <hr>
+ <footer>
+ Created by <a href="https://yuv.al">Yuval Adam</a>. Maintained collaboratively on <a
+ href="https://github.com/yuvadm/namehack.club">Github</a>.
+ </footer>
+</body>
+
+</html>