Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refa raw html css #143

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
/core
/e2e
/models
/static
app.js
3 changes: 3 additions & 0 deletions core/frontend/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import './styles.css';
import './print.css';

import './records.js';
import './search.js';
import './graph.js';
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion core/models/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import path from 'node:path';
import nunjucks from 'nunjucks';
import lang from './lang.js';
import { fileURLToPath } from 'url';
import reportTemplate from '../../static/template/report.njk';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

Expand Down Expand Up @@ -38,7 +39,7 @@ class Report {
minute: 'numeric',
second: 'numeric',
});
return templateEngine.render('static/template/report.njk', {
return templateEngine.renderString(reportTemplate, {
lang: lang.flag,
date,
projectTitle,
Expand Down
9 changes: 8 additions & 1 deletion core/models/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import langPck from './lang.js';
import { fileURLToPath } from 'url';
import convertWikilinks from '../utils/convertWikilinks.js';
import convertQuotes from '../utils/convertQuotes.js';
import cosmoscopeTemplate from '../../static/template/cosmoscope.njk';
import favicon from '../../static/icons/cosmafavicon.png';
import logo from '../../static/icons/cosmalogo.svg';
import frontendScript from 'front';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

Expand Down Expand Up @@ -248,7 +252,7 @@ class Template {
this.custom_css = fs.readFileSync(cssCustomPath, 'utf-8');
}

this.html = templateEngine.render('static/template/cosmoscope.njk', {
this.html = templateEngine.renderString(cosmoscopeTemplate, {
publishMode: this.params.has('publish') === true,
devMode: this.params.has('dev') === true,
canSaveRecords: this.config.canSaveRecords(),
Expand Down Expand Up @@ -318,6 +322,9 @@ class Template {
},

app: app, // app version, description, license…
script: frontendScript,
favicon,
logo,
});
}
}
Expand Down
238 changes: 233 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@
"babel-loader": "^9.1.3",
"chai": "^4.3.6",
"chai-fs": "^2.0.0",
"css-loader": "^7.1.2",
"cypress": "^13.9.0",
"jest": "^29.7.0",
"mocha": "^10.4.0",
"prettier": "3.2.5",
"style-loader": "^4.0.0",
"webpack": "^5.94.0",
"webpack-cli": "^5.1.4",
"yaml-loader": "^0.8.1"
Expand Down
Loading
Loading