Adding Assets
You can get a lot of functionality out of plain HTML but even simple projects are probably going to want some static assets. You can add assets to your project in two ways:
- Upload files from your computer
- Create new files with the built in editor
First we’ll add some CSS with the built in editor. Click the “New Asset” button and fill in the form with the following:
Filename: application.css
Content:
body {
font-family: sans-serif;
}
Click “Create asset” to add this asset to the project.
Let’s also try uploading an asset. First we need an asset to upload, save this GIF to your computer https://pageo.us/construction.gif Now navigate to the upload page by clicking “Upload Assets” on the Assets page. Click browse, find the file on your computer and then click “Upload”. You should now see both assets listed on the Assets page.
Now let’s get our pages using these new assets. Navigate to the Layouts page and click “Edit” on our Basic Layout.
In the head
tag add the following line:
<link rel="stylesheet" href="/assets/application.css">
Now our pages will be styled by our stylesheet. At the beginning of the body tag add:
<img src="/assets/construction.gif">
This way visitors to our pages will know they’re still under construction.
If you want to view our changes you can navigate to Pages > Show User Page and click “Render” on the preview we created earlier. You should see the construction.gif and the font changes that we made.
We’re well on our way to having a legitmate web app.