Skip to content

Commit 08e152f

Browse files
committed
fix comments for css files
1 parent 3191c4a commit 08e152f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

modules/nixos-wiki/pages.nix

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,27 @@ in
9494
9595
# Read page content and add management comment
9696
content=$(cat "$wiki_file")
97-
content_with_comment="<!--
98-
This page is automatically managed through git repository synchronization.
97+
98+
# Define the comment content
99+
comment_text="This page is automatically managed through git repository synchronization.
99100
Do not edit this page directly on the wiki - changes will be overwritten.
100101
To edit this page, modify the file: $filename
101-
Source: https://github.com/NixOS/nixos-wiki-infra/blob/main/pages/$filename
102+
Source: https://github.com/NixOS/nixos-wiki-infra/blob/main/pages/$filename"
103+
104+
# Use appropriate comment syntax based on page type
105+
if [[ "$filename" == *.css.wiki ]]; then
106+
content_with_comment="/*
107+
$comment_text
108+
*/
109+
110+
$content"
111+
else
112+
content_with_comment="<!--
113+
$comment_text
102114
-->
103115
104116
$content"
117+
fi
105118
106119
# Edit the page using maintenance script (no --user means system maintenance user)
107120
echo "$content_with_comment" | ${config.services.phpfpm.pools.mediawiki.phpPackage}/bin/php \

0 commit comments

Comments
 (0)