- Theming: Changing CSS to achieve different look and feel on the same HTML content.
- Templating: Changing both HTML and CSS to achieve different layout and content structure on the same feed data.
- Adding Inline HTML: Add HTML (which can include CSS and JavaScript) into the existing template. Supported by default template and optionally supported by user created templates.
- Adding static files: Add files to the host for public access.
⚠ Note: This documentation applies to the default template. Other template may have a different workflow.
default-gruvbox-light
: Default template, gruvbox light theme. Demodefault-solarized-light
: Default template, solarized light theme. Demodefault-solarized-dark
: Default template, solarized dark theme. Demo
- Create
includes/before-head-end.html
in your repo. - Copy the
:root
block from the default css file intobefore-head-end.html
.<style> :root { /** rules */ } </style>
- To replace the default
gruvbox-dark-medium
theme with other base16 themes, fillbase00
,base01
, ...base0F
in thePalette
section with the colors from the theme you want. - For inspirations, try this tool.
- To change font family and size, adjust variables in the
Typograph
section. - To tweak other aspects of the UI, adjust variables in the
Components
section. - A final result might look like this.
Template allows you to fully customize the output of the HTML. Unlike the theming where you reuse the existing HTML, customizating template means generating your own HTML and writing your own CSS.
- Basic knowledge in HTML and CSS is assumed.
- Learning the basics of Handlebars.
articles-unstyled
: Flat list of articles, no theme Demoarticles-daily-unstyled
: Articles grouped by day, no theme Demosources-daily-unstyled
: Articles grouped by source, then grouped by day, no theme Demo
-
In your repo, create an
includes
directory. Then createindex.hbs
. This is the Handlebars template for generatingindex.html
. -
Copy content to
includes/index.hbs
from one of these starter templates: -
Alternatively, you can start with the default template.
-
Refer to source code for all the data available to the template.
-
If you reference any
css
orjs
files in your template, make sure to add them to thestatic
folder. Conventions for adding static files also apply to your customized template. Exampleindex.hbs
: -
After customization, your folder structure might look like this
repo-root/ ├── includes/ │ └── index.hbs ├── static/ │ ├── index.css │ └── index.js ├── osmosfeed.yaml └── package.json
-
Need help? You can raise a question on the Q&A discussions page.
You can inject arbitrary content into 3 predefined slots in the default template.
⚠ Note: These slots may not exist for custom templates. The template author is responsible for deciding whether they want to support this.
<!DOCTYPE html>
<html lang="en">
<head>
<title>osmos::feed</title>
<link href="assets/styles.css" rel="stylesheet" />
<!-- %before-head-end.html% -->
</head>
<body>
<!-- %after-body-begin.html% -->
<!-- %MAIN_CONTENT% -->
<script src="assets/index.js"></script>
<!-- %before-body-end.html% -->
</body>
</html>
The builder will scan the includes
folder to see if there are any matching files to inject.
repo-root/
├── includes/
│ ├── after-body-begin.html
│ ├── before-body-end.html
│ └── before-head-end.html
├── osmosfeed.yaml
└── package.json
With this technique, you can
- Customize the parameters in the current theme. See theming guide.
- Add custom CSS by injecting a
<style>
tag usingbefore-head-end.html
. - Run custom JavaScript by injecting a
<script>
tag usingbefore-body-end.html
.
Add any file to the static
directory. The builder will copy those files to the root of your site. This is useful for
- Configure custom domain with
CNAME
- Override the default
favicon.ico
with a custom one.
repo-root/
├── static/
│ ├── CNAME
│ └── favicon.ico
├── osmosfeed.yaml
└── package.json