Compare commits
No commits in common. "d0467e15c02af5cb7cbad044fc6002b64955991a" and "8de08e4cbb0a8898bdaa9434b7cd704b7c941e81" have entirely different histories.
d0467e15c0
...
8de08e4cbb
@ -34,8 +34,7 @@
|
||||
<xsl:otherwise>
|
||||
<xsl:element name="li">
|
||||
<xsl:element name="a">
|
||||
<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:attribute name="href"><xsl:value-of select="$urlprefix"/><xsl:value-of select="/buildinfo/@filename"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
|
||||
<xsl:value-of select="." disable-output-escaping="yes"/>
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
|
@ -172,7 +172,7 @@ function calculate_information($data)
|
||||
"." .
|
||||
$data["lang"] .
|
||||
".xml";
|
||||
$file_url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/fsfe.org/events/{$year}/{$filename}";
|
||||
$file_url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/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/fsfe.org/events/{$year}";
|
||||
$url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/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/fsfe.org/events/{$year}/{$filename}";
|
||||
$file_url = "https://git.fsfe.org/api/v1/repos/FSFE/fsfe-website/contents/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 fsfe.org/events/{$calculated_information["year"]}/{$calculated_information["filename"]}",
|
||||
"message" => "Commit generated by fsfe-website/cgi-bin/registerevent, to add event /events/{$calculated_information["year"]}/{$calculated_information["filename"]}",
|
||||
"signoff" => true,
|
||||
] +
|
||||
($calculated_information["newbranch"]
|
||||
? [
|
||||
"branch" => "test",
|
||||
"branch" => "master",
|
||||
"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" => "test",
|
||||
"base" => "master",
|
||||
"body" => "This pr has been automatically generated by registerevent.php to merge {$calculated_information["branchname"]}.",
|
||||
"head" => $calculated_information["branchname"],
|
||||
"title" => "WIP: {$calculated_information["branchname"]}",
|
||||
|
@ -36,4 +36,4 @@ ARCH_SOURCES := $(foreach year,$(ARCH_YEARS),$(year)/index.sources)
|
||||
all: $(ARCH_SOURCES)
|
||||
$(ARCH_SOURCES): %.sources:
|
||||
@echo "* Creating $@"
|
||||
@echo "fsfe.org/events/$(dir $@)event-*:[]\nfsfe.org/events/$(dir $@).event-*:[]\nfsfe.org/events/.localmenu:[]\n" > $@
|
||||
@echo "events/$(dir $@)event-*:[]\nevents/$(dir $@).event-*:[]\nevents/.localmenu:[]\n" > $@
|
||||
|
@ -36,7 +36,7 @@ ARCH_SOURCES := $(foreach year,$(ARCH_YEARS),$(year)/index.sources)
|
||||
all: $(ARCH_SOURCES)
|
||||
$(ARCH_SOURCES): %.sources:
|
||||
@echo "* Creating $@"
|
||||
@printf "fsfe.org/news/$(dir $@)news-*:[]\nfsfe.org/news/$(dir $@).news-*:[]\nfsfe.org/news/.localmenu:[]\n" > $@
|
||||
@printf "news/$(dir $@)news-*:[]\nnews/$(dir $@).news-*:[]\nnews/.localmenu:[]\n" > $@
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Remove generated .xml files where original .xhtml file does not exist anymore
|
||||
|
@ -13,8 +13,9 @@ 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
|
||||
)
|
||||
@ -67,7 +68,7 @@ for dir in ${!files_by_dir[@]}; do
|
||||
file="${basefile}.en.xhtml"
|
||||
fi
|
||||
xsltproc \
|
||||
--stringparam "link" "$(echo "$basefile"| sed 's/^\.\/[^\/]*//').html" \
|
||||
--stringparam "link" "/${basefile}.html" \
|
||||
build/xslt/get_localmenu_line.xsl \
|
||||
"${file}"
|
||||
echo ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user