diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-11-16 09:57:31 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-11-16 09:57:31 +0100 |
| commit | 2476a7a2ec5b05999f7bf9bdc593ddad87b70986 (patch) | |
| tree | 7dab4c9c3f9cf6b5e634bd45cb9432989c27affb /src/Pages | |
| parent | 4285f48864c3eed297bddae7dbba6765d0b26373 (diff) | |
| download | lettnytt-2476a7a2ec5b05999f7bf9bdc593ddad87b70986.tar.xz lettnytt-2476a7a2ec5b05999f7bf9bdc593ddad87b70986.zip | |
feat: Redirect all article links containing nrk.no to /les first
Diffstat (limited to 'src/Pages')
| -rw-r--r-- | src/Pages/Read.cshtml | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/Pages/Read.cshtml b/src/Pages/Read.cshtml index 63543aa..9cff853 100644 --- a/src/Pages/Read.cshtml +++ b/src/Pages/Read.cshtml @@ -11,9 +11,10 @@ </div> </div> -<div id="art-body"> +<article id="art-body"> @Html.Raw(Model.Source.Content) -</div> +</article> + <footer> <p> <div style="display: flex; flex-direction: column; flex-wrap: nowrap;"> @@ -33,9 +34,17 @@ } <br/> <small> - <a href="@Model.Source.Href">Les på nrk.no</a> + <a href="@Model.Source.Href" no-interception>Les på nrk.no</a> </small> </div> </div> </p> -</footer>
\ No newline at end of file +</footer> + +<script> +document.addEventListener("DOMContentLoaded", () => { + document.querySelectorAll("a:not([no-interception])").forEach(el => { + if (el.href.indexOf("nrk.no") !== -1) el.href = "/les/nrk?url=" + el.href; + }); +}) +</script>
\ No newline at end of file |
