@@ -40,11 +40,12 @@ def update_config(app):
40
40
)
41
41
42
42
# Validate icon links
43
- if not isinstance (theme_options .get ("icon_links" , []), list ):
44
- raise ExtensionError (
45
- "`icon_links` must be a list of dictionaries, you provided "
46
- f"type { type (theme_options .get ('icon_links' ))} ."
47
- )
43
+ if theme_options .get ("icon_links" ) is not None :
44
+ if not isinstance (theme_options .get ("icon_links" , []), list ):
45
+ raise ExtensionError (
46
+ "`icon_links` must be a list of dictionaries, you provided "
47
+ f"type { type (theme_options .get ('icon_links' ))} ."
48
+ )
48
49
49
50
# Set the anchor link default to be # if the user hasn't provided their own
50
51
if not utils .config_provided_by_user (app , "html_permalinks_icon" ):
@@ -140,18 +141,19 @@ def update_config(app):
140
141
# Add extra icon links entries if there were shortcuts present
141
142
# TODO: Deprecate this at some point in the future?
142
143
icon_links = theme_options .get ("icon_links" , [])
143
- for url , icon , name in shortcuts :
144
- if theme_options .get (url ):
145
- # This defaults to an empty list so we can always insert
146
- icon_links .insert (
147
- 0 ,
148
- {
149
- "url" : theme_options .get (url ),
150
- "icon" : icon ,
151
- "name" : name ,
152
- "type" : "fontawesome" ,
153
- },
154
- )
144
+ if icon_links is not None :
145
+ for url , icon , name in shortcuts :
146
+ if theme_options .get (url ):
147
+ # This defaults to an empty list so we can always insert
148
+ icon_links .insert (
149
+ 0 ,
150
+ {
151
+ "url" : theme_options .get (url ),
152
+ "icon" : icon ,
153
+ "name" : name ,
154
+ "type" : "fontawesome" ,
155
+ },
156
+ )
155
157
theme_options ["icon_links" ] = icon_links
156
158
157
159
# Prepare the logo config dictionary
0 commit comments