mirror of https://github.com/lxndrblz/anatole.git

Alexander Bilz
30.22.2020 1efce0f1c5cdffae9b5c5c65736a6de3b14b9d01
🦉 Added support for Twitter Cards
1 files added
3 files modified
17 ■■■■■ changed files
README.md 15 ●●●●● patch | view | raw | blame | history
exampleSite/config.toml 1 ●●●● patch | view | raw | blame | history
exampleSite/static/images/site-feature-image.png patch | view | raw | blame | history
layouts/partials/head.html 1 ●●●● patch | view | raw | blame | history
README.md
@@ -18,6 +18,7 @@
- Google Analytics (optional)
- Comments powered by Disqus (optional)
- Katex support (optional)
- Twitter Cards support
- MIT License
- Fontawesome icons
- Custom CSS (optional)
@@ -104,6 +105,20 @@
use = "katex"  # options: "katex", "mathjax". default is "katex".
```
### Twitter Cards support
In order to use the full functionality of Twitter cards, you will have to define a couple of settings in the `config.toml` and the frontmatter of a page.
In the `config.toml` you can configure a site feature image. This image will be displayed, if no image is defined in the frontmatter of a page.
```toml
[params]
  images = ["images/site-feature-image.png"]
```
To define a custom image of a page, you might want to add the following to the frontmatter of a post.
```toml
images = ["post-cover.png"]
```
### Custom CSS
You can add your custom CSS files with the `customCss` parameter of the configuration file. Put your files into the `static/css` directory.
exampleSite/config.toml
@@ -21,6 +21,7 @@
favicon = "favicons/"
customCss = []
mainSections = ["post"]
images = ["images/site-feature-image.png"]
## Math settings
[params.math]
exampleSite/static/images/site-feature-image.png
layouts/partials/head.html
@@ -19,4 +19,5 @@
    {{ $anatole := resources.Get "js/anatole-header.js" }}
    {{ $secureJS := $anatole |  resources.Minify | resources.Fingerprint }}
    <script type="text/javascript" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}" crossorigin="anonymous"></script>
    {{ template "_internal/twitter_cards.html" . }}
</head>