Compare commits
2 Commits
8de08e4cbb
...
d0467e15c0
Author | SHA1 | Date | |
---|---|---|---|
d0467e15c0 | |||
0236119d13 |
@ -34,7 +34,8 @@
|
|||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:element name="li">
|
<xsl:element name="li">
|
||||||
<xsl:element name="a">
|
<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:value-of select="." disable-output-escaping="yes"/>
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
</xsl:element>
|
</xsl:element>
|
||||||
|
@ -172,7 +172,7 @@ function calculate_information($data)
|
|||||||
"." .
|
"." .
|
||||||
$data["lang"] .
|
$data["lang"] .
|
||||||
".xml";
|
".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;
|
$branchname = $pr_head_label;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ function calculate_information($data)
|
|||||||
// If there is no matching pr
|
// If there is no matching pr
|
||||||
if ($newbranch) {
|
if ($newbranch) {
|
||||||
// Check if file already exists, and increment until it does not.
|
// 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 = curl_init();
|
||||||
curl_setopt_array($curl, [
|
curl_setopt_array($curl, [
|
||||||
CURLOPT_RETURNTRANSFER => 1,
|
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;
|
break;
|
||||||
}
|
}
|
||||||
if ($count == 30) {
|
if ($count == 30) {
|
||||||
@ -295,12 +295,12 @@ function add_event_file($data, $event, $calculated_information)
|
|||||||
],
|
],
|
||||||
// Encode file in base64, as required by the api.
|
// Encode file in base64, as required by the api.
|
||||||
"content" => base64_encode($event),
|
"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,
|
"signoff" => true,
|
||||||
] +
|
] +
|
||||||
($calculated_information["newbranch"]
|
($calculated_information["newbranch"]
|
||||||
? [
|
? [
|
||||||
"branch" => "master",
|
"branch" => "test",
|
||||||
"new_branch" => $calculated_information["branchname"],
|
"new_branch" => $calculated_information["branchname"],
|
||||||
]
|
]
|
||||||
: ["branch" => $calculated_information["branchname"]]);
|
: ["branch" => $calculated_information["branchname"]]);
|
||||||
@ -332,7 +332,7 @@ function create_pr($data, $calculated_information)
|
|||||||
$apikey = getenv("GITEA_API_KEY");
|
$apikey = getenv("GITEA_API_KEY");
|
||||||
$jsondata = [
|
$jsondata = [
|
||||||
"assignees" => ["delliott"],
|
"assignees" => ["delliott"],
|
||||||
"base" => "master",
|
"base" => "test",
|
||||||
"body" => "This pr has been automatically generated by registerevent.php to merge {$calculated_information["branchname"]}.",
|
"body" => "This pr has been automatically generated by registerevent.php to merge {$calculated_information["branchname"]}.",
|
||||||
"head" => $calculated_information["branchname"],
|
"head" => $calculated_information["branchname"],
|
||||||
"title" => "WIP: {$calculated_information["branchname"]}",
|
"title" => "WIP: {$calculated_information["branchname"]}",
|
||||||
|
@ -36,4 +36,4 @@ ARCH_SOURCES := $(foreach year,$(ARCH_YEARS),$(year)/index.sources)
|
|||||||
all: $(ARCH_SOURCES)
|
all: $(ARCH_SOURCES)
|
||||||
$(ARCH_SOURCES): %.sources:
|
$(ARCH_SOURCES): %.sources:
|
||||||
@echo "* Creating $@"
|
@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" > $@
|
||||||
|
@ -36,7 +36,7 @@ ARCH_SOURCES := $(foreach year,$(ARCH_YEARS),$(year)/index.sources)
|
|||||||
all: $(ARCH_SOURCES)
|
all: $(ARCH_SOURCES)
|
||||||
$(ARCH_SOURCES): %.sources:
|
$(ARCH_SOURCES): %.sources:
|
||||||
@echo "* Creating $@"
|
@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
|
# Remove generated .xml files where original .xhtml file does not exist anymore
|
||||||
|
@ -13,9 +13,8 @@ echo "* Updating local menus"
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Get a list of all source files containing local menus
|
# Get a list of all source files containing local menus
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
all_files=$(
|
all_files=$(
|
||||||
find * -name "*.xhtml" -not -name "*-template.*" \
|
find . -name "*.xhtml" -not -name "*-template.*" \
|
||||||
| xargs grep -l "</localmenu>" \
|
| xargs grep -l "</localmenu>" \
|
||||||
| sort
|
| sort
|
||||||
)
|
)
|
||||||
@ -68,7 +67,7 @@ for dir in ${!files_by_dir[@]}; do
|
|||||||
file="${basefile}.en.xhtml"
|
file="${basefile}.en.xhtml"
|
||||||
fi
|
fi
|
||||||
xsltproc \
|
xsltproc \
|
||||||
--stringparam "link" "/${basefile}.html" \
|
--stringparam "link" "$(echo "$basefile"| sed 's/^\.\/[^\/]*//').html" \
|
||||||
build/xslt/get_localmenu_line.xsl \
|
build/xslt/get_localmenu_line.xsl \
|
||||||
"${file}"
|
"${file}"
|
||||||
echo ""
|
echo ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user