Skip to content

Commit

Permalink
Merge pull request #71 from openzim/external_links
Browse files Browse the repository at this point in the history
External links
  • Loading branch information
benoit74 authored Jan 20, 2025
2 parents 2bf179f + d974750 commit f891b6a
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Upgrade to Python 3.12 and Node.JS 22, adopt new openZIM practices, upgrade all dependencies (including zimscraperlib 5.0.0), add support for 'legacy' browsers (#43)
- Add clearer visual indication of external links (#70)

### Fixed

Expand Down
3 changes: 2 additions & 1 deletion zimui/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/free-code-camp-logo.svg" />
<link rel="stylesheet" type="text/css" href="./custom.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>freeCodeCamp on Kiwix</title>
</head>
Expand Down
28 changes: 28 additions & 0 deletions zimui/public/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
a[href^="http://"],
a[href^="https://"]
{
/* modify all <a> tag so that the :after is centered */
display: inline-flex;
align-items: center;
color: #df2121;
}

a[href^="http://"]:hover,
a[href^="https://"]:hover
{
color: #df2121;
}

a[href^="http://"]:after,
a[href^="https://"]:after
{
/* add an external link icon to all external links (not relative after HTML rewriting) */
content: '';
display: inline-block;
width: 10px;
height: 10px;
background-image: url('external-link.svg');
background-size: contain;
background-repeat: no-repeat;
margin-left: 5px;
}
15 changes: 15 additions & 0 deletions zimui/public/external-link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion zimui/public/vite.svg

This file was deleted.

0 comments on commit f891b6a

Please sign in to comment.