File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11< meta charset ="utf-8 ">
22< meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
33< meta name ="viewport " content ="width=device-width, initial-scale=1 ">
4- < meta name ="description " content ="{% if page.summary %}{{ page.summary | strip_html | strip_newlines | truncate: 160 }}{% endif %} ">
5- < meta name ="keywords " content ="{{page.tags}}{% if page.tags %}, {% endif %} {{page.keywords}} ">
4+
5+ {% include metadata.html %}
6+
67< title > {{ page.title }} | {{ site.site_title }}</ title >
78< link rel ="stylesheet " href ="{{ "assets /css/syntax.css" }}">
89
Original file line number Diff line number Diff line change 1+ < meta name ="description " content ="{% if page.summary %}{{ page.summary | strip_html | strip_newlines }}{% endif %} ">
2+ < meta name ="keywords " content ="{{page.tags}}{% if page.tags %}, {% endif %} {{page.keywords}} ">
3+ {% if page.title %}
4+ < meta name ="name " content ="{{ image.name }} ">
5+ {% endif %}
6+ < meta name ="thumbnail " content ="http://singularity.lbl.gov/images/logo/logo.svg ">
7+ {% if page.targz %}
8+ < meta name ="file " content ="{{ site.repo }}/archive/{{ page.targz }} ">
9+ {% endif %}
10+ {% if page.version %}
11+ < meta name ="file " content ="{{ site.repo }}/releases/download/{{ page.version }}/singularity-{{ page.version }}.tar.gz ">
12+ {% endif %}
Original file line number Diff line number Diff line change 55'''
66import sys
77import os
8- import re
98from glob import glob
109
1110site_dir = os .path .abspath (sys .argv [1 ])
1211print ("Using site directory %s" % (site_dir ))
1312
1413files = glob ("%s/*.html" % (site_dir ))
14+
15+ # For each file, we need to replace all links to have correct .html extension
16+ search_names = [os .path .basename (f ) for f in files ]
17+
1518for html_file in files :
16- if not html_file .endswith ('index.html' ):
17- new_name = html_file .replace ('.html' ,'' )
18- print ("Renaming %s to %s." % (html_file ,new_name ))
19- os .rename (html_file , new_name )
19+ with open (html_file ,'r' ) as filey :
20+ content = filey .read ()
21+ for search_name in search_names :
22+ content = content .replace ('/%s"' % (search_name ),'/%s.html"' % (search_name ))
23+ with open (html_file ,'w' as filey :
24+ filey .write (content )
You can’t perform that action at this time.
0 commit comments