From e667ddc7ee47d0897ffc5b569aadeafaa829d6a4 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Tue, 25 May 2021 00:33:12 -0600 Subject: add content:encoded tag in rss and update readme --- ChangeLog | 4 ++++ README.md | 6 +++++- src/pyssg/rss.py | 3 ++- src/pyssg/template.py | 4 +++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8190ba..bbe5f7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ CHANGES ======= +v0.3.0 +------ + +* add better version printing * fix timezone * fix missing ref to obj * fix bad method call diff --git a/README.md b/README.md index 67649b8..1ef3265 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ I'm writing this in *pYtHoN* (thought about doing it in Go, but I'm most comfort - [x] Tag functionality. - [ ] Open Graph (and similar) support. - [ ] Build `sitemap.xml` file. -- [ ] Build `rss.xml` file. +- [x] Build `rss.xml` file. - [x] Only build page if `*.md` is new or updated. - [ ] Extend this to tag pages and index (right now all tags and index is built no matter if no new/updated file is present). - [x] Configuration file as an alternative to using command line flags (configuration file options are prioritized). @@ -53,6 +53,8 @@ pyssg -s src_dir -d dst_dir -i That creates the desired directories with the basic templates that can be edited as desired. Place your `*.md` files somewhere inside the source directory (`src_dir` in the command above), but outside of the `templates` directory. It accepts sub-directories. +Strongly recommended to edit `rss.xml` template under `rss` directory, since it has a lot of placeholder values. + Build the site with: ```sh @@ -60,3 +62,5 @@ pyssg -s src_dir -d dst_dir -u https://base.url -b ``` That creates all `*.html` for the site and can be easily moved to the server. Here, the `-u` flag is technically optional in the sense that you'll not receive a warning/error, but it's used to prepend links with this URL (not strictly required everywhere), so don't ignore it; also don't include the trailing `/`. + +For now, the `-b`uild tag also creates a `rss.xml` file based on a template (created when initializing the directories/templates) adding all converted `*.md` files, meaning that separate `*.html` files should be included manually in the template. diff --git a/src/pyssg/rss.py b/src/pyssg/rss.py index 9cfe629..4cd4695 100644 --- a/src/pyssg/rss.py +++ b/src/pyssg/rss.py @@ -44,9 +44,10 @@ class RSSBuilder: i_f = f'{i_f} \n' i_f = f'{i_f} {p.title}\n' i_f = f'{i_f} {url}\n' - i_f = f'{i_f} {p.summary}\n' i_f = f'{i_f} {url}\n' i_f = f'{i_f} {date}\n' + i_f = f'{i_f} {p.summary}\n' + i_f = f'{i_f} \n' i_f = f'{i_f} \n' return i_f diff --git a/src/pyssg/template.py b/src/pyssg/template.py index d62c40f..0c43f22 100644 --- a/src/pyssg/template.py +++ b/src/pyssg/template.py @@ -115,7 +115,9 @@ class Template(HF): os.chdir('rss') self.__write_template('rss.xml', ['\n', - '\n', + '\n', ' \n', ' $$TITLE\n', ' $$LINK\n', -- cgit v1.2.3-70-g09d2