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})
'';
outputs.html = (cfg.templates.html.page config).override (
final: prev: {
_final: prev: {
html = {
head.title.text = "Fediversity";
head.link.stylesheets = prev.html.head.link.stylesheets ++ [

View file

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

View file

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

View file

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

View file

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

View file

@ -20,7 +20,7 @@ rec {
in
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
*/
{ config, lib, ... }:
let
cfg = config;
inherit (lib) mkOption types;
inherit (types) submodule;
@ -45,7 +45,7 @@ let
};
# 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
# 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 = {
type = with types; listOf nonEmptyStr;
default = [ ];
@ -105,7 +105,7 @@ let
# all possible attributes to `<link>` elements.
# 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 = {
# 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
@ -130,7 +130,7 @@ let
# TODO: not sure where to put these, since so far they apply to multiple elements,
# 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
href = {
# TODO: https://url.spec.whatwg.org/#valid-url-string
@ -415,7 +415,7 @@ let
};
base =
{ name, ... }:
{ ... }:
{
imports = [ element ];
# TODO: "A base element must have either an href attribute, a target attribute, or both."
@ -427,7 +427,7 @@ let
};
link =
{ name, ... }:
{ ... }:
{
imports = [ element ];
options = global-attrs // {
@ -472,7 +472,7 @@ let
# <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>`
stylesheet =
{ config, name, ... }:
{ config, ... }:
{
imports = [ element ];
options = global-attrs // {
@ -808,7 +808,7 @@ let
with lib;
removeAttrs
(filterAttrs (
name: value:
_name: value:
!any (
c:
elem c [

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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