Compare commits

...

2 Commits

Author SHA1 Message Date
d0467e15c0
Fix register event script for new layout
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-23 11:05:09 +02:00
0236119d13
Fix localmenus, language switcher, Event/News archives 2024-08-23 10:43:41 +02:00
5 changed files with 12 additions and 12 deletions

View File

@ -34,7 +34,8 @@
<xsl:otherwise>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/><xsl:value-of select="/buildinfo/@filename"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>/<xsl:value-of select="substring-after(substring-after(/buildinfo/@filename,'/'),'/')"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:element>
</xsl:element>

View File

@ -172,7 +172,7 @@ function calculate_information($data)
"." .
$data["lang"] .
".xml";
$file_url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/events/{$year}/{$filename}";
$file_url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/fsfe.org/events/{$year}/{$filename}";
$branchname = $pr_head_label;
break;
}
@ -184,7 +184,7 @@ function calculate_information($data)
// If there is no matching pr
if ($newbranch) {
// Check if file already exists, and increment until it does not.
$url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/events/{$year}";
$url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/fsfe.org/events/{$year}";
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => 1,
@ -219,7 +219,7 @@ function calculate_information($data)
)
)
) {
$file_url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/events/{$year}/{$filename}";
$file_url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/fsfe.org/events/{$year}/{$filename}";
break;
}
if ($count == 30) {
@ -295,12 +295,12 @@ function add_event_file($data, $event, $calculated_information)
],
// Encode file in base64, as required by the api.
"content" => base64_encode($event),
"message" => "Commit generated by fsfe-website/cgi-bin/registerevent, to add event /events/{$calculated_information["year"]}/{$calculated_information["filename"]}",
"message" => "Commit generated by fsfe-website/cgi-bin/registerevent, to add event fsfe.org/events/{$calculated_information["year"]}/{$calculated_information["filename"]}",
"signoff" => true,
] +
($calculated_information["newbranch"]
? [
"branch" => "master",
"branch" => "test",
"new_branch" => $calculated_information["branchname"],
]
: ["branch" => $calculated_information["branchname"]]);
@ -332,7 +332,7 @@ function create_pr($data, $calculated_information)
$apikey = getenv("GITEA_API_KEY");
$jsondata = [
"assignees" => ["delliott"],
"base" => "master",
"base" => "test",
"body" => "This pr has been automatically generated by registerevent.php to merge {$calculated_information["branchname"]}.",
"head" => $calculated_information["branchname"],
"title" => "WIP: {$calculated_information["branchname"]}",

View File

@ -36,4 +36,4 @@ ARCH_SOURCES := $(foreach year,$(ARCH_YEARS),$(year)/index.sources)
all: $(ARCH_SOURCES)
$(ARCH_SOURCES): %.sources:
@echo "* Creating $@"
@echo "events/$(dir $@)event-*:[]\nevents/$(dir $@).event-*:[]\nevents/.localmenu:[]\n" > $@
@echo "fsfe.org/events/$(dir $@)event-*:[]\nfsfe.org/events/$(dir $@).event-*:[]\nfsfe.org/events/.localmenu:[]\n" > $@

View File

@ -36,7 +36,7 @@ ARCH_SOURCES := $(foreach year,$(ARCH_YEARS),$(year)/index.sources)
all: $(ARCH_SOURCES)
$(ARCH_SOURCES): %.sources:
@echo "* Creating $@"
@printf "news/$(dir $@)news-*:[]\nnews/$(dir $@).news-*:[]\nnews/.localmenu:[]\n" > $@
@printf "fsfe.org/news/$(dir $@)news-*:[]\nfsfe.org/news/$(dir $@).news-*:[]\nfsfe.org/news/.localmenu:[]\n" > $@
# -----------------------------------------------------------------------------
# Remove generated .xml files where original .xhtml file does not exist anymore

View File

@ -13,9 +13,8 @@ echo "* Updating local menus"
# -----------------------------------------------------------------------------
# Get a list of all source files containing local menus
# -----------------------------------------------------------------------------
all_files=$(
find * -name "*.xhtml" -not -name "*-template.*" \
find . -name "*.xhtml" -not -name "*-template.*" \
| xargs grep -l "</localmenu>" \
| sort
)
@ -68,7 +67,7 @@ for dir in ${!files_by_dir[@]}; do
file="${basefile}.en.xhtml"
fi
xsltproc \
--stringparam "link" "/${basefile}.html" \
--stringparam "link" "$(echo "$basefile"| sed 's/^\.\/[^\/]*//').html" \
build/xslt/get_localmenu_line.xsl \
"${file}"
echo ""