website: remove unused arguments

This commit is contained in:
Nicolas Jeannerod 2025-02-19 18:38:05 +01:00 committed by Valentin Gagarin
parent 10f3d15a98
commit 06d3d37a39
13 changed files with 24 additions and 30 deletions

View file

@ -23,7 +23,7 @@ in
[Learn more about Fediversity](${link pages.fediversity}) [Learn more about Fediversity](${link pages.fediversity})
''; '';
outputs.html = (cfg.templates.html.page config).override ( outputs.html = (cfg.templates.html.page config).override (
final: prev: { _final: prev: {
html = { html = {
head.title.text = "Fediversity"; head.title.text = "Fediversity";
head.link.stylesheets = prev.html.head.link.stylesheets ++ [ head.link.stylesheets = prev.html.head.link.stylesheets ++ [

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, ... }:
{ {
collections.events.entry = collections.events.entry =
{ link, ... }: { link, ... }:

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, ... }:
let let
inherit (config) pages; inherit (config) pages;
in in

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { config, ... }:
{ {
collections.news.entry = collections.news.entry =
{ link, ... }: { link, ... }:

View file

@ -1,7 +1,8 @@
{ config, lib, ... }: { ... }:
{ {
collections.news.entry = collections.news.entry =
{ link, ... }: { ... }:
{ {
title = "Fediversity project publicly announced"; title = "Fediversity project publicly announced";
description = "The Fediversity project has officially been announced"; description = "The Fediversity project has officially been announced";

View file

@ -20,7 +20,7 @@ rec {
in in
result' result'
// { // {
override = new: (template g (x': base') x).override new; override = new: (template g (_: base') x).override new;
}; };
}; };

View file

@ -6,8 +6,8 @@
Similar work from the OCaml ecosystem: https://github.com/ocsigen/tyxml Similar work from the OCaml ecosystem: https://github.com/ocsigen/tyxml
*/ */
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config;
inherit (lib) mkOption types; inherit (lib) mkOption types;
inherit (types) submodule; inherit (types) submodule;
@ -45,7 +45,7 @@ let
}; };
# options with types for all the defined DOM elements # options with types for all the defined DOM elements
element-types = lib.mapAttrs (name: value: mkOption { type = submodule value; }) elements; element-types = lib.mapAttrs (_name: value: mkOption { type = submodule value; }) elements;
# attrset of categories, where values are module options with the type of the # attrset of categories, where values are module options with the type of the
# elements that belong to these categories # elements that belong to these categories
@ -69,7 +69,7 @@ let
) )
); );
global-attrs = lib.mapAttrs (name: value: mkOption value) { global-attrs = lib.mapAttrs (_name: value: mkOption value) {
class = { class = {
type = with types; listOf nonEmptyStr; type = with types; listOf nonEmptyStr;
default = [ ]; default = [ ];
@ -105,7 +105,7 @@ let
# all possible attributes to `<link>` elements. # all possible attributes to `<link>` elements.
# since not all of them apply to each `rel=` type, the separate implementations can pick from this collection # since not all of them apply to each `rel=` type, the separate implementations can pick from this collection
link-attrs = lib.mapAttrs (name: value: mkOption value) { link-attrs = lib.mapAttrs (_name: value: mkOption value) {
href = { href = {
# TODO: implement https://html.spec.whatwg.org/multipage/semantics.html#the-link-element:attr-link-href-3 # TODO: implement https://html.spec.whatwg.org/multipage/semantics.html#the-link-element:attr-link-href-3
# TODO: https://url.spec.whatwg.org/#valid-url-string # TODO: https://url.spec.whatwg.org/#valid-url-string
@ -130,7 +130,7 @@ let
# TODO: not sure where to put these, since so far they apply to multiple elements, # TODO: not sure where to put these, since so far they apply to multiple elements,
# but have the same properties for all of them # but have the same properties for all of them
attrs = lib.mapAttrs (name: value: mkOption value) { attrs = lib.mapAttrs (_name: value: mkOption value) {
# TODO: investigate: `href` may be coupled with other attributes such as `target` or `hreflang`, this could simplify things # TODO: investigate: `href` may be coupled with other attributes such as `target` or `hreflang`, this could simplify things
href = { href = {
# TODO: https://url.spec.whatwg.org/#valid-url-string # TODO: https://url.spec.whatwg.org/#valid-url-string
@ -415,7 +415,7 @@ let
}; };
base = base =
{ name, ... }: { ... }:
{ {
imports = [ element ]; imports = [ element ];
# TODO: "A base element must have either an href attribute, a target attribute, or both." # TODO: "A base element must have either an href attribute, a target attribute, or both."
@ -427,7 +427,7 @@ let
}; };
link = link =
{ name, ... }: { ... }:
{ {
imports = [ element ]; imports = [ element ];
options = global-attrs // { options = global-attrs // {
@ -472,7 +472,7 @@ let
# <link rel="stylesheet"> is implemented separately because it can be used both in `<head>` and `<body>` # <link rel="stylesheet"> is implemented separately because it can be used both in `<head>` and `<body>`
# semantically it's a standalone thing but syntactically happens to be subsumed under `<link>` # semantically it's a standalone thing but syntactically happens to be subsumed under `<link>`
stylesheet = stylesheet =
{ config, name, ... }: { config, ... }:
{ {
imports = [ element ]; imports = [ element ];
options = global-attrs // { options = global-attrs // {
@ -808,7 +808,7 @@ let
with lib; with lib;
removeAttrs removeAttrs
(filterAttrs ( (filterAttrs (
name: value: _name: value:
!any ( !any (
c: c:
elem c [ elem c [

View file

@ -1,16 +1,10 @@
{ {
config, config,
options,
lib, lib,
pkgs, pkgs,
... ...
}: }:
let
inherit (lib)
mkOption
types
;
in
{ {
config.templates.html = { config.templates.html = {
dom = dom =

View file

@ -36,7 +36,7 @@ in
config.name = with lib; mkDefault (slug config.title); config.name = with lib; mkDefault (slug config.title);
config.outputs.html = lib.mkForce ( config.outputs.html = lib.mkForce (
(cfg.templates.html.page config).override ( (cfg.templates.html.page config).override (
final: prev: { _final: prev: {
html = { html = {
# TODO: make authors always a list # TODO: make authors always a list
head.meta.authors = if lib.isList config.author then config.author else [ config.author ]; head.meta.authors = if lib.isList config.author then config.author else [ config.author ];

View file

@ -34,7 +34,7 @@ in
flatten = flatten =
attrs: attrs:
mapAttrsToList ( mapAttrsToList (
name: value: _name: value:
# HACK: we somehow have to distinguish a module value from regular attributes. # HACK: we somehow have to distinguish a module value from regular attributes.
# arbitrary choice: the outputs attribute # arbitrary choice: the outputs attribute
if value ? outputs then value else mapAttrsToList value if value ? outputs then value else mapAttrsToList value

View file

@ -2,9 +2,9 @@
config, config,
options, options,
lib, lib,
pkgs,
... ...
}: }:
let let
inherit (lib) inherit (lib)
mkOption mkOption
@ -12,6 +12,7 @@ let
; ;
cfg = config; cfg = config;
in in
{ {
options.collections = mkOption { options.collections = mkOption {
description = '' description = ''

View file

@ -2,7 +2,6 @@
config, config,
options, options,
lib, lib,
pkgs,
... ...
}: }:
let let
@ -10,7 +9,6 @@ let
mkOption mkOption
types types
; ;
cfg = config;
in in
{ {
imports = lib.nixFiles ./.; imports = lib.nixFiles ./.;
@ -74,7 +72,7 @@ in
let let
path = relativePath (head config.locations) (head target.locations); path = relativePath (head config.locations) (head target.locations);
links = mapAttrs ( links = mapAttrs (
type: output: path + optionalString (type != "") ".${type}" type: _output: path + optionalString (type != "") ".${type}"
# ^^^^^^^^^^^^ # ^^^^^^^^^^^^
# convention for raw files # convention for raw files
) target.outputs; ) target.outputs;

View file

@ -50,7 +50,7 @@ in
config.summary = lib.mkDefault config.description; config.summary = lib.mkDefault config.description;
config.outputs.html = lib.mkForce ( config.outputs.html = lib.mkForce (
(cfg.templates.html.page config).override ( (cfg.templates.html.page config).override (
final: prev: { _final: prev: {
html.body.content = html.body.content =
with lib; with lib;
map ( map (