kireerik / refo Goto Github PK
View Code? Open in Web Editor NEWA website template for the modern web. ⭐️ Star to support our work!
Home Page: https://kireerik.github.io/refo/
A website template for the modern web. ⭐️ Star to support our work!
Home Page: https://kireerik.github.io/refo/
refo/index/index/core/watch/index.js
Line 41 in 29af0b9
case 'deleted':
const staticFilePath = filePath.toStaticDirectory()
// handle delete
//handle(filePath, true)
if (fs.existsSync(staticFilePath))
fs.unlink(staticFilePath)
break;
puppeteer-html2pdf should optionally handle pdfPath
as a function
in order to support this feature.
The current implementation is correct assuming that Gaze issue 253 (shama/gaze#253) is valid.
Copying will be needed if the above mentioned issue is not valid or if it isn't resolved.
The mentioned issue is considered invalid if it isn't the expected behavior.
Related code where copying can be implemented:
refo/index/index/core/watch/index.js
Line 48 in 5f5757c
Manage file (module) changes using the hot-module-replacement library.
The Handlebars handler is no longer required once this is implemented.
#!/usr/bin/env node
const fs = require('fs')
, path = require('path')
, coreFileName = './refo.core'
, coreFile = path.resolve(fs.realpathSync(process.cwd()), coreFileName)
try {var core = require(coreFile)} catch (error) {}
const index = require('./index')
if (core)
index(core.handlers, core.options)
else
module.exports = index
Alternative way to handle front end JavaScript:
Main handler:
refo/index/index/main/handlers.js
Lines 61 to 64 in ec7f6c3
if (typeof html == 'string') {
html = await handleHTML(filePath, html)
;(filePath.substring(0, filePath.lastIndexOf('.')) + '.html')
.saveToStaticDirectory(html)
} else
filePath.saveToStaticDirectory(html())
Front end JavaScript:
const handleJs = require('frontend-javascript-handler')
module.exports = () => handleJs('../frontEndJavaScriptFileToHandle')
Front end JavaScript handler module:
const path = require('path')
, bundle = require('bundle-js')
, minifyJS = require('uglify-js').minify
module.exports = file => {
const filePath = path.resolve(file)
;(() => require(filePath))()
let js = bundle({entry: filePath, disablebeautify: true})
for (let i = 1; i <= 2; i++)
js = minifyJS(js).code
return js
}
This is not recommended because the filePath
needs to be requred as a module even when it is not a module in order to have hot module replacement:
;(() => require(filePath))()
Requiring it as a string resolves this, but this is currently not supported by hot-module-replacement:
check with support:
SolidJS await,
output non index page html, but if there is already a folder put it inside
firebase tools behaves differently locally
check with Emotion: same class for same styles issue
service worker output contains unnecessary new line
check with mini-css-class-name: is it possible to improve the algorithm, and modify the order so it is the same similar to the other characters
resolved with workaround (until there is a better option):
implementation in consideration:
, serviceWorker({
//enableInDevelopment: true
, workbox: {
swDest: outDir + '/' + 'main' + '/' + 'cache' + '/' + 'index.js'
}
})
Default usage:
refo/index/index/core/watch/index.js
Line 28 in c9b131a
asset
directory within siteDirectory
:
refo/index/index/main/handlers.js
Line 42 in c9b131a
This could be a feature as well, but it can be also confusing. So it is probably recommended to separate the 2 use cases and have a different assetDirectory
variable for front end JavaScript handling.
The Examples page recommends the following configuration for JS Custom:
{
"configurations": {
"Default": {
"custom_template_tags": {
"html": "scope:text.html.basic"
, "": "scope:text.html.basic"
}
}
}
}
In current versions of JS Custom, custom template options have been expanded. The custom_template_tags
option has been deprecated in favor of a custom_templates
option with various sub-options:
{
"configurations": {
"Default": {
"custom_templates": {
"default": "scope:text.html.basic",
"tags": {
"html": "scope:text.html.basic"
}
}
}
}
}
The old suggested configuration using custom_template_tags
should still work, but as I recall, using ""
as a custom tag was buggy, which is why the new default
sub-option exists.
refo/index/index/main/handlers.js
Line 62 in 29af0b9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.