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

Matthew Brush notifications at xxxxx
Sun Jun 23 20:50:31 UTC 2019


codebrainz 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 even worth it, but instead of caching, it could check the [index.json.md5 file](https://github.com/geany/geany-themes/blob/b77a43c9c496dec9f36bf225b47198fdc036a2e8/index/index.json.md5) to see whether it needs to re-download the whole index again. 45 bytes to download the md5 file each page access to save downloading ~800 kilobytes every hour the page is accessed, and it would always be up-to-date.

Just a thought, not important at all.

-- 
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#pullrequestreview-253148965
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190623/0ef87692/attachment.html>


More information about the Github-comments mailing list