--- title: "Help: Images and files in Markdown" authors: Roberts date: 2021-10-14 tags: help --- Your web pages gain much in readability and ease of use if you can add images and downloadable files in your pages (known as *notes* in `hackmd`). The most important thing to remeber that you insert *links* to images and files. You do not embed images directly into your web code (markdown) - you insert links! Links then point to where in the world the images and files are. Your reader can see the images and download your files. ## Images * Insert images via the provided image button above * It will upload it to a popular image sharing site imgur.com * imgur is not accessible via Trust's corporate network - as many file sharing services (like dropbox) it is blocked; you will need to connect your computer's wifi to the *Guest WiFi network* and then upload the image to imgur * Once inserted image link will appear like this: * `![Image description](hhps link-to-image-on-imgur )` * Once I have processed the image before uploading it to psychinfo.org it will appear like this: * ``{{< figure src="/img/mBalint.jpg" title="Dr Michael Balint" >}}` * if the image link looks like that - you do not need to do anything about it. Unless you want to replace the image - in which case you upload a new one - like described above and delete the {{ figure }} thing. Be quite sure that you want to have the image replaced. ## Files It is most useful to attach documents that people can download, view and print on their computers. My advice is - keep it simple; only ever upload PDF files. If you have a word document - save it as PDF before uploading. If it is a powerpoint presentation - save it as PDF first. The benefit of PDF documents they will look the same across all computers, they can be printed easily anywhere. Another thing - they are not editable, therefore no one can mess up your work and say - your file does not work. If we introduce other types of files, we get increasing complexity that we do not need. Hence please - only upload PDF files. * To upload files you need to use your file sharing service. Google Drive (aka google docs) is perfect for this. It is not blocked by the Trust. Create a separate folder where you will keep your files - such as `wwwUploads` - you can call it whatever you like. * Upload your file (a PDF!) there * right click on the file in the google drive and chose `Get Link` - make sure anyone with the link can get to the file. It means that anyone with the link can view (and download) the file. * Copy that link - it will be something like: * `https://docs.google.com/spreadsheets/d/1Yd0jFyZAlwY0TYHESGsuEIDrqcvqvFNAEf0ks9iywoU/edit?usp=sharing` * To insert link to the file in your webpage (in your markdown) you will insert link `[link description](actual link gets pasted here)` - it will look like: * [Article on Russia, China and Iran](https://drive.google.com/file/d/0BwuF8yKmFaSLR0V1RS1zUUxNMTg/view?usp=sharing&resourcekey=0-cWRKGPmcOncrNvVxdRRIyw) * If you have done it all well you can click on the link in the preview of yoru markdown and your PDF will open. Once you manage insert a couple of image links and file links in your documents, you will become a lot more confident with this. It is not hard :-)