You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ Create a project directory for your site and run `foresite init` from within it:
41
41
Created erb/post.md.erb
42
42
Created erb/wrapper.html.erb
43
43
Created erb/_list.html.erb
44
+
Created erb/feed.xml.erb
44
45
45
46
Three subdirectories are created, along with three [ERB](https://docs.ruby-lang.org/en/3.2/ERB.html) template files.
46
47
@@ -52,6 +53,7 @@ Some facts:
52
53
*`post.md.erb` is the default markdown file for every post.
53
54
*`wrapper.html.erb` is a HTML wrapper template for every generated HTML file.
54
55
*`_list.html.erb` is a HTML template partial for the list of posts on the `index.html` page.
56
+
*`feed.xml.erb` is a XML template for an RSS feed.
55
57
56
58
### 2. Write your first post
57
59
@@ -69,8 +71,8 @@ A single markdown file is created in the `md` subdirectory. **This file is meant
69
71
70
72
Some facts:
71
73
72
-
* The title is the first line formatted as H1 (mandatory).
73
-
* Current date in YYYY-MM-DD format is the first markdown paragraph (optional).
74
+
* The title is the first line formatted as H1.
75
+
* Current date in YYYY-MM-DD format is the first markdown paragraph.
74
76
* Current date and title are "slugified" for filename.
75
77
76
78
### 3. Modify templates as desired
@@ -81,23 +83,27 @@ Some facts:
81
83
82
84
`_list.html.erb` is used to generate the `<ul>` list of posts on the `index.html` file. Modify to show posts in a different way.
83
85
86
+
`feed.xml.erb` is an RSS feed, it will require a `title` as well as a `base_url` for where you host your site.
87
+
84
88
### 4. Generate HTML from markdown
85
89
86
90
Run `foresite build` to create HTML in the `post` subdirectory and the `index.html` file:
87
91
88
92
$ foresite build
89
93
Created post/2023-01-15-welcome-to-my-site.html
90
94
Created index.html
95
+
Created feed.xml
91
96
92
-
In this example, two HTML files are created.
97
+
In this example, two HTML files and an XML file are created.
93
98
94
99
Some facts:
95
100
96
101
* For every post markdown file in the `md` subdirectory an equivalent HTML file is generated in the `post` subdirectory, each wrapped with wrapper template markup.
97
102
* A single `index.html` file shows a list of links to all posts in reverse-chronological order, prefixed with post date.
98
103
* Post titles are parsed from the first H1 tag in each post markdown file.
99
104
* Post dates are parsed from the post markdown filename.
100
-
* Re-running `foresite build` removes and recreates all HTML files in the `post` subdirectory as well as the `index.html` file.
105
+
* The `feed.xml` file reflects the list posts in RSS 2.0 format.
106
+
* Re-running `foresite build` removes and recreates all HTML files in the `post` subdirectory as well as the `index.html` file and `feed.xml` file.
0 commit comments