Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add library intro #587

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion dub.selections.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"fileVersion": 1,
"versions": {
"diet-ng": "1.8.1",
"diet-ng": "1.8.3",
"dub": "1.33.1",
"eventcore": "0.9.31",
"libasync": "0.8.6",
"memutils": "1.0.11",
"mir-linux-kernel": "1.0.1",
"openssl": "3.3.3",
"openssl-static": "1.0.5+3.0.8",
Expand Down
Empty file added home-fixed.dt
Empty file.
12 changes: 12 additions & 0 deletions views/home.dt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ block body
- else
p Welcome to DUB, the D package registry. The following list shows all available packages:

//New Section
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't add comments that refer to old/new things, this comment will be outdated immediately on the next change and isn't helping anyone. I would just suggest removing this line since the h2 describes it already

h2 📚 Commonly Used Libraries
ul
li
a(href="https://vibed.org/") 🌐 vibe.d - A high-performance asynchronous I/O web framework
li
a(href="http://gtkd.org/") 🖥️ gtkd - GTK bindings for building GUI applications in D
li
a(href="https://github.com/BindBC") 🔗 bindbc - A collection of bindings for C libraries
li
a(href="https://github.com/dlang-community/gettext") 🌎 gettext - A library for handling internationalization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like having a list of common libraries, but I don't know if the registry is the right place for this. This needs some discussion on the forum where to put it and which libraries to include in it I think. There are already a lot of "awesome" lists for D projects, e.g. https://github.com/dlang-community/awesome-d/ - it should probably rather link to a project like this instead of maintaining a separate list.

We already have the dynamically updating "Most popular" listing as well. It would probably make more sense to update the scoring there if you think certain packages shouldn't be ranked so high.

Also I don't think it's a good idea to use emoji on websites due to possible encoding issues, not all fonts having them and the look being different on each platform / emoji font which isn't really controllable and quickly gets ugly. For categories we already included monochrome icons which could be reused here instead.


form#category-form(method="GET", action="")
input(type="hidden", name="sort", value=sort_mode)
input(type="hidden", name="limit", value=info.limit)
Expand Down
8 changes: 4 additions & 4 deletions views/layout.inc.menu.dt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
ul
- foreach(items; listitems)
- if(items[1].length < 2)
- bool active = startsWith(req.path[1..$], items[1][0]);
- if( items[1][0].empty ) active = req.path == "/";
- bool active = startsWith(req.requestPath.toString()[1..$], items[1][0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unrelated to the change above, please only do one thing at a time in a PR, you can have multiple PRs open at the same time

- if( items[1][0].empty ) active = req.requestPath.toString() == "/";
li(class=(active ? "active" : ""))
- if (!(items[1][0].length > 4 && items[1][0][0..4] == "http"))
- items[1][0] = req.rootDir ~ items[1][0];
Expand All @@ -31,14 +31,14 @@
- else
- bool active = false;
- foreach(itm; items[1])
- if (startsWith(req.path[1..$], split(itm, ";")[1])) active = true;
- if (startsWith(req.requestPath.toString()[1..$], split(itm, ";")[1])) active = true;
li(class=(active ? "expand-container active" : "expand-container"))
a.expand-toggle(href="#")
span=items[0]
ul.expand-content
- foreach(itm; items[1])
- auto parts = split(itm, ";");
- bool active_item = startsWith(req.path[1..$], parts[1]);
- bool active_item = startsWith(req.requestPath.toString()[1..$], parts[1]);
li(class=(active_item ? "active" : ""))
- if (!(parts[1].length > 4 && parts[1][0..4] == "http"))
- parts[1] = req.rootDir ~ parts[1];
Expand Down
2 changes: 1 addition & 1 deletion views/view_package.dt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ block title
- import vibe.inet.url;
- import vibe.textfilter.urlencode;
- import dubregistry.viewutils;
- import userman.controller;
- import userman.db.controller;
- title = "Package " ~ packageName ~ " version " ~ versionInfo["version"].get!string;
- auto packageInfo = packinfo.info;

Expand Down