Ligações relativas e absolutas
Quando inclui hiperligações, tem de ter em conta dois fatores: se pretende que sejam definidas como relativas ou absolutas ao guardar e se o ficheiro está ou não presente.
-
Escolha LibreOffice - PreferênciasFerramentas - Opções - Carregar/Guardar - Geral e especifique no campo Guardar URL relativos a se o LibreOffice deve criar hiperligações relativas ou absolutas. As hiperligações relativas apenas são possíveis quando o documento em que está a trabalhar e o destino da hiperligação se encontram na mesma unidade.
-
You should create the same directory structure on your hard disk as that which exists in the web space hosted by your Internet provider. Call the root directory for the homepage on your hard disk "homepage", for example. The start file is then "index.html", the full path being "C:\homepage\index.html" (assuming Windows operating system). The URL on your Internet provider's server might then be as follows: "http://www.myprovider.com/mypage/index.html". With relative addressing, you indicate the link relative to the location of the output document. For example, if you placed all the graphics for your homepage in a subfolder called "C:\homepage\images", you would need to give the following path to access the graphic "picture.gif": "images\picture.gif". This is the relative path, starting from the location of the file "index.html". On the provider's server, you would place the picture in the folder "mypage/images". When you transfer the document "index.html" to the provider's server through the File - Save As dialog, and if you have marked the option Copy local images to Internet under LibreOffice - PreferencesTools - Options - Load/Save - HTML Compatibility, LibreOffice will automatically copy the graphic to the correct directory on the server.
-
An absolute path such as "C:\homepage\graphics\picture.gif" would no longer function on the provider server. Neither a server nor the computer of a reader needs to have a C hard drive: operating systems such as Unix or macOS do not recognize drive letters, and even if the folder homepage\graphics existed, your picture would not be available. It is better to use relative addressing for file links.
-
Uma hiperligação a uma página da Web, por exemplo, "www.exemplo.pt" ou "www.servidor.pt/minhapagina/index.html" é uma ligação absoluta.
-
O LibreOffice também reage de maneira diferente dependendo se o ficheiro referido na ligação existe e onde está localizado. LibreOffice verifica cada uma das ligações novas e estabelece um destino e protocolo automaticamente. O resultado pode ser observado no código HTML gerado depois de guardar o documento origem.
-
Aplicam-se as seguintes regras: uma referência relativa ("imagens/foto.gif") só é possível quando os dois ficheiros estiverem na mesma unidade. Se os ficheiros estiverem em unidades diferentes do sistema local de ficheiros, a referência absoluta segue o protocolo "file:" ("file:///dados1/xyz/foto.gif"). Se os ficheiros estiverem em servidores diferentes ou se o destino da ligação não estiver disponível, a referência absoluta utiliza o protocolo "http:" ("http://dados2/abc/foto.gif").
-
Certifique-se de que organiza todos os ficheiros da página inicial na mesma unidade que o ficheiro de início da página inicial. Deste modo, o LibreOffice pode estabelecer o protocolo e destino para que a referência no servidor esteja sempre correta.
Ao colocar o rato numa hiperligação, uma dica apresenta a referência absoluta, uma vez que o LibreOffice utiliza nomes de caminho absolutos. O caminho e endereço completos só podem ser vistos quando visualizar o resultado da exportação HTML, ao carregar o ficheiro HTML como "Texto" ou abrindo-o com um editor de texto.