2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-12-23 18:48:58 +00:00

Merge pull request #210 from revant/fix-website-style-css

This commit is contained in:
Chinmay Pai 2020-04-23 21:47:23 +05:30 committed by GitHub
commit aac3efb24b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 2 deletions

View File

@ -6,13 +6,23 @@ RUN mkdir -p /home/frappe/frappe-bench/sites \
RUN install_packages git
RUN mkdir -p apps sites/assets \
RUN mkdir -p apps sites/assets/css \
&& cd apps \
&& git clone --depth 1 https://github.com/frappe/frappe
COPY build/frappe-nginx/generate_standard_style_css.js \
/home/frappe/frappe-bench/apps/frappe/generate_standard_style_css.js
RUN cd /home/frappe/frappe-bench/apps/frappe \
&& yarn \
&& yarn run production \
&& yarn add nunjucks -D \
&& node generate_standard_style_css.js \
frappe/website/doctype/website_theme/website_theme_template.scss > \
/home/frappe/standard_templates_string \
&& node generate_bootstrap_theme.js \
/home/frappe/frappe-bench/sites/assets/css/standard_style.css \
"$(cat /home/frappe/standard_templates_string)" \
&& rm -fr node_modules \
&& yarn install --production=true \
&& node --version \

View File

@ -0,0 +1,14 @@
const nunjucks = require("nunjucks");
const templatePath = process.argv[2];
const pathArray = templatePath.split("/");
const templateFile = pathArray.pop();
const templateDir = pathArray.join("/");
nunjucks.configure(templateDir);
const rendered = nunjucks.render(templateFile, {
button_rounded_corners: true,
font_properties: "300,600",
});
console.log(rendered.replace(/\n/gm, "\\n"));

View File

@ -6,13 +6,23 @@ RUN mkdir -p /home/frappe/frappe-bench/sites \
RUN install_packages git
RUN mkdir -p apps sites/assets \
RUN mkdir -p apps sites/assets/css \
&& cd apps \
&& git clone --depth 1 https://github.com/frappe/frappe --branch version-12
COPY build/frappe-nginx/generate_standard_style_css.js \
/home/frappe/frappe-bench/apps/frappe/generate_standard_style_css.js
RUN cd /home/frappe/frappe-bench/apps/frappe \
&& yarn \
&& yarn run production \
&& yarn add nunjucks -D \
&& node generate_standard_style_css.js \
frappe/website/doctype/website_theme/website_theme_template.scss > \
/home/frappe/standard_templates_string \
&& node generate_bootstrap_theme.js \
/home/frappe/frappe-bench/sites/assets/css/standard_style.css \
"$(cat /home/frappe/standard_templates_string)" \
&& rm -fr node_modules \
&& yarn install --production=true \
&& node --version \