@@ -40,12 +40,11 @@ def update_config(app):
40
40
)
41
41
42
42
# Validate icon links
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
- )
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
+ )
49
48
50
49
# Set the anchor link default to be # if the user hasn't provided their own
51
50
if not utils .config_provided_by_user (app , "html_permalinks_icon" ):
@@ -141,19 +140,18 @@ def update_config(app):
141
140
# Add extra icon links entries if there were shortcuts present
142
141
# TODO: Deprecate this at some point in the future?
143
142
icon_links = theme_options .get ("icon_links" , [])
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
- )
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
+ )
157
155
theme_options ["icon_links" ] = icon_links
158
156
159
157
# Prepare the logo config dictionary
0 commit comments