Skip to content

Commit

Permalink
Add newsfeed paramet to config (#198)
Browse files Browse the repository at this point in the history
Update link to news feed
  • Loading branch information
atarakanovdes authored Mar 1, 2024
1 parent 85bd4d9 commit 89b5391
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ corner-radius = "0px"
uniNavHeaderUrl = 'https://konturio.github.io/qgis-uni-navigation/index.js'
uniNavHeaderLocationPrefix = "/QGIS-Hugo"

## Url to news feed. After URL change you have to check
## themes/hugo-bulma-blocks-theme/layouts/partials/contextmenu.html
## file to ensure that it adresses the correct keys
newsfeed ='https://feed.qgis.org/?lang=en&json=1'

## This will turn on Coockie popup. True to show popup
cookiesstate = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<div class="container is-flex is-justify-content-space-between">
<div class="rss-feed">
{{ $data := "" }}
{{ $url := "https://blog.qgis.org/feed/" }}
{{ $url := .Site.Params.newsfeed }}
{{ with resources.GetRemote $url }}
{{ with .Err }}
{{ errorf "%s" . }}
{{ else }}
{{ $data = .Content | transform.Unmarshal }}
{{ with $data.channel.item }}
{{ with $data }}
{{ range . | first 1 }}
<a href="{{ .link | safeURL }}" target="_blank" rel="noopener" class="external-link">
<a href="{{ .url | safeURL }}" target="_blank" rel="noopener" class="external-link">
{{ .title }}
</a>
{{ end }}
Expand Down

0 comments on commit 89b5391

Please sign in to comment.