Enhancements to the Apollo Minimalist Theme

Apollo Theme

Switch the theme to Apollo

The Apollo theme has been discontinued for many years, and all Jade templates must be replaced with Pug.

Error

Local testing error

extends partial/layout block container include mixins/post +posts() block pagination include mixins/paginator +home() block copyright include partial/copyright

It suggests needing to install hexo-renderer-jade, which is not recommended.

Instead, install hexo-renderer-pug and convert all Jade files to Pug

npm install hexo-renderer-pug --save

Hide Creation Time Display on Non-Home Pages

themes/apollo/layout/mixins/post.pug

    .post-info
+       if (is_home() || is_post())    
            != full_date(item.date, 'll')
			if item.from && (is_home() || is_post())
				a.post-from(href=item.from target="_blank" title=item.from)!= __('translated')

Display Tags on Article Pages

themes/apollo/layout/mixins/post.pug

+        - var transform = function(str) { return '# ' + str; }
+        - var config = {class: 'post-tag', show_count: false, style: false, separator: ' ', transform: transform}
+        .post-tags
+            if is_post()
+                != list_tags(item.tags, config)

Display the Sidebar Table of Contents on Article Pages

themes/apollo/layout/mixins/post.pug

+    if is_post()
+        .post-toc
+                h3.post-toc-title
+                    != item.title
+                nav#toc-nav.navbar
+                    != toc(item.content, { list_number: false, class: 'nav' })  

themes/apollo/layout/partia/layout.pug

    body
+       .container(data-bs-spy="scroll" data-bs-target="#toc-nav" data-bs-offset=0)
        .wrap


        include scripts
+       script(src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.min.js")