Skip to content

liquid-utilities/feed-atom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Liquid Feed Atom

Liquid layout that builds Atom feeds from Jekyll collections via FrontMatter configurations

Byte size of feed-atom.html Open Issues Open Pull Requests Latest commits Feed Atom Demos


Table of Contents


Quick Start

Bash Variables

_module_name='feed-atom'
_module_https_url="https://github.com/liquid-utilities/${_module_name}.git"
_module_relative_path="_layouts/modules/${_module_name}"

Bash Submodule Commands

cd "<your-git-project-path>"

git checkout gh-pages
mkdir -vp "_layouts/modules"

git submodule add\
 -b master --name "${_module_name}"\
 "${_module_https_url}" "${_module_relative_path}"

Your ReadMe File

Suggested additions for your ReadMe.md file so everyone has a good time with submodules

Clone with the following to avoid incomplete downloads


    git clone --recurse-submodules <url-for-your-project>


Update/upgrade submodules via


    git submodule update --init --merge --recursive --remote

Utilize Feed Atom

Each collection directory should contain a atom.xml file similar to...

_administration/administration.atom

---
layout: modules/feed-atom/feed-atom
title: Administration
collection_name: administration
collection_home: /administration/
date: 2019-07-21 11:12:13 -0700
content_type: xhtml
permalink: /:collection/:name:output_ext
---

Note, an [Atom feed example][feed_atom__gh_pages__rss_feed] file is available within the gh-pages branch of this repository.

Each collection page should have the following FrontMatter definitions...

---
## Layout may be `default`, `post`, or `page` depending upon theme
layout: post

title: Title of Page
date: 2019-07-21 11:42:11 -0300
#date_updated:  ## Optional and formatted like `date` above

description: A description of page content
#excerpt: Or a snippet about this page

## Optional, allows for embedding CSV data within `content` tags
#content_type: 'text/delimited'  ## Defaults to `html`

# Number of seconds till update by client reader is recommended
time_to_live: 1800
---

Note, excerpt requires site.show_excerpts to be non-false and not setting a description for those pages using excerpts

An example page raw source is available within the gh-pages branch of this repository.

Assign site.url, either via Jekyll build/serve command line option or with the following _config.yml examples...

_config.yml

url: "http://example.com"
show_excerpts: false
plugins:
  - jekyll-github-metadata

Note, a full example _config.yml file is available within the gh-pages branch of this repository.

To enable all features please configure the GitHub MetaData plugin...

Gemfile

# gem "jekyll", "~> 3.8.5"
gem "github-pages", group: :jekyll_plugins

gem "jekyll-github-metadata"

Add links to feed within other layout files where desired...

_layouts/collections/home.html

<!-- ... Other layout stuff above -->
<span>
  <svg class="svg-icon orange">
  <use xlink:href="{{- '/assets/minima-social-icons.svg#rss' | relative_url -}}"></use>
  </svg>
  <a href="{{- '/administration/administration.atom' | relative_url -}}">Atom Feed</a>
</span>
<!-- ... More layout stuff bellow -->

Commit and Push

git add .gitmodules
git add _layouts/feed-atom


## Add any changed files too


git commit -F- <<'EOF'
:heavy_plus_sign: Adds `liquid-utilities/feed-atom#1` submodule



**Additions**


- `.gitmodules`, tracks submodules AKA Git within Git _fanciness_

- `README.md`, updates installation and updating guidance

- `_layouts/feed-atom`, builds Atom feeds via FrontMatter configurations
EOF


git push origin gh-pages

🎉 Excellent 🎉 your site is now ready to begin unitizing code from this repository!


Attribution

Resources that where helpful in building this project so far


License

Legal bits of Open Source software

Feed Atom ReadMe documenting how things like this could be utilized
Copyright (C) 2019  S0AndS0

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation; version 3 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.