diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2021-05-17 14:37:31 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2021-05-17 14:37:31 -0600 |
commit | 30c699f96429598b9ff88103971ccf689e163799 (patch) | |
tree | 3d8c1336596de459426a08934d3deed659299887 | |
parent | 8f04b57f1adff758e74c255e448f8e2e9e861982 (diff) |
fix required base url and tag header substitutionv0.2.1
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | src/pyssg/builder.py | 1 | ||||
-rw-r--r-- | src/pyssg/pyssg.py | 2 |
4 files changed, 9 insertions, 4 deletions
@@ -1,6 +1,12 @@ CHANGES ======= +v0.2.0 +------ + +* clean up and update readme +* refactor code and finish basic features + v0.1.0 ------ @@ -39,7 +39,7 @@ That creates the desired directories with the basic templates that can be edited Build the site with: ```sh -pyssg -s src_dir -d dst_dir -u https://baseurl.com -b +pyssg -s src_dir -d dst_dir -b ``` -Without a trailing slash `/` at the end of the base URL. That creates all `*.html` for the site and can be easily moved to the server. +That creates all `*.html` for the site and can be easily moved to the server. Where an optional `-u` flag can be provided for the base URL (don't include the trailing slash `/`) diff --git a/src/pyssg/builder.py b/src/pyssg/builder.py index 2ba1b6c..b2ff63c 100644 --- a/src/pyssg/builder.py +++ b/src/pyssg/builder.py @@ -238,7 +238,6 @@ class HTMLBuilder: # tag header tag_url: str = f'{self.base_url}/tag/@{tag}.html' t.tags.header = t.tags.header.replace('$$NAME', tag) - t.tags.header = t.tags.header.replace('$$URL', tag_url) with open(os.path.join(self.dst, f'tag/@{tag}.html'), 'w') as f: f.write(t.header) diff --git a/src/pyssg/pyssg.py b/src/pyssg/pyssg.py index 3f8cb8d..3cda0bc 100644 --- a/src/pyssg/pyssg.py +++ b/src/pyssg/pyssg.py @@ -21,7 +21,7 @@ def get_options() -> Namespace: help='''dst directory; generated (and transfered html) files; defaults to 'dst' ''') parser.add_argument('-u', '--url', - required=True, + default='', type=str, help='''base url without trailing slash''') parser.add_argument('-i', '--init', |