чување 4a802719c6d5b7c2c3d10cd54aa4d9bacb2b758f
родитељ e6c509597018d44ef2e3fcc406d6a29d84f57cdd
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Thu, 4 Feb 2021 21:21:21 +0100
Added the lang YAML variable
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 4, додавања: 17(+), брисања: 10(-)
diff --git a/examples/csv/sales.csv b/examples/csv/sales.csv
@@ -1,4 +1,4 @@
-"Item";"Q1 2020";"Q2 2020";"Q3 2020";"Q4 2020"
-"Toothpick";"15.2";"12";"";"10"
-"Teapot";"1.2";"";"5";"3.5"
+"Item","Q1 2020","Q2 2020","Q3 2020","Q4 2020"
+"Toothpick","15.2","12","","10"
+"Teapot","1.2","","5","3.5"
diff --git a/index.html b/index.html
@@ -2,7 +2,7 @@
<html lang="en">
<head>
<title>slweb - Simple static website generator. </title>
-<meta charset="utf8" />
+<meta charset="utf-8" />
<link rel="shortcut icon" type="image/x-icon" href="/slweb/favicon.ico" />
<meta name="description" content="Simple static website generator" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -136,12 +136,12 @@ this program. If not, see <<a href="https://www.gnu.org/licenses">https://www
<div id="git-log">
Previous commit:
-index.slw 853bbd5 2021-02-04 14:12:24 +0100 (Страхиња Радић) (HEAD -> master, tag: v0.3.8, origin/master, origin/HEAD)
+index.slw e6c5095 2021-02-04 19:20:09 +0100 (Страхиња Радић) (HEAD -> master, origin/master, origin/HEAD)
</div><!--git-log-->
<div id="made-by">
-Generated by <a href="https://strahinja.github.io/slweb">slweb</a>
+Generated by <a href="https://strahinja.github.io/slweb" target="_blank">slweb</a>
© 2020, 2021 Strahinya Radich.
</div><!--made-by-->
diff --git a/slweb.1.in b/slweb.1.in
@@ -759,6 +759,11 @@ The contents of this variable will be added to the start of the output body
(inside a \fC<header>\fP tag if it is set), surrounded by \fC<p></p>\fP.
.
.IP \[bu]
+.BR lang .
+Contents of this variable will be used for the \fClang\fP attribute of the
+\fC<html>\fP tag.
+.
+.IP \[bu]
.BR permalink-url .
If present, this
.SM URL
diff --git a/slweb.c b/slweb.c
@@ -1747,15 +1747,17 @@ process_formula(FILE* output, const uint8_t* token, BOOL display_formula)
int
begin_html_and_head(FILE* output)
{
- uint8_t* site_name = get_value(vars, vars_count, (uint8_t*)"site-name", NULL);
- uint8_t* site_desc = get_value(vars, vars_count, (uint8_t*)"site-desc", NULL);
+ uint8_t* lang = get_value(vars, vars_count, (uint8_t*)"lang", NULL);
+ uint8_t* site_name = get_value(vars, vars_count, (uint8_t*)"site-name", NULL);
+ uint8_t* site_desc = get_value(vars, vars_count, (uint8_t*)"site-desc", NULL);
uint8_t* favicon_url = get_value(vars, vars_count, (uint8_t*)"favicon-url", NULL);
print_output(output, "<!DOCTYPE html>\n"
- "<html lang=\"en\">\n"
+ "<html lang=\"%s\">\n"
"<head>\n"
"<title>%s</title>\n"
- "<meta charset=\"utf8\" />\n",
+ "<meta charset=\"utf-8\" />\n",
+ lang ? (char*)lang : "en",
site_name ? (char*)site_name : "");
char* favicon = NULL;