[Github-comments] [geany/www.geany.org] Add Geany-Themes page with theme preview (#8)

Enrico Tröger notifications at xxxxx
Sat Jun 29 08:25:17 UTC 2019


eht16 commented on this pull request.



> +class ThemesView(StaticDocsView):
+    """
+    Fetch the Geany-Themes index from https://github.com/geany/geany-themes/tree/master/index
+    """
+
+    template_name = "pages/download/themes.html"
+
+    # ----------------------------------------------------------------------
+    def get_context_data(self, **kwargs):
+        theme_index = self._get_theme_index()
+        context = super(ThemesView, self).get_context_data(**kwargs)
+        context['theme_index'] = theme_index
+        return context
+
+    # ----------------------------------------------------------------------
+    @cache_function(CACHE_TIMEOUT_1HOUR)

I don't know if it's worth, too.
But just implemented it in https://github.com/geany/www.geany.org/pull/8/commits/c5a12415d902bdcb5d66538a885e1ca90ea52d88. Besides reducing traffic between us and Github, it probably won't make much difference: the request durations of the MD5 hash and the whole index JSON are almost equal. But anyway, it probably won't hurt and in case of theme index updates, the preview page will update quicker.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/www.geany.org/pull/8#discussion_r298792493
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190629/f79853fd/attachment-0001.html>


More information about the Github-comments mailing list