Skip to content

Commit 059a306

Browse files
authored
Improved styling of blog (#23)
* add theme switcher to header * use dracula theme dark mode * improve header links * improve homepage layout * add list-style to homepage * improve homepage styling * remove accidentally custom styling file * improve styling from choldgraf template * normalize date format * add css for postlist * add seaprator * update css to simplify for theme * remove underlines for titles
1 parent 722e10e commit 059a306

File tree

7 files changed

+74
-18
lines changed

7 files changed

+74
-18
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ dependencies = [
99
"napari-sphinx-theme>=0.7.0",
1010
"sphinx>=8.2.3",
1111
"sphinx-autobuild>=2025.8.25",
12+
"sphinx-design>=0.6.0",
1213
]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ sphinx<7.3.0
22
ablog
33
napari-sphinx-theme
44
myst-parser
5+
sphinx-design

source/_static/custom.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* Custom styling for postlist - multiline layout */
2+
3+
/* More spacing between blog posts */
4+
.postlist .ablog-post {
5+
margin-bottom: 2em;
6+
}
7+
8+
/* The paragraph containing title, date, author - make it smaller and grey */
9+
.postlist .ablog-post-title {
10+
font-size: 0.9em;
11+
line-height: 1.8;
12+
}
13+
14+
/* Make the title link large, bold, and black - override parent styling */
15+
.postlist .ablog-post-title > a:first-child {
16+
display: block;
17+
font-size: 1.4em; /* 1.4 * 0.9em = 1.26em effectively */
18+
font-weight: 700;
19+
margin-bottom: 0.3em;
20+
text-decoration: none;
21+
}
22+
23+
.postlist .ablog-post-title a:not(:first-child) {
24+
text-decoration: none;
25+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- A small template snippet for theme testing -->
1+
<!-- Blog navigation -->
22
<a class="navbar-brand" href="{{ pathto(master_doc) }}">
3-
napari
3+
🏝️ Island Dispatch
44
</a>

source/blog/sustainability_survey.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ language: English
99

1010
# Towards long-term sustainability for napari
1111

12-
*Tues, Oct 21, 2025*
13-
1412
The napari project has had a big year, with lots of new releases, community initiatives, and an expanding core team. In this post, we want to share the work supported by our current grant funding, the ongoing effort required to maintain the project, our current thoughts for ensuring napari’s long-term financial sustainability and the new funding models that we’re exploring to support the project’s needs.
1513

1614
We want **your** thoughts and feedback, so please **fill out [this short survey](https://napari.typeform.com/sustainability) by November 1st** to help guide our next steps!

source/conf.py

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"myst_parser",
1818
"ablog",
1919
"sphinx.ext.intersphinx",
20+
"sphinx_design",
2021
]
2122

2223
templates_path = ['_templates']
@@ -25,7 +26,18 @@
2526
]
2627

2728
# ABlog configuration
28-
blog_baseurl = "https://napari.org"
29+
blog_baseurl = "https://napari.org/island-dispatch"
30+
blog_title = "The Island Dispatch"
31+
blog_path = "blog"
32+
blog_post_pattern = "blog/*/*"
33+
blog_feed_fulltext = True
34+
blog_feed_subtitle = "Community news and updates from the napari project"
35+
fontawesome_included = True
36+
post_redirect_refresh = 1
37+
# post_auto_image = 1
38+
post_auto_excerpt = 2
39+
post_date_format = "%Y %B %d"
40+
post_date_format_short = "%Y %b %d"
2941

3042
# -- Options for HTML output -------------------------------------------------
3143
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
@@ -34,17 +46,24 @@
3446
html_static_path = ['_static']
3547
html_logo = "_static/logo.png"
3648
html_favicon = "_static/logo.png"
49+
html_css_files = ['custom.css']
3750

3851
html_theme_options = {
39-
#"external_links": [{"name": "napari hub", "url": "https://napari-hub.org"}],
52+
"external_links": [
53+
{"name": "napari.org", "url": "https://napari.org"},
54+
{"name": "napari hub", "url": "https://napari-hub.org"},
55+
],
4056
"github_url": "https://github.com/napari/napari",
4157
"navbar_start": ["navbar-logo", "navbar-project"],
42-
"navbar_end": ["navbar-icon-links"],
58+
"navbar_end": ["navbar-icon-links", "theme-switcher"],
4359
"navbar_persistent": [],
4460
"header_links_before_dropdown": 6,
45-
# "secondary_sidebar_items": ["page-toc"],
46-
"pygment_light_style": "napari",
47-
"pygment_dark_style": "napari",
61+
"logo": {
62+
"link": "https://napari.org",
63+
},
64+
"secondary_sidebar_items": [],
65+
"pygments_light_style": "napari",
66+
"pygments_dark_style": "dracula",
4867
# "announcement": "https://napari.org/dev/_static/announcement.html",
4968
"analytics": {
5069
# The domain you'd like to use for this analytics instance
@@ -53,3 +72,18 @@
5372
"plausible_analytics_url": "https://plausible.io/js/plausible.js",
5473
},
5574
}
75+
76+
# HTML context for theme
77+
html_context = {
78+
"default_mode": "auto",
79+
}
80+
81+
# Sidebar configuration
82+
html_sidebars = {
83+
"**": [
84+
"search-field.html",
85+
"ablog/postcard.html",
86+
"ablog/recentposts.html",
87+
"ablog/archives.html",
88+
]
89+
}

source/index.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# The Island Dispatch 🏝️
2-
3-
Here's the napari community blog!
4-
5-
## All posts
1+
# Welcome to the napari community blog! 🏝️
62

73
```{postlist}
8-
:list-style: circle
9-
:format: "{title}"
10-
:sort:
4+
:format: {title} {date} | {author}
5+
:date: %Y %B %d
6+
:excerpts:
7+
:expand: Read more ...
118
```

0 commit comments

Comments
 (0)