Utopia integrates with Yarn and provides a bake task to simplify deployment packages distributed using yarn
that implement the dist
sub-directory convention.
If you don't already have yarn installed, make sure you have npm installed and then run the following command:
$ sudo npm install -g yarn
Installing jQuery
Firstly, ensure your project has a package.json
file:
$ yarn init
Then install jquery using yarn
:
$ yarn add jquery
Copy the distribution scripts to public/_components
:
$ bundle exec bake utopia:node:update
Then add the appropriate <script>
tags to pages/_page.xnode
:
<script type="text/javascript" src="/_components/jquery/jquery.min.js"></script>
Using JavaScript
You can use JavaScript by embedding it directly into your HTML, or by creating a JavaScript source file and referencing that.
Embedding CodeIn your HTML view:
<html>
<body>
<script type="text/javascript">
//<![CDATA[
console.log("Hello World")
//]]>
</script>
</body>
</html>
External Script
In script.js
:
console.log("Hello World")
In your HTML view:
<html>
<body>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4